fef909e3ece89856dab369cb9261eb77a184eed8
[samba.git] / source / librpc / gen_ndr / srv_lsa.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * server auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_lsa.h"
8
9 static bool api_lsa_Close(pipes_struct *p)
10 {
11         const struct ndr_interface_call *call;
12         struct ndr_pull *pull;
13         struct ndr_push *push;
14         NTSTATUS status;
15         DATA_BLOB blob;
16         struct lsa_Close *r;
17         
18         call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSE];
19         
20         r = talloc(NULL, struct lsa_Close);
21         if (r == NULL) {
22                 return False;
23         }
24         
25         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26                 talloc_free(r);
27                 return False;
28         }
29         
30         pull = ndr_pull_init_blob(&blob, r);
31         if (pull == NULL) {
32                 talloc_free(r);
33                 return False;
34         }
35         
36         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37         status = call->ndr_pull(pull, NDR_IN, r);
38         if (NT_STATUS_IS_ERR(status)) {
39                 talloc_free(r);
40                 return False;
41         }
42         
43         if (DEBUGLEVEL >= 10)
44                 NDR_PRINT_IN_DEBUG(lsa_Close, r);
45         
46         ZERO_STRUCT(r->out);
47         r->out.handle = r->in.handle;
48         r->out.result = _lsa_Close(p, r);
49         
50         if (p->rng_fault_state) {
51                 talloc_free(r);
52                 /* Return True here, srv_pipe_hnd.c will take care */
53                 return True;
54         }
55         
56         if (DEBUGLEVEL >= 10)
57                 NDR_PRINT_OUT_DEBUG(lsa_Close, r);
58         
59         push = ndr_push_init_ctx(r);
60         if (push == NULL) {
61                 talloc_free(r);
62                 return False;
63         }
64         
65         status = call->ndr_push(push, NDR_OUT, r);
66         if (NT_STATUS_IS_ERR(status)) {
67                 talloc_free(r);
68                 return False;
69         }
70         
71         blob = ndr_push_blob(push);
72         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
73                 talloc_free(r);
74                 return False;
75         }
76         
77         talloc_free(r);
78         
79         return True;
80 }
81
82 static bool api_lsa_Delete(pipes_struct *p)
83 {
84         const struct ndr_interface_call *call;
85         struct ndr_pull *pull;
86         struct ndr_push *push;
87         NTSTATUS status;
88         DATA_BLOB blob;
89         struct lsa_Delete *r;
90         
91         call = &ndr_table_lsarpc.calls[NDR_LSA_DELETE];
92         
93         r = talloc(NULL, struct lsa_Delete);
94         if (r == NULL) {
95                 return False;
96         }
97         
98         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
99                 talloc_free(r);
100                 return False;
101         }
102         
103         pull = ndr_pull_init_blob(&blob, r);
104         if (pull == NULL) {
105                 talloc_free(r);
106                 return False;
107         }
108         
109         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
110         status = call->ndr_pull(pull, NDR_IN, r);
111         if (NT_STATUS_IS_ERR(status)) {
112                 talloc_free(r);
113                 return False;
114         }
115         
116         if (DEBUGLEVEL >= 10)
117                 NDR_PRINT_IN_DEBUG(lsa_Delete, r);
118         
119         r->out.result = _lsa_Delete(p, r);
120         
121         if (p->rng_fault_state) {
122                 talloc_free(r);
123                 /* Return True here, srv_pipe_hnd.c will take care */
124                 return True;
125         }
126         
127         if (DEBUGLEVEL >= 10)
128                 NDR_PRINT_OUT_DEBUG(lsa_Delete, r);
129         
130         push = ndr_push_init_ctx(r);
131         if (push == NULL) {
132                 talloc_free(r);
133                 return False;
134         }
135         
136         status = call->ndr_push(push, NDR_OUT, r);
137         if (NT_STATUS_IS_ERR(status)) {
138                 talloc_free(r);
139                 return False;
140         }
141         
142         blob = ndr_push_blob(push);
143         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
144                 talloc_free(r);
145                 return False;
146         }
147         
148         talloc_free(r);
149         
150         return True;
151 }
152
153 static bool api_lsa_EnumPrivs(pipes_struct *p)
154 {
155         const struct ndr_interface_call *call;
156         struct ndr_pull *pull;
157         struct ndr_push *push;
158         NTSTATUS status;
159         DATA_BLOB blob;
160         struct lsa_EnumPrivs *r;
161         
162         call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVS];
163         
164         r = talloc(NULL, struct lsa_EnumPrivs);
165         if (r == NULL) {
166                 return False;
167         }
168         
169         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
170                 talloc_free(r);
171                 return False;
172         }
173         
174         pull = ndr_pull_init_blob(&blob, r);
175         if (pull == NULL) {
176                 talloc_free(r);
177                 return False;
178         }
179         
180         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
181         status = call->ndr_pull(pull, NDR_IN, r);
182         if (NT_STATUS_IS_ERR(status)) {
183                 talloc_free(r);
184                 return False;
185         }
186         
187         if (DEBUGLEVEL >= 10)
188                 NDR_PRINT_IN_DEBUG(lsa_EnumPrivs, r);
189         
190         ZERO_STRUCT(r->out);
191         r->out.resume_handle = r->in.resume_handle;
192         r->out.privs = talloc_zero(r, struct lsa_PrivArray);
193         if (r->out.privs == NULL) {
194                 talloc_free(r);
195                 return False;
196         }
197         
198         r->out.result = _lsa_EnumPrivs(p, r);
199         
200         if (p->rng_fault_state) {
201                 talloc_free(r);
202                 /* Return True here, srv_pipe_hnd.c will take care */
203                 return True;
204         }
205         
206         if (DEBUGLEVEL >= 10)
207                 NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, r);
208         
209         push = ndr_push_init_ctx(r);
210         if (push == NULL) {
211                 talloc_free(r);
212                 return False;
213         }
214         
215         status = call->ndr_push(push, NDR_OUT, r);
216         if (NT_STATUS_IS_ERR(status)) {
217                 talloc_free(r);
218                 return False;
219         }
220         
221         blob = ndr_push_blob(push);
222         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
223                 talloc_free(r);
224                 return False;
225         }
226         
227         talloc_free(r);
228         
229         return True;
230 }
231
232 static bool api_lsa_QuerySecurity(pipes_struct *p)
233 {
234         const struct ndr_interface_call *call;
235         struct ndr_pull *pull;
236         struct ndr_push *push;
237         NTSTATUS status;
238         DATA_BLOB blob;
239         struct lsa_QuerySecurity *r;
240         
241         call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECURITY];
242         
243         r = talloc(NULL, struct lsa_QuerySecurity);
244         if (r == NULL) {
245                 return False;
246         }
247         
248         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
249                 talloc_free(r);
250                 return False;
251         }
252         
253         pull = ndr_pull_init_blob(&blob, r);
254         if (pull == NULL) {
255                 talloc_free(r);
256                 return False;
257         }
258         
259         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
260         status = call->ndr_pull(pull, NDR_IN, r);
261         if (NT_STATUS_IS_ERR(status)) {
262                 talloc_free(r);
263                 return False;
264         }
265         
266         if (DEBUGLEVEL >= 10)
267                 NDR_PRINT_IN_DEBUG(lsa_QuerySecurity, r);
268         
269         ZERO_STRUCT(r->out);
270         r->out.sdbuf = talloc_zero(r, struct sec_desc_buf);
271         if (r->out.sdbuf == NULL) {
272                 talloc_free(r);
273                 return False;
274         }
275         
276         r->out.result = _lsa_QuerySecurity(p, r);
277         
278         if (p->rng_fault_state) {
279                 talloc_free(r);
280                 /* Return True here, srv_pipe_hnd.c will take care */
281                 return True;
282         }
283         
284         if (DEBUGLEVEL >= 10)
285                 NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, r);
286         
287         push = ndr_push_init_ctx(r);
288         if (push == NULL) {
289                 talloc_free(r);
290                 return False;
291         }
292         
293         status = call->ndr_push(push, NDR_OUT, r);
294         if (NT_STATUS_IS_ERR(status)) {
295                 talloc_free(r);
296                 return False;
297         }
298         
299         blob = ndr_push_blob(push);
300         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
301                 talloc_free(r);
302                 return False;
303         }
304         
305         talloc_free(r);
306         
307         return True;
308 }
309
310 static bool api_lsa_SetSecObj(pipes_struct *p)
311 {
312         const struct ndr_interface_call *call;
313         struct ndr_pull *pull;
314         struct ndr_push *push;
315         NTSTATUS status;
316         DATA_BLOB blob;
317         struct lsa_SetSecObj *r;
318         
319         call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECOBJ];
320         
321         r = talloc(NULL, struct lsa_SetSecObj);
322         if (r == NULL) {
323                 return False;
324         }
325         
326         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
327                 talloc_free(r);
328                 return False;
329         }
330         
331         pull = ndr_pull_init_blob(&blob, r);
332         if (pull == NULL) {
333                 talloc_free(r);
334                 return False;
335         }
336         
337         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
338         status = call->ndr_pull(pull, NDR_IN, r);
339         if (NT_STATUS_IS_ERR(status)) {
340                 talloc_free(r);
341                 return False;
342         }
343         
344         if (DEBUGLEVEL >= 10)
345                 NDR_PRINT_IN_DEBUG(lsa_SetSecObj, r);
346         
347         r->out.result = _lsa_SetSecObj(p, r);
348         
349         if (p->rng_fault_state) {
350                 talloc_free(r);
351                 /* Return True here, srv_pipe_hnd.c will take care */
352                 return True;
353         }
354         
355         if (DEBUGLEVEL >= 10)
356                 NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, r);
357         
358         push = ndr_push_init_ctx(r);
359         if (push == NULL) {
360                 talloc_free(r);
361                 return False;
362         }
363         
364         status = call->ndr_push(push, NDR_OUT, r);
365         if (NT_STATUS_IS_ERR(status)) {
366                 talloc_free(r);
367                 return False;
368         }
369         
370         blob = ndr_push_blob(push);
371         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
372                 talloc_free(r);
373                 return False;
374         }
375         
376         talloc_free(r);
377         
378         return True;
379 }
380
381 static bool api_lsa_ChangePassword(pipes_struct *p)
382 {
383         const struct ndr_interface_call *call;
384         struct ndr_pull *pull;
385         struct ndr_push *push;
386         NTSTATUS status;
387         DATA_BLOB blob;
388         struct lsa_ChangePassword *r;
389         
390         call = &ndr_table_lsarpc.calls[NDR_LSA_CHANGEPASSWORD];
391         
392         r = talloc(NULL, struct lsa_ChangePassword);
393         if (r == NULL) {
394                 return False;
395         }
396         
397         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
398                 talloc_free(r);
399                 return False;
400         }
401         
402         pull = ndr_pull_init_blob(&blob, r);
403         if (pull == NULL) {
404                 talloc_free(r);
405                 return False;
406         }
407         
408         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
409         status = call->ndr_pull(pull, NDR_IN, r);
410         if (NT_STATUS_IS_ERR(status)) {
411                 talloc_free(r);
412                 return False;
413         }
414         
415         if (DEBUGLEVEL >= 10)
416                 NDR_PRINT_IN_DEBUG(lsa_ChangePassword, r);
417         
418         r->out.result = _lsa_ChangePassword(p, r);
419         
420         if (p->rng_fault_state) {
421                 talloc_free(r);
422                 /* Return True here, srv_pipe_hnd.c will take care */
423                 return True;
424         }
425         
426         if (DEBUGLEVEL >= 10)
427                 NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, r);
428         
429         push = ndr_push_init_ctx(r);
430         if (push == NULL) {
431                 talloc_free(r);
432                 return False;
433         }
434         
435         status = call->ndr_push(push, NDR_OUT, r);
436         if (NT_STATUS_IS_ERR(status)) {
437                 talloc_free(r);
438                 return False;
439         }
440         
441         blob = ndr_push_blob(push);
442         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
443                 talloc_free(r);
444                 return False;
445         }
446         
447         talloc_free(r);
448         
449         return True;
450 }
451
452 static bool api_lsa_OpenPolicy(pipes_struct *p)
453 {
454         const struct ndr_interface_call *call;
455         struct ndr_pull *pull;
456         struct ndr_push *push;
457         NTSTATUS status;
458         DATA_BLOB blob;
459         struct lsa_OpenPolicy *r;
460         
461         call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY];
462         
463         r = talloc(NULL, struct lsa_OpenPolicy);
464         if (r == NULL) {
465                 return False;
466         }
467         
468         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
469                 talloc_free(r);
470                 return False;
471         }
472         
473         pull = ndr_pull_init_blob(&blob, r);
474         if (pull == NULL) {
475                 talloc_free(r);
476                 return False;
477         }
478         
479         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
480         status = call->ndr_pull(pull, NDR_IN, r);
481         if (NT_STATUS_IS_ERR(status)) {
482                 talloc_free(r);
483                 return False;
484         }
485         
486         if (DEBUGLEVEL >= 10)
487                 NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, r);
488         
489         ZERO_STRUCT(r->out);
490         r->out.handle = talloc_zero(r, struct policy_handle);
491         if (r->out.handle == NULL) {
492                 talloc_free(r);
493                 return False;
494         }
495         
496         r->out.result = _lsa_OpenPolicy(p, r);
497         
498         if (p->rng_fault_state) {
499                 talloc_free(r);
500                 /* Return True here, srv_pipe_hnd.c will take care */
501                 return True;
502         }
503         
504         if (DEBUGLEVEL >= 10)
505                 NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, r);
506         
507         push = ndr_push_init_ctx(r);
508         if (push == NULL) {
509                 talloc_free(r);
510                 return False;
511         }
512         
513         status = call->ndr_push(push, NDR_OUT, r);
514         if (NT_STATUS_IS_ERR(status)) {
515                 talloc_free(r);
516                 return False;
517         }
518         
519         blob = ndr_push_blob(push);
520         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
521                 talloc_free(r);
522                 return False;
523         }
524         
525         talloc_free(r);
526         
527         return True;
528 }
529
530 static bool api_lsa_QueryInfoPolicy(pipes_struct *p)
531 {
532         const struct ndr_interface_call *call;
533         struct ndr_pull *pull;
534         struct ndr_push *push;
535         NTSTATUS status;
536         DATA_BLOB blob;
537         struct lsa_QueryInfoPolicy *r;
538         
539         call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY];
540         
541         r = talloc(NULL, struct lsa_QueryInfoPolicy);
542         if (r == NULL) {
543                 return False;
544         }
545         
546         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
547                 talloc_free(r);
548                 return False;
549         }
550         
551         pull = ndr_pull_init_blob(&blob, r);
552         if (pull == NULL) {
553                 talloc_free(r);
554                 return False;
555         }
556         
557         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
558         status = call->ndr_pull(pull, NDR_IN, r);
559         if (NT_STATUS_IS_ERR(status)) {
560                 talloc_free(r);
561                 return False;
562         }
563         
564         if (DEBUGLEVEL >= 10)
565                 NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, r);
566         
567         ZERO_STRUCT(r->out);
568         r->out.info = talloc_zero(r, union lsa_PolicyInformation);
569         if (r->out.info == NULL) {
570                 talloc_free(r);
571                 return False;
572         }
573         
574         r->out.result = _lsa_QueryInfoPolicy(p, r);
575         
576         if (p->rng_fault_state) {
577                 talloc_free(r);
578                 /* Return True here, srv_pipe_hnd.c will take care */
579                 return True;
580         }
581         
582         if (DEBUGLEVEL >= 10)
583                 NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, r);
584         
585         push = ndr_push_init_ctx(r);
586         if (push == NULL) {
587                 talloc_free(r);
588                 return False;
589         }
590         
591         status = call->ndr_push(push, NDR_OUT, r);
592         if (NT_STATUS_IS_ERR(status)) {
593                 talloc_free(r);
594                 return False;
595         }
596         
597         blob = ndr_push_blob(push);
598         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
599                 talloc_free(r);
600                 return False;
601         }
602         
603         talloc_free(r);
604         
605         return True;
606 }
607
608 static bool api_lsa_SetInfoPolicy(pipes_struct *p)
609 {
610         const struct ndr_interface_call *call;
611         struct ndr_pull *pull;
612         struct ndr_push *push;
613         NTSTATUS status;
614         DATA_BLOB blob;
615         struct lsa_SetInfoPolicy *r;
616         
617         call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY];
618         
619         r = talloc(NULL, struct lsa_SetInfoPolicy);
620         if (r == NULL) {
621                 return False;
622         }
623         
624         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
625                 talloc_free(r);
626                 return False;
627         }
628         
629         pull = ndr_pull_init_blob(&blob, r);
630         if (pull == NULL) {
631                 talloc_free(r);
632                 return False;
633         }
634         
635         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
636         status = call->ndr_pull(pull, NDR_IN, r);
637         if (NT_STATUS_IS_ERR(status)) {
638                 talloc_free(r);
639                 return False;
640         }
641         
642         if (DEBUGLEVEL >= 10)
643                 NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, r);
644         
645         r->out.result = _lsa_SetInfoPolicy(p, r);
646         
647         if (p->rng_fault_state) {
648                 talloc_free(r);
649                 /* Return True here, srv_pipe_hnd.c will take care */
650                 return True;
651         }
652         
653         if (DEBUGLEVEL >= 10)
654                 NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, r);
655         
656         push = ndr_push_init_ctx(r);
657         if (push == NULL) {
658                 talloc_free(r);
659                 return False;
660         }
661         
662         status = call->ndr_push(push, NDR_OUT, r);
663         if (NT_STATUS_IS_ERR(status)) {
664                 talloc_free(r);
665                 return False;
666         }
667         
668         blob = ndr_push_blob(push);
669         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
670                 talloc_free(r);
671                 return False;
672         }
673         
674         talloc_free(r);
675         
676         return True;
677 }
678
679 static bool api_lsa_ClearAuditLog(pipes_struct *p)
680 {
681         const struct ndr_interface_call *call;
682         struct ndr_pull *pull;
683         struct ndr_push *push;
684         NTSTATUS status;
685         DATA_BLOB blob;
686         struct lsa_ClearAuditLog *r;
687         
688         call = &ndr_table_lsarpc.calls[NDR_LSA_CLEARAUDITLOG];
689         
690         r = talloc(NULL, struct lsa_ClearAuditLog);
691         if (r == NULL) {
692                 return False;
693         }
694         
695         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
696                 talloc_free(r);
697                 return False;
698         }
699         
700         pull = ndr_pull_init_blob(&blob, r);
701         if (pull == NULL) {
702                 talloc_free(r);
703                 return False;
704         }
705         
706         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
707         status = call->ndr_pull(pull, NDR_IN, r);
708         if (NT_STATUS_IS_ERR(status)) {
709                 talloc_free(r);
710                 return False;
711         }
712         
713         if (DEBUGLEVEL >= 10)
714                 NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, r);
715         
716         r->out.result = _lsa_ClearAuditLog(p, r);
717         
718         if (p->rng_fault_state) {
719                 talloc_free(r);
720                 /* Return True here, srv_pipe_hnd.c will take care */
721                 return True;
722         }
723         
724         if (DEBUGLEVEL >= 10)
725                 NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, r);
726         
727         push = ndr_push_init_ctx(r);
728         if (push == NULL) {
729                 talloc_free(r);
730                 return False;
731         }
732         
733         status = call->ndr_push(push, NDR_OUT, r);
734         if (NT_STATUS_IS_ERR(status)) {
735                 talloc_free(r);
736                 return False;
737         }
738         
739         blob = ndr_push_blob(push);
740         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
741                 talloc_free(r);
742                 return False;
743         }
744         
745         talloc_free(r);
746         
747         return True;
748 }
749
750 static bool api_lsa_CreateAccount(pipes_struct *p)
751 {
752         const struct ndr_interface_call *call;
753         struct ndr_pull *pull;
754         struct ndr_push *push;
755         NTSTATUS status;
756         DATA_BLOB blob;
757         struct lsa_CreateAccount *r;
758         
759         call = &ndr_table_lsarpc.calls[NDR_LSA_CREATEACCOUNT];
760         
761         r = talloc(NULL, struct lsa_CreateAccount);
762         if (r == NULL) {
763                 return False;
764         }
765         
766         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
767                 talloc_free(r);
768                 return False;
769         }
770         
771         pull = ndr_pull_init_blob(&blob, r);
772         if (pull == NULL) {
773                 talloc_free(r);
774                 return False;
775         }
776         
777         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
778         status = call->ndr_pull(pull, NDR_IN, r);
779         if (NT_STATUS_IS_ERR(status)) {
780                 talloc_free(r);
781                 return False;
782         }
783         
784         if (DEBUGLEVEL >= 10)
785                 NDR_PRINT_IN_DEBUG(lsa_CreateAccount, r);
786         
787         ZERO_STRUCT(r->out);
788         r->out.acct_handle = talloc_zero(r, struct policy_handle);
789         if (r->out.acct_handle == NULL) {
790                 talloc_free(r);
791                 return False;
792         }
793         
794         r->out.result = _lsa_CreateAccount(p, r);
795         
796         if (p->rng_fault_state) {
797                 talloc_free(r);
798                 /* Return True here, srv_pipe_hnd.c will take care */
799                 return True;
800         }
801         
802         if (DEBUGLEVEL >= 10)
803                 NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, r);
804         
805         push = ndr_push_init_ctx(r);
806         if (push == NULL) {
807                 talloc_free(r);
808                 return False;
809         }
810         
811         status = call->ndr_push(push, NDR_OUT, r);
812         if (NT_STATUS_IS_ERR(status)) {
813                 talloc_free(r);
814                 return False;
815         }
816         
817         blob = ndr_push_blob(push);
818         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
819                 talloc_free(r);
820                 return False;
821         }
822         
823         talloc_free(r);
824         
825         return True;
826 }
827
828 static bool api_lsa_EnumAccounts(pipes_struct *p)
829 {
830         const struct ndr_interface_call *call;
831         struct ndr_pull *pull;
832         struct ndr_push *push;
833         NTSTATUS status;
834         DATA_BLOB blob;
835         struct lsa_EnumAccounts *r;
836         
837         call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTS];
838         
839         r = talloc(NULL, struct lsa_EnumAccounts);
840         if (r == NULL) {
841                 return False;
842         }
843         
844         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
845                 talloc_free(r);
846                 return False;
847         }
848         
849         pull = ndr_pull_init_blob(&blob, r);
850         if (pull == NULL) {
851                 talloc_free(r);
852                 return False;
853         }
854         
855         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
856         status = call->ndr_pull(pull, NDR_IN, r);
857         if (NT_STATUS_IS_ERR(status)) {
858                 talloc_free(r);
859                 return False;
860         }
861         
862         if (DEBUGLEVEL >= 10)
863                 NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, r);
864         
865         ZERO_STRUCT(r->out);
866         r->out.resume_handle = r->in.resume_handle;
867         r->out.sids = talloc_zero(r, struct lsa_SidArray);
868         if (r->out.sids == NULL) {
869                 talloc_free(r);
870                 return False;
871         }
872         
873         r->out.result = _lsa_EnumAccounts(p, r);
874         
875         if (p->rng_fault_state) {
876                 talloc_free(r);
877                 /* Return True here, srv_pipe_hnd.c will take care */
878                 return True;
879         }
880         
881         if (DEBUGLEVEL >= 10)
882                 NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, r);
883         
884         push = ndr_push_init_ctx(r);
885         if (push == NULL) {
886                 talloc_free(r);
887                 return False;
888         }
889         
890         status = call->ndr_push(push, NDR_OUT, r);
891         if (NT_STATUS_IS_ERR(status)) {
892                 talloc_free(r);
893                 return False;
894         }
895         
896         blob = ndr_push_blob(push);
897         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
898                 talloc_free(r);
899                 return False;
900         }
901         
902         talloc_free(r);
903         
904         return True;
905 }
906
907 static bool api_lsa_CreateTrustedDomain(pipes_struct *p)
908 {
909         const struct ndr_interface_call *call;
910         struct ndr_pull *pull;
911         struct ndr_push *push;
912         NTSTATUS status;
913         DATA_BLOB blob;
914         struct lsa_CreateTrustedDomain *r;
915         
916         call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAIN];
917         
918         r = talloc(NULL, struct lsa_CreateTrustedDomain);
919         if (r == NULL) {
920                 return False;
921         }
922         
923         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
924                 talloc_free(r);
925                 return False;
926         }
927         
928         pull = ndr_pull_init_blob(&blob, r);
929         if (pull == NULL) {
930                 talloc_free(r);
931                 return False;
932         }
933         
934         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
935         status = call->ndr_pull(pull, NDR_IN, r);
936         if (NT_STATUS_IS_ERR(status)) {
937                 talloc_free(r);
938                 return False;
939         }
940         
941         if (DEBUGLEVEL >= 10)
942                 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, r);
943         
944         ZERO_STRUCT(r->out);
945         r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
946         if (r->out.trustdom_handle == NULL) {
947                 talloc_free(r);
948                 return False;
949         }
950         
951         r->out.result = _lsa_CreateTrustedDomain(p, r);
952         
953         if (p->rng_fault_state) {
954                 talloc_free(r);
955                 /* Return True here, srv_pipe_hnd.c will take care */
956                 return True;
957         }
958         
959         if (DEBUGLEVEL >= 10)
960                 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, r);
961         
962         push = ndr_push_init_ctx(r);
963         if (push == NULL) {
964                 talloc_free(r);
965                 return False;
966         }
967         
968         status = call->ndr_push(push, NDR_OUT, r);
969         if (NT_STATUS_IS_ERR(status)) {
970                 talloc_free(r);
971                 return False;
972         }
973         
974         blob = ndr_push_blob(push);
975         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
976                 talloc_free(r);
977                 return False;
978         }
979         
980         talloc_free(r);
981         
982         return True;
983 }
984
985 static bool api_lsa_EnumTrustDom(pipes_struct *p)
986 {
987         const struct ndr_interface_call *call;
988         struct ndr_pull *pull;
989         struct ndr_push *push;
990         NTSTATUS status;
991         DATA_BLOB blob;
992         struct lsa_EnumTrustDom *r;
993         
994         call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTDOM];
995         
996         r = talloc(NULL, struct lsa_EnumTrustDom);
997         if (r == NULL) {
998                 return False;
999         }
1000         
1001         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1002                 talloc_free(r);
1003                 return False;
1004         }
1005         
1006         pull = ndr_pull_init_blob(&blob, r);
1007         if (pull == NULL) {
1008                 talloc_free(r);
1009                 return False;
1010         }
1011         
1012         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1013         status = call->ndr_pull(pull, NDR_IN, r);
1014         if (NT_STATUS_IS_ERR(status)) {
1015                 talloc_free(r);
1016                 return False;
1017         }
1018         
1019         if (DEBUGLEVEL >= 10)
1020                 NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, r);
1021         
1022         ZERO_STRUCT(r->out);
1023         r->out.resume_handle = r->in.resume_handle;
1024         r->out.domains = talloc_zero(r, struct lsa_DomainList);
1025         if (r->out.domains == NULL) {
1026                 talloc_free(r);
1027                 return False;
1028         }
1029         
1030         r->out.result = _lsa_EnumTrustDom(p, r);
1031         
1032         if (p->rng_fault_state) {
1033                 talloc_free(r);
1034                 /* Return True here, srv_pipe_hnd.c will take care */
1035                 return True;
1036         }
1037         
1038         if (DEBUGLEVEL >= 10)
1039                 NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, r);
1040         
1041         push = ndr_push_init_ctx(r);
1042         if (push == NULL) {
1043                 talloc_free(r);
1044                 return False;
1045         }
1046         
1047         status = call->ndr_push(push, NDR_OUT, r);
1048         if (NT_STATUS_IS_ERR(status)) {
1049                 talloc_free(r);
1050                 return False;
1051         }
1052         
1053         blob = ndr_push_blob(push);
1054         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1055                 talloc_free(r);
1056                 return False;
1057         }
1058         
1059         talloc_free(r);
1060         
1061         return True;
1062 }
1063
1064 static bool api_lsa_LookupNames(pipes_struct *p)
1065 {
1066         const struct ndr_interface_call *call;
1067         struct ndr_pull *pull;
1068         struct ndr_push *push;
1069         NTSTATUS status;
1070         DATA_BLOB blob;
1071         struct lsa_LookupNames *r;
1072         
1073         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES];
1074         
1075         r = talloc(NULL, struct lsa_LookupNames);
1076         if (r == NULL) {
1077                 return False;
1078         }
1079         
1080         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1081                 talloc_free(r);
1082                 return False;
1083         }
1084         
1085         pull = ndr_pull_init_blob(&blob, r);
1086         if (pull == NULL) {
1087                 talloc_free(r);
1088                 return False;
1089         }
1090         
1091         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1092         status = call->ndr_pull(pull, NDR_IN, r);
1093         if (NT_STATUS_IS_ERR(status)) {
1094                 talloc_free(r);
1095                 return False;
1096         }
1097         
1098         if (DEBUGLEVEL >= 10)
1099                 NDR_PRINT_IN_DEBUG(lsa_LookupNames, r);
1100         
1101         ZERO_STRUCT(r->out);
1102         r->out.domains = talloc_zero(r, struct lsa_RefDomainList);
1103         if (r->out.domains == NULL) {
1104                 talloc_free(r);
1105                 return False;
1106         }
1107         
1108         r->out.sids = r->in.sids;
1109         r->out.count = r->in.count;
1110         r->out.result = _lsa_LookupNames(p, r);
1111         
1112         if (p->rng_fault_state) {
1113                 talloc_free(r);
1114                 /* Return True here, srv_pipe_hnd.c will take care */
1115                 return True;
1116         }
1117         
1118         if (DEBUGLEVEL >= 10)
1119                 NDR_PRINT_OUT_DEBUG(lsa_LookupNames, r);
1120         
1121         push = ndr_push_init_ctx(r);
1122         if (push == NULL) {
1123                 talloc_free(r);
1124                 return False;
1125         }
1126         
1127         status = call->ndr_push(push, NDR_OUT, r);
1128         if (NT_STATUS_IS_ERR(status)) {
1129                 talloc_free(r);
1130                 return False;
1131         }
1132         
1133         blob = ndr_push_blob(push);
1134         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1135                 talloc_free(r);
1136                 return False;
1137         }
1138         
1139         talloc_free(r);
1140         
1141         return True;
1142 }
1143
1144 static bool api_lsa_LookupSids(pipes_struct *p)
1145 {
1146         const struct ndr_interface_call *call;
1147         struct ndr_pull *pull;
1148         struct ndr_push *push;
1149         NTSTATUS status;
1150         DATA_BLOB blob;
1151         struct lsa_LookupSids *r;
1152         
1153         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS];
1154         
1155         r = talloc(NULL, struct lsa_LookupSids);
1156         if (r == NULL) {
1157                 return False;
1158         }
1159         
1160         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1161                 talloc_free(r);
1162                 return False;
1163         }
1164         
1165         pull = ndr_pull_init_blob(&blob, r);
1166         if (pull == NULL) {
1167                 talloc_free(r);
1168                 return False;
1169         }
1170         
1171         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1172         status = call->ndr_pull(pull, NDR_IN, r);
1173         if (NT_STATUS_IS_ERR(status)) {
1174                 talloc_free(r);
1175                 return False;
1176         }
1177         
1178         if (DEBUGLEVEL >= 10)
1179                 NDR_PRINT_IN_DEBUG(lsa_LookupSids, r);
1180         
1181         ZERO_STRUCT(r->out);
1182         r->out.domains = talloc_zero(r, struct lsa_RefDomainList);
1183         if (r->out.domains == NULL) {
1184                 talloc_free(r);
1185                 return False;
1186         }
1187         
1188         r->out.names = r->in.names;
1189         r->out.count = r->in.count;
1190         r->out.result = _lsa_LookupSids(p, r);
1191         
1192         if (p->rng_fault_state) {
1193                 talloc_free(r);
1194                 /* Return True here, srv_pipe_hnd.c will take care */
1195                 return True;
1196         }
1197         
1198         if (DEBUGLEVEL >= 10)
1199                 NDR_PRINT_OUT_DEBUG(lsa_LookupSids, r);
1200         
1201         push = ndr_push_init_ctx(r);
1202         if (push == NULL) {
1203                 talloc_free(r);
1204                 return False;
1205         }
1206         
1207         status = call->ndr_push(push, NDR_OUT, r);
1208         if (NT_STATUS_IS_ERR(status)) {
1209                 talloc_free(r);
1210                 return False;
1211         }
1212         
1213         blob = ndr_push_blob(push);
1214         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1215                 talloc_free(r);
1216                 return False;
1217         }
1218         
1219         talloc_free(r);
1220         
1221         return True;
1222 }
1223
1224 static bool api_lsa_CreateSecret(pipes_struct *p)
1225 {
1226         const struct ndr_interface_call *call;
1227         struct ndr_pull *pull;
1228         struct ndr_push *push;
1229         NTSTATUS status;
1230         DATA_BLOB blob;
1231         struct lsa_CreateSecret *r;
1232         
1233         call = &ndr_table_lsarpc.calls[NDR_LSA_CREATESECRET];
1234         
1235         r = talloc(NULL, struct lsa_CreateSecret);
1236         if (r == NULL) {
1237                 return False;
1238         }
1239         
1240         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1241                 talloc_free(r);
1242                 return False;
1243         }
1244         
1245         pull = ndr_pull_init_blob(&blob, r);
1246         if (pull == NULL) {
1247                 talloc_free(r);
1248                 return False;
1249         }
1250         
1251         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1252         status = call->ndr_pull(pull, NDR_IN, r);
1253         if (NT_STATUS_IS_ERR(status)) {
1254                 talloc_free(r);
1255                 return False;
1256         }
1257         
1258         if (DEBUGLEVEL >= 10)
1259                 NDR_PRINT_IN_DEBUG(lsa_CreateSecret, r);
1260         
1261         ZERO_STRUCT(r->out);
1262         r->out.sec_handle = talloc_zero(r, struct policy_handle);
1263         if (r->out.sec_handle == NULL) {
1264                 talloc_free(r);
1265                 return False;
1266         }
1267         
1268         r->out.result = _lsa_CreateSecret(p, r);
1269         
1270         if (p->rng_fault_state) {
1271                 talloc_free(r);
1272                 /* Return True here, srv_pipe_hnd.c will take care */
1273                 return True;
1274         }
1275         
1276         if (DEBUGLEVEL >= 10)
1277                 NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, r);
1278         
1279         push = ndr_push_init_ctx(r);
1280         if (push == NULL) {
1281                 talloc_free(r);
1282                 return False;
1283         }
1284         
1285         status = call->ndr_push(push, NDR_OUT, r);
1286         if (NT_STATUS_IS_ERR(status)) {
1287                 talloc_free(r);
1288                 return False;
1289         }
1290         
1291         blob = ndr_push_blob(push);
1292         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1293                 talloc_free(r);
1294                 return False;
1295         }
1296         
1297         talloc_free(r);
1298         
1299         return True;
1300 }
1301
1302 static bool api_lsa_OpenAccount(pipes_struct *p)
1303 {
1304         const struct ndr_interface_call *call;
1305         struct ndr_pull *pull;
1306         struct ndr_push *push;
1307         NTSTATUS status;
1308         DATA_BLOB blob;
1309         struct lsa_OpenAccount *r;
1310         
1311         call = &ndr_table_lsarpc.calls[NDR_LSA_OPENACCOUNT];
1312         
1313         r = talloc(NULL, struct lsa_OpenAccount);
1314         if (r == NULL) {
1315                 return False;
1316         }
1317         
1318         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1319                 talloc_free(r);
1320                 return False;
1321         }
1322         
1323         pull = ndr_pull_init_blob(&blob, r);
1324         if (pull == NULL) {
1325                 talloc_free(r);
1326                 return False;
1327         }
1328         
1329         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1330         status = call->ndr_pull(pull, NDR_IN, r);
1331         if (NT_STATUS_IS_ERR(status)) {
1332                 talloc_free(r);
1333                 return False;
1334         }
1335         
1336         if (DEBUGLEVEL >= 10)
1337                 NDR_PRINT_IN_DEBUG(lsa_OpenAccount, r);
1338         
1339         ZERO_STRUCT(r->out);
1340         r->out.acct_handle = talloc_zero(r, struct policy_handle);
1341         if (r->out.acct_handle == NULL) {
1342                 talloc_free(r);
1343                 return False;
1344         }
1345         
1346         r->out.result = _lsa_OpenAccount(p, r);
1347         
1348         if (p->rng_fault_state) {
1349                 talloc_free(r);
1350                 /* Return True here, srv_pipe_hnd.c will take care */
1351                 return True;
1352         }
1353         
1354         if (DEBUGLEVEL >= 10)
1355                 NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, r);
1356         
1357         push = ndr_push_init_ctx(r);
1358         if (push == NULL) {
1359                 talloc_free(r);
1360                 return False;
1361         }
1362         
1363         status = call->ndr_push(push, NDR_OUT, r);
1364         if (NT_STATUS_IS_ERR(status)) {
1365                 talloc_free(r);
1366                 return False;
1367         }
1368         
1369         blob = ndr_push_blob(push);
1370         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1371                 talloc_free(r);
1372                 return False;
1373         }
1374         
1375         talloc_free(r);
1376         
1377         return True;
1378 }
1379
1380 static bool api_lsa_EnumPrivsAccount(pipes_struct *p)
1381 {
1382         const struct ndr_interface_call *call;
1383         struct ndr_pull *pull;
1384         struct ndr_push *push;
1385         NTSTATUS status;
1386         DATA_BLOB blob;
1387         struct lsa_EnumPrivsAccount *r;
1388         
1389         call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMPRIVSACCOUNT];
1390         
1391         r = talloc(NULL, struct lsa_EnumPrivsAccount);
1392         if (r == NULL) {
1393                 return False;
1394         }
1395         
1396         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1397                 talloc_free(r);
1398                 return False;
1399         }
1400         
1401         pull = ndr_pull_init_blob(&blob, r);
1402         if (pull == NULL) {
1403                 talloc_free(r);
1404                 return False;
1405         }
1406         
1407         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1408         status = call->ndr_pull(pull, NDR_IN, r);
1409         if (NT_STATUS_IS_ERR(status)) {
1410                 talloc_free(r);
1411                 return False;
1412         }
1413         
1414         if (DEBUGLEVEL >= 10)
1415                 NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, r);
1416         
1417         ZERO_STRUCT(r->out);
1418         r->out.privs = talloc_zero(r, struct lsa_PrivilegeSet);
1419         if (r->out.privs == NULL) {
1420                 talloc_free(r);
1421                 return False;
1422         }
1423         
1424         r->out.result = _lsa_EnumPrivsAccount(p, r);
1425         
1426         if (p->rng_fault_state) {
1427                 talloc_free(r);
1428                 /* Return True here, srv_pipe_hnd.c will take care */
1429                 return True;
1430         }
1431         
1432         if (DEBUGLEVEL >= 10)
1433                 NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, r);
1434         
1435         push = ndr_push_init_ctx(r);
1436         if (push == NULL) {
1437                 talloc_free(r);
1438                 return False;
1439         }
1440         
1441         status = call->ndr_push(push, NDR_OUT, r);
1442         if (NT_STATUS_IS_ERR(status)) {
1443                 talloc_free(r);
1444                 return False;
1445         }
1446         
1447         blob = ndr_push_blob(push);
1448         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1449                 talloc_free(r);
1450                 return False;
1451         }
1452         
1453         talloc_free(r);
1454         
1455         return True;
1456 }
1457
1458 static bool api_lsa_AddPrivilegesToAccount(pipes_struct *p)
1459 {
1460         const struct ndr_interface_call *call;
1461         struct ndr_pull *pull;
1462         struct ndr_push *push;
1463         NTSTATUS status;
1464         DATA_BLOB blob;
1465         struct lsa_AddPrivilegesToAccount *r;
1466         
1467         call = &ndr_table_lsarpc.calls[NDR_LSA_ADDPRIVILEGESTOACCOUNT];
1468         
1469         r = talloc(NULL, struct lsa_AddPrivilegesToAccount);
1470         if (r == NULL) {
1471                 return False;
1472         }
1473         
1474         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1475                 talloc_free(r);
1476                 return False;
1477         }
1478         
1479         pull = ndr_pull_init_blob(&blob, r);
1480         if (pull == NULL) {
1481                 talloc_free(r);
1482                 return False;
1483         }
1484         
1485         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1486         status = call->ndr_pull(pull, NDR_IN, r);
1487         if (NT_STATUS_IS_ERR(status)) {
1488                 talloc_free(r);
1489                 return False;
1490         }
1491         
1492         if (DEBUGLEVEL >= 10)
1493                 NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, r);
1494         
1495         r->out.result = _lsa_AddPrivilegesToAccount(p, r);
1496         
1497         if (p->rng_fault_state) {
1498                 talloc_free(r);
1499                 /* Return True here, srv_pipe_hnd.c will take care */
1500                 return True;
1501         }
1502         
1503         if (DEBUGLEVEL >= 10)
1504                 NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, r);
1505         
1506         push = ndr_push_init_ctx(r);
1507         if (push == NULL) {
1508                 talloc_free(r);
1509                 return False;
1510         }
1511         
1512         status = call->ndr_push(push, NDR_OUT, r);
1513         if (NT_STATUS_IS_ERR(status)) {
1514                 talloc_free(r);
1515                 return False;
1516         }
1517         
1518         blob = ndr_push_blob(push);
1519         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1520                 talloc_free(r);
1521                 return False;
1522         }
1523         
1524         talloc_free(r);
1525         
1526         return True;
1527 }
1528
1529 static bool api_lsa_RemovePrivilegesFromAccount(pipes_struct *p)
1530 {
1531         const struct ndr_interface_call *call;
1532         struct ndr_pull *pull;
1533         struct ndr_push *push;
1534         NTSTATUS status;
1535         DATA_BLOB blob;
1536         struct lsa_RemovePrivilegesFromAccount *r;
1537         
1538         call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT];
1539         
1540         r = talloc(NULL, struct lsa_RemovePrivilegesFromAccount);
1541         if (r == NULL) {
1542                 return False;
1543         }
1544         
1545         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1546                 talloc_free(r);
1547                 return False;
1548         }
1549         
1550         pull = ndr_pull_init_blob(&blob, r);
1551         if (pull == NULL) {
1552                 talloc_free(r);
1553                 return False;
1554         }
1555         
1556         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1557         status = call->ndr_pull(pull, NDR_IN, r);
1558         if (NT_STATUS_IS_ERR(status)) {
1559                 talloc_free(r);
1560                 return False;
1561         }
1562         
1563         if (DEBUGLEVEL >= 10)
1564                 NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, r);
1565         
1566         r->out.result = _lsa_RemovePrivilegesFromAccount(p, r);
1567         
1568         if (p->rng_fault_state) {
1569                 talloc_free(r);
1570                 /* Return True here, srv_pipe_hnd.c will take care */
1571                 return True;
1572         }
1573         
1574         if (DEBUGLEVEL >= 10)
1575                 NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, r);
1576         
1577         push = ndr_push_init_ctx(r);
1578         if (push == NULL) {
1579                 talloc_free(r);
1580                 return False;
1581         }
1582         
1583         status = call->ndr_push(push, NDR_OUT, r);
1584         if (NT_STATUS_IS_ERR(status)) {
1585                 talloc_free(r);
1586                 return False;
1587         }
1588         
1589         blob = ndr_push_blob(push);
1590         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1591                 talloc_free(r);
1592                 return False;
1593         }
1594         
1595         talloc_free(r);
1596         
1597         return True;
1598 }
1599
1600 static bool api_lsa_GetQuotasForAccount(pipes_struct *p)
1601 {
1602         const struct ndr_interface_call *call;
1603         struct ndr_pull *pull;
1604         struct ndr_push *push;
1605         NTSTATUS status;
1606         DATA_BLOB blob;
1607         struct lsa_GetQuotasForAccount *r;
1608         
1609         call = &ndr_table_lsarpc.calls[NDR_LSA_GETQUOTASFORACCOUNT];
1610         
1611         r = talloc(NULL, struct lsa_GetQuotasForAccount);
1612         if (r == NULL) {
1613                 return False;
1614         }
1615         
1616         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1617                 talloc_free(r);
1618                 return False;
1619         }
1620         
1621         pull = ndr_pull_init_blob(&blob, r);
1622         if (pull == NULL) {
1623                 talloc_free(r);
1624                 return False;
1625         }
1626         
1627         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1628         status = call->ndr_pull(pull, NDR_IN, r);
1629         if (NT_STATUS_IS_ERR(status)) {
1630                 talloc_free(r);
1631                 return False;
1632         }
1633         
1634         if (DEBUGLEVEL >= 10)
1635                 NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, r);
1636         
1637         r->out.result = _lsa_GetQuotasForAccount(p, r);
1638         
1639         if (p->rng_fault_state) {
1640                 talloc_free(r);
1641                 /* Return True here, srv_pipe_hnd.c will take care */
1642                 return True;
1643         }
1644         
1645         if (DEBUGLEVEL >= 10)
1646                 NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, r);
1647         
1648         push = ndr_push_init_ctx(r);
1649         if (push == NULL) {
1650                 talloc_free(r);
1651                 return False;
1652         }
1653         
1654         status = call->ndr_push(push, NDR_OUT, r);
1655         if (NT_STATUS_IS_ERR(status)) {
1656                 talloc_free(r);
1657                 return False;
1658         }
1659         
1660         blob = ndr_push_blob(push);
1661         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1662                 talloc_free(r);
1663                 return False;
1664         }
1665         
1666         talloc_free(r);
1667         
1668         return True;
1669 }
1670
1671 static bool api_lsa_SetQuotasForAccount(pipes_struct *p)
1672 {
1673         const struct ndr_interface_call *call;
1674         struct ndr_pull *pull;
1675         struct ndr_push *push;
1676         NTSTATUS status;
1677         DATA_BLOB blob;
1678         struct lsa_SetQuotasForAccount *r;
1679         
1680         call = &ndr_table_lsarpc.calls[NDR_LSA_SETQUOTASFORACCOUNT];
1681         
1682         r = talloc(NULL, struct lsa_SetQuotasForAccount);
1683         if (r == NULL) {
1684                 return False;
1685         }
1686         
1687         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1688                 talloc_free(r);
1689                 return False;
1690         }
1691         
1692         pull = ndr_pull_init_blob(&blob, r);
1693         if (pull == NULL) {
1694                 talloc_free(r);
1695                 return False;
1696         }
1697         
1698         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1699         status = call->ndr_pull(pull, NDR_IN, r);
1700         if (NT_STATUS_IS_ERR(status)) {
1701                 talloc_free(r);
1702                 return False;
1703         }
1704         
1705         if (DEBUGLEVEL >= 10)
1706                 NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, r);
1707         
1708         r->out.result = _lsa_SetQuotasForAccount(p, r);
1709         
1710         if (p->rng_fault_state) {
1711                 talloc_free(r);
1712                 /* Return True here, srv_pipe_hnd.c will take care */
1713                 return True;
1714         }
1715         
1716         if (DEBUGLEVEL >= 10)
1717                 NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, r);
1718         
1719         push = ndr_push_init_ctx(r);
1720         if (push == NULL) {
1721                 talloc_free(r);
1722                 return False;
1723         }
1724         
1725         status = call->ndr_push(push, NDR_OUT, r);
1726         if (NT_STATUS_IS_ERR(status)) {
1727                 talloc_free(r);
1728                 return False;
1729         }
1730         
1731         blob = ndr_push_blob(push);
1732         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1733                 talloc_free(r);
1734                 return False;
1735         }
1736         
1737         talloc_free(r);
1738         
1739         return True;
1740 }
1741
1742 static bool api_lsa_GetSystemAccessAccount(pipes_struct *p)
1743 {
1744         const struct ndr_interface_call *call;
1745         struct ndr_pull *pull;
1746         struct ndr_push *push;
1747         NTSTATUS status;
1748         DATA_BLOB blob;
1749         struct lsa_GetSystemAccessAccount *r;
1750         
1751         call = &ndr_table_lsarpc.calls[NDR_LSA_GETSYSTEMACCESSACCOUNT];
1752         
1753         r = talloc(NULL, struct lsa_GetSystemAccessAccount);
1754         if (r == NULL) {
1755                 return False;
1756         }
1757         
1758         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1759                 talloc_free(r);
1760                 return False;
1761         }
1762         
1763         pull = ndr_pull_init_blob(&blob, r);
1764         if (pull == NULL) {
1765                 talloc_free(r);
1766                 return False;
1767         }
1768         
1769         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1770         status = call->ndr_pull(pull, NDR_IN, r);
1771         if (NT_STATUS_IS_ERR(status)) {
1772                 talloc_free(r);
1773                 return False;
1774         }
1775         
1776         if (DEBUGLEVEL >= 10)
1777                 NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, r);
1778         
1779         r->out.result = _lsa_GetSystemAccessAccount(p, r);
1780         
1781         if (p->rng_fault_state) {
1782                 talloc_free(r);
1783                 /* Return True here, srv_pipe_hnd.c will take care */
1784                 return True;
1785         }
1786         
1787         if (DEBUGLEVEL >= 10)
1788                 NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, r);
1789         
1790         push = ndr_push_init_ctx(r);
1791         if (push == NULL) {
1792                 talloc_free(r);
1793                 return False;
1794         }
1795         
1796         status = call->ndr_push(push, NDR_OUT, r);
1797         if (NT_STATUS_IS_ERR(status)) {
1798                 talloc_free(r);
1799                 return False;
1800         }
1801         
1802         blob = ndr_push_blob(push);
1803         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1804                 talloc_free(r);
1805                 return False;
1806         }
1807         
1808         talloc_free(r);
1809         
1810         return True;
1811 }
1812
1813 static bool api_lsa_SetSystemAccessAccount(pipes_struct *p)
1814 {
1815         const struct ndr_interface_call *call;
1816         struct ndr_pull *pull;
1817         struct ndr_push *push;
1818         NTSTATUS status;
1819         DATA_BLOB blob;
1820         struct lsa_SetSystemAccessAccount *r;
1821         
1822         call = &ndr_table_lsarpc.calls[NDR_LSA_SETSYSTEMACCESSACCOUNT];
1823         
1824         r = talloc(NULL, struct lsa_SetSystemAccessAccount);
1825         if (r == NULL) {
1826                 return False;
1827         }
1828         
1829         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1830                 talloc_free(r);
1831                 return False;
1832         }
1833         
1834         pull = ndr_pull_init_blob(&blob, r);
1835         if (pull == NULL) {
1836                 talloc_free(r);
1837                 return False;
1838         }
1839         
1840         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1841         status = call->ndr_pull(pull, NDR_IN, r);
1842         if (NT_STATUS_IS_ERR(status)) {
1843                 talloc_free(r);
1844                 return False;
1845         }
1846         
1847         if (DEBUGLEVEL >= 10)
1848                 NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, r);
1849         
1850         r->out.result = _lsa_SetSystemAccessAccount(p, r);
1851         
1852         if (p->rng_fault_state) {
1853                 talloc_free(r);
1854                 /* Return True here, srv_pipe_hnd.c will take care */
1855                 return True;
1856         }
1857         
1858         if (DEBUGLEVEL >= 10)
1859                 NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, r);
1860         
1861         push = ndr_push_init_ctx(r);
1862         if (push == NULL) {
1863                 talloc_free(r);
1864                 return False;
1865         }
1866         
1867         status = call->ndr_push(push, NDR_OUT, r);
1868         if (NT_STATUS_IS_ERR(status)) {
1869                 talloc_free(r);
1870                 return False;
1871         }
1872         
1873         blob = ndr_push_blob(push);
1874         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1875                 talloc_free(r);
1876                 return False;
1877         }
1878         
1879         talloc_free(r);
1880         
1881         return True;
1882 }
1883
1884 static bool api_lsa_OpenTrustedDomain(pipes_struct *p)
1885 {
1886         const struct ndr_interface_call *call;
1887         struct ndr_pull *pull;
1888         struct ndr_push *push;
1889         NTSTATUS status;
1890         DATA_BLOB blob;
1891         struct lsa_OpenTrustedDomain *r;
1892         
1893         call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAIN];
1894         
1895         r = talloc(NULL, struct lsa_OpenTrustedDomain);
1896         if (r == NULL) {
1897                 return False;
1898         }
1899         
1900         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1901                 talloc_free(r);
1902                 return False;
1903         }
1904         
1905         pull = ndr_pull_init_blob(&blob, r);
1906         if (pull == NULL) {
1907                 talloc_free(r);
1908                 return False;
1909         }
1910         
1911         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1912         status = call->ndr_pull(pull, NDR_IN, r);
1913         if (NT_STATUS_IS_ERR(status)) {
1914                 talloc_free(r);
1915                 return False;
1916         }
1917         
1918         if (DEBUGLEVEL >= 10)
1919                 NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, r);
1920         
1921         ZERO_STRUCT(r->out);
1922         r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
1923         if (r->out.trustdom_handle == NULL) {
1924                 talloc_free(r);
1925                 return False;
1926         }
1927         
1928         r->out.result = _lsa_OpenTrustedDomain(p, r);
1929         
1930         if (p->rng_fault_state) {
1931                 talloc_free(r);
1932                 /* Return True here, srv_pipe_hnd.c will take care */
1933                 return True;
1934         }
1935         
1936         if (DEBUGLEVEL >= 10)
1937                 NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, r);
1938         
1939         push = ndr_push_init_ctx(r);
1940         if (push == NULL) {
1941                 talloc_free(r);
1942                 return False;
1943         }
1944         
1945         status = call->ndr_push(push, NDR_OUT, r);
1946         if (NT_STATUS_IS_ERR(status)) {
1947                 talloc_free(r);
1948                 return False;
1949         }
1950         
1951         blob = ndr_push_blob(push);
1952         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1953                 talloc_free(r);
1954                 return False;
1955         }
1956         
1957         talloc_free(r);
1958         
1959         return True;
1960 }
1961
1962 static bool api_lsa_QueryTrustedDomainInfo(pipes_struct *p)
1963 {
1964         const struct ndr_interface_call *call;
1965         struct ndr_pull *pull;
1966         struct ndr_push *push;
1967         NTSTATUS status;
1968         DATA_BLOB blob;
1969         struct lsa_QueryTrustedDomainInfo *r;
1970         
1971         call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFO];
1972         
1973         r = talloc(NULL, struct lsa_QueryTrustedDomainInfo);
1974         if (r == NULL) {
1975                 return False;
1976         }
1977         
1978         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1979                 talloc_free(r);
1980                 return False;
1981         }
1982         
1983         pull = ndr_pull_init_blob(&blob, r);
1984         if (pull == NULL) {
1985                 talloc_free(r);
1986                 return False;
1987         }
1988         
1989         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1990         status = call->ndr_pull(pull, NDR_IN, r);
1991         if (NT_STATUS_IS_ERR(status)) {
1992                 talloc_free(r);
1993                 return False;
1994         }
1995         
1996         if (DEBUGLEVEL >= 10)
1997                 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, r);
1998         
1999         ZERO_STRUCT(r->out);
2000         r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo);
2001         if (r->out.info == NULL) {
2002                 talloc_free(r);
2003                 return False;
2004         }
2005         
2006         r->out.result = _lsa_QueryTrustedDomainInfo(p, r);
2007         
2008         if (p->rng_fault_state) {
2009                 talloc_free(r);
2010                 /* Return True here, srv_pipe_hnd.c will take care */
2011                 return True;
2012         }
2013         
2014         if (DEBUGLEVEL >= 10)
2015                 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, r);
2016         
2017         push = ndr_push_init_ctx(r);
2018         if (push == NULL) {
2019                 talloc_free(r);
2020                 return False;
2021         }
2022         
2023         status = call->ndr_push(push, NDR_OUT, r);
2024         if (NT_STATUS_IS_ERR(status)) {
2025                 talloc_free(r);
2026                 return False;
2027         }
2028         
2029         blob = ndr_push_blob(push);
2030         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2031                 talloc_free(r);
2032                 return False;
2033         }
2034         
2035         talloc_free(r);
2036         
2037         return True;
2038 }
2039
2040 static bool api_lsa_SetInformationTrustedDomain(pipes_struct *p)
2041 {
2042         const struct ndr_interface_call *call;
2043         struct ndr_pull *pull;
2044         struct ndr_push *push;
2045         NTSTATUS status;
2046         DATA_BLOB blob;
2047         struct lsa_SetInformationTrustedDomain *r;
2048         
2049         call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN];
2050         
2051         r = talloc(NULL, struct lsa_SetInformationTrustedDomain);
2052         if (r == NULL) {
2053                 return False;
2054         }
2055         
2056         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2057                 talloc_free(r);
2058                 return False;
2059         }
2060         
2061         pull = ndr_pull_init_blob(&blob, r);
2062         if (pull == NULL) {
2063                 talloc_free(r);
2064                 return False;
2065         }
2066         
2067         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2068         status = call->ndr_pull(pull, NDR_IN, r);
2069         if (NT_STATUS_IS_ERR(status)) {
2070                 talloc_free(r);
2071                 return False;
2072         }
2073         
2074         if (DEBUGLEVEL >= 10)
2075                 NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, r);
2076         
2077         r->out.result = _lsa_SetInformationTrustedDomain(p, r);
2078         
2079         if (p->rng_fault_state) {
2080                 talloc_free(r);
2081                 /* Return True here, srv_pipe_hnd.c will take care */
2082                 return True;
2083         }
2084         
2085         if (DEBUGLEVEL >= 10)
2086                 NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, r);
2087         
2088         push = ndr_push_init_ctx(r);
2089         if (push == NULL) {
2090                 talloc_free(r);
2091                 return False;
2092         }
2093         
2094         status = call->ndr_push(push, NDR_OUT, r);
2095         if (NT_STATUS_IS_ERR(status)) {
2096                 talloc_free(r);
2097                 return False;
2098         }
2099         
2100         blob = ndr_push_blob(push);
2101         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2102                 talloc_free(r);
2103                 return False;
2104         }
2105         
2106         talloc_free(r);
2107         
2108         return True;
2109 }
2110
2111 static bool api_lsa_OpenSecret(pipes_struct *p)
2112 {
2113         const struct ndr_interface_call *call;
2114         struct ndr_pull *pull;
2115         struct ndr_push *push;
2116         NTSTATUS status;
2117         DATA_BLOB blob;
2118         struct lsa_OpenSecret *r;
2119         
2120         call = &ndr_table_lsarpc.calls[NDR_LSA_OPENSECRET];
2121         
2122         r = talloc(NULL, struct lsa_OpenSecret);
2123         if (r == NULL) {
2124                 return False;
2125         }
2126         
2127         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2128                 talloc_free(r);
2129                 return False;
2130         }
2131         
2132         pull = ndr_pull_init_blob(&blob, r);
2133         if (pull == NULL) {
2134                 talloc_free(r);
2135                 return False;
2136         }
2137         
2138         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2139         status = call->ndr_pull(pull, NDR_IN, r);
2140         if (NT_STATUS_IS_ERR(status)) {
2141                 talloc_free(r);
2142                 return False;
2143         }
2144         
2145         if (DEBUGLEVEL >= 10)
2146                 NDR_PRINT_IN_DEBUG(lsa_OpenSecret, r);
2147         
2148         ZERO_STRUCT(r->out);
2149         r->out.sec_handle = talloc_zero(r, struct policy_handle);
2150         if (r->out.sec_handle == NULL) {
2151                 talloc_free(r);
2152                 return False;
2153         }
2154         
2155         r->out.result = _lsa_OpenSecret(p, r);
2156         
2157         if (p->rng_fault_state) {
2158                 talloc_free(r);
2159                 /* Return True here, srv_pipe_hnd.c will take care */
2160                 return True;
2161         }
2162         
2163         if (DEBUGLEVEL >= 10)
2164                 NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, r);
2165         
2166         push = ndr_push_init_ctx(r);
2167         if (push == NULL) {
2168                 talloc_free(r);
2169                 return False;
2170         }
2171         
2172         status = call->ndr_push(push, NDR_OUT, r);
2173         if (NT_STATUS_IS_ERR(status)) {
2174                 talloc_free(r);
2175                 return False;
2176         }
2177         
2178         blob = ndr_push_blob(push);
2179         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2180                 talloc_free(r);
2181                 return False;
2182         }
2183         
2184         talloc_free(r);
2185         
2186         return True;
2187 }
2188
2189 static bool api_lsa_SetSecret(pipes_struct *p)
2190 {
2191         const struct ndr_interface_call *call;
2192         struct ndr_pull *pull;
2193         struct ndr_push *push;
2194         NTSTATUS status;
2195         DATA_BLOB blob;
2196         struct lsa_SetSecret *r;
2197         
2198         call = &ndr_table_lsarpc.calls[NDR_LSA_SETSECRET];
2199         
2200         r = talloc(NULL, struct lsa_SetSecret);
2201         if (r == NULL) {
2202                 return False;
2203         }
2204         
2205         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2206                 talloc_free(r);
2207                 return False;
2208         }
2209         
2210         pull = ndr_pull_init_blob(&blob, r);
2211         if (pull == NULL) {
2212                 talloc_free(r);
2213                 return False;
2214         }
2215         
2216         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2217         status = call->ndr_pull(pull, NDR_IN, r);
2218         if (NT_STATUS_IS_ERR(status)) {
2219                 talloc_free(r);
2220                 return False;
2221         }
2222         
2223         if (DEBUGLEVEL >= 10)
2224                 NDR_PRINT_IN_DEBUG(lsa_SetSecret, r);
2225         
2226         r->out.result = _lsa_SetSecret(p, r);
2227         
2228         if (p->rng_fault_state) {
2229                 talloc_free(r);
2230                 /* Return True here, srv_pipe_hnd.c will take care */
2231                 return True;
2232         }
2233         
2234         if (DEBUGLEVEL >= 10)
2235                 NDR_PRINT_OUT_DEBUG(lsa_SetSecret, r);
2236         
2237         push = ndr_push_init_ctx(r);
2238         if (push == NULL) {
2239                 talloc_free(r);
2240                 return False;
2241         }
2242         
2243         status = call->ndr_push(push, NDR_OUT, r);
2244         if (NT_STATUS_IS_ERR(status)) {
2245                 talloc_free(r);
2246                 return False;
2247         }
2248         
2249         blob = ndr_push_blob(push);
2250         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2251                 talloc_free(r);
2252                 return False;
2253         }
2254         
2255         talloc_free(r);
2256         
2257         return True;
2258 }
2259
2260 static bool api_lsa_QuerySecret(pipes_struct *p)
2261 {
2262         const struct ndr_interface_call *call;
2263         struct ndr_pull *pull;
2264         struct ndr_push *push;
2265         NTSTATUS status;
2266         DATA_BLOB blob;
2267         struct lsa_QuerySecret *r;
2268         
2269         call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYSECRET];
2270         
2271         r = talloc(NULL, struct lsa_QuerySecret);
2272         if (r == NULL) {
2273                 return False;
2274         }
2275         
2276         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2277                 talloc_free(r);
2278                 return False;
2279         }
2280         
2281         pull = ndr_pull_init_blob(&blob, r);
2282         if (pull == NULL) {
2283                 talloc_free(r);
2284                 return False;
2285         }
2286         
2287         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2288         status = call->ndr_pull(pull, NDR_IN, r);
2289         if (NT_STATUS_IS_ERR(status)) {
2290                 talloc_free(r);
2291                 return False;
2292         }
2293         
2294         if (DEBUGLEVEL >= 10)
2295                 NDR_PRINT_IN_DEBUG(lsa_QuerySecret, r);
2296         
2297         ZERO_STRUCT(r->out);
2298         r->out.new_val = r->in.new_val;
2299         r->out.new_mtime = r->in.new_mtime;
2300         r->out.old_val = r->in.old_val;
2301         r->out.old_mtime = r->in.old_mtime;
2302         r->out.result = _lsa_QuerySecret(p, r);
2303         
2304         if (p->rng_fault_state) {
2305                 talloc_free(r);
2306                 /* Return True here, srv_pipe_hnd.c will take care */
2307                 return True;
2308         }
2309         
2310         if (DEBUGLEVEL >= 10)
2311                 NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, r);
2312         
2313         push = ndr_push_init_ctx(r);
2314         if (push == NULL) {
2315                 talloc_free(r);
2316                 return False;
2317         }
2318         
2319         status = call->ndr_push(push, NDR_OUT, r);
2320         if (NT_STATUS_IS_ERR(status)) {
2321                 talloc_free(r);
2322                 return False;
2323         }
2324         
2325         blob = ndr_push_blob(push);
2326         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2327                 talloc_free(r);
2328                 return False;
2329         }
2330         
2331         talloc_free(r);
2332         
2333         return True;
2334 }
2335
2336 static bool api_lsa_LookupPrivValue(pipes_struct *p)
2337 {
2338         const struct ndr_interface_call *call;
2339         struct ndr_pull *pull;
2340         struct ndr_push *push;
2341         NTSTATUS status;
2342         DATA_BLOB blob;
2343         struct lsa_LookupPrivValue *r;
2344         
2345         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVVALUE];
2346         
2347         r = talloc(NULL, struct lsa_LookupPrivValue);
2348         if (r == NULL) {
2349                 return False;
2350         }
2351         
2352         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2353                 talloc_free(r);
2354                 return False;
2355         }
2356         
2357         pull = ndr_pull_init_blob(&blob, r);
2358         if (pull == NULL) {
2359                 talloc_free(r);
2360                 return False;
2361         }
2362         
2363         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2364         status = call->ndr_pull(pull, NDR_IN, r);
2365         if (NT_STATUS_IS_ERR(status)) {
2366                 talloc_free(r);
2367                 return False;
2368         }
2369         
2370         if (DEBUGLEVEL >= 10)
2371                 NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, r);
2372         
2373         ZERO_STRUCT(r->out);
2374         r->out.luid = talloc_zero(r, struct lsa_LUID);
2375         if (r->out.luid == NULL) {
2376                 talloc_free(r);
2377                 return False;
2378         }
2379         
2380         r->out.result = _lsa_LookupPrivValue(p, r);
2381         
2382         if (p->rng_fault_state) {
2383                 talloc_free(r);
2384                 /* Return True here, srv_pipe_hnd.c will take care */
2385                 return True;
2386         }
2387         
2388         if (DEBUGLEVEL >= 10)
2389                 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, r);
2390         
2391         push = ndr_push_init_ctx(r);
2392         if (push == NULL) {
2393                 talloc_free(r);
2394                 return False;
2395         }
2396         
2397         status = call->ndr_push(push, NDR_OUT, r);
2398         if (NT_STATUS_IS_ERR(status)) {
2399                 talloc_free(r);
2400                 return False;
2401         }
2402         
2403         blob = ndr_push_blob(push);
2404         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2405                 talloc_free(r);
2406                 return False;
2407         }
2408         
2409         talloc_free(r);
2410         
2411         return True;
2412 }
2413
2414 static bool api_lsa_LookupPrivName(pipes_struct *p)
2415 {
2416         const struct ndr_interface_call *call;
2417         struct ndr_pull *pull;
2418         struct ndr_push *push;
2419         NTSTATUS status;
2420         DATA_BLOB blob;
2421         struct lsa_LookupPrivName *r;
2422         
2423         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVNAME];
2424         
2425         r = talloc(NULL, struct lsa_LookupPrivName);
2426         if (r == NULL) {
2427                 return False;
2428         }
2429         
2430         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2431                 talloc_free(r);
2432                 return False;
2433         }
2434         
2435         pull = ndr_pull_init_blob(&blob, r);
2436         if (pull == NULL) {
2437                 talloc_free(r);
2438                 return False;
2439         }
2440         
2441         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2442         status = call->ndr_pull(pull, NDR_IN, r);
2443         if (NT_STATUS_IS_ERR(status)) {
2444                 talloc_free(r);
2445                 return False;
2446         }
2447         
2448         if (DEBUGLEVEL >= 10)
2449                 NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, r);
2450         
2451         ZERO_STRUCT(r->out);
2452         r->out.name = talloc_zero(r, struct lsa_StringLarge);
2453         if (r->out.name == NULL) {
2454                 talloc_free(r);
2455                 return False;
2456         }
2457         
2458         r->out.result = _lsa_LookupPrivName(p, r);
2459         
2460         if (p->rng_fault_state) {
2461                 talloc_free(r);
2462                 /* Return True here, srv_pipe_hnd.c will take care */
2463                 return True;
2464         }
2465         
2466         if (DEBUGLEVEL >= 10)
2467                 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, r);
2468         
2469         push = ndr_push_init_ctx(r);
2470         if (push == NULL) {
2471                 talloc_free(r);
2472                 return False;
2473         }
2474         
2475         status = call->ndr_push(push, NDR_OUT, r);
2476         if (NT_STATUS_IS_ERR(status)) {
2477                 talloc_free(r);
2478                 return False;
2479         }
2480         
2481         blob = ndr_push_blob(push);
2482         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2483                 talloc_free(r);
2484                 return False;
2485         }
2486         
2487         talloc_free(r);
2488         
2489         return True;
2490 }
2491
2492 static bool api_lsa_LookupPrivDisplayName(pipes_struct *p)
2493 {
2494         const struct ndr_interface_call *call;
2495         struct ndr_pull *pull;
2496         struct ndr_push *push;
2497         NTSTATUS status;
2498         DATA_BLOB blob;
2499         struct lsa_LookupPrivDisplayName *r;
2500         
2501         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPPRIVDISPLAYNAME];
2502         
2503         r = talloc(NULL, struct lsa_LookupPrivDisplayName);
2504         if (r == NULL) {
2505                 return False;
2506         }
2507         
2508         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2509                 talloc_free(r);
2510                 return False;
2511         }
2512         
2513         pull = ndr_pull_init_blob(&blob, r);
2514         if (pull == NULL) {
2515                 talloc_free(r);
2516                 return False;
2517         }
2518         
2519         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2520         status = call->ndr_pull(pull, NDR_IN, r);
2521         if (NT_STATUS_IS_ERR(status)) {
2522                 talloc_free(r);
2523                 return False;
2524         }
2525         
2526         if (DEBUGLEVEL >= 10)
2527                 NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, r);
2528         
2529         ZERO_STRUCT(r->out);
2530         r->out.disp_name = talloc_zero(r, struct lsa_StringLarge);
2531         if (r->out.disp_name == NULL) {
2532                 talloc_free(r);
2533                 return False;
2534         }
2535         
2536         r->out.language_id = r->in.language_id;
2537         r->out.result = _lsa_LookupPrivDisplayName(p, r);
2538         
2539         if (p->rng_fault_state) {
2540                 talloc_free(r);
2541                 /* Return True here, srv_pipe_hnd.c will take care */
2542                 return True;
2543         }
2544         
2545         if (DEBUGLEVEL >= 10)
2546                 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, r);
2547         
2548         push = ndr_push_init_ctx(r);
2549         if (push == NULL) {
2550                 talloc_free(r);
2551                 return False;
2552         }
2553         
2554         status = call->ndr_push(push, NDR_OUT, r);
2555         if (NT_STATUS_IS_ERR(status)) {
2556                 talloc_free(r);
2557                 return False;
2558         }
2559         
2560         blob = ndr_push_blob(push);
2561         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2562                 talloc_free(r);
2563                 return False;
2564         }
2565         
2566         talloc_free(r);
2567         
2568         return True;
2569 }
2570
2571 static bool api_lsa_DeleteObject(pipes_struct *p)
2572 {
2573         const struct ndr_interface_call *call;
2574         struct ndr_pull *pull;
2575         struct ndr_push *push;
2576         NTSTATUS status;
2577         DATA_BLOB blob;
2578         struct lsa_DeleteObject *r;
2579         
2580         call = &ndr_table_lsarpc.calls[NDR_LSA_DELETEOBJECT];
2581         
2582         r = talloc(NULL, struct lsa_DeleteObject);
2583         if (r == NULL) {
2584                 return False;
2585         }
2586         
2587         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2588                 talloc_free(r);
2589                 return False;
2590         }
2591         
2592         pull = ndr_pull_init_blob(&blob, r);
2593         if (pull == NULL) {
2594                 talloc_free(r);
2595                 return False;
2596         }
2597         
2598         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2599         status = call->ndr_pull(pull, NDR_IN, r);
2600         if (NT_STATUS_IS_ERR(status)) {
2601                 talloc_free(r);
2602                 return False;
2603         }
2604         
2605         if (DEBUGLEVEL >= 10)
2606                 NDR_PRINT_IN_DEBUG(lsa_DeleteObject, r);
2607         
2608         r->out.result = _lsa_DeleteObject(p, r);
2609         
2610         if (p->rng_fault_state) {
2611                 talloc_free(r);
2612                 /* Return True here, srv_pipe_hnd.c will take care */
2613                 return True;
2614         }
2615         
2616         if (DEBUGLEVEL >= 10)
2617                 NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, r);
2618         
2619         push = ndr_push_init_ctx(r);
2620         if (push == NULL) {
2621                 talloc_free(r);
2622                 return False;
2623         }
2624         
2625         status = call->ndr_push(push, NDR_OUT, r);
2626         if (NT_STATUS_IS_ERR(status)) {
2627                 talloc_free(r);
2628                 return False;
2629         }
2630         
2631         blob = ndr_push_blob(push);
2632         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2633                 talloc_free(r);
2634                 return False;
2635         }
2636         
2637         talloc_free(r);
2638         
2639         return True;
2640 }
2641
2642 static bool api_lsa_EnumAccountsWithUserRight(pipes_struct *p)
2643 {
2644         const struct ndr_interface_call *call;
2645         struct ndr_pull *pull;
2646         struct ndr_push *push;
2647         NTSTATUS status;
2648         DATA_BLOB blob;
2649         struct lsa_EnumAccountsWithUserRight *r;
2650         
2651         call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT];
2652         
2653         r = talloc(NULL, struct lsa_EnumAccountsWithUserRight);
2654         if (r == NULL) {
2655                 return False;
2656         }
2657         
2658         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2659                 talloc_free(r);
2660                 return False;
2661         }
2662         
2663         pull = ndr_pull_init_blob(&blob, r);
2664         if (pull == NULL) {
2665                 talloc_free(r);
2666                 return False;
2667         }
2668         
2669         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2670         status = call->ndr_pull(pull, NDR_IN, r);
2671         if (NT_STATUS_IS_ERR(status)) {
2672                 talloc_free(r);
2673                 return False;
2674         }
2675         
2676         if (DEBUGLEVEL >= 10)
2677                 NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, r);
2678         
2679         ZERO_STRUCT(r->out);
2680         r->out.sids = talloc_zero(r, struct lsa_SidArray);
2681         if (r->out.sids == NULL) {
2682                 talloc_free(r);
2683                 return False;
2684         }
2685         
2686         r->out.result = _lsa_EnumAccountsWithUserRight(p, r);
2687         
2688         if (p->rng_fault_state) {
2689                 talloc_free(r);
2690                 /* Return True here, srv_pipe_hnd.c will take care */
2691                 return True;
2692         }
2693         
2694         if (DEBUGLEVEL >= 10)
2695                 NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, r);
2696         
2697         push = ndr_push_init_ctx(r);
2698         if (push == NULL) {
2699                 talloc_free(r);
2700                 return False;
2701         }
2702         
2703         status = call->ndr_push(push, NDR_OUT, r);
2704         if (NT_STATUS_IS_ERR(status)) {
2705                 talloc_free(r);
2706                 return False;
2707         }
2708         
2709         blob = ndr_push_blob(push);
2710         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2711                 talloc_free(r);
2712                 return False;
2713         }
2714         
2715         talloc_free(r);
2716         
2717         return True;
2718 }
2719
2720 static bool api_lsa_EnumAccountRights(pipes_struct *p)
2721 {
2722         const struct ndr_interface_call *call;
2723         struct ndr_pull *pull;
2724         struct ndr_push *push;
2725         NTSTATUS status;
2726         DATA_BLOB blob;
2727         struct lsa_EnumAccountRights *r;
2728         
2729         call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMACCOUNTRIGHTS];
2730         
2731         r = talloc(NULL, struct lsa_EnumAccountRights);
2732         if (r == NULL) {
2733                 return False;
2734         }
2735         
2736         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2737                 talloc_free(r);
2738                 return False;
2739         }
2740         
2741         pull = ndr_pull_init_blob(&blob, r);
2742         if (pull == NULL) {
2743                 talloc_free(r);
2744                 return False;
2745         }
2746         
2747         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2748         status = call->ndr_pull(pull, NDR_IN, r);
2749         if (NT_STATUS_IS_ERR(status)) {
2750                 talloc_free(r);
2751                 return False;
2752         }
2753         
2754         if (DEBUGLEVEL >= 10)
2755                 NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, r);
2756         
2757         ZERO_STRUCT(r->out);
2758         r->out.rights = talloc_zero(r, struct lsa_RightSet);
2759         if (r->out.rights == NULL) {
2760                 talloc_free(r);
2761                 return False;
2762         }
2763         
2764         r->out.result = _lsa_EnumAccountRights(p, r);
2765         
2766         if (p->rng_fault_state) {
2767                 talloc_free(r);
2768                 /* Return True here, srv_pipe_hnd.c will take care */
2769                 return True;
2770         }
2771         
2772         if (DEBUGLEVEL >= 10)
2773                 NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, r);
2774         
2775         push = ndr_push_init_ctx(r);
2776         if (push == NULL) {
2777                 talloc_free(r);
2778                 return False;
2779         }
2780         
2781         status = call->ndr_push(push, NDR_OUT, r);
2782         if (NT_STATUS_IS_ERR(status)) {
2783                 talloc_free(r);
2784                 return False;
2785         }
2786         
2787         blob = ndr_push_blob(push);
2788         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2789                 talloc_free(r);
2790                 return False;
2791         }
2792         
2793         talloc_free(r);
2794         
2795         return True;
2796 }
2797
2798 static bool api_lsa_AddAccountRights(pipes_struct *p)
2799 {
2800         const struct ndr_interface_call *call;
2801         struct ndr_pull *pull;
2802         struct ndr_push *push;
2803         NTSTATUS status;
2804         DATA_BLOB blob;
2805         struct lsa_AddAccountRights *r;
2806         
2807         call = &ndr_table_lsarpc.calls[NDR_LSA_ADDACCOUNTRIGHTS];
2808         
2809         r = talloc(NULL, struct lsa_AddAccountRights);
2810         if (r == NULL) {
2811                 return False;
2812         }
2813         
2814         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2815                 talloc_free(r);
2816                 return False;
2817         }
2818         
2819         pull = ndr_pull_init_blob(&blob, r);
2820         if (pull == NULL) {
2821                 talloc_free(r);
2822                 return False;
2823         }
2824         
2825         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2826         status = call->ndr_pull(pull, NDR_IN, r);
2827         if (NT_STATUS_IS_ERR(status)) {
2828                 talloc_free(r);
2829                 return False;
2830         }
2831         
2832         if (DEBUGLEVEL >= 10)
2833                 NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, r);
2834         
2835         r->out.result = _lsa_AddAccountRights(p, r);
2836         
2837         if (p->rng_fault_state) {
2838                 talloc_free(r);
2839                 /* Return True here, srv_pipe_hnd.c will take care */
2840                 return True;
2841         }
2842         
2843         if (DEBUGLEVEL >= 10)
2844                 NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, r);
2845         
2846         push = ndr_push_init_ctx(r);
2847         if (push == NULL) {
2848                 talloc_free(r);
2849                 return False;
2850         }
2851         
2852         status = call->ndr_push(push, NDR_OUT, r);
2853         if (NT_STATUS_IS_ERR(status)) {
2854                 talloc_free(r);
2855                 return False;
2856         }
2857         
2858         blob = ndr_push_blob(push);
2859         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2860                 talloc_free(r);
2861                 return False;
2862         }
2863         
2864         talloc_free(r);
2865         
2866         return True;
2867 }
2868
2869 static bool api_lsa_RemoveAccountRights(pipes_struct *p)
2870 {
2871         const struct ndr_interface_call *call;
2872         struct ndr_pull *pull;
2873         struct ndr_push *push;
2874         NTSTATUS status;
2875         DATA_BLOB blob;
2876         struct lsa_RemoveAccountRights *r;
2877         
2878         call = &ndr_table_lsarpc.calls[NDR_LSA_REMOVEACCOUNTRIGHTS];
2879         
2880         r = talloc(NULL, struct lsa_RemoveAccountRights);
2881         if (r == NULL) {
2882                 return False;
2883         }
2884         
2885         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2886                 talloc_free(r);
2887                 return False;
2888         }
2889         
2890         pull = ndr_pull_init_blob(&blob, r);
2891         if (pull == NULL) {
2892                 talloc_free(r);
2893                 return False;
2894         }
2895         
2896         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2897         status = call->ndr_pull(pull, NDR_IN, r);
2898         if (NT_STATUS_IS_ERR(status)) {
2899                 talloc_free(r);
2900                 return False;
2901         }
2902         
2903         if (DEBUGLEVEL >= 10)
2904                 NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, r);
2905         
2906         r->out.result = _lsa_RemoveAccountRights(p, r);
2907         
2908         if (p->rng_fault_state) {
2909                 talloc_free(r);
2910                 /* Return True here, srv_pipe_hnd.c will take care */
2911                 return True;
2912         }
2913         
2914         if (DEBUGLEVEL >= 10)
2915                 NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, r);
2916         
2917         push = ndr_push_init_ctx(r);
2918         if (push == NULL) {
2919                 talloc_free(r);
2920                 return False;
2921         }
2922         
2923         status = call->ndr_push(push, NDR_OUT, r);
2924         if (NT_STATUS_IS_ERR(status)) {
2925                 talloc_free(r);
2926                 return False;
2927         }
2928         
2929         blob = ndr_push_blob(push);
2930         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2931                 talloc_free(r);
2932                 return False;
2933         }
2934         
2935         talloc_free(r);
2936         
2937         return True;
2938 }
2939
2940 static bool api_lsa_QueryTrustedDomainInfoBySid(pipes_struct *p)
2941 {
2942         const struct ndr_interface_call *call;
2943         struct ndr_pull *pull;
2944         struct ndr_push *push;
2945         NTSTATUS status;
2946         DATA_BLOB blob;
2947         struct lsa_QueryTrustedDomainInfoBySid *r;
2948         
2949         call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID];
2950         
2951         r = talloc(NULL, struct lsa_QueryTrustedDomainInfoBySid);
2952         if (r == NULL) {
2953                 return False;
2954         }
2955         
2956         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2957                 talloc_free(r);
2958                 return False;
2959         }
2960         
2961         pull = ndr_pull_init_blob(&blob, r);
2962         if (pull == NULL) {
2963                 talloc_free(r);
2964                 return False;
2965         }
2966         
2967         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2968         status = call->ndr_pull(pull, NDR_IN, r);
2969         if (NT_STATUS_IS_ERR(status)) {
2970                 talloc_free(r);
2971                 return False;
2972         }
2973         
2974         if (DEBUGLEVEL >= 10)
2975                 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, r);
2976         
2977         ZERO_STRUCT(r->out);
2978         r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo);
2979         if (r->out.info == NULL) {
2980                 talloc_free(r);
2981                 return False;
2982         }
2983         
2984         r->out.result = _lsa_QueryTrustedDomainInfoBySid(p, r);
2985         
2986         if (p->rng_fault_state) {
2987                 talloc_free(r);
2988                 /* Return True here, srv_pipe_hnd.c will take care */
2989                 return True;
2990         }
2991         
2992         if (DEBUGLEVEL >= 10)
2993                 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, r);
2994         
2995         push = ndr_push_init_ctx(r);
2996         if (push == NULL) {
2997                 talloc_free(r);
2998                 return False;
2999         }
3000         
3001         status = call->ndr_push(push, NDR_OUT, r);
3002         if (NT_STATUS_IS_ERR(status)) {
3003                 talloc_free(r);
3004                 return False;
3005         }
3006         
3007         blob = ndr_push_blob(push);
3008         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3009                 talloc_free(r);
3010                 return False;
3011         }
3012         
3013         talloc_free(r);
3014         
3015         return True;
3016 }
3017
3018 static bool api_lsa_SetTrustedDomainInfo(pipes_struct *p)
3019 {
3020         const struct ndr_interface_call *call;
3021         struct ndr_pull *pull;
3022         struct ndr_push *push;
3023         NTSTATUS status;
3024         DATA_BLOB blob;
3025         struct lsa_SetTrustedDomainInfo *r;
3026         
3027         call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFO];
3028         
3029         r = talloc(NULL, struct lsa_SetTrustedDomainInfo);
3030         if (r == NULL) {
3031                 return False;
3032         }
3033         
3034         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3035                 talloc_free(r);
3036                 return False;
3037         }
3038         
3039         pull = ndr_pull_init_blob(&blob, r);
3040         if (pull == NULL) {
3041                 talloc_free(r);
3042                 return False;
3043         }
3044         
3045         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3046         status = call->ndr_pull(pull, NDR_IN, r);
3047         if (NT_STATUS_IS_ERR(status)) {
3048                 talloc_free(r);
3049                 return False;
3050         }
3051         
3052         if (DEBUGLEVEL >= 10)
3053                 NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, r);
3054         
3055         r->out.result = _lsa_SetTrustedDomainInfo(p, r);
3056         
3057         if (p->rng_fault_state) {
3058                 talloc_free(r);
3059                 /* Return True here, srv_pipe_hnd.c will take care */
3060                 return True;
3061         }
3062         
3063         if (DEBUGLEVEL >= 10)
3064                 NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, r);
3065         
3066         push = ndr_push_init_ctx(r);
3067         if (push == NULL) {
3068                 talloc_free(r);
3069                 return False;
3070         }
3071         
3072         status = call->ndr_push(push, NDR_OUT, r);
3073         if (NT_STATUS_IS_ERR(status)) {
3074                 talloc_free(r);
3075                 return False;
3076         }
3077         
3078         blob = ndr_push_blob(push);
3079         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3080                 talloc_free(r);
3081                 return False;
3082         }
3083         
3084         talloc_free(r);
3085         
3086         return True;
3087 }
3088
3089 static bool api_lsa_DeleteTrustedDomain(pipes_struct *p)
3090 {
3091         const struct ndr_interface_call *call;
3092         struct ndr_pull *pull;
3093         struct ndr_push *push;
3094         NTSTATUS status;
3095         DATA_BLOB blob;
3096         struct lsa_DeleteTrustedDomain *r;
3097         
3098         call = &ndr_table_lsarpc.calls[NDR_LSA_DELETETRUSTEDDOMAIN];
3099         
3100         r = talloc(NULL, struct lsa_DeleteTrustedDomain);
3101         if (r == NULL) {
3102                 return False;
3103         }
3104         
3105         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3106                 talloc_free(r);
3107                 return False;
3108         }
3109         
3110         pull = ndr_pull_init_blob(&blob, r);
3111         if (pull == NULL) {
3112                 talloc_free(r);
3113                 return False;
3114         }
3115         
3116         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3117         status = call->ndr_pull(pull, NDR_IN, r);
3118         if (NT_STATUS_IS_ERR(status)) {
3119                 talloc_free(r);
3120                 return False;
3121         }
3122         
3123         if (DEBUGLEVEL >= 10)
3124                 NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, r);
3125         
3126         r->out.result = _lsa_DeleteTrustedDomain(p, r);
3127         
3128         if (p->rng_fault_state) {
3129                 talloc_free(r);
3130                 /* Return True here, srv_pipe_hnd.c will take care */
3131                 return True;
3132         }
3133         
3134         if (DEBUGLEVEL >= 10)
3135                 NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, r);
3136         
3137         push = ndr_push_init_ctx(r);
3138         if (push == NULL) {
3139                 talloc_free(r);
3140                 return False;
3141         }
3142         
3143         status = call->ndr_push(push, NDR_OUT, r);
3144         if (NT_STATUS_IS_ERR(status)) {
3145                 talloc_free(r);
3146                 return False;
3147         }
3148         
3149         blob = ndr_push_blob(push);
3150         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3151                 talloc_free(r);
3152                 return False;
3153         }
3154         
3155         talloc_free(r);
3156         
3157         return True;
3158 }
3159
3160 static bool api_lsa_StorePrivateData(pipes_struct *p)
3161 {
3162         const struct ndr_interface_call *call;
3163         struct ndr_pull *pull;
3164         struct ndr_push *push;
3165         NTSTATUS status;
3166         DATA_BLOB blob;
3167         struct lsa_StorePrivateData *r;
3168         
3169         call = &ndr_table_lsarpc.calls[NDR_LSA_STOREPRIVATEDATA];
3170         
3171         r = talloc(NULL, struct lsa_StorePrivateData);
3172         if (r == NULL) {
3173                 return False;
3174         }
3175         
3176         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3177                 talloc_free(r);
3178                 return False;
3179         }
3180         
3181         pull = ndr_pull_init_blob(&blob, r);
3182         if (pull == NULL) {
3183                 talloc_free(r);
3184                 return False;
3185         }
3186         
3187         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3188         status = call->ndr_pull(pull, NDR_IN, r);
3189         if (NT_STATUS_IS_ERR(status)) {
3190                 talloc_free(r);
3191                 return False;
3192         }
3193         
3194         if (DEBUGLEVEL >= 10)
3195                 NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, r);
3196         
3197         r->out.result = _lsa_StorePrivateData(p, r);
3198         
3199         if (p->rng_fault_state) {
3200                 talloc_free(r);
3201                 /* Return True here, srv_pipe_hnd.c will take care */
3202                 return True;
3203         }
3204         
3205         if (DEBUGLEVEL >= 10)
3206                 NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, r);
3207         
3208         push = ndr_push_init_ctx(r);
3209         if (push == NULL) {
3210                 talloc_free(r);
3211                 return False;
3212         }
3213         
3214         status = call->ndr_push(push, NDR_OUT, r);
3215         if (NT_STATUS_IS_ERR(status)) {
3216                 talloc_free(r);
3217                 return False;
3218         }
3219         
3220         blob = ndr_push_blob(push);
3221         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3222                 talloc_free(r);
3223                 return False;
3224         }
3225         
3226         talloc_free(r);
3227         
3228         return True;
3229 }
3230
3231 static bool api_lsa_RetrievePrivateData(pipes_struct *p)
3232 {
3233         const struct ndr_interface_call *call;
3234         struct ndr_pull *pull;
3235         struct ndr_push *push;
3236         NTSTATUS status;
3237         DATA_BLOB blob;
3238         struct lsa_RetrievePrivateData *r;
3239         
3240         call = &ndr_table_lsarpc.calls[NDR_LSA_RETRIEVEPRIVATEDATA];
3241         
3242         r = talloc(NULL, struct lsa_RetrievePrivateData);
3243         if (r == NULL) {
3244                 return False;
3245         }
3246         
3247         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3248                 talloc_free(r);
3249                 return False;
3250         }
3251         
3252         pull = ndr_pull_init_blob(&blob, r);
3253         if (pull == NULL) {
3254                 talloc_free(r);
3255                 return False;
3256         }
3257         
3258         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3259         status = call->ndr_pull(pull, NDR_IN, r);
3260         if (NT_STATUS_IS_ERR(status)) {
3261                 talloc_free(r);
3262                 return False;
3263         }
3264         
3265         if (DEBUGLEVEL >= 10)
3266                 NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, r);
3267         
3268         r->out.result = _lsa_RetrievePrivateData(p, r);
3269         
3270         if (p->rng_fault_state) {
3271                 talloc_free(r);
3272                 /* Return True here, srv_pipe_hnd.c will take care */
3273                 return True;
3274         }
3275         
3276         if (DEBUGLEVEL >= 10)
3277                 NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, r);
3278         
3279         push = ndr_push_init_ctx(r);
3280         if (push == NULL) {
3281                 talloc_free(r);
3282                 return False;
3283         }
3284         
3285         status = call->ndr_push(push, NDR_OUT, r);
3286         if (NT_STATUS_IS_ERR(status)) {
3287                 talloc_free(r);
3288                 return False;
3289         }
3290         
3291         blob = ndr_push_blob(push);
3292         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3293                 talloc_free(r);
3294                 return False;
3295         }
3296         
3297         talloc_free(r);
3298         
3299         return True;
3300 }
3301
3302 static bool api_lsa_OpenPolicy2(pipes_struct *p)
3303 {
3304         const struct ndr_interface_call *call;
3305         struct ndr_pull *pull;
3306         struct ndr_push *push;
3307         NTSTATUS status;
3308         DATA_BLOB blob;
3309         struct lsa_OpenPolicy2 *r;
3310         
3311         call = &ndr_table_lsarpc.calls[NDR_LSA_OPENPOLICY2];
3312         
3313         r = talloc(NULL, struct lsa_OpenPolicy2);
3314         if (r == NULL) {
3315                 return False;
3316         }
3317         
3318         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3319                 talloc_free(r);
3320                 return False;
3321         }
3322         
3323         pull = ndr_pull_init_blob(&blob, r);
3324         if (pull == NULL) {
3325                 talloc_free(r);
3326                 return False;
3327         }
3328         
3329         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3330         status = call->ndr_pull(pull, NDR_IN, r);
3331         if (NT_STATUS_IS_ERR(status)) {
3332                 talloc_free(r);
3333                 return False;
3334         }
3335         
3336         if (DEBUGLEVEL >= 10)
3337                 NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, r);
3338         
3339         ZERO_STRUCT(r->out);
3340         r->out.handle = talloc_zero(r, struct policy_handle);
3341         if (r->out.handle == NULL) {
3342                 talloc_free(r);
3343                 return False;
3344         }
3345         
3346         r->out.result = _lsa_OpenPolicy2(p, r);
3347         
3348         if (p->rng_fault_state) {
3349                 talloc_free(r);
3350                 /* Return True here, srv_pipe_hnd.c will take care */
3351                 return True;
3352         }
3353         
3354         if (DEBUGLEVEL >= 10)
3355                 NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, r);
3356         
3357         push = ndr_push_init_ctx(r);
3358         if (push == NULL) {
3359                 talloc_free(r);
3360                 return False;
3361         }
3362         
3363         status = call->ndr_push(push, NDR_OUT, r);
3364         if (NT_STATUS_IS_ERR(status)) {
3365                 talloc_free(r);
3366                 return False;
3367         }
3368         
3369         blob = ndr_push_blob(push);
3370         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3371                 talloc_free(r);
3372                 return False;
3373         }
3374         
3375         talloc_free(r);
3376         
3377         return True;
3378 }
3379
3380 static bool api_lsa_GetUserName(pipes_struct *p)
3381 {
3382         const struct ndr_interface_call *call;
3383         struct ndr_pull *pull;
3384         struct ndr_push *push;
3385         NTSTATUS status;
3386         DATA_BLOB blob;
3387         struct lsa_GetUserName *r;
3388         
3389         call = &ndr_table_lsarpc.calls[NDR_LSA_GETUSERNAME];
3390         
3391         r = talloc(NULL, struct lsa_GetUserName);
3392         if (r == NULL) {
3393                 return False;
3394         }
3395         
3396         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3397                 talloc_free(r);
3398                 return False;
3399         }
3400         
3401         pull = ndr_pull_init_blob(&blob, r);
3402         if (pull == NULL) {
3403                 talloc_free(r);
3404                 return False;
3405         }
3406         
3407         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3408         status = call->ndr_pull(pull, NDR_IN, r);
3409         if (NT_STATUS_IS_ERR(status)) {
3410                 talloc_free(r);
3411                 return False;
3412         }
3413         
3414         if (DEBUGLEVEL >= 10)
3415                 NDR_PRINT_IN_DEBUG(lsa_GetUserName, r);
3416         
3417         ZERO_STRUCT(r->out);
3418         r->out.account_name = r->in.account_name;
3419         r->out.authority_name = r->in.authority_name;
3420         r->out.result = _lsa_GetUserName(p, r);
3421         
3422         if (p->rng_fault_state) {
3423                 talloc_free(r);
3424                 /* Return True here, srv_pipe_hnd.c will take care */
3425                 return True;
3426         }
3427         
3428         if (DEBUGLEVEL >= 10)
3429                 NDR_PRINT_OUT_DEBUG(lsa_GetUserName, r);
3430         
3431         push = ndr_push_init_ctx(r);
3432         if (push == NULL) {
3433                 talloc_free(r);
3434                 return False;
3435         }
3436         
3437         status = call->ndr_push(push, NDR_OUT, r);
3438         if (NT_STATUS_IS_ERR(status)) {
3439                 talloc_free(r);
3440                 return False;
3441         }
3442         
3443         blob = ndr_push_blob(push);
3444         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3445                 talloc_free(r);
3446                 return False;
3447         }
3448         
3449         talloc_free(r);
3450         
3451         return True;
3452 }
3453
3454 static bool api_lsa_QueryInfoPolicy2(pipes_struct *p)
3455 {
3456         const struct ndr_interface_call *call;
3457         struct ndr_pull *pull;
3458         struct ndr_push *push;
3459         NTSTATUS status;
3460         DATA_BLOB blob;
3461         struct lsa_QueryInfoPolicy2 *r;
3462         
3463         call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYINFOPOLICY2];
3464         
3465         r = talloc(NULL, struct lsa_QueryInfoPolicy2);
3466         if (r == NULL) {
3467                 return False;
3468         }
3469         
3470         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3471                 talloc_free(r);
3472                 return False;
3473         }
3474         
3475         pull = ndr_pull_init_blob(&blob, r);
3476         if (pull == NULL) {
3477                 talloc_free(r);
3478                 return False;
3479         }
3480         
3481         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3482         status = call->ndr_pull(pull, NDR_IN, r);
3483         if (NT_STATUS_IS_ERR(status)) {
3484                 talloc_free(r);
3485                 return False;
3486         }
3487         
3488         if (DEBUGLEVEL >= 10)
3489                 NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, r);
3490         
3491         ZERO_STRUCT(r->out);
3492         r->out.info = talloc_zero(r, union lsa_PolicyInformation);
3493         if (r->out.info == NULL) {
3494                 talloc_free(r);
3495                 return False;
3496         }
3497         
3498         r->out.result = _lsa_QueryInfoPolicy2(p, r);
3499         
3500         if (p->rng_fault_state) {
3501                 talloc_free(r);
3502                 /* Return True here, srv_pipe_hnd.c will take care */
3503                 return True;
3504         }
3505         
3506         if (DEBUGLEVEL >= 10)
3507                 NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, r);
3508         
3509         push = ndr_push_init_ctx(r);
3510         if (push == NULL) {
3511                 talloc_free(r);
3512                 return False;
3513         }
3514         
3515         status = call->ndr_push(push, NDR_OUT, r);
3516         if (NT_STATUS_IS_ERR(status)) {
3517                 talloc_free(r);
3518                 return False;
3519         }
3520         
3521         blob = ndr_push_blob(push);
3522         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3523                 talloc_free(r);
3524                 return False;
3525         }
3526         
3527         talloc_free(r);
3528         
3529         return True;
3530 }
3531
3532 static bool api_lsa_SetInfoPolicy2(pipes_struct *p)
3533 {
3534         const struct ndr_interface_call *call;
3535         struct ndr_pull *pull;
3536         struct ndr_push *push;
3537         NTSTATUS status;
3538         DATA_BLOB blob;
3539         struct lsa_SetInfoPolicy2 *r;
3540         
3541         call = &ndr_table_lsarpc.calls[NDR_LSA_SETINFOPOLICY2];
3542         
3543         r = talloc(NULL, struct lsa_SetInfoPolicy2);
3544         if (r == NULL) {
3545                 return False;
3546         }
3547         
3548         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3549                 talloc_free(r);
3550                 return False;
3551         }
3552         
3553         pull = ndr_pull_init_blob(&blob, r);
3554         if (pull == NULL) {
3555                 talloc_free(r);
3556                 return False;
3557         }
3558         
3559         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3560         status = call->ndr_pull(pull, NDR_IN, r);
3561         if (NT_STATUS_IS_ERR(status)) {
3562                 talloc_free(r);
3563                 return False;
3564         }
3565         
3566         if (DEBUGLEVEL >= 10)
3567                 NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, r);
3568         
3569         r->out.result = _lsa_SetInfoPolicy2(p, r);
3570         
3571         if (p->rng_fault_state) {
3572                 talloc_free(r);
3573                 /* Return True here, srv_pipe_hnd.c will take care */
3574                 return True;
3575         }
3576         
3577         if (DEBUGLEVEL >= 10)
3578                 NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, r);
3579         
3580         push = ndr_push_init_ctx(r);
3581         if (push == NULL) {
3582                 talloc_free(r);
3583                 return False;
3584         }
3585         
3586         status = call->ndr_push(push, NDR_OUT, r);
3587         if (NT_STATUS_IS_ERR(status)) {
3588                 talloc_free(r);
3589                 return False;
3590         }
3591         
3592         blob = ndr_push_blob(push);
3593         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3594                 talloc_free(r);
3595                 return False;
3596         }
3597         
3598         talloc_free(r);
3599         
3600         return True;
3601 }
3602
3603 static bool api_lsa_QueryTrustedDomainInfoByName(pipes_struct *p)
3604 {
3605         const struct ndr_interface_call *call;
3606         struct ndr_pull *pull;
3607         struct ndr_push *push;
3608         NTSTATUS status;
3609         DATA_BLOB blob;
3610         struct lsa_QueryTrustedDomainInfoByName *r;
3611         
3612         call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME];
3613         
3614         r = talloc(NULL, struct lsa_QueryTrustedDomainInfoByName);
3615         if (r == NULL) {
3616                 return False;
3617         }
3618         
3619         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3620                 talloc_free(r);
3621                 return False;
3622         }
3623         
3624         pull = ndr_pull_init_blob(&blob, r);
3625         if (pull == NULL) {
3626                 talloc_free(r);
3627                 return False;
3628         }
3629         
3630         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3631         status = call->ndr_pull(pull, NDR_IN, r);
3632         if (NT_STATUS_IS_ERR(status)) {
3633                 talloc_free(r);
3634                 return False;
3635         }
3636         
3637         if (DEBUGLEVEL >= 10)
3638                 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, r);
3639         
3640         ZERO_STRUCT(r->out);
3641         r->out.info = talloc_zero(r, union lsa_TrustedDomainInfo);
3642         if (r->out.info == NULL) {
3643                 talloc_free(r);
3644                 return False;
3645         }
3646         
3647         r->out.result = _lsa_QueryTrustedDomainInfoByName(p, r);
3648         
3649         if (p->rng_fault_state) {
3650                 talloc_free(r);
3651                 /* Return True here, srv_pipe_hnd.c will take care */
3652                 return True;
3653         }
3654         
3655         if (DEBUGLEVEL >= 10)
3656                 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, r);
3657         
3658         push = ndr_push_init_ctx(r);
3659         if (push == NULL) {
3660                 talloc_free(r);
3661                 return False;
3662         }
3663         
3664         status = call->ndr_push(push, NDR_OUT, r);
3665         if (NT_STATUS_IS_ERR(status)) {
3666                 talloc_free(r);
3667                 return False;
3668         }
3669         
3670         blob = ndr_push_blob(push);
3671         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3672                 talloc_free(r);
3673                 return False;
3674         }
3675         
3676         talloc_free(r);
3677         
3678         return True;
3679 }
3680
3681 static bool api_lsa_SetTrustedDomainInfoByName(pipes_struct *p)
3682 {
3683         const struct ndr_interface_call *call;
3684         struct ndr_pull *pull;
3685         struct ndr_push *push;
3686         NTSTATUS status;
3687         DATA_BLOB blob;
3688         struct lsa_SetTrustedDomainInfoByName *r;
3689         
3690         call = &ndr_table_lsarpc.calls[NDR_LSA_SETTRUSTEDDOMAININFOBYNAME];
3691         
3692         r = talloc(NULL, struct lsa_SetTrustedDomainInfoByName);
3693         if (r == NULL) {
3694                 return False;
3695         }
3696         
3697         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3698                 talloc_free(r);
3699                 return False;
3700         }
3701         
3702         pull = ndr_pull_init_blob(&blob, r);
3703         if (pull == NULL) {
3704                 talloc_free(r);
3705                 return False;
3706         }
3707         
3708         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3709         status = call->ndr_pull(pull, NDR_IN, r);
3710         if (NT_STATUS_IS_ERR(status)) {
3711                 talloc_free(r);
3712                 return False;
3713         }
3714         
3715         if (DEBUGLEVEL >= 10)
3716                 NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, r);
3717         
3718         r->out.result = _lsa_SetTrustedDomainInfoByName(p, r);
3719         
3720         if (p->rng_fault_state) {
3721                 talloc_free(r);
3722                 /* Return True here, srv_pipe_hnd.c will take care */
3723                 return True;
3724         }
3725         
3726         if (DEBUGLEVEL >= 10)
3727                 NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, r);
3728         
3729         push = ndr_push_init_ctx(r);
3730         if (push == NULL) {
3731                 talloc_free(r);
3732                 return False;
3733         }
3734         
3735         status = call->ndr_push(push, NDR_OUT, r);
3736         if (NT_STATUS_IS_ERR(status)) {
3737                 talloc_free(r);
3738                 return False;
3739         }
3740         
3741         blob = ndr_push_blob(push);
3742         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3743                 talloc_free(r);
3744                 return False;
3745         }
3746         
3747         talloc_free(r);
3748         
3749         return True;
3750 }
3751
3752 static bool api_lsa_EnumTrustedDomainsEx(pipes_struct *p)
3753 {
3754         const struct ndr_interface_call *call;
3755         struct ndr_pull *pull;
3756         struct ndr_push *push;
3757         NTSTATUS status;
3758         DATA_BLOB blob;
3759         struct lsa_EnumTrustedDomainsEx *r;
3760         
3761         call = &ndr_table_lsarpc.calls[NDR_LSA_ENUMTRUSTEDDOMAINSEX];
3762         
3763         r = talloc(NULL, struct lsa_EnumTrustedDomainsEx);
3764         if (r == NULL) {
3765                 return False;
3766         }
3767         
3768         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3769                 talloc_free(r);
3770                 return False;
3771         }
3772         
3773         pull = ndr_pull_init_blob(&blob, r);
3774         if (pull == NULL) {
3775                 talloc_free(r);
3776                 return False;
3777         }
3778         
3779         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3780         status = call->ndr_pull(pull, NDR_IN, r);
3781         if (NT_STATUS_IS_ERR(status)) {
3782                 talloc_free(r);
3783                 return False;
3784         }
3785         
3786         if (DEBUGLEVEL >= 10)
3787                 NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, r);
3788         
3789         ZERO_STRUCT(r->out);
3790         r->out.resume_handle = r->in.resume_handle;
3791         r->out.domains = talloc_zero(r, struct lsa_DomainListEx);
3792         if (r->out.domains == NULL) {
3793                 talloc_free(r);
3794                 return False;
3795         }
3796         
3797         r->out.result = _lsa_EnumTrustedDomainsEx(p, r);
3798         
3799         if (p->rng_fault_state) {
3800                 talloc_free(r);
3801                 /* Return True here, srv_pipe_hnd.c will take care */
3802                 return True;
3803         }
3804         
3805         if (DEBUGLEVEL >= 10)
3806                 NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, r);
3807         
3808         push = ndr_push_init_ctx(r);
3809         if (push == NULL) {
3810                 talloc_free(r);
3811                 return False;
3812         }
3813         
3814         status = call->ndr_push(push, NDR_OUT, r);
3815         if (NT_STATUS_IS_ERR(status)) {
3816                 talloc_free(r);
3817                 return False;
3818         }
3819         
3820         blob = ndr_push_blob(push);
3821         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3822                 talloc_free(r);
3823                 return False;
3824         }
3825         
3826         talloc_free(r);
3827         
3828         return True;
3829 }
3830
3831 static bool api_lsa_CreateTrustedDomainEx(pipes_struct *p)
3832 {
3833         const struct ndr_interface_call *call;
3834         struct ndr_pull *pull;
3835         struct ndr_push *push;
3836         NTSTATUS status;
3837         DATA_BLOB blob;
3838         struct lsa_CreateTrustedDomainEx *r;
3839         
3840         call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX];
3841         
3842         r = talloc(NULL, struct lsa_CreateTrustedDomainEx);
3843         if (r == NULL) {
3844                 return False;
3845         }
3846         
3847         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3848                 talloc_free(r);
3849                 return False;
3850         }
3851         
3852         pull = ndr_pull_init_blob(&blob, r);
3853         if (pull == NULL) {
3854                 talloc_free(r);
3855                 return False;
3856         }
3857         
3858         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3859         status = call->ndr_pull(pull, NDR_IN, r);
3860         if (NT_STATUS_IS_ERR(status)) {
3861                 talloc_free(r);
3862                 return False;
3863         }
3864         
3865         if (DEBUGLEVEL >= 10)
3866                 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, r);
3867         
3868         r->out.result = _lsa_CreateTrustedDomainEx(p, r);
3869         
3870         if (p->rng_fault_state) {
3871                 talloc_free(r);
3872                 /* Return True here, srv_pipe_hnd.c will take care */
3873                 return True;
3874         }
3875         
3876         if (DEBUGLEVEL >= 10)
3877                 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, r);
3878         
3879         push = ndr_push_init_ctx(r);
3880         if (push == NULL) {
3881                 talloc_free(r);
3882                 return False;
3883         }
3884         
3885         status = call->ndr_push(push, NDR_OUT, r);
3886         if (NT_STATUS_IS_ERR(status)) {
3887                 talloc_free(r);
3888                 return False;
3889         }
3890         
3891         blob = ndr_push_blob(push);
3892         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3893                 talloc_free(r);
3894                 return False;
3895         }
3896         
3897         talloc_free(r);
3898         
3899         return True;
3900 }
3901
3902 static bool api_lsa_CloseTrustedDomainEx(pipes_struct *p)
3903 {
3904         const struct ndr_interface_call *call;
3905         struct ndr_pull *pull;
3906         struct ndr_push *push;
3907         NTSTATUS status;
3908         DATA_BLOB blob;
3909         struct lsa_CloseTrustedDomainEx *r;
3910         
3911         call = &ndr_table_lsarpc.calls[NDR_LSA_CLOSETRUSTEDDOMAINEX];
3912         
3913         r = talloc(NULL, struct lsa_CloseTrustedDomainEx);
3914         if (r == NULL) {
3915                 return False;
3916         }
3917         
3918         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3919                 talloc_free(r);
3920                 return False;
3921         }
3922         
3923         pull = ndr_pull_init_blob(&blob, r);
3924         if (pull == NULL) {
3925                 talloc_free(r);
3926                 return False;
3927         }
3928         
3929         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
3930         status = call->ndr_pull(pull, NDR_IN, r);
3931         if (NT_STATUS_IS_ERR(status)) {
3932                 talloc_free(r);
3933                 return False;
3934         }
3935         
3936         if (DEBUGLEVEL >= 10)
3937                 NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, r);
3938         
3939         ZERO_STRUCT(r->out);
3940         r->out.handle = r->in.handle;
3941         r->out.result = _lsa_CloseTrustedDomainEx(p, r);
3942         
3943         if (p->rng_fault_state) {
3944                 talloc_free(r);
3945                 /* Return True here, srv_pipe_hnd.c will take care */
3946                 return True;
3947         }
3948         
3949         if (DEBUGLEVEL >= 10)
3950                 NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, r);
3951         
3952         push = ndr_push_init_ctx(r);
3953         if (push == NULL) {
3954                 talloc_free(r);
3955                 return False;
3956         }
3957         
3958         status = call->ndr_push(push, NDR_OUT, r);
3959         if (NT_STATUS_IS_ERR(status)) {
3960                 talloc_free(r);
3961                 return False;
3962         }
3963         
3964         blob = ndr_push_blob(push);
3965         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
3966                 talloc_free(r);
3967                 return False;
3968         }
3969         
3970         talloc_free(r);
3971         
3972         return True;
3973 }
3974
3975 static bool api_lsa_QueryDomainInformationPolicy(pipes_struct *p)
3976 {
3977         const struct ndr_interface_call *call;
3978         struct ndr_pull *pull;
3979         struct ndr_push *push;
3980         NTSTATUS status;
3981         DATA_BLOB blob;
3982         struct lsa_QueryDomainInformationPolicy *r;
3983         
3984         call = &ndr_table_lsarpc.calls[NDR_LSA_QUERYDOMAININFORMATIONPOLICY];
3985         
3986         r = talloc(NULL, struct lsa_QueryDomainInformationPolicy);
3987         if (r == NULL) {
3988                 return False;
3989         }
3990         
3991         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
3992                 talloc_free(r);
3993                 return False;
3994         }
3995         
3996         pull = ndr_pull_init_blob(&blob, r);
3997         if (pull == NULL) {
3998                 talloc_free(r);
3999                 return False;
4000         }
4001         
4002         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4003         status = call->ndr_pull(pull, NDR_IN, r);
4004         if (NT_STATUS_IS_ERR(status)) {
4005                 talloc_free(r);
4006                 return False;
4007         }
4008         
4009         if (DEBUGLEVEL >= 10)
4010                 NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, r);
4011         
4012         ZERO_STRUCT(r->out);
4013         r->out.info = talloc_zero(r, union lsa_DomainInformationPolicy);
4014         if (r->out.info == NULL) {
4015                 talloc_free(r);
4016                 return False;
4017         }
4018         
4019         r->out.result = _lsa_QueryDomainInformationPolicy(p, r);
4020         
4021         if (p->rng_fault_state) {
4022                 talloc_free(r);
4023                 /* Return True here, srv_pipe_hnd.c will take care */
4024                 return True;
4025         }
4026         
4027         if (DEBUGLEVEL >= 10)
4028                 NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, r);
4029         
4030         push = ndr_push_init_ctx(r);
4031         if (push == NULL) {
4032                 talloc_free(r);
4033                 return False;
4034         }
4035         
4036         status = call->ndr_push(push, NDR_OUT, r);
4037         if (NT_STATUS_IS_ERR(status)) {
4038                 talloc_free(r);
4039                 return False;
4040         }
4041         
4042         blob = ndr_push_blob(push);
4043         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4044                 talloc_free(r);
4045                 return False;
4046         }
4047         
4048         talloc_free(r);
4049         
4050         return True;
4051 }
4052
4053 static bool api_lsa_SetDomainInformationPolicy(pipes_struct *p)
4054 {
4055         const struct ndr_interface_call *call;
4056         struct ndr_pull *pull;
4057         struct ndr_push *push;
4058         NTSTATUS status;
4059         DATA_BLOB blob;
4060         struct lsa_SetDomainInformationPolicy *r;
4061         
4062         call = &ndr_table_lsarpc.calls[NDR_LSA_SETDOMAININFORMATIONPOLICY];
4063         
4064         r = talloc(NULL, struct lsa_SetDomainInformationPolicy);
4065         if (r == NULL) {
4066                 return False;
4067         }
4068         
4069         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4070                 talloc_free(r);
4071                 return False;
4072         }
4073         
4074         pull = ndr_pull_init_blob(&blob, r);
4075         if (pull == NULL) {
4076                 talloc_free(r);
4077                 return False;
4078         }
4079         
4080         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4081         status = call->ndr_pull(pull, NDR_IN, r);
4082         if (NT_STATUS_IS_ERR(status)) {
4083                 talloc_free(r);
4084                 return False;
4085         }
4086         
4087         if (DEBUGLEVEL >= 10)
4088                 NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, r);
4089         
4090         r->out.result = _lsa_SetDomainInformationPolicy(p, r);
4091         
4092         if (p->rng_fault_state) {
4093                 talloc_free(r);
4094                 /* Return True here, srv_pipe_hnd.c will take care */
4095                 return True;
4096         }
4097         
4098         if (DEBUGLEVEL >= 10)
4099                 NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, r);
4100         
4101         push = ndr_push_init_ctx(r);
4102         if (push == NULL) {
4103                 talloc_free(r);
4104                 return False;
4105         }
4106         
4107         status = call->ndr_push(push, NDR_OUT, r);
4108         if (NT_STATUS_IS_ERR(status)) {
4109                 talloc_free(r);
4110                 return False;
4111         }
4112         
4113         blob = ndr_push_blob(push);
4114         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4115                 talloc_free(r);
4116                 return False;
4117         }
4118         
4119         talloc_free(r);
4120         
4121         return True;
4122 }
4123
4124 static bool api_lsa_OpenTrustedDomainByName(pipes_struct *p)
4125 {
4126         const struct ndr_interface_call *call;
4127         struct ndr_pull *pull;
4128         struct ndr_push *push;
4129         NTSTATUS status;
4130         DATA_BLOB blob;
4131         struct lsa_OpenTrustedDomainByName *r;
4132         
4133         call = &ndr_table_lsarpc.calls[NDR_LSA_OPENTRUSTEDDOMAINBYNAME];
4134         
4135         r = talloc(NULL, struct lsa_OpenTrustedDomainByName);
4136         if (r == NULL) {
4137                 return False;
4138         }
4139         
4140         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4141                 talloc_free(r);
4142                 return False;
4143         }
4144         
4145         pull = ndr_pull_init_blob(&blob, r);
4146         if (pull == NULL) {
4147                 talloc_free(r);
4148                 return False;
4149         }
4150         
4151         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4152         status = call->ndr_pull(pull, NDR_IN, r);
4153         if (NT_STATUS_IS_ERR(status)) {
4154                 talloc_free(r);
4155                 return False;
4156         }
4157         
4158         if (DEBUGLEVEL >= 10)
4159                 NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, r);
4160         
4161         ZERO_STRUCT(r->out);
4162         r->out.trustdom_handle = talloc_zero(r, struct policy_handle);
4163         if (r->out.trustdom_handle == NULL) {
4164                 talloc_free(r);
4165                 return False;
4166         }
4167         
4168         r->out.result = _lsa_OpenTrustedDomainByName(p, r);
4169         
4170         if (p->rng_fault_state) {
4171                 talloc_free(r);
4172                 /* Return True here, srv_pipe_hnd.c will take care */
4173                 return True;
4174         }
4175         
4176         if (DEBUGLEVEL >= 10)
4177                 NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, r);
4178         
4179         push = ndr_push_init_ctx(r);
4180         if (push == NULL) {
4181                 talloc_free(r);
4182                 return False;
4183         }
4184         
4185         status = call->ndr_push(push, NDR_OUT, r);
4186         if (NT_STATUS_IS_ERR(status)) {
4187                 talloc_free(r);
4188                 return False;
4189         }
4190         
4191         blob = ndr_push_blob(push);
4192         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4193                 talloc_free(r);
4194                 return False;
4195         }
4196         
4197         talloc_free(r);
4198         
4199         return True;
4200 }
4201
4202 static bool api_lsa_TestCall(pipes_struct *p)
4203 {
4204         const struct ndr_interface_call *call;
4205         struct ndr_pull *pull;
4206         struct ndr_push *push;
4207         NTSTATUS status;
4208         DATA_BLOB blob;
4209         struct lsa_TestCall *r;
4210         
4211         call = &ndr_table_lsarpc.calls[NDR_LSA_TESTCALL];
4212         
4213         r = talloc(NULL, struct lsa_TestCall);
4214         if (r == NULL) {
4215                 return False;
4216         }
4217         
4218         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4219                 talloc_free(r);
4220                 return False;
4221         }
4222         
4223         pull = ndr_pull_init_blob(&blob, r);
4224         if (pull == NULL) {
4225                 talloc_free(r);
4226                 return False;
4227         }
4228         
4229         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4230         status = call->ndr_pull(pull, NDR_IN, r);
4231         if (NT_STATUS_IS_ERR(status)) {
4232                 talloc_free(r);
4233                 return False;
4234         }
4235         
4236         if (DEBUGLEVEL >= 10)
4237                 NDR_PRINT_IN_DEBUG(lsa_TestCall, r);
4238         
4239         r->out.result = _lsa_TestCall(p, r);
4240         
4241         if (p->rng_fault_state) {
4242                 talloc_free(r);
4243                 /* Return True here, srv_pipe_hnd.c will take care */
4244                 return True;
4245         }
4246         
4247         if (DEBUGLEVEL >= 10)
4248                 NDR_PRINT_OUT_DEBUG(lsa_TestCall, r);
4249         
4250         push = ndr_push_init_ctx(r);
4251         if (push == NULL) {
4252                 talloc_free(r);
4253                 return False;
4254         }
4255         
4256         status = call->ndr_push(push, NDR_OUT, r);
4257         if (NT_STATUS_IS_ERR(status)) {
4258                 talloc_free(r);
4259                 return False;
4260         }
4261         
4262         blob = ndr_push_blob(push);
4263         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4264                 talloc_free(r);
4265                 return False;
4266         }
4267         
4268         talloc_free(r);
4269         
4270         return True;
4271 }
4272
4273 static bool api_lsa_LookupSids2(pipes_struct *p)
4274 {
4275         const struct ndr_interface_call *call;
4276         struct ndr_pull *pull;
4277         struct ndr_push *push;
4278         NTSTATUS status;
4279         DATA_BLOB blob;
4280         struct lsa_LookupSids2 *r;
4281         
4282         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS2];
4283         
4284         r = talloc(NULL, struct lsa_LookupSids2);
4285         if (r == NULL) {
4286                 return False;
4287         }
4288         
4289         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4290                 talloc_free(r);
4291                 return False;
4292         }
4293         
4294         pull = ndr_pull_init_blob(&blob, r);
4295         if (pull == NULL) {
4296                 talloc_free(r);
4297                 return False;
4298         }
4299         
4300         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4301         status = call->ndr_pull(pull, NDR_IN, r);
4302         if (NT_STATUS_IS_ERR(status)) {
4303                 talloc_free(r);
4304                 return False;
4305         }
4306         
4307         if (DEBUGLEVEL >= 10)
4308                 NDR_PRINT_IN_DEBUG(lsa_LookupSids2, r);
4309         
4310         ZERO_STRUCT(r->out);
4311         r->out.domains = talloc_zero(r, struct lsa_RefDomainList);
4312         if (r->out.domains == NULL) {
4313                 talloc_free(r);
4314                 return False;
4315         }
4316         
4317         r->out.names = r->in.names;
4318         r->out.count = r->in.count;
4319         r->out.result = _lsa_LookupSids2(p, r);
4320         
4321         if (p->rng_fault_state) {
4322                 talloc_free(r);
4323                 /* Return True here, srv_pipe_hnd.c will take care */
4324                 return True;
4325         }
4326         
4327         if (DEBUGLEVEL >= 10)
4328                 NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, r);
4329         
4330         push = ndr_push_init_ctx(r);
4331         if (push == NULL) {
4332                 talloc_free(r);
4333                 return False;
4334         }
4335         
4336         status = call->ndr_push(push, NDR_OUT, r);
4337         if (NT_STATUS_IS_ERR(status)) {
4338                 talloc_free(r);
4339                 return False;
4340         }
4341         
4342         blob = ndr_push_blob(push);
4343         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4344                 talloc_free(r);
4345                 return False;
4346         }
4347         
4348         talloc_free(r);
4349         
4350         return True;
4351 }
4352
4353 static bool api_lsa_LookupNames2(pipes_struct *p)
4354 {
4355         const struct ndr_interface_call *call;
4356         struct ndr_pull *pull;
4357         struct ndr_push *push;
4358         NTSTATUS status;
4359         DATA_BLOB blob;
4360         struct lsa_LookupNames2 *r;
4361         
4362         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES2];
4363         
4364         r = talloc(NULL, struct lsa_LookupNames2);
4365         if (r == NULL) {
4366                 return False;
4367         }
4368         
4369         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4370                 talloc_free(r);
4371                 return False;
4372         }
4373         
4374         pull = ndr_pull_init_blob(&blob, r);
4375         if (pull == NULL) {
4376                 talloc_free(r);
4377                 return False;
4378         }
4379         
4380         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4381         status = call->ndr_pull(pull, NDR_IN, r);
4382         if (NT_STATUS_IS_ERR(status)) {
4383                 talloc_free(r);
4384                 return False;
4385         }
4386         
4387         if (DEBUGLEVEL >= 10)
4388                 NDR_PRINT_IN_DEBUG(lsa_LookupNames2, r);
4389         
4390         ZERO_STRUCT(r->out);
4391         r->out.domains = talloc_zero(r, struct lsa_RefDomainList);
4392         if (r->out.domains == NULL) {
4393                 talloc_free(r);
4394                 return False;
4395         }
4396         
4397         r->out.sids = r->in.sids;
4398         r->out.count = r->in.count;
4399         r->out.result = _lsa_LookupNames2(p, r);
4400         
4401         if (p->rng_fault_state) {
4402                 talloc_free(r);
4403                 /* Return True here, srv_pipe_hnd.c will take care */
4404                 return True;
4405         }
4406         
4407         if (DEBUGLEVEL >= 10)
4408                 NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, r);
4409         
4410         push = ndr_push_init_ctx(r);
4411         if (push == NULL) {
4412                 talloc_free(r);
4413                 return False;
4414         }
4415         
4416         status = call->ndr_push(push, NDR_OUT, r);
4417         if (NT_STATUS_IS_ERR(status)) {
4418                 talloc_free(r);
4419                 return False;
4420         }
4421         
4422         blob = ndr_push_blob(push);
4423         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4424                 talloc_free(r);
4425                 return False;
4426         }
4427         
4428         talloc_free(r);
4429         
4430         return True;
4431 }
4432
4433 static bool api_lsa_CreateTrustedDomainEx2(pipes_struct *p)
4434 {
4435         const struct ndr_interface_call *call;
4436         struct ndr_pull *pull;
4437         struct ndr_push *push;
4438         NTSTATUS status;
4439         DATA_BLOB blob;
4440         struct lsa_CreateTrustedDomainEx2 *r;
4441         
4442         call = &ndr_table_lsarpc.calls[NDR_LSA_CREATETRUSTEDDOMAINEX2];
4443         
4444         r = talloc(NULL, struct lsa_CreateTrustedDomainEx2);
4445         if (r == NULL) {
4446                 return False;
4447         }
4448         
4449         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4450                 talloc_free(r);
4451                 return False;
4452         }
4453         
4454         pull = ndr_pull_init_blob(&blob, r);
4455         if (pull == NULL) {
4456                 talloc_free(r);
4457                 return False;
4458         }
4459         
4460         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4461         status = call->ndr_pull(pull, NDR_IN, r);
4462         if (NT_STATUS_IS_ERR(status)) {
4463                 talloc_free(r);
4464                 return False;
4465         }
4466         
4467         if (DEBUGLEVEL >= 10)
4468                 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, r);
4469         
4470         r->out.result = _lsa_CreateTrustedDomainEx2(p, r);
4471         
4472         if (p->rng_fault_state) {
4473                 talloc_free(r);
4474                 /* Return True here, srv_pipe_hnd.c will take care */
4475                 return True;
4476         }
4477         
4478         if (DEBUGLEVEL >= 10)
4479                 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, r);
4480         
4481         push = ndr_push_init_ctx(r);
4482         if (push == NULL) {
4483                 talloc_free(r);
4484                 return False;
4485         }
4486         
4487         status = call->ndr_push(push, NDR_OUT, r);
4488         if (NT_STATUS_IS_ERR(status)) {
4489                 talloc_free(r);
4490                 return False;
4491         }
4492         
4493         blob = ndr_push_blob(push);
4494         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4495                 talloc_free(r);
4496                 return False;
4497         }
4498         
4499         talloc_free(r);
4500         
4501         return True;
4502 }
4503
4504 static bool api_lsa_CREDRWRITE(pipes_struct *p)
4505 {
4506         const struct ndr_interface_call *call;
4507         struct ndr_pull *pull;
4508         struct ndr_push *push;
4509         NTSTATUS status;
4510         DATA_BLOB blob;
4511         struct lsa_CREDRWRITE *r;
4512         
4513         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITE];
4514         
4515         r = talloc(NULL, struct lsa_CREDRWRITE);
4516         if (r == NULL) {
4517                 return False;
4518         }
4519         
4520         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4521                 talloc_free(r);
4522                 return False;
4523         }
4524         
4525         pull = ndr_pull_init_blob(&blob, r);
4526         if (pull == NULL) {
4527                 talloc_free(r);
4528                 return False;
4529         }
4530         
4531         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4532         status = call->ndr_pull(pull, NDR_IN, r);
4533         if (NT_STATUS_IS_ERR(status)) {
4534                 talloc_free(r);
4535                 return False;
4536         }
4537         
4538         if (DEBUGLEVEL >= 10)
4539                 NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, r);
4540         
4541         r->out.result = _lsa_CREDRWRITE(p, r);
4542         
4543         if (p->rng_fault_state) {
4544                 talloc_free(r);
4545                 /* Return True here, srv_pipe_hnd.c will take care */
4546                 return True;
4547         }
4548         
4549         if (DEBUGLEVEL >= 10)
4550                 NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, r);
4551         
4552         push = ndr_push_init_ctx(r);
4553         if (push == NULL) {
4554                 talloc_free(r);
4555                 return False;
4556         }
4557         
4558         status = call->ndr_push(push, NDR_OUT, r);
4559         if (NT_STATUS_IS_ERR(status)) {
4560                 talloc_free(r);
4561                 return False;
4562         }
4563         
4564         blob = ndr_push_blob(push);
4565         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4566                 talloc_free(r);
4567                 return False;
4568         }
4569         
4570         talloc_free(r);
4571         
4572         return True;
4573 }
4574
4575 static bool api_lsa_CREDRREAD(pipes_struct *p)
4576 {
4577         const struct ndr_interface_call *call;
4578         struct ndr_pull *pull;
4579         struct ndr_push *push;
4580         NTSTATUS status;
4581         DATA_BLOB blob;
4582         struct lsa_CREDRREAD *r;
4583         
4584         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREAD];
4585         
4586         r = talloc(NULL, struct lsa_CREDRREAD);
4587         if (r == NULL) {
4588                 return False;
4589         }
4590         
4591         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4592                 talloc_free(r);
4593                 return False;
4594         }
4595         
4596         pull = ndr_pull_init_blob(&blob, r);
4597         if (pull == NULL) {
4598                 talloc_free(r);
4599                 return False;
4600         }
4601         
4602         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4603         status = call->ndr_pull(pull, NDR_IN, r);
4604         if (NT_STATUS_IS_ERR(status)) {
4605                 talloc_free(r);
4606                 return False;
4607         }
4608         
4609         if (DEBUGLEVEL >= 10)
4610                 NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, r);
4611         
4612         r->out.result = _lsa_CREDRREAD(p, r);
4613         
4614         if (p->rng_fault_state) {
4615                 talloc_free(r);
4616                 /* Return True here, srv_pipe_hnd.c will take care */
4617                 return True;
4618         }
4619         
4620         if (DEBUGLEVEL >= 10)
4621                 NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, r);
4622         
4623         push = ndr_push_init_ctx(r);
4624         if (push == NULL) {
4625                 talloc_free(r);
4626                 return False;
4627         }
4628         
4629         status = call->ndr_push(push, NDR_OUT, r);
4630         if (NT_STATUS_IS_ERR(status)) {
4631                 talloc_free(r);
4632                 return False;
4633         }
4634         
4635         blob = ndr_push_blob(push);
4636         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4637                 talloc_free(r);
4638                 return False;
4639         }
4640         
4641         talloc_free(r);
4642         
4643         return True;
4644 }
4645
4646 static bool api_lsa_CREDRENUMERATE(pipes_struct *p)
4647 {
4648         const struct ndr_interface_call *call;
4649         struct ndr_pull *pull;
4650         struct ndr_push *push;
4651         NTSTATUS status;
4652         DATA_BLOB blob;
4653         struct lsa_CREDRENUMERATE *r;
4654         
4655         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRENUMERATE];
4656         
4657         r = talloc(NULL, struct lsa_CREDRENUMERATE);
4658         if (r == NULL) {
4659                 return False;
4660         }
4661         
4662         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4663                 talloc_free(r);
4664                 return False;
4665         }
4666         
4667         pull = ndr_pull_init_blob(&blob, r);
4668         if (pull == NULL) {
4669                 talloc_free(r);
4670                 return False;
4671         }
4672         
4673         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4674         status = call->ndr_pull(pull, NDR_IN, r);
4675         if (NT_STATUS_IS_ERR(status)) {
4676                 talloc_free(r);
4677                 return False;
4678         }
4679         
4680         if (DEBUGLEVEL >= 10)
4681                 NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, r);
4682         
4683         r->out.result = _lsa_CREDRENUMERATE(p, r);
4684         
4685         if (p->rng_fault_state) {
4686                 talloc_free(r);
4687                 /* Return True here, srv_pipe_hnd.c will take care */
4688                 return True;
4689         }
4690         
4691         if (DEBUGLEVEL >= 10)
4692                 NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, r);
4693         
4694         push = ndr_push_init_ctx(r);
4695         if (push == NULL) {
4696                 talloc_free(r);
4697                 return False;
4698         }
4699         
4700         status = call->ndr_push(push, NDR_OUT, r);
4701         if (NT_STATUS_IS_ERR(status)) {
4702                 talloc_free(r);
4703                 return False;
4704         }
4705         
4706         blob = ndr_push_blob(push);
4707         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4708                 talloc_free(r);
4709                 return False;
4710         }
4711         
4712         talloc_free(r);
4713         
4714         return True;
4715 }
4716
4717 static bool api_lsa_CREDRWRITEDOMAINCREDENTIALS(pipes_struct *p)
4718 {
4719         const struct ndr_interface_call *call;
4720         struct ndr_pull *pull;
4721         struct ndr_push *push;
4722         NTSTATUS status;
4723         DATA_BLOB blob;
4724         struct lsa_CREDRWRITEDOMAINCREDENTIALS *r;
4725         
4726         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRWRITEDOMAINCREDENTIALS];
4727         
4728         r = talloc(NULL, struct lsa_CREDRWRITEDOMAINCREDENTIALS);
4729         if (r == NULL) {
4730                 return False;
4731         }
4732         
4733         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4734                 talloc_free(r);
4735                 return False;
4736         }
4737         
4738         pull = ndr_pull_init_blob(&blob, r);
4739         if (pull == NULL) {
4740                 talloc_free(r);
4741                 return False;
4742         }
4743         
4744         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4745         status = call->ndr_pull(pull, NDR_IN, r);
4746         if (NT_STATUS_IS_ERR(status)) {
4747                 talloc_free(r);
4748                 return False;
4749         }
4750         
4751         if (DEBUGLEVEL >= 10)
4752                 NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, r);
4753         
4754         r->out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(p, r);
4755         
4756         if (p->rng_fault_state) {
4757                 talloc_free(r);
4758                 /* Return True here, srv_pipe_hnd.c will take care */
4759                 return True;
4760         }
4761         
4762         if (DEBUGLEVEL >= 10)
4763                 NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, r);
4764         
4765         push = ndr_push_init_ctx(r);
4766         if (push == NULL) {
4767                 talloc_free(r);
4768                 return False;
4769         }
4770         
4771         status = call->ndr_push(push, NDR_OUT, r);
4772         if (NT_STATUS_IS_ERR(status)) {
4773                 talloc_free(r);
4774                 return False;
4775         }
4776         
4777         blob = ndr_push_blob(push);
4778         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4779                 talloc_free(r);
4780                 return False;
4781         }
4782         
4783         talloc_free(r);
4784         
4785         return True;
4786 }
4787
4788 static bool api_lsa_CREDRREADDOMAINCREDENTIALS(pipes_struct *p)
4789 {
4790         const struct ndr_interface_call *call;
4791         struct ndr_pull *pull;
4792         struct ndr_push *push;
4793         NTSTATUS status;
4794         DATA_BLOB blob;
4795         struct lsa_CREDRREADDOMAINCREDENTIALS *r;
4796         
4797         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRREADDOMAINCREDENTIALS];
4798         
4799         r = talloc(NULL, struct lsa_CREDRREADDOMAINCREDENTIALS);
4800         if (r == NULL) {
4801                 return False;
4802         }
4803         
4804         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4805                 talloc_free(r);
4806                 return False;
4807         }
4808         
4809         pull = ndr_pull_init_blob(&blob, r);
4810         if (pull == NULL) {
4811                 talloc_free(r);
4812                 return False;
4813         }
4814         
4815         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4816         status = call->ndr_pull(pull, NDR_IN, r);
4817         if (NT_STATUS_IS_ERR(status)) {
4818                 talloc_free(r);
4819                 return False;
4820         }
4821         
4822         if (DEBUGLEVEL >= 10)
4823                 NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, r);
4824         
4825         r->out.result = _lsa_CREDRREADDOMAINCREDENTIALS(p, r);
4826         
4827         if (p->rng_fault_state) {
4828                 talloc_free(r);
4829                 /* Return True here, srv_pipe_hnd.c will take care */
4830                 return True;
4831         }
4832         
4833         if (DEBUGLEVEL >= 10)
4834                 NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, r);
4835         
4836         push = ndr_push_init_ctx(r);
4837         if (push == NULL) {
4838                 talloc_free(r);
4839                 return False;
4840         }
4841         
4842         status = call->ndr_push(push, NDR_OUT, r);
4843         if (NT_STATUS_IS_ERR(status)) {
4844                 talloc_free(r);
4845                 return False;
4846         }
4847         
4848         blob = ndr_push_blob(push);
4849         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4850                 talloc_free(r);
4851                 return False;
4852         }
4853         
4854         talloc_free(r);
4855         
4856         return True;
4857 }
4858
4859 static bool api_lsa_CREDRDELETE(pipes_struct *p)
4860 {
4861         const struct ndr_interface_call *call;
4862         struct ndr_pull *pull;
4863         struct ndr_push *push;
4864         NTSTATUS status;
4865         DATA_BLOB blob;
4866         struct lsa_CREDRDELETE *r;
4867         
4868         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRDELETE];
4869         
4870         r = talloc(NULL, struct lsa_CREDRDELETE);
4871         if (r == NULL) {
4872                 return False;
4873         }
4874         
4875         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4876                 talloc_free(r);
4877                 return False;
4878         }
4879         
4880         pull = ndr_pull_init_blob(&blob, r);
4881         if (pull == NULL) {
4882                 talloc_free(r);
4883                 return False;
4884         }
4885         
4886         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4887         status = call->ndr_pull(pull, NDR_IN, r);
4888         if (NT_STATUS_IS_ERR(status)) {
4889                 talloc_free(r);
4890                 return False;
4891         }
4892         
4893         if (DEBUGLEVEL >= 10)
4894                 NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, r);
4895         
4896         r->out.result = _lsa_CREDRDELETE(p, r);
4897         
4898         if (p->rng_fault_state) {
4899                 talloc_free(r);
4900                 /* Return True here, srv_pipe_hnd.c will take care */
4901                 return True;
4902         }
4903         
4904         if (DEBUGLEVEL >= 10)
4905                 NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, r);
4906         
4907         push = ndr_push_init_ctx(r);
4908         if (push == NULL) {
4909                 talloc_free(r);
4910                 return False;
4911         }
4912         
4913         status = call->ndr_push(push, NDR_OUT, r);
4914         if (NT_STATUS_IS_ERR(status)) {
4915                 talloc_free(r);
4916                 return False;
4917         }
4918         
4919         blob = ndr_push_blob(push);
4920         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4921                 talloc_free(r);
4922                 return False;
4923         }
4924         
4925         talloc_free(r);
4926         
4927         return True;
4928 }
4929
4930 static bool api_lsa_CREDRGETTARGETINFO(pipes_struct *p)
4931 {
4932         const struct ndr_interface_call *call;
4933         struct ndr_pull *pull;
4934         struct ndr_push *push;
4935         NTSTATUS status;
4936         DATA_BLOB blob;
4937         struct lsa_CREDRGETTARGETINFO *r;
4938         
4939         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETTARGETINFO];
4940         
4941         r = talloc(NULL, struct lsa_CREDRGETTARGETINFO);
4942         if (r == NULL) {
4943                 return False;
4944         }
4945         
4946         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
4947                 talloc_free(r);
4948                 return False;
4949         }
4950         
4951         pull = ndr_pull_init_blob(&blob, r);
4952         if (pull == NULL) {
4953                 talloc_free(r);
4954                 return False;
4955         }
4956         
4957         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
4958         status = call->ndr_pull(pull, NDR_IN, r);
4959         if (NT_STATUS_IS_ERR(status)) {
4960                 talloc_free(r);
4961                 return False;
4962         }
4963         
4964         if (DEBUGLEVEL >= 10)
4965                 NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, r);
4966         
4967         r->out.result = _lsa_CREDRGETTARGETINFO(p, r);
4968         
4969         if (p->rng_fault_state) {
4970                 talloc_free(r);
4971                 /* Return True here, srv_pipe_hnd.c will take care */
4972                 return True;
4973         }
4974         
4975         if (DEBUGLEVEL >= 10)
4976                 NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, r);
4977         
4978         push = ndr_push_init_ctx(r);
4979         if (push == NULL) {
4980                 talloc_free(r);
4981                 return False;
4982         }
4983         
4984         status = call->ndr_push(push, NDR_OUT, r);
4985         if (NT_STATUS_IS_ERR(status)) {
4986                 talloc_free(r);
4987                 return False;
4988         }
4989         
4990         blob = ndr_push_blob(push);
4991         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
4992                 talloc_free(r);
4993                 return False;
4994         }
4995         
4996         talloc_free(r);
4997         
4998         return True;
4999 }
5000
5001 static bool api_lsa_CREDRPROFILELOADED(pipes_struct *p)
5002 {
5003         const struct ndr_interface_call *call;
5004         struct ndr_pull *pull;
5005         struct ndr_push *push;
5006         NTSTATUS status;
5007         DATA_BLOB blob;
5008         struct lsa_CREDRPROFILELOADED *r;
5009         
5010         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRPROFILELOADED];
5011         
5012         r = talloc(NULL, struct lsa_CREDRPROFILELOADED);
5013         if (r == NULL) {
5014                 return False;
5015         }
5016         
5017         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5018                 talloc_free(r);
5019                 return False;
5020         }
5021         
5022         pull = ndr_pull_init_blob(&blob, r);
5023         if (pull == NULL) {
5024                 talloc_free(r);
5025                 return False;
5026         }
5027         
5028         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5029         status = call->ndr_pull(pull, NDR_IN, r);
5030         if (NT_STATUS_IS_ERR(status)) {
5031                 talloc_free(r);
5032                 return False;
5033         }
5034         
5035         if (DEBUGLEVEL >= 10)
5036                 NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, r);
5037         
5038         r->out.result = _lsa_CREDRPROFILELOADED(p, r);
5039         
5040         if (p->rng_fault_state) {
5041                 talloc_free(r);
5042                 /* Return True here, srv_pipe_hnd.c will take care */
5043                 return True;
5044         }
5045         
5046         if (DEBUGLEVEL >= 10)
5047                 NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, r);
5048         
5049         push = ndr_push_init_ctx(r);
5050         if (push == NULL) {
5051                 talloc_free(r);
5052                 return False;
5053         }
5054         
5055         status = call->ndr_push(push, NDR_OUT, r);
5056         if (NT_STATUS_IS_ERR(status)) {
5057                 talloc_free(r);
5058                 return False;
5059         }
5060         
5061         blob = ndr_push_blob(push);
5062         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5063                 talloc_free(r);
5064                 return False;
5065         }
5066         
5067         talloc_free(r);
5068         
5069         return True;
5070 }
5071
5072 static bool api_lsa_LookupNames3(pipes_struct *p)
5073 {
5074         const struct ndr_interface_call *call;
5075         struct ndr_pull *pull;
5076         struct ndr_push *push;
5077         NTSTATUS status;
5078         DATA_BLOB blob;
5079         struct lsa_LookupNames3 *r;
5080         
5081         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES3];
5082         
5083         r = talloc(NULL, struct lsa_LookupNames3);
5084         if (r == NULL) {
5085                 return False;
5086         }
5087         
5088         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5089                 talloc_free(r);
5090                 return False;
5091         }
5092         
5093         pull = ndr_pull_init_blob(&blob, r);
5094         if (pull == NULL) {
5095                 talloc_free(r);
5096                 return False;
5097         }
5098         
5099         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5100         status = call->ndr_pull(pull, NDR_IN, r);
5101         if (NT_STATUS_IS_ERR(status)) {
5102                 talloc_free(r);
5103                 return False;
5104         }
5105         
5106         if (DEBUGLEVEL >= 10)
5107                 NDR_PRINT_IN_DEBUG(lsa_LookupNames3, r);
5108         
5109         ZERO_STRUCT(r->out);
5110         r->out.domains = talloc_zero(r, struct lsa_RefDomainList);
5111         if (r->out.domains == NULL) {
5112                 talloc_free(r);
5113                 return False;
5114         }
5115         
5116         r->out.sids = r->in.sids;
5117         r->out.count = r->in.count;
5118         r->out.result = _lsa_LookupNames3(p, r);
5119         
5120         if (p->rng_fault_state) {
5121                 talloc_free(r);
5122                 /* Return True here, srv_pipe_hnd.c will take care */
5123                 return True;
5124         }
5125         
5126         if (DEBUGLEVEL >= 10)
5127                 NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, r);
5128         
5129         push = ndr_push_init_ctx(r);
5130         if (push == NULL) {
5131                 talloc_free(r);
5132                 return False;
5133         }
5134         
5135         status = call->ndr_push(push, NDR_OUT, r);
5136         if (NT_STATUS_IS_ERR(status)) {
5137                 talloc_free(r);
5138                 return False;
5139         }
5140         
5141         blob = ndr_push_blob(push);
5142         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5143                 talloc_free(r);
5144                 return False;
5145         }
5146         
5147         talloc_free(r);
5148         
5149         return True;
5150 }
5151
5152 static bool api_lsa_CREDRGETSESSIONTYPES(pipes_struct *p)
5153 {
5154         const struct ndr_interface_call *call;
5155         struct ndr_pull *pull;
5156         struct ndr_push *push;
5157         NTSTATUS status;
5158         DATA_BLOB blob;
5159         struct lsa_CREDRGETSESSIONTYPES *r;
5160         
5161         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRGETSESSIONTYPES];
5162         
5163         r = talloc(NULL, struct lsa_CREDRGETSESSIONTYPES);
5164         if (r == NULL) {
5165                 return False;
5166         }
5167         
5168         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5169                 talloc_free(r);
5170                 return False;
5171         }
5172         
5173         pull = ndr_pull_init_blob(&blob, r);
5174         if (pull == NULL) {
5175                 talloc_free(r);
5176                 return False;
5177         }
5178         
5179         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5180         status = call->ndr_pull(pull, NDR_IN, r);
5181         if (NT_STATUS_IS_ERR(status)) {
5182                 talloc_free(r);
5183                 return False;
5184         }
5185         
5186         if (DEBUGLEVEL >= 10)
5187                 NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, r);
5188         
5189         r->out.result = _lsa_CREDRGETSESSIONTYPES(p, r);
5190         
5191         if (p->rng_fault_state) {
5192                 talloc_free(r);
5193                 /* Return True here, srv_pipe_hnd.c will take care */
5194                 return True;
5195         }
5196         
5197         if (DEBUGLEVEL >= 10)
5198                 NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, r);
5199         
5200         push = ndr_push_init_ctx(r);
5201         if (push == NULL) {
5202                 talloc_free(r);
5203                 return False;
5204         }
5205         
5206         status = call->ndr_push(push, NDR_OUT, r);
5207         if (NT_STATUS_IS_ERR(status)) {
5208                 talloc_free(r);
5209                 return False;
5210         }
5211         
5212         blob = ndr_push_blob(push);
5213         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5214                 talloc_free(r);
5215                 return False;
5216         }
5217         
5218         talloc_free(r);
5219         
5220         return True;
5221 }
5222
5223 static bool api_lsa_LSARREGISTERAUDITEVENT(pipes_struct *p)
5224 {
5225         const struct ndr_interface_call *call;
5226         struct ndr_pull *pull;
5227         struct ndr_push *push;
5228         NTSTATUS status;
5229         DATA_BLOB blob;
5230         struct lsa_LSARREGISTERAUDITEVENT *r;
5231         
5232         call = &ndr_table_lsarpc.calls[NDR_LSA_LSARREGISTERAUDITEVENT];
5233         
5234         r = talloc(NULL, struct lsa_LSARREGISTERAUDITEVENT);
5235         if (r == NULL) {
5236                 return False;
5237         }
5238         
5239         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5240                 talloc_free(r);
5241                 return False;
5242         }
5243         
5244         pull = ndr_pull_init_blob(&blob, r);
5245         if (pull == NULL) {
5246                 talloc_free(r);
5247                 return False;
5248         }
5249         
5250         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5251         status = call->ndr_pull(pull, NDR_IN, r);
5252         if (NT_STATUS_IS_ERR(status)) {
5253                 talloc_free(r);
5254                 return False;
5255         }
5256         
5257         if (DEBUGLEVEL >= 10)
5258                 NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, r);
5259         
5260         r->out.result = _lsa_LSARREGISTERAUDITEVENT(p, r);
5261         
5262         if (p->rng_fault_state) {
5263                 talloc_free(r);
5264                 /* Return True here, srv_pipe_hnd.c will take care */
5265                 return True;
5266         }
5267         
5268         if (DEBUGLEVEL >= 10)
5269                 NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, r);
5270         
5271         push = ndr_push_init_ctx(r);
5272         if (push == NULL) {
5273                 talloc_free(r);
5274                 return False;
5275         }
5276         
5277         status = call->ndr_push(push, NDR_OUT, r);
5278         if (NT_STATUS_IS_ERR(status)) {
5279                 talloc_free(r);
5280                 return False;
5281         }
5282         
5283         blob = ndr_push_blob(push);
5284         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5285                 talloc_free(r);
5286                 return False;
5287         }
5288         
5289         talloc_free(r);
5290         
5291         return True;
5292 }
5293
5294 static bool api_lsa_LSARGENAUDITEVENT(pipes_struct *p)
5295 {
5296         const struct ndr_interface_call *call;
5297         struct ndr_pull *pull;
5298         struct ndr_push *push;
5299         NTSTATUS status;
5300         DATA_BLOB blob;
5301         struct lsa_LSARGENAUDITEVENT *r;
5302         
5303         call = &ndr_table_lsarpc.calls[NDR_LSA_LSARGENAUDITEVENT];
5304         
5305         r = talloc(NULL, struct lsa_LSARGENAUDITEVENT);
5306         if (r == NULL) {
5307                 return False;
5308         }
5309         
5310         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5311                 talloc_free(r);
5312                 return False;
5313         }
5314         
5315         pull = ndr_pull_init_blob(&blob, r);
5316         if (pull == NULL) {
5317                 talloc_free(r);
5318                 return False;
5319         }
5320         
5321         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5322         status = call->ndr_pull(pull, NDR_IN, r);
5323         if (NT_STATUS_IS_ERR(status)) {
5324                 talloc_free(r);
5325                 return False;
5326         }
5327         
5328         if (DEBUGLEVEL >= 10)
5329                 NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, r);
5330         
5331         r->out.result = _lsa_LSARGENAUDITEVENT(p, r);
5332         
5333         if (p->rng_fault_state) {
5334                 talloc_free(r);
5335                 /* Return True here, srv_pipe_hnd.c will take care */
5336                 return True;
5337         }
5338         
5339         if (DEBUGLEVEL >= 10)
5340                 NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, r);
5341         
5342         push = ndr_push_init_ctx(r);
5343         if (push == NULL) {
5344                 talloc_free(r);
5345                 return False;
5346         }
5347         
5348         status = call->ndr_push(push, NDR_OUT, r);
5349         if (NT_STATUS_IS_ERR(status)) {
5350                 talloc_free(r);
5351                 return False;
5352         }
5353         
5354         blob = ndr_push_blob(push);
5355         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5356                 talloc_free(r);
5357                 return False;
5358         }
5359         
5360         talloc_free(r);
5361         
5362         return True;
5363 }
5364
5365 static bool api_lsa_LSARUNREGISTERAUDITEVENT(pipes_struct *p)
5366 {
5367         const struct ndr_interface_call *call;
5368         struct ndr_pull *pull;
5369         struct ndr_push *push;
5370         NTSTATUS status;
5371         DATA_BLOB blob;
5372         struct lsa_LSARUNREGISTERAUDITEVENT *r;
5373         
5374         call = &ndr_table_lsarpc.calls[NDR_LSA_LSARUNREGISTERAUDITEVENT];
5375         
5376         r = talloc(NULL, struct lsa_LSARUNREGISTERAUDITEVENT);
5377         if (r == NULL) {
5378                 return False;
5379         }
5380         
5381         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5382                 talloc_free(r);
5383                 return False;
5384         }
5385         
5386         pull = ndr_pull_init_blob(&blob, r);
5387         if (pull == NULL) {
5388                 talloc_free(r);
5389                 return False;
5390         }
5391         
5392         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5393         status = call->ndr_pull(pull, NDR_IN, r);
5394         if (NT_STATUS_IS_ERR(status)) {
5395                 talloc_free(r);
5396                 return False;
5397         }
5398         
5399         if (DEBUGLEVEL >= 10)
5400                 NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, r);
5401         
5402         r->out.result = _lsa_LSARUNREGISTERAUDITEVENT(p, r);
5403         
5404         if (p->rng_fault_state) {
5405                 talloc_free(r);
5406                 /* Return True here, srv_pipe_hnd.c will take care */
5407                 return True;
5408         }
5409         
5410         if (DEBUGLEVEL >= 10)
5411                 NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, r);
5412         
5413         push = ndr_push_init_ctx(r);
5414         if (push == NULL) {
5415                 talloc_free(r);
5416                 return False;
5417         }
5418         
5419         status = call->ndr_push(push, NDR_OUT, r);
5420         if (NT_STATUS_IS_ERR(status)) {
5421                 talloc_free(r);
5422                 return False;
5423         }
5424         
5425         blob = ndr_push_blob(push);
5426         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5427                 talloc_free(r);
5428                 return False;
5429         }
5430         
5431         talloc_free(r);
5432         
5433         return True;
5434 }
5435
5436 static bool api_lsa_LSARQUERYFORESTTRUSTINFORMATION(pipes_struct *p)
5437 {
5438         const struct ndr_interface_call *call;
5439         struct ndr_pull *pull;
5440         struct ndr_push *push;
5441         NTSTATUS status;
5442         DATA_BLOB blob;
5443         struct lsa_LSARQUERYFORESTTRUSTINFORMATION *r;
5444         
5445         call = &ndr_table_lsarpc.calls[NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION];
5446         
5447         r = talloc(NULL, struct lsa_LSARQUERYFORESTTRUSTINFORMATION);
5448         if (r == NULL) {
5449                 return False;
5450         }
5451         
5452         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5453                 talloc_free(r);
5454                 return False;
5455         }
5456         
5457         pull = ndr_pull_init_blob(&blob, r);
5458         if (pull == NULL) {
5459                 talloc_free(r);
5460                 return False;
5461         }
5462         
5463         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5464         status = call->ndr_pull(pull, NDR_IN, r);
5465         if (NT_STATUS_IS_ERR(status)) {
5466                 talloc_free(r);
5467                 return False;
5468         }
5469         
5470         if (DEBUGLEVEL >= 10)
5471                 NDR_PRINT_IN_DEBUG(lsa_LSARQUERYFORESTTRUSTINFORMATION, r);
5472         
5473         r->out.result = _lsa_LSARQUERYFORESTTRUSTINFORMATION(p, r);
5474         
5475         if (p->rng_fault_state) {
5476                 talloc_free(r);
5477                 /* Return True here, srv_pipe_hnd.c will take care */
5478                 return True;
5479         }
5480         
5481         if (DEBUGLEVEL >= 10)
5482                 NDR_PRINT_OUT_DEBUG(lsa_LSARQUERYFORESTTRUSTINFORMATION, r);
5483         
5484         push = ndr_push_init_ctx(r);
5485         if (push == NULL) {
5486                 talloc_free(r);
5487                 return False;
5488         }
5489         
5490         status = call->ndr_push(push, NDR_OUT, r);
5491         if (NT_STATUS_IS_ERR(status)) {
5492                 talloc_free(r);
5493                 return False;
5494         }
5495         
5496         blob = ndr_push_blob(push);
5497         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5498                 talloc_free(r);
5499                 return False;
5500         }
5501         
5502         talloc_free(r);
5503         
5504         return True;
5505 }
5506
5507 static bool api_lsa_LSARSETFORESTTRUSTINFORMATION(pipes_struct *p)
5508 {
5509         const struct ndr_interface_call *call;
5510         struct ndr_pull *pull;
5511         struct ndr_push *push;
5512         NTSTATUS status;
5513         DATA_BLOB blob;
5514         struct lsa_LSARSETFORESTTRUSTINFORMATION *r;
5515         
5516         call = &ndr_table_lsarpc.calls[NDR_LSA_LSARSETFORESTTRUSTINFORMATION];
5517         
5518         r = talloc(NULL, struct lsa_LSARSETFORESTTRUSTINFORMATION);
5519         if (r == NULL) {
5520                 return False;
5521         }
5522         
5523         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5524                 talloc_free(r);
5525                 return False;
5526         }
5527         
5528         pull = ndr_pull_init_blob(&blob, r);
5529         if (pull == NULL) {
5530                 talloc_free(r);
5531                 return False;
5532         }
5533         
5534         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5535         status = call->ndr_pull(pull, NDR_IN, r);
5536         if (NT_STATUS_IS_ERR(status)) {
5537                 talloc_free(r);
5538                 return False;
5539         }
5540         
5541         if (DEBUGLEVEL >= 10)
5542                 NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, r);
5543         
5544         r->out.result = _lsa_LSARSETFORESTTRUSTINFORMATION(p, r);
5545         
5546         if (p->rng_fault_state) {
5547                 talloc_free(r);
5548                 /* Return True here, srv_pipe_hnd.c will take care */
5549                 return True;
5550         }
5551         
5552         if (DEBUGLEVEL >= 10)
5553                 NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, r);
5554         
5555         push = ndr_push_init_ctx(r);
5556         if (push == NULL) {
5557                 talloc_free(r);
5558                 return False;
5559         }
5560         
5561         status = call->ndr_push(push, NDR_OUT, r);
5562         if (NT_STATUS_IS_ERR(status)) {
5563                 talloc_free(r);
5564                 return False;
5565         }
5566         
5567         blob = ndr_push_blob(push);
5568         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5569                 talloc_free(r);
5570                 return False;
5571         }
5572         
5573         talloc_free(r);
5574         
5575         return True;
5576 }
5577
5578 static bool api_lsa_CREDRRENAME(pipes_struct *p)
5579 {
5580         const struct ndr_interface_call *call;
5581         struct ndr_pull *pull;
5582         struct ndr_push *push;
5583         NTSTATUS status;
5584         DATA_BLOB blob;
5585         struct lsa_CREDRRENAME *r;
5586         
5587         call = &ndr_table_lsarpc.calls[NDR_LSA_CREDRRENAME];
5588         
5589         r = talloc(NULL, struct lsa_CREDRRENAME);
5590         if (r == NULL) {
5591                 return False;
5592         }
5593         
5594         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5595                 talloc_free(r);
5596                 return False;
5597         }
5598         
5599         pull = ndr_pull_init_blob(&blob, r);
5600         if (pull == NULL) {
5601                 talloc_free(r);
5602                 return False;
5603         }
5604         
5605         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5606         status = call->ndr_pull(pull, NDR_IN, r);
5607         if (NT_STATUS_IS_ERR(status)) {
5608                 talloc_free(r);
5609                 return False;
5610         }
5611         
5612         if (DEBUGLEVEL >= 10)
5613                 NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, r);
5614         
5615         r->out.result = _lsa_CREDRRENAME(p, r);
5616         
5617         if (p->rng_fault_state) {
5618                 talloc_free(r);
5619                 /* Return True here, srv_pipe_hnd.c will take care */
5620                 return True;
5621         }
5622         
5623         if (DEBUGLEVEL >= 10)
5624                 NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, r);
5625         
5626         push = ndr_push_init_ctx(r);
5627         if (push == NULL) {
5628                 talloc_free(r);
5629                 return False;
5630         }
5631         
5632         status = call->ndr_push(push, NDR_OUT, r);
5633         if (NT_STATUS_IS_ERR(status)) {
5634                 talloc_free(r);
5635                 return False;
5636         }
5637         
5638         blob = ndr_push_blob(push);
5639         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5640                 talloc_free(r);
5641                 return False;
5642         }
5643         
5644         talloc_free(r);
5645         
5646         return True;
5647 }
5648
5649 static bool api_lsa_LookupSids3(pipes_struct *p)
5650 {
5651         const struct ndr_interface_call *call;
5652         struct ndr_pull *pull;
5653         struct ndr_push *push;
5654         NTSTATUS status;
5655         DATA_BLOB blob;
5656         struct lsa_LookupSids3 *r;
5657         
5658         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPSIDS3];
5659         
5660         r = talloc(NULL, struct lsa_LookupSids3);
5661         if (r == NULL) {
5662                 return False;
5663         }
5664         
5665         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5666                 talloc_free(r);
5667                 return False;
5668         }
5669         
5670         pull = ndr_pull_init_blob(&blob, r);
5671         if (pull == NULL) {
5672                 talloc_free(r);
5673                 return False;
5674         }
5675         
5676         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5677         status = call->ndr_pull(pull, NDR_IN, r);
5678         if (NT_STATUS_IS_ERR(status)) {
5679                 talloc_free(r);
5680                 return False;
5681         }
5682         
5683         if (DEBUGLEVEL >= 10)
5684                 NDR_PRINT_IN_DEBUG(lsa_LookupSids3, r);
5685         
5686         ZERO_STRUCT(r->out);
5687         r->out.domains = talloc_zero(r, struct lsa_RefDomainList);
5688         if (r->out.domains == NULL) {
5689                 talloc_free(r);
5690                 return False;
5691         }
5692         
5693         r->out.names = r->in.names;
5694         r->out.count = r->in.count;
5695         r->out.result = _lsa_LookupSids3(p, r);
5696         
5697         if (p->rng_fault_state) {
5698                 talloc_free(r);
5699                 /* Return True here, srv_pipe_hnd.c will take care */
5700                 return True;
5701         }
5702         
5703         if (DEBUGLEVEL >= 10)
5704                 NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, r);
5705         
5706         push = ndr_push_init_ctx(r);
5707         if (push == NULL) {
5708                 talloc_free(r);
5709                 return False;
5710         }
5711         
5712         status = call->ndr_push(push, NDR_OUT, r);
5713         if (NT_STATUS_IS_ERR(status)) {
5714                 talloc_free(r);
5715                 return False;
5716         }
5717         
5718         blob = ndr_push_blob(push);
5719         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5720                 talloc_free(r);
5721                 return False;
5722         }
5723         
5724         talloc_free(r);
5725         
5726         return True;
5727 }
5728
5729 static bool api_lsa_LookupNames4(pipes_struct *p)
5730 {
5731         const struct ndr_interface_call *call;
5732         struct ndr_pull *pull;
5733         struct ndr_push *push;
5734         NTSTATUS status;
5735         DATA_BLOB blob;
5736         struct lsa_LookupNames4 *r;
5737         
5738         call = &ndr_table_lsarpc.calls[NDR_LSA_LOOKUPNAMES4];
5739         
5740         r = talloc(NULL, struct lsa_LookupNames4);
5741         if (r == NULL) {
5742                 return False;
5743         }
5744         
5745         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5746                 talloc_free(r);
5747                 return False;
5748         }
5749         
5750         pull = ndr_pull_init_blob(&blob, r);
5751         if (pull == NULL) {
5752                 talloc_free(r);
5753                 return False;
5754         }
5755         
5756         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5757         status = call->ndr_pull(pull, NDR_IN, r);
5758         if (NT_STATUS_IS_ERR(status)) {
5759                 talloc_free(r);
5760                 return False;
5761         }
5762         
5763         if (DEBUGLEVEL >= 10)
5764                 NDR_PRINT_IN_DEBUG(lsa_LookupNames4, r);
5765         
5766         ZERO_STRUCT(r->out);
5767         r->out.domains = talloc_zero(r, struct lsa_RefDomainList);
5768         if (r->out.domains == NULL) {
5769                 talloc_free(r);
5770                 return False;
5771         }
5772         
5773         r->out.sids = r->in.sids;
5774         r->out.count = r->in.count;
5775         r->out.result = _lsa_LookupNames4(p, r);
5776         
5777         if (p->rng_fault_state) {
5778                 talloc_free(r);
5779                 /* Return True here, srv_pipe_hnd.c will take care */
5780                 return True;
5781         }
5782         
5783         if (DEBUGLEVEL >= 10)
5784                 NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, r);
5785         
5786         push = ndr_push_init_ctx(r);
5787         if (push == NULL) {
5788                 talloc_free(r);
5789                 return False;
5790         }
5791         
5792         status = call->ndr_push(push, NDR_OUT, r);
5793         if (NT_STATUS_IS_ERR(status)) {
5794                 talloc_free(r);
5795                 return False;
5796         }
5797         
5798         blob = ndr_push_blob(push);
5799         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5800                 talloc_free(r);
5801                 return False;
5802         }
5803         
5804         talloc_free(r);
5805         
5806         return True;
5807 }
5808
5809 static bool api_lsa_LSAROPENPOLICYSCE(pipes_struct *p)
5810 {
5811         const struct ndr_interface_call *call;
5812         struct ndr_pull *pull;
5813         struct ndr_push *push;
5814         NTSTATUS status;
5815         DATA_BLOB blob;
5816         struct lsa_LSAROPENPOLICYSCE *r;
5817         
5818         call = &ndr_table_lsarpc.calls[NDR_LSA_LSAROPENPOLICYSCE];
5819         
5820         r = talloc(NULL, struct lsa_LSAROPENPOLICYSCE);
5821         if (r == NULL) {
5822                 return False;
5823         }
5824         
5825         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5826                 talloc_free(r);
5827                 return False;
5828         }
5829         
5830         pull = ndr_pull_init_blob(&blob, r);
5831         if (pull == NULL) {
5832                 talloc_free(r);
5833                 return False;
5834         }
5835         
5836         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5837         status = call->ndr_pull(pull, NDR_IN, r);
5838         if (NT_STATUS_IS_ERR(status)) {
5839                 talloc_free(r);
5840                 return False;
5841         }
5842         
5843         if (DEBUGLEVEL >= 10)
5844                 NDR_PRINT_IN_DEBUG(lsa_LSAROPENPOLICYSCE, r);
5845         
5846         r->out.result = _lsa_LSAROPENPOLICYSCE(p, r);
5847         
5848         if (p->rng_fault_state) {
5849                 talloc_free(r);
5850                 /* Return True here, srv_pipe_hnd.c will take care */
5851                 return True;
5852         }
5853         
5854         if (DEBUGLEVEL >= 10)
5855                 NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, r);
5856         
5857         push = ndr_push_init_ctx(r);
5858         if (push == NULL) {
5859                 talloc_free(r);
5860                 return False;
5861         }
5862         
5863         status = call->ndr_push(push, NDR_OUT, r);
5864         if (NT_STATUS_IS_ERR(status)) {
5865                 talloc_free(r);
5866                 return False;
5867         }
5868         
5869         blob = ndr_push_blob(push);
5870         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5871                 talloc_free(r);
5872                 return False;
5873         }
5874         
5875         talloc_free(r);
5876         
5877         return True;
5878 }
5879
5880 static bool api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(pipes_struct *p)
5881 {
5882         const struct ndr_interface_call *call;
5883         struct ndr_pull *pull;
5884         struct ndr_push *push;
5885         NTSTATUS status;
5886         DATA_BLOB blob;
5887         struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r;
5888         
5889         call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE];
5890         
5891         r = talloc(NULL, struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE);
5892         if (r == NULL) {
5893                 return False;
5894         }
5895         
5896         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5897                 talloc_free(r);
5898                 return False;
5899         }
5900         
5901         pull = ndr_pull_init_blob(&blob, r);
5902         if (pull == NULL) {
5903                 talloc_free(r);
5904                 return False;
5905         }
5906         
5907         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5908         status = call->ndr_pull(pull, NDR_IN, r);
5909         if (NT_STATUS_IS_ERR(status)) {
5910                 talloc_free(r);
5911                 return False;
5912         }
5913         
5914         if (DEBUGLEVEL >= 10)
5915                 NDR_PRINT_IN_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, r);
5916         
5917         r->out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(p, r);
5918         
5919         if (p->rng_fault_state) {
5920                 talloc_free(r);
5921                 /* Return True here, srv_pipe_hnd.c will take care */
5922                 return True;
5923         }
5924         
5925         if (DEBUGLEVEL >= 10)
5926                 NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, r);
5927         
5928         push = ndr_push_init_ctx(r);
5929         if (push == NULL) {
5930                 talloc_free(r);
5931                 return False;
5932         }
5933         
5934         status = call->ndr_push(push, NDR_OUT, r);
5935         if (NT_STATUS_IS_ERR(status)) {
5936                 talloc_free(r);
5937                 return False;
5938         }
5939         
5940         blob = ndr_push_blob(push);
5941         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
5942                 talloc_free(r);
5943                 return False;
5944         }
5945         
5946         talloc_free(r);
5947         
5948         return True;
5949 }
5950
5951 static bool api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(pipes_struct *p)
5952 {
5953         const struct ndr_interface_call *call;
5954         struct ndr_pull *pull;
5955         struct ndr_push *push;
5956         NTSTATUS status;
5957         DATA_BLOB blob;
5958         struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r;
5959         
5960         call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE];
5961         
5962         r = talloc(NULL, struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE);
5963         if (r == NULL) {
5964                 return False;
5965         }
5966         
5967         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
5968                 talloc_free(r);
5969                 return False;
5970         }
5971         
5972         pull = ndr_pull_init_blob(&blob, r);
5973         if (pull == NULL) {
5974                 talloc_free(r);
5975                 return False;
5976         }
5977         
5978         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
5979         status = call->ndr_pull(pull, NDR_IN, r);
5980         if (NT_STATUS_IS_ERR(status)) {
5981                 talloc_free(r);
5982                 return False;
5983         }
5984         
5985         if (DEBUGLEVEL >= 10)
5986                 NDR_PRINT_IN_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, r);
5987         
5988         r->out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(p, r);
5989         
5990         if (p->rng_fault_state) {
5991                 talloc_free(r);
5992                 /* Return True here, srv_pipe_hnd.c will take care */
5993                 return True;
5994         }
5995         
5996         if (DEBUGLEVEL >= 10)
5997                 NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, r);
5998         
5999         push = ndr_push_init_ctx(r);
6000         if (push == NULL) {
6001                 talloc_free(r);
6002                 return False;
6003         }
6004         
6005         status = call->ndr_push(push, NDR_OUT, r);
6006         if (NT_STATUS_IS_ERR(status)) {
6007                 talloc_free(r);
6008                 return False;
6009         }
6010         
6011         blob = ndr_push_blob(push);
6012         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
6013                 talloc_free(r);
6014                 return False;
6015         }
6016         
6017         talloc_free(r);
6018         
6019         return True;
6020 }
6021
6022 static bool api_lsa_LSARADTREPORTSECURITYEVENT(pipes_struct *p)
6023 {
6024         const struct ndr_interface_call *call;
6025         struct ndr_pull *pull;
6026         struct ndr_push *push;
6027         NTSTATUS status;
6028         DATA_BLOB blob;
6029         struct lsa_LSARADTREPORTSECURITYEVENT *r;
6030         
6031         call = &ndr_table_lsarpc.calls[NDR_LSA_LSARADTREPORTSECURITYEVENT];
6032         
6033         r = talloc(NULL, struct lsa_LSARADTREPORTSECURITYEVENT);
6034         if (r == NULL) {
6035                 return False;
6036         }
6037         
6038         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
6039                 talloc_free(r);
6040                 return False;
6041         }
6042         
6043         pull = ndr_pull_init_blob(&blob, r);
6044         if (pull == NULL) {
6045                 talloc_free(r);
6046                 return False;
6047         }
6048         
6049         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
6050         status = call->ndr_pull(pull, NDR_IN, r);
6051         if (NT_STATUS_IS_ERR(status)) {
6052                 talloc_free(r);
6053                 return False;
6054         }
6055         
6056         if (DEBUGLEVEL >= 10)
6057                 NDR_PRINT_IN_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, r);
6058         
6059         r->out.result = _lsa_LSARADTREPORTSECURITYEVENT(p, r);
6060         
6061         if (p->rng_fault_state) {
6062                 talloc_free(r);
6063                 /* Return True here, srv_pipe_hnd.c will take care */
6064                 return True;
6065         }
6066         
6067         if (DEBUGLEVEL >= 10)
6068                 NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, r);
6069         
6070         push = ndr_push_init_ctx(r);
6071         if (push == NULL) {
6072                 talloc_free(r);
6073                 return False;
6074         }
6075         
6076         status = call->ndr_push(push, NDR_OUT, r);
6077         if (NT_STATUS_IS_ERR(status)) {
6078                 talloc_free(r);
6079                 return False;
6080         }
6081         
6082         blob = ndr_push_blob(push);
6083         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
6084                 talloc_free(r);
6085                 return False;
6086         }
6087         
6088         talloc_free(r);
6089         
6090         return True;
6091 }
6092
6093
6094 /* Tables */
6095 static struct api_struct api_lsarpc_cmds[] = 
6096 {
6097         {"LSA_CLOSE", NDR_LSA_CLOSE, api_lsa_Close},
6098         {"LSA_DELETE", NDR_LSA_DELETE, api_lsa_Delete},
6099         {"LSA_ENUMPRIVS", NDR_LSA_ENUMPRIVS, api_lsa_EnumPrivs},
6100         {"LSA_QUERYSECURITY", NDR_LSA_QUERYSECURITY, api_lsa_QuerySecurity},
6101         {"LSA_SETSECOBJ", NDR_LSA_SETSECOBJ, api_lsa_SetSecObj},
6102         {"LSA_CHANGEPASSWORD", NDR_LSA_CHANGEPASSWORD, api_lsa_ChangePassword},
6103         {"LSA_OPENPOLICY", NDR_LSA_OPENPOLICY, api_lsa_OpenPolicy},
6104         {"LSA_QUERYINFOPOLICY", NDR_LSA_QUERYINFOPOLICY, api_lsa_QueryInfoPolicy},
6105         {"LSA_SETINFOPOLICY", NDR_LSA_SETINFOPOLICY, api_lsa_SetInfoPolicy},
6106         {"LSA_CLEARAUDITLOG", NDR_LSA_CLEARAUDITLOG, api_lsa_ClearAuditLog},
6107         {"LSA_CREATEACCOUNT", NDR_LSA_CREATEACCOUNT, api_lsa_CreateAccount},
6108         {"LSA_ENUMACCOUNTS", NDR_LSA_ENUMACCOUNTS, api_lsa_EnumAccounts},
6109         {"LSA_CREATETRUSTEDDOMAIN", NDR_LSA_CREATETRUSTEDDOMAIN, api_lsa_CreateTrustedDomain},
6110         {"LSA_ENUMTRUSTDOM", NDR_LSA_ENUMTRUSTDOM, api_lsa_EnumTrustDom},
6111         {"LSA_LOOKUPNAMES", NDR_LSA_LOOKUPNAMES, api_lsa_LookupNames},
6112         {"LSA_LOOKUPSIDS", NDR_LSA_LOOKUPSIDS, api_lsa_LookupSids},
6113         {"LSA_CREATESECRET", NDR_LSA_CREATESECRET, api_lsa_CreateSecret},
6114         {"LSA_OPENACCOUNT", NDR_LSA_OPENACCOUNT, api_lsa_OpenAccount},
6115         {"LSA_ENUMPRIVSACCOUNT", NDR_LSA_ENUMPRIVSACCOUNT, api_lsa_EnumPrivsAccount},
6116         {"LSA_ADDPRIVILEGESTOACCOUNT", NDR_LSA_ADDPRIVILEGESTOACCOUNT, api_lsa_AddPrivilegesToAccount},
6117         {"LSA_REMOVEPRIVILEGESFROMACCOUNT", NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT, api_lsa_RemovePrivilegesFromAccount},
6118         {"LSA_GETQUOTASFORACCOUNT", NDR_LSA_GETQUOTASFORACCOUNT, api_lsa_GetQuotasForAccount},
6119         {"LSA_SETQUOTASFORACCOUNT", NDR_LSA_SETQUOTASFORACCOUNT, api_lsa_SetQuotasForAccount},
6120         {"LSA_GETSYSTEMACCESSACCOUNT", NDR_LSA_GETSYSTEMACCESSACCOUNT, api_lsa_GetSystemAccessAccount},
6121         {"LSA_SETSYSTEMACCESSACCOUNT", NDR_LSA_SETSYSTEMACCESSACCOUNT, api_lsa_SetSystemAccessAccount},
6122         {"LSA_OPENTRUSTEDDOMAIN", NDR_LSA_OPENTRUSTEDDOMAIN, api_lsa_OpenTrustedDomain},
6123         {"LSA_QUERYTRUSTEDDOMAININFO", NDR_LSA_QUERYTRUSTEDDOMAININFO, api_lsa_QueryTrustedDomainInfo},
6124         {"LSA_SETINFORMATIONTRUSTEDDOMAIN", NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN, api_lsa_SetInformationTrustedDomain},
6125         {"LSA_OPENSECRET", NDR_LSA_OPENSECRET, api_lsa_OpenSecret},
6126         {"LSA_SETSECRET", NDR_LSA_SETSECRET, api_lsa_SetSecret},
6127         {"LSA_QUERYSECRET", NDR_LSA_QUERYSECRET, api_lsa_QuerySecret},
6128         {"LSA_LOOKUPPRIVVALUE", NDR_LSA_LOOKUPPRIVVALUE, api_lsa_LookupPrivValue},
6129         {"LSA_LOOKUPPRIVNAME", NDR_LSA_LOOKUPPRIVNAME, api_lsa_LookupPrivName},
6130         {"LSA_LOOKUPPRIVDISPLAYNAME", NDR_LSA_LOOKUPPRIVDISPLAYNAME, api_lsa_LookupPrivDisplayName},
6131         {"LSA_DELETEOBJECT", NDR_LSA_DELETEOBJECT, api_lsa_DeleteObject},
6132         {"LSA_ENUMACCOUNTSWITHUSERRIGHT", NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT, api_lsa_EnumAccountsWithUserRight},
6133         {"LSA_ENUMACCOUNTRIGHTS", NDR_LSA_ENUMACCOUNTRIGHTS, api_lsa_EnumAccountRights},
6134         {"LSA_ADDACCOUNTRIGHTS", NDR_LSA_ADDACCOUNTRIGHTS, api_lsa_AddAccountRights},
6135         {"LSA_REMOVEACCOUNTRIGHTS", NDR_LSA_REMOVEACCOUNTRIGHTS, api_lsa_RemoveAccountRights},
6136         {"LSA_QUERYTRUSTEDDOMAININFOBYSID", NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID, api_lsa_QueryTrustedDomainInfoBySid},
6137         {"LSA_SETTRUSTEDDOMAININFO", NDR_LSA_SETTRUSTEDDOMAININFO, api_lsa_SetTrustedDomainInfo},
6138         {"LSA_DELETETRUSTEDDOMAIN", NDR_LSA_DELETETRUSTEDDOMAIN, api_lsa_DeleteTrustedDomain},
6139         {"LSA_STOREPRIVATEDATA", NDR_LSA_STOREPRIVATEDATA, api_lsa_StorePrivateData},
6140         {"LSA_RETRIEVEPRIVATEDATA", NDR_LSA_RETRIEVEPRIVATEDATA, api_lsa_RetrievePrivateData},
6141         {"LSA_OPENPOLICY2", NDR_LSA_OPENPOLICY2, api_lsa_OpenPolicy2},
6142         {"LSA_GETUSERNAME", NDR_LSA_GETUSERNAME, api_lsa_GetUserName},
6143         {"LSA_QUERYINFOPOLICY2", NDR_LSA_QUERYINFOPOLICY2, api_lsa_QueryInfoPolicy2},
6144         {"LSA_SETINFOPOLICY2", NDR_LSA_SETINFOPOLICY2, api_lsa_SetInfoPolicy2},
6145         {"LSA_QUERYTRUSTEDDOMAININFOBYNAME", NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME, api_lsa_QueryTrustedDomainInfoByName},
6146         {"LSA_SETTRUSTEDDOMAININFOBYNAME", NDR_LSA_SETTRUSTEDDOMAININFOBYNAME, api_lsa_SetTrustedDomainInfoByName},
6147         {"LSA_ENUMTRUSTEDDOMAINSEX", NDR_LSA_ENUMTRUSTEDDOMAINSEX, api_lsa_EnumTrustedDomainsEx},
6148         {"LSA_CREATETRUSTEDDOMAINEX", NDR_LSA_CREATETRUSTEDDOMAINEX, api_lsa_CreateTrustedDomainEx},
6149         {"LSA_CLOSETRUSTEDDOMAINEX", NDR_LSA_CLOSETRUSTEDDOMAINEX, api_lsa_CloseTrustedDomainEx},
6150         {"LSA_QUERYDOMAININFORMATIONPOLICY", NDR_LSA_QUERYDOMAININFORMATIONPOLICY, api_lsa_QueryDomainInformationPolicy},
6151         {"LSA_SETDOMAININFORMATIONPOLICY", NDR_LSA_SETDOMAININFORMATIONPOLICY, api_lsa_SetDomainInformationPolicy},
6152         {"LSA_OPENTRUSTEDDOMAINBYNAME", NDR_LSA_OPENTRUSTEDDOMAINBYNAME, api_lsa_OpenTrustedDomainByName},
6153         {"LSA_TESTCALL", NDR_LSA_TESTCALL, api_lsa_TestCall},
6154         {"LSA_LOOKUPSIDS2", NDR_LSA_LOOKUPSIDS2, api_lsa_LookupSids2},
6155         {"LSA_LOOKUPNAMES2", NDR_LSA_LOOKUPNAMES2, api_lsa_LookupNames2},
6156         {"LSA_CREATETRUSTEDDOMAINEX2", NDR_LSA_CREATETRUSTEDDOMAINEX2, api_lsa_CreateTrustedDomainEx2},
6157         {"LSA_CREDRWRITE", NDR_LSA_CREDRWRITE, api_lsa_CREDRWRITE},
6158         {"LSA_CREDRREAD", NDR_LSA_CREDRREAD, api_lsa_CREDRREAD},
6159         {"LSA_CREDRENUMERATE", NDR_LSA_CREDRENUMERATE, api_lsa_CREDRENUMERATE},
6160         {"LSA_CREDRWRITEDOMAINCREDENTIALS", NDR_LSA_CREDRWRITEDOMAINCREDENTIALS, api_lsa_CREDRWRITEDOMAINCREDENTIALS},
6161         {"LSA_CREDRREADDOMAINCREDENTIALS", NDR_LSA_CREDRREADDOMAINCREDENTIALS, api_lsa_CREDRREADDOMAINCREDENTIALS},
6162         {"LSA_CREDRDELETE", NDR_LSA_CREDRDELETE, api_lsa_CREDRDELETE},
6163         {"LSA_CREDRGETTARGETINFO", NDR_LSA_CREDRGETTARGETINFO, api_lsa_CREDRGETTARGETINFO},
6164         {"LSA_CREDRPROFILELOADED", NDR_LSA_CREDRPROFILELOADED, api_lsa_CREDRPROFILELOADED},
6165         {"LSA_LOOKUPNAMES3", NDR_LSA_LOOKUPNAMES3, api_lsa_LookupNames3},
6166         {"LSA_CREDRGETSESSIONTYPES", NDR_LSA_CREDRGETSESSIONTYPES, api_lsa_CREDRGETSESSIONTYPES},
6167         {"LSA_LSARREGISTERAUDITEVENT", NDR_LSA_LSARREGISTERAUDITEVENT, api_lsa_LSARREGISTERAUDITEVENT},
6168         {"LSA_LSARGENAUDITEVENT", NDR_LSA_LSARGENAUDITEVENT, api_lsa_LSARGENAUDITEVENT},
6169         {"LSA_LSARUNREGISTERAUDITEVENT", NDR_LSA_LSARUNREGISTERAUDITEVENT, api_lsa_LSARUNREGISTERAUDITEVENT},
6170         {"LSA_LSARQUERYFORESTTRUSTINFORMATION", NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION, api_lsa_LSARQUERYFORESTTRUSTINFORMATION},
6171         {"LSA_LSARSETFORESTTRUSTINFORMATION", NDR_LSA_LSARSETFORESTTRUSTINFORMATION, api_lsa_LSARSETFORESTTRUSTINFORMATION},
6172         {"LSA_CREDRRENAME", NDR_LSA_CREDRRENAME, api_lsa_CREDRRENAME},
6173         {"LSA_LOOKUPSIDS3", NDR_LSA_LOOKUPSIDS3, api_lsa_LookupSids3},
6174         {"LSA_LOOKUPNAMES4", NDR_LSA_LOOKUPNAMES4, api_lsa_LookupNames4},
6175         {"LSA_LSAROPENPOLICYSCE", NDR_LSA_LSAROPENPOLICYSCE, api_lsa_LSAROPENPOLICYSCE},
6176         {"LSA_LSARADTREGISTERSECURITYEVENTSOURCE", NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTREGISTERSECURITYEVENTSOURCE},
6177         {"LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE", NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE, api_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE},
6178         {"LSA_LSARADTREPORTSECURITYEVENT", NDR_LSA_LSARADTREPORTSECURITYEVENT, api_lsa_LSARADTREPORTSECURITYEVENT},
6179 };
6180
6181 void lsarpc_get_pipe_fns(struct api_struct **fns, int *n_fns)
6182 {
6183         *fns = api_lsarpc_cmds;
6184         *n_fns = sizeof(api_lsarpc_cmds) / sizeof(struct api_struct);
6185 }
6186
6187 NTSTATUS rpc_lsarpc_init(void)
6188 {
6189         return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "lsarpc", "lsarpc", api_lsarpc_cmds, sizeof(api_lsarpc_cmds) / sizeof(struct api_struct));
6190 }