RIP BOOL. Convert BOOL -> bool. I found a few interesting
[samba.git] / source3 / librpc / gen_ndr / srv_winreg.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_winreg.h"
8
9 static bool api_winreg_OpenHKCR(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 winreg_OpenHKCR *r;
17         
18         call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCR];
19         
20         r = talloc(NULL, struct winreg_OpenHKCR);
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(winreg_OpenHKCR, r);
45         
46         ZERO_STRUCT(r->out);
47         r->out.handle = talloc_zero(r, struct policy_handle);
48         if (r->out.handle == NULL) {
49                 talloc_free(r);
50                 return False;
51         }
52         
53         r->out.result = _winreg_OpenHKCR(p, r);
54         
55         if (p->rng_fault_state) {
56                 talloc_free(r);
57                 /* Return True here, srv_pipe_hnd.c will take care */
58                 return True;
59         }
60         
61         if (DEBUGLEVEL >= 10)
62                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, r);
63         
64         push = ndr_push_init_ctx(r);
65         if (push == NULL) {
66                 talloc_free(r);
67                 return False;
68         }
69         
70         status = call->ndr_push(push, NDR_OUT, r);
71         if (NT_STATUS_IS_ERR(status)) {
72                 talloc_free(r);
73                 return False;
74         }
75         
76         blob = ndr_push_blob(push);
77         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
78                 talloc_free(r);
79                 return False;
80         }
81         
82         talloc_free(r);
83         
84         return True;
85 }
86
87 static bool api_winreg_OpenHKCU(pipes_struct *p)
88 {
89         const struct ndr_interface_call *call;
90         struct ndr_pull *pull;
91         struct ndr_push *push;
92         NTSTATUS status;
93         DATA_BLOB blob;
94         struct winreg_OpenHKCU *r;
95         
96         call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCU];
97         
98         r = talloc(NULL, struct winreg_OpenHKCU);
99         if (r == NULL) {
100                 return False;
101         }
102         
103         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
104                 talloc_free(r);
105                 return False;
106         }
107         
108         pull = ndr_pull_init_blob(&blob, r);
109         if (pull == NULL) {
110                 talloc_free(r);
111                 return False;
112         }
113         
114         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
115         status = call->ndr_pull(pull, NDR_IN, r);
116         if (NT_STATUS_IS_ERR(status)) {
117                 talloc_free(r);
118                 return False;
119         }
120         
121         if (DEBUGLEVEL >= 10)
122                 NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, r);
123         
124         ZERO_STRUCT(r->out);
125         r->out.handle = talloc_zero(r, struct policy_handle);
126         if (r->out.handle == NULL) {
127                 talloc_free(r);
128                 return False;
129         }
130         
131         r->out.result = _winreg_OpenHKCU(p, r);
132         
133         if (p->rng_fault_state) {
134                 talloc_free(r);
135                 /* Return True here, srv_pipe_hnd.c will take care */
136                 return True;
137         }
138         
139         if (DEBUGLEVEL >= 10)
140                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, r);
141         
142         push = ndr_push_init_ctx(r);
143         if (push == NULL) {
144                 talloc_free(r);
145                 return False;
146         }
147         
148         status = call->ndr_push(push, NDR_OUT, r);
149         if (NT_STATUS_IS_ERR(status)) {
150                 talloc_free(r);
151                 return False;
152         }
153         
154         blob = ndr_push_blob(push);
155         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
156                 talloc_free(r);
157                 return False;
158         }
159         
160         talloc_free(r);
161         
162         return True;
163 }
164
165 static bool api_winreg_OpenHKLM(pipes_struct *p)
166 {
167         const struct ndr_interface_call *call;
168         struct ndr_pull *pull;
169         struct ndr_push *push;
170         NTSTATUS status;
171         DATA_BLOB blob;
172         struct winreg_OpenHKLM *r;
173         
174         call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKLM];
175         
176         r = talloc(NULL, struct winreg_OpenHKLM);
177         if (r == NULL) {
178                 return False;
179         }
180         
181         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
182                 talloc_free(r);
183                 return False;
184         }
185         
186         pull = ndr_pull_init_blob(&blob, r);
187         if (pull == NULL) {
188                 talloc_free(r);
189                 return False;
190         }
191         
192         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
193         status = call->ndr_pull(pull, NDR_IN, r);
194         if (NT_STATUS_IS_ERR(status)) {
195                 talloc_free(r);
196                 return False;
197         }
198         
199         if (DEBUGLEVEL >= 10)
200                 NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, r);
201         
202         ZERO_STRUCT(r->out);
203         r->out.handle = talloc_zero(r, struct policy_handle);
204         if (r->out.handle == NULL) {
205                 talloc_free(r);
206                 return False;
207         }
208         
209         r->out.result = _winreg_OpenHKLM(p, r);
210         
211         if (p->rng_fault_state) {
212                 talloc_free(r);
213                 /* Return True here, srv_pipe_hnd.c will take care */
214                 return True;
215         }
216         
217         if (DEBUGLEVEL >= 10)
218                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, r);
219         
220         push = ndr_push_init_ctx(r);
221         if (push == NULL) {
222                 talloc_free(r);
223                 return False;
224         }
225         
226         status = call->ndr_push(push, NDR_OUT, r);
227         if (NT_STATUS_IS_ERR(status)) {
228                 talloc_free(r);
229                 return False;
230         }
231         
232         blob = ndr_push_blob(push);
233         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
234                 talloc_free(r);
235                 return False;
236         }
237         
238         talloc_free(r);
239         
240         return True;
241 }
242
243 static bool api_winreg_OpenHKPD(pipes_struct *p)
244 {
245         const struct ndr_interface_call *call;
246         struct ndr_pull *pull;
247         struct ndr_push *push;
248         NTSTATUS status;
249         DATA_BLOB blob;
250         struct winreg_OpenHKPD *r;
251         
252         call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPD];
253         
254         r = talloc(NULL, struct winreg_OpenHKPD);
255         if (r == NULL) {
256                 return False;
257         }
258         
259         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
260                 talloc_free(r);
261                 return False;
262         }
263         
264         pull = ndr_pull_init_blob(&blob, r);
265         if (pull == NULL) {
266                 talloc_free(r);
267                 return False;
268         }
269         
270         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
271         status = call->ndr_pull(pull, NDR_IN, r);
272         if (NT_STATUS_IS_ERR(status)) {
273                 talloc_free(r);
274                 return False;
275         }
276         
277         if (DEBUGLEVEL >= 10)
278                 NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, r);
279         
280         ZERO_STRUCT(r->out);
281         r->out.handle = talloc_zero(r, struct policy_handle);
282         if (r->out.handle == NULL) {
283                 talloc_free(r);
284                 return False;
285         }
286         
287         r->out.result = _winreg_OpenHKPD(p, r);
288         
289         if (p->rng_fault_state) {
290                 talloc_free(r);
291                 /* Return True here, srv_pipe_hnd.c will take care */
292                 return True;
293         }
294         
295         if (DEBUGLEVEL >= 10)
296                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, r);
297         
298         push = ndr_push_init_ctx(r);
299         if (push == NULL) {
300                 talloc_free(r);
301                 return False;
302         }
303         
304         status = call->ndr_push(push, NDR_OUT, r);
305         if (NT_STATUS_IS_ERR(status)) {
306                 talloc_free(r);
307                 return False;
308         }
309         
310         blob = ndr_push_blob(push);
311         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
312                 talloc_free(r);
313                 return False;
314         }
315         
316         talloc_free(r);
317         
318         return True;
319 }
320
321 static bool api_winreg_OpenHKU(pipes_struct *p)
322 {
323         const struct ndr_interface_call *call;
324         struct ndr_pull *pull;
325         struct ndr_push *push;
326         NTSTATUS status;
327         DATA_BLOB blob;
328         struct winreg_OpenHKU *r;
329         
330         call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKU];
331         
332         r = talloc(NULL, struct winreg_OpenHKU);
333         if (r == NULL) {
334                 return False;
335         }
336         
337         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
338                 talloc_free(r);
339                 return False;
340         }
341         
342         pull = ndr_pull_init_blob(&blob, r);
343         if (pull == NULL) {
344                 talloc_free(r);
345                 return False;
346         }
347         
348         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
349         status = call->ndr_pull(pull, NDR_IN, r);
350         if (NT_STATUS_IS_ERR(status)) {
351                 talloc_free(r);
352                 return False;
353         }
354         
355         if (DEBUGLEVEL >= 10)
356                 NDR_PRINT_IN_DEBUG(winreg_OpenHKU, r);
357         
358         ZERO_STRUCT(r->out);
359         r->out.handle = talloc_zero(r, struct policy_handle);
360         if (r->out.handle == NULL) {
361                 talloc_free(r);
362                 return False;
363         }
364         
365         r->out.result = _winreg_OpenHKU(p, r);
366         
367         if (p->rng_fault_state) {
368                 talloc_free(r);
369                 /* Return True here, srv_pipe_hnd.c will take care */
370                 return True;
371         }
372         
373         if (DEBUGLEVEL >= 10)
374                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, r);
375         
376         push = ndr_push_init_ctx(r);
377         if (push == NULL) {
378                 talloc_free(r);
379                 return False;
380         }
381         
382         status = call->ndr_push(push, NDR_OUT, r);
383         if (NT_STATUS_IS_ERR(status)) {
384                 talloc_free(r);
385                 return False;
386         }
387         
388         blob = ndr_push_blob(push);
389         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
390                 talloc_free(r);
391                 return False;
392         }
393         
394         talloc_free(r);
395         
396         return True;
397 }
398
399 static bool api_winreg_CloseKey(pipes_struct *p)
400 {
401         const struct ndr_interface_call *call;
402         struct ndr_pull *pull;
403         struct ndr_push *push;
404         NTSTATUS status;
405         DATA_BLOB blob;
406         struct winreg_CloseKey *r;
407         
408         call = &ndr_table_winreg.calls[NDR_WINREG_CLOSEKEY];
409         
410         r = talloc(NULL, struct winreg_CloseKey);
411         if (r == NULL) {
412                 return False;
413         }
414         
415         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
416                 talloc_free(r);
417                 return False;
418         }
419         
420         pull = ndr_pull_init_blob(&blob, r);
421         if (pull == NULL) {
422                 talloc_free(r);
423                 return False;
424         }
425         
426         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
427         status = call->ndr_pull(pull, NDR_IN, r);
428         if (NT_STATUS_IS_ERR(status)) {
429                 talloc_free(r);
430                 return False;
431         }
432         
433         if (DEBUGLEVEL >= 10)
434                 NDR_PRINT_IN_DEBUG(winreg_CloseKey, r);
435         
436         ZERO_STRUCT(r->out);
437         r->out.handle = r->in.handle;
438         r->out.result = _winreg_CloseKey(p, r);
439         
440         if (p->rng_fault_state) {
441                 talloc_free(r);
442                 /* Return True here, srv_pipe_hnd.c will take care */
443                 return True;
444         }
445         
446         if (DEBUGLEVEL >= 10)
447                 NDR_PRINT_OUT_DEBUG(winreg_CloseKey, r);
448         
449         push = ndr_push_init_ctx(r);
450         if (push == NULL) {
451                 talloc_free(r);
452                 return False;
453         }
454         
455         status = call->ndr_push(push, NDR_OUT, r);
456         if (NT_STATUS_IS_ERR(status)) {
457                 talloc_free(r);
458                 return False;
459         }
460         
461         blob = ndr_push_blob(push);
462         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
463                 talloc_free(r);
464                 return False;
465         }
466         
467         talloc_free(r);
468         
469         return True;
470 }
471
472 static bool api_winreg_CreateKey(pipes_struct *p)
473 {
474         const struct ndr_interface_call *call;
475         struct ndr_pull *pull;
476         struct ndr_push *push;
477         NTSTATUS status;
478         DATA_BLOB blob;
479         struct winreg_CreateKey *r;
480         
481         call = &ndr_table_winreg.calls[NDR_WINREG_CREATEKEY];
482         
483         r = talloc(NULL, struct winreg_CreateKey);
484         if (r == NULL) {
485                 return False;
486         }
487         
488         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
489                 talloc_free(r);
490                 return False;
491         }
492         
493         pull = ndr_pull_init_blob(&blob, r);
494         if (pull == NULL) {
495                 talloc_free(r);
496                 return False;
497         }
498         
499         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
500         status = call->ndr_pull(pull, NDR_IN, r);
501         if (NT_STATUS_IS_ERR(status)) {
502                 talloc_free(r);
503                 return False;
504         }
505         
506         if (DEBUGLEVEL >= 10)
507                 NDR_PRINT_IN_DEBUG(winreg_CreateKey, r);
508         
509         ZERO_STRUCT(r->out);
510         r->out.new_handle = talloc_zero(r, struct policy_handle);
511         if (r->out.new_handle == NULL) {
512                 talloc_free(r);
513                 return False;
514         }
515         
516         r->out.action_taken = r->in.action_taken;
517         r->out.result = _winreg_CreateKey(p, r);
518         
519         if (p->rng_fault_state) {
520                 talloc_free(r);
521                 /* Return True here, srv_pipe_hnd.c will take care */
522                 return True;
523         }
524         
525         if (DEBUGLEVEL >= 10)
526                 NDR_PRINT_OUT_DEBUG(winreg_CreateKey, r);
527         
528         push = ndr_push_init_ctx(r);
529         if (push == NULL) {
530                 talloc_free(r);
531                 return False;
532         }
533         
534         status = call->ndr_push(push, NDR_OUT, r);
535         if (NT_STATUS_IS_ERR(status)) {
536                 talloc_free(r);
537                 return False;
538         }
539         
540         blob = ndr_push_blob(push);
541         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
542                 talloc_free(r);
543                 return False;
544         }
545         
546         talloc_free(r);
547         
548         return True;
549 }
550
551 static bool api_winreg_DeleteKey(pipes_struct *p)
552 {
553         const struct ndr_interface_call *call;
554         struct ndr_pull *pull;
555         struct ndr_push *push;
556         NTSTATUS status;
557         DATA_BLOB blob;
558         struct winreg_DeleteKey *r;
559         
560         call = &ndr_table_winreg.calls[NDR_WINREG_DELETEKEY];
561         
562         r = talloc(NULL, struct winreg_DeleteKey);
563         if (r == NULL) {
564                 return False;
565         }
566         
567         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
568                 talloc_free(r);
569                 return False;
570         }
571         
572         pull = ndr_pull_init_blob(&blob, r);
573         if (pull == NULL) {
574                 talloc_free(r);
575                 return False;
576         }
577         
578         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
579         status = call->ndr_pull(pull, NDR_IN, r);
580         if (NT_STATUS_IS_ERR(status)) {
581                 talloc_free(r);
582                 return False;
583         }
584         
585         if (DEBUGLEVEL >= 10)
586                 NDR_PRINT_IN_DEBUG(winreg_DeleteKey, r);
587         
588         r->out.result = _winreg_DeleteKey(p, r);
589         
590         if (p->rng_fault_state) {
591                 talloc_free(r);
592                 /* Return True here, srv_pipe_hnd.c will take care */
593                 return True;
594         }
595         
596         if (DEBUGLEVEL >= 10)
597                 NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, r);
598         
599         push = ndr_push_init_ctx(r);
600         if (push == NULL) {
601                 talloc_free(r);
602                 return False;
603         }
604         
605         status = call->ndr_push(push, NDR_OUT, r);
606         if (NT_STATUS_IS_ERR(status)) {
607                 talloc_free(r);
608                 return False;
609         }
610         
611         blob = ndr_push_blob(push);
612         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
613                 talloc_free(r);
614                 return False;
615         }
616         
617         talloc_free(r);
618         
619         return True;
620 }
621
622 static bool api_winreg_DeleteValue(pipes_struct *p)
623 {
624         const struct ndr_interface_call *call;
625         struct ndr_pull *pull;
626         struct ndr_push *push;
627         NTSTATUS status;
628         DATA_BLOB blob;
629         struct winreg_DeleteValue *r;
630         
631         call = &ndr_table_winreg.calls[NDR_WINREG_DELETEVALUE];
632         
633         r = talloc(NULL, struct winreg_DeleteValue);
634         if (r == NULL) {
635                 return False;
636         }
637         
638         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
639                 talloc_free(r);
640                 return False;
641         }
642         
643         pull = ndr_pull_init_blob(&blob, r);
644         if (pull == NULL) {
645                 talloc_free(r);
646                 return False;
647         }
648         
649         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
650         status = call->ndr_pull(pull, NDR_IN, r);
651         if (NT_STATUS_IS_ERR(status)) {
652                 talloc_free(r);
653                 return False;
654         }
655         
656         if (DEBUGLEVEL >= 10)
657                 NDR_PRINT_IN_DEBUG(winreg_DeleteValue, r);
658         
659         r->out.result = _winreg_DeleteValue(p, r);
660         
661         if (p->rng_fault_state) {
662                 talloc_free(r);
663                 /* Return True here, srv_pipe_hnd.c will take care */
664                 return True;
665         }
666         
667         if (DEBUGLEVEL >= 10)
668                 NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, r);
669         
670         push = ndr_push_init_ctx(r);
671         if (push == NULL) {
672                 talloc_free(r);
673                 return False;
674         }
675         
676         status = call->ndr_push(push, NDR_OUT, r);
677         if (NT_STATUS_IS_ERR(status)) {
678                 talloc_free(r);
679                 return False;
680         }
681         
682         blob = ndr_push_blob(push);
683         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
684                 talloc_free(r);
685                 return False;
686         }
687         
688         talloc_free(r);
689         
690         return True;
691 }
692
693 static bool api_winreg_EnumKey(pipes_struct *p)
694 {
695         const struct ndr_interface_call *call;
696         struct ndr_pull *pull;
697         struct ndr_push *push;
698         NTSTATUS status;
699         DATA_BLOB blob;
700         struct winreg_EnumKey *r;
701         
702         call = &ndr_table_winreg.calls[NDR_WINREG_ENUMKEY];
703         
704         r = talloc(NULL, struct winreg_EnumKey);
705         if (r == NULL) {
706                 return False;
707         }
708         
709         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
710                 talloc_free(r);
711                 return False;
712         }
713         
714         pull = ndr_pull_init_blob(&blob, r);
715         if (pull == NULL) {
716                 talloc_free(r);
717                 return False;
718         }
719         
720         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
721         status = call->ndr_pull(pull, NDR_IN, r);
722         if (NT_STATUS_IS_ERR(status)) {
723                 talloc_free(r);
724                 return False;
725         }
726         
727         if (DEBUGLEVEL >= 10)
728                 NDR_PRINT_IN_DEBUG(winreg_EnumKey, r);
729         
730         ZERO_STRUCT(r->out);
731         r->out.name = r->in.name;
732         r->out.keyclass = r->in.keyclass;
733         r->out.last_changed_time = r->in.last_changed_time;
734         r->out.result = _winreg_EnumKey(p, r);
735         
736         if (p->rng_fault_state) {
737                 talloc_free(r);
738                 /* Return True here, srv_pipe_hnd.c will take care */
739                 return True;
740         }
741         
742         if (DEBUGLEVEL >= 10)
743                 NDR_PRINT_OUT_DEBUG(winreg_EnumKey, r);
744         
745         push = ndr_push_init_ctx(r);
746         if (push == NULL) {
747                 talloc_free(r);
748                 return False;
749         }
750         
751         status = call->ndr_push(push, NDR_OUT, r);
752         if (NT_STATUS_IS_ERR(status)) {
753                 talloc_free(r);
754                 return False;
755         }
756         
757         blob = ndr_push_blob(push);
758         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
759                 talloc_free(r);
760                 return False;
761         }
762         
763         talloc_free(r);
764         
765         return True;
766 }
767
768 static bool api_winreg_EnumValue(pipes_struct *p)
769 {
770         const struct ndr_interface_call *call;
771         struct ndr_pull *pull;
772         struct ndr_push *push;
773         NTSTATUS status;
774         DATA_BLOB blob;
775         struct winreg_EnumValue *r;
776         
777         call = &ndr_table_winreg.calls[NDR_WINREG_ENUMVALUE];
778         
779         r = talloc(NULL, struct winreg_EnumValue);
780         if (r == NULL) {
781                 return False;
782         }
783         
784         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
785                 talloc_free(r);
786                 return False;
787         }
788         
789         pull = ndr_pull_init_blob(&blob, r);
790         if (pull == NULL) {
791                 talloc_free(r);
792                 return False;
793         }
794         
795         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
796         status = call->ndr_pull(pull, NDR_IN, r);
797         if (NT_STATUS_IS_ERR(status)) {
798                 talloc_free(r);
799                 return False;
800         }
801         
802         if (DEBUGLEVEL >= 10)
803                 NDR_PRINT_IN_DEBUG(winreg_EnumValue, r);
804         
805         ZERO_STRUCT(r->out);
806         r->out.name = r->in.name;
807         r->out.type = r->in.type;
808         r->out.value = r->in.value;
809         r->out.size = r->in.size;
810         r->out.length = r->in.length;
811         r->out.result = _winreg_EnumValue(p, r);
812         
813         if (p->rng_fault_state) {
814                 talloc_free(r);
815                 /* Return True here, srv_pipe_hnd.c will take care */
816                 return True;
817         }
818         
819         if (DEBUGLEVEL >= 10)
820                 NDR_PRINT_OUT_DEBUG(winreg_EnumValue, r);
821         
822         push = ndr_push_init_ctx(r);
823         if (push == NULL) {
824                 talloc_free(r);
825                 return False;
826         }
827         
828         status = call->ndr_push(push, NDR_OUT, r);
829         if (NT_STATUS_IS_ERR(status)) {
830                 talloc_free(r);
831                 return False;
832         }
833         
834         blob = ndr_push_blob(push);
835         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
836                 talloc_free(r);
837                 return False;
838         }
839         
840         talloc_free(r);
841         
842         return True;
843 }
844
845 static bool api_winreg_FlushKey(pipes_struct *p)
846 {
847         const struct ndr_interface_call *call;
848         struct ndr_pull *pull;
849         struct ndr_push *push;
850         NTSTATUS status;
851         DATA_BLOB blob;
852         struct winreg_FlushKey *r;
853         
854         call = &ndr_table_winreg.calls[NDR_WINREG_FLUSHKEY];
855         
856         r = talloc(NULL, struct winreg_FlushKey);
857         if (r == NULL) {
858                 return False;
859         }
860         
861         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
862                 talloc_free(r);
863                 return False;
864         }
865         
866         pull = ndr_pull_init_blob(&blob, r);
867         if (pull == NULL) {
868                 talloc_free(r);
869                 return False;
870         }
871         
872         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
873         status = call->ndr_pull(pull, NDR_IN, r);
874         if (NT_STATUS_IS_ERR(status)) {
875                 talloc_free(r);
876                 return False;
877         }
878         
879         if (DEBUGLEVEL >= 10)
880                 NDR_PRINT_IN_DEBUG(winreg_FlushKey, r);
881         
882         r->out.result = _winreg_FlushKey(p, r);
883         
884         if (p->rng_fault_state) {
885                 talloc_free(r);
886                 /* Return True here, srv_pipe_hnd.c will take care */
887                 return True;
888         }
889         
890         if (DEBUGLEVEL >= 10)
891                 NDR_PRINT_OUT_DEBUG(winreg_FlushKey, r);
892         
893         push = ndr_push_init_ctx(r);
894         if (push == NULL) {
895                 talloc_free(r);
896                 return False;
897         }
898         
899         status = call->ndr_push(push, NDR_OUT, r);
900         if (NT_STATUS_IS_ERR(status)) {
901                 talloc_free(r);
902                 return False;
903         }
904         
905         blob = ndr_push_blob(push);
906         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
907                 talloc_free(r);
908                 return False;
909         }
910         
911         talloc_free(r);
912         
913         return True;
914 }
915
916 static bool api_winreg_GetKeySecurity(pipes_struct *p)
917 {
918         const struct ndr_interface_call *call;
919         struct ndr_pull *pull;
920         struct ndr_push *push;
921         NTSTATUS status;
922         DATA_BLOB blob;
923         struct winreg_GetKeySecurity *r;
924         
925         call = &ndr_table_winreg.calls[NDR_WINREG_GETKEYSECURITY];
926         
927         r = talloc(NULL, struct winreg_GetKeySecurity);
928         if (r == NULL) {
929                 return False;
930         }
931         
932         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
933                 talloc_free(r);
934                 return False;
935         }
936         
937         pull = ndr_pull_init_blob(&blob, r);
938         if (pull == NULL) {
939                 talloc_free(r);
940                 return False;
941         }
942         
943         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
944         status = call->ndr_pull(pull, NDR_IN, r);
945         if (NT_STATUS_IS_ERR(status)) {
946                 talloc_free(r);
947                 return False;
948         }
949         
950         if (DEBUGLEVEL >= 10)
951                 NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, r);
952         
953         ZERO_STRUCT(r->out);
954         r->out.sd = r->in.sd;
955         r->out.result = _winreg_GetKeySecurity(p, r);
956         
957         if (p->rng_fault_state) {
958                 talloc_free(r);
959                 /* Return True here, srv_pipe_hnd.c will take care */
960                 return True;
961         }
962         
963         if (DEBUGLEVEL >= 10)
964                 NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, r);
965         
966         push = ndr_push_init_ctx(r);
967         if (push == NULL) {
968                 talloc_free(r);
969                 return False;
970         }
971         
972         status = call->ndr_push(push, NDR_OUT, r);
973         if (NT_STATUS_IS_ERR(status)) {
974                 talloc_free(r);
975                 return False;
976         }
977         
978         blob = ndr_push_blob(push);
979         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
980                 talloc_free(r);
981                 return False;
982         }
983         
984         talloc_free(r);
985         
986         return True;
987 }
988
989 static bool api_winreg_LoadKey(pipes_struct *p)
990 {
991         const struct ndr_interface_call *call;
992         struct ndr_pull *pull;
993         struct ndr_push *push;
994         NTSTATUS status;
995         DATA_BLOB blob;
996         struct winreg_LoadKey *r;
997         
998         call = &ndr_table_winreg.calls[NDR_WINREG_LOADKEY];
999         
1000         r = talloc(NULL, struct winreg_LoadKey);
1001         if (r == NULL) {
1002                 return False;
1003         }
1004         
1005         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1006                 talloc_free(r);
1007                 return False;
1008         }
1009         
1010         pull = ndr_pull_init_blob(&blob, r);
1011         if (pull == NULL) {
1012                 talloc_free(r);
1013                 return False;
1014         }
1015         
1016         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1017         status = call->ndr_pull(pull, NDR_IN, r);
1018         if (NT_STATUS_IS_ERR(status)) {
1019                 talloc_free(r);
1020                 return False;
1021         }
1022         
1023         if (DEBUGLEVEL >= 10)
1024                 NDR_PRINT_IN_DEBUG(winreg_LoadKey, r);
1025         
1026         r->out.result = _winreg_LoadKey(p, r);
1027         
1028         if (p->rng_fault_state) {
1029                 talloc_free(r);
1030                 /* Return True here, srv_pipe_hnd.c will take care */
1031                 return True;
1032         }
1033         
1034         if (DEBUGLEVEL >= 10)
1035                 NDR_PRINT_OUT_DEBUG(winreg_LoadKey, r);
1036         
1037         push = ndr_push_init_ctx(r);
1038         if (push == NULL) {
1039                 talloc_free(r);
1040                 return False;
1041         }
1042         
1043         status = call->ndr_push(push, NDR_OUT, r);
1044         if (NT_STATUS_IS_ERR(status)) {
1045                 talloc_free(r);
1046                 return False;
1047         }
1048         
1049         blob = ndr_push_blob(push);
1050         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1051                 talloc_free(r);
1052                 return False;
1053         }
1054         
1055         talloc_free(r);
1056         
1057         return True;
1058 }
1059
1060 static bool api_winreg_NotifyChangeKeyValue(pipes_struct *p)
1061 {
1062         const struct ndr_interface_call *call;
1063         struct ndr_pull *pull;
1064         struct ndr_push *push;
1065         NTSTATUS status;
1066         DATA_BLOB blob;
1067         struct winreg_NotifyChangeKeyValue *r;
1068         
1069         call = &ndr_table_winreg.calls[NDR_WINREG_NOTIFYCHANGEKEYVALUE];
1070         
1071         r = talloc(NULL, struct winreg_NotifyChangeKeyValue);
1072         if (r == NULL) {
1073                 return False;
1074         }
1075         
1076         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1077                 talloc_free(r);
1078                 return False;
1079         }
1080         
1081         pull = ndr_pull_init_blob(&blob, r);
1082         if (pull == NULL) {
1083                 talloc_free(r);
1084                 return False;
1085         }
1086         
1087         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1088         status = call->ndr_pull(pull, NDR_IN, r);
1089         if (NT_STATUS_IS_ERR(status)) {
1090                 talloc_free(r);
1091                 return False;
1092         }
1093         
1094         if (DEBUGLEVEL >= 10)
1095                 NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, r);
1096         
1097         r->out.result = _winreg_NotifyChangeKeyValue(p, r);
1098         
1099         if (p->rng_fault_state) {
1100                 talloc_free(r);
1101                 /* Return True here, srv_pipe_hnd.c will take care */
1102                 return True;
1103         }
1104         
1105         if (DEBUGLEVEL >= 10)
1106                 NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, r);
1107         
1108         push = ndr_push_init_ctx(r);
1109         if (push == NULL) {
1110                 talloc_free(r);
1111                 return False;
1112         }
1113         
1114         status = call->ndr_push(push, NDR_OUT, r);
1115         if (NT_STATUS_IS_ERR(status)) {
1116                 talloc_free(r);
1117                 return False;
1118         }
1119         
1120         blob = ndr_push_blob(push);
1121         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1122                 talloc_free(r);
1123                 return False;
1124         }
1125         
1126         talloc_free(r);
1127         
1128         return True;
1129 }
1130
1131 static bool api_winreg_OpenKey(pipes_struct *p)
1132 {
1133         const struct ndr_interface_call *call;
1134         struct ndr_pull *pull;
1135         struct ndr_push *push;
1136         NTSTATUS status;
1137         DATA_BLOB blob;
1138         struct winreg_OpenKey *r;
1139         
1140         call = &ndr_table_winreg.calls[NDR_WINREG_OPENKEY];
1141         
1142         r = talloc(NULL, struct winreg_OpenKey);
1143         if (r == NULL) {
1144                 return False;
1145         }
1146         
1147         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1148                 talloc_free(r);
1149                 return False;
1150         }
1151         
1152         pull = ndr_pull_init_blob(&blob, r);
1153         if (pull == NULL) {
1154                 talloc_free(r);
1155                 return False;
1156         }
1157         
1158         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1159         status = call->ndr_pull(pull, NDR_IN, r);
1160         if (NT_STATUS_IS_ERR(status)) {
1161                 talloc_free(r);
1162                 return False;
1163         }
1164         
1165         if (DEBUGLEVEL >= 10)
1166                 NDR_PRINT_IN_DEBUG(winreg_OpenKey, r);
1167         
1168         ZERO_STRUCT(r->out);
1169         r->out.handle = talloc_zero(r, struct policy_handle);
1170         if (r->out.handle == NULL) {
1171                 talloc_free(r);
1172                 return False;
1173         }
1174         
1175         r->out.result = _winreg_OpenKey(p, r);
1176         
1177         if (p->rng_fault_state) {
1178                 talloc_free(r);
1179                 /* Return True here, srv_pipe_hnd.c will take care */
1180                 return True;
1181         }
1182         
1183         if (DEBUGLEVEL >= 10)
1184                 NDR_PRINT_OUT_DEBUG(winreg_OpenKey, r);
1185         
1186         push = ndr_push_init_ctx(r);
1187         if (push == NULL) {
1188                 talloc_free(r);
1189                 return False;
1190         }
1191         
1192         status = call->ndr_push(push, NDR_OUT, r);
1193         if (NT_STATUS_IS_ERR(status)) {
1194                 talloc_free(r);
1195                 return False;
1196         }
1197         
1198         blob = ndr_push_blob(push);
1199         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1200                 talloc_free(r);
1201                 return False;
1202         }
1203         
1204         talloc_free(r);
1205         
1206         return True;
1207 }
1208
1209 static bool api_winreg_QueryInfoKey(pipes_struct *p)
1210 {
1211         const struct ndr_interface_call *call;
1212         struct ndr_pull *pull;
1213         struct ndr_push *push;
1214         NTSTATUS status;
1215         DATA_BLOB blob;
1216         struct winreg_QueryInfoKey *r;
1217         
1218         call = &ndr_table_winreg.calls[NDR_WINREG_QUERYINFOKEY];
1219         
1220         r = talloc(NULL, struct winreg_QueryInfoKey);
1221         if (r == NULL) {
1222                 return False;
1223         }
1224         
1225         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1226                 talloc_free(r);
1227                 return False;
1228         }
1229         
1230         pull = ndr_pull_init_blob(&blob, r);
1231         if (pull == NULL) {
1232                 talloc_free(r);
1233                 return False;
1234         }
1235         
1236         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1237         status = call->ndr_pull(pull, NDR_IN, r);
1238         if (NT_STATUS_IS_ERR(status)) {
1239                 talloc_free(r);
1240                 return False;
1241         }
1242         
1243         if (DEBUGLEVEL >= 10)
1244                 NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, r);
1245         
1246         ZERO_STRUCT(r->out);
1247         r->out.classname = r->in.classname;
1248         r->out.num_subkeys = talloc_zero(r, uint32_t);
1249         if (r->out.num_subkeys == NULL) {
1250                 talloc_free(r);
1251                 return False;
1252         }
1253         
1254         r->out.max_subkeylen = talloc_zero(r, uint32_t);
1255         if (r->out.max_subkeylen == NULL) {
1256                 talloc_free(r);
1257                 return False;
1258         }
1259         
1260         r->out.max_classlen = talloc_zero(r, uint32_t);
1261         if (r->out.max_classlen == NULL) {
1262                 talloc_free(r);
1263                 return False;
1264         }
1265         
1266         r->out.num_values = talloc_zero(r, uint32_t);
1267         if (r->out.num_values == NULL) {
1268                 talloc_free(r);
1269                 return False;
1270         }
1271         
1272         r->out.max_valnamelen = talloc_zero(r, uint32_t);
1273         if (r->out.max_valnamelen == NULL) {
1274                 talloc_free(r);
1275                 return False;
1276         }
1277         
1278         r->out.max_valbufsize = talloc_zero(r, uint32_t);
1279         if (r->out.max_valbufsize == NULL) {
1280                 talloc_free(r);
1281                 return False;
1282         }
1283         
1284         r->out.secdescsize = talloc_zero(r, uint32_t);
1285         if (r->out.secdescsize == NULL) {
1286                 talloc_free(r);
1287                 return False;
1288         }
1289         
1290         r->out.last_changed_time = talloc_zero(r, NTTIME);
1291         if (r->out.last_changed_time == NULL) {
1292                 talloc_free(r);
1293                 return False;
1294         }
1295         
1296         r->out.result = _winreg_QueryInfoKey(p, r);
1297         
1298         if (p->rng_fault_state) {
1299                 talloc_free(r);
1300                 /* Return True here, srv_pipe_hnd.c will take care */
1301                 return True;
1302         }
1303         
1304         if (DEBUGLEVEL >= 10)
1305                 NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, r);
1306         
1307         push = ndr_push_init_ctx(r);
1308         if (push == NULL) {
1309                 talloc_free(r);
1310                 return False;
1311         }
1312         
1313         status = call->ndr_push(push, NDR_OUT, r);
1314         if (NT_STATUS_IS_ERR(status)) {
1315                 talloc_free(r);
1316                 return False;
1317         }
1318         
1319         blob = ndr_push_blob(push);
1320         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1321                 talloc_free(r);
1322                 return False;
1323         }
1324         
1325         talloc_free(r);
1326         
1327         return True;
1328 }
1329
1330 static bool api_winreg_QueryValue(pipes_struct *p)
1331 {
1332         const struct ndr_interface_call *call;
1333         struct ndr_pull *pull;
1334         struct ndr_push *push;
1335         NTSTATUS status;
1336         DATA_BLOB blob;
1337         struct winreg_QueryValue *r;
1338         
1339         call = &ndr_table_winreg.calls[NDR_WINREG_QUERYVALUE];
1340         
1341         r = talloc(NULL, struct winreg_QueryValue);
1342         if (r == NULL) {
1343                 return False;
1344         }
1345         
1346         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1347                 talloc_free(r);
1348                 return False;
1349         }
1350         
1351         pull = ndr_pull_init_blob(&blob, r);
1352         if (pull == NULL) {
1353                 talloc_free(r);
1354                 return False;
1355         }
1356         
1357         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1358         status = call->ndr_pull(pull, NDR_IN, r);
1359         if (NT_STATUS_IS_ERR(status)) {
1360                 talloc_free(r);
1361                 return False;
1362         }
1363         
1364         if (DEBUGLEVEL >= 10)
1365                 NDR_PRINT_IN_DEBUG(winreg_QueryValue, r);
1366         
1367         ZERO_STRUCT(r->out);
1368         r->out.type = r->in.type;
1369         r->out.data = r->in.data;
1370         r->out.data_size = r->in.data_size;
1371         r->out.value_length = r->in.value_length;
1372         r->out.result = _winreg_QueryValue(p, r);
1373         
1374         if (p->rng_fault_state) {
1375                 talloc_free(r);
1376                 /* Return True here, srv_pipe_hnd.c will take care */
1377                 return True;
1378         }
1379         
1380         if (DEBUGLEVEL >= 10)
1381                 NDR_PRINT_OUT_DEBUG(winreg_QueryValue, r);
1382         
1383         push = ndr_push_init_ctx(r);
1384         if (push == NULL) {
1385                 talloc_free(r);
1386                 return False;
1387         }
1388         
1389         status = call->ndr_push(push, NDR_OUT, r);
1390         if (NT_STATUS_IS_ERR(status)) {
1391                 talloc_free(r);
1392                 return False;
1393         }
1394         
1395         blob = ndr_push_blob(push);
1396         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1397                 talloc_free(r);
1398                 return False;
1399         }
1400         
1401         talloc_free(r);
1402         
1403         return True;
1404 }
1405
1406 static bool api_winreg_ReplaceKey(pipes_struct *p)
1407 {
1408         const struct ndr_interface_call *call;
1409         struct ndr_pull *pull;
1410         struct ndr_push *push;
1411         NTSTATUS status;
1412         DATA_BLOB blob;
1413         struct winreg_ReplaceKey *r;
1414         
1415         call = &ndr_table_winreg.calls[NDR_WINREG_REPLACEKEY];
1416         
1417         r = talloc(NULL, struct winreg_ReplaceKey);
1418         if (r == NULL) {
1419                 return False;
1420         }
1421         
1422         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1423                 talloc_free(r);
1424                 return False;
1425         }
1426         
1427         pull = ndr_pull_init_blob(&blob, r);
1428         if (pull == NULL) {
1429                 talloc_free(r);
1430                 return False;
1431         }
1432         
1433         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1434         status = call->ndr_pull(pull, NDR_IN, r);
1435         if (NT_STATUS_IS_ERR(status)) {
1436                 talloc_free(r);
1437                 return False;
1438         }
1439         
1440         if (DEBUGLEVEL >= 10)
1441                 NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, r);
1442         
1443         r->out.result = _winreg_ReplaceKey(p, r);
1444         
1445         if (p->rng_fault_state) {
1446                 talloc_free(r);
1447                 /* Return True here, srv_pipe_hnd.c will take care */
1448                 return True;
1449         }
1450         
1451         if (DEBUGLEVEL >= 10)
1452                 NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, r);
1453         
1454         push = ndr_push_init_ctx(r);
1455         if (push == NULL) {
1456                 talloc_free(r);
1457                 return False;
1458         }
1459         
1460         status = call->ndr_push(push, NDR_OUT, r);
1461         if (NT_STATUS_IS_ERR(status)) {
1462                 talloc_free(r);
1463                 return False;
1464         }
1465         
1466         blob = ndr_push_blob(push);
1467         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1468                 talloc_free(r);
1469                 return False;
1470         }
1471         
1472         talloc_free(r);
1473         
1474         return True;
1475 }
1476
1477 static bool api_winreg_RestoreKey(pipes_struct *p)
1478 {
1479         const struct ndr_interface_call *call;
1480         struct ndr_pull *pull;
1481         struct ndr_push *push;
1482         NTSTATUS status;
1483         DATA_BLOB blob;
1484         struct winreg_RestoreKey *r;
1485         
1486         call = &ndr_table_winreg.calls[NDR_WINREG_RESTOREKEY];
1487         
1488         r = talloc(NULL, struct winreg_RestoreKey);
1489         if (r == NULL) {
1490                 return False;
1491         }
1492         
1493         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1494                 talloc_free(r);
1495                 return False;
1496         }
1497         
1498         pull = ndr_pull_init_blob(&blob, r);
1499         if (pull == NULL) {
1500                 talloc_free(r);
1501                 return False;
1502         }
1503         
1504         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1505         status = call->ndr_pull(pull, NDR_IN, r);
1506         if (NT_STATUS_IS_ERR(status)) {
1507                 talloc_free(r);
1508                 return False;
1509         }
1510         
1511         if (DEBUGLEVEL >= 10)
1512                 NDR_PRINT_IN_DEBUG(winreg_RestoreKey, r);
1513         
1514         r->out.result = _winreg_RestoreKey(p, r);
1515         
1516         if (p->rng_fault_state) {
1517                 talloc_free(r);
1518                 /* Return True here, srv_pipe_hnd.c will take care */
1519                 return True;
1520         }
1521         
1522         if (DEBUGLEVEL >= 10)
1523                 NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, r);
1524         
1525         push = ndr_push_init_ctx(r);
1526         if (push == NULL) {
1527                 talloc_free(r);
1528                 return False;
1529         }
1530         
1531         status = call->ndr_push(push, NDR_OUT, r);
1532         if (NT_STATUS_IS_ERR(status)) {
1533                 talloc_free(r);
1534                 return False;
1535         }
1536         
1537         blob = ndr_push_blob(push);
1538         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1539                 talloc_free(r);
1540                 return False;
1541         }
1542         
1543         talloc_free(r);
1544         
1545         return True;
1546 }
1547
1548 static bool api_winreg_SaveKey(pipes_struct *p)
1549 {
1550         const struct ndr_interface_call *call;
1551         struct ndr_pull *pull;
1552         struct ndr_push *push;
1553         NTSTATUS status;
1554         DATA_BLOB blob;
1555         struct winreg_SaveKey *r;
1556         
1557         call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEY];
1558         
1559         r = talloc(NULL, struct winreg_SaveKey);
1560         if (r == NULL) {
1561                 return False;
1562         }
1563         
1564         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1565                 talloc_free(r);
1566                 return False;
1567         }
1568         
1569         pull = ndr_pull_init_blob(&blob, r);
1570         if (pull == NULL) {
1571                 talloc_free(r);
1572                 return False;
1573         }
1574         
1575         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1576         status = call->ndr_pull(pull, NDR_IN, r);
1577         if (NT_STATUS_IS_ERR(status)) {
1578                 talloc_free(r);
1579                 return False;
1580         }
1581         
1582         if (DEBUGLEVEL >= 10)
1583                 NDR_PRINT_IN_DEBUG(winreg_SaveKey, r);
1584         
1585         r->out.result = _winreg_SaveKey(p, r);
1586         
1587         if (p->rng_fault_state) {
1588                 talloc_free(r);
1589                 /* Return True here, srv_pipe_hnd.c will take care */
1590                 return True;
1591         }
1592         
1593         if (DEBUGLEVEL >= 10)
1594                 NDR_PRINT_OUT_DEBUG(winreg_SaveKey, r);
1595         
1596         push = ndr_push_init_ctx(r);
1597         if (push == NULL) {
1598                 talloc_free(r);
1599                 return False;
1600         }
1601         
1602         status = call->ndr_push(push, NDR_OUT, r);
1603         if (NT_STATUS_IS_ERR(status)) {
1604                 talloc_free(r);
1605                 return False;
1606         }
1607         
1608         blob = ndr_push_blob(push);
1609         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1610                 talloc_free(r);
1611                 return False;
1612         }
1613         
1614         talloc_free(r);
1615         
1616         return True;
1617 }
1618
1619 static bool api_winreg_SetKeySecurity(pipes_struct *p)
1620 {
1621         const struct ndr_interface_call *call;
1622         struct ndr_pull *pull;
1623         struct ndr_push *push;
1624         NTSTATUS status;
1625         DATA_BLOB blob;
1626         struct winreg_SetKeySecurity *r;
1627         
1628         call = &ndr_table_winreg.calls[NDR_WINREG_SETKEYSECURITY];
1629         
1630         r = talloc(NULL, struct winreg_SetKeySecurity);
1631         if (r == NULL) {
1632                 return False;
1633         }
1634         
1635         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1636                 talloc_free(r);
1637                 return False;
1638         }
1639         
1640         pull = ndr_pull_init_blob(&blob, r);
1641         if (pull == NULL) {
1642                 talloc_free(r);
1643                 return False;
1644         }
1645         
1646         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1647         status = call->ndr_pull(pull, NDR_IN, r);
1648         if (NT_STATUS_IS_ERR(status)) {
1649                 talloc_free(r);
1650                 return False;
1651         }
1652         
1653         if (DEBUGLEVEL >= 10)
1654                 NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, r);
1655         
1656         r->out.result = _winreg_SetKeySecurity(p, r);
1657         
1658         if (p->rng_fault_state) {
1659                 talloc_free(r);
1660                 /* Return True here, srv_pipe_hnd.c will take care */
1661                 return True;
1662         }
1663         
1664         if (DEBUGLEVEL >= 10)
1665                 NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, r);
1666         
1667         push = ndr_push_init_ctx(r);
1668         if (push == NULL) {
1669                 talloc_free(r);
1670                 return False;
1671         }
1672         
1673         status = call->ndr_push(push, NDR_OUT, r);
1674         if (NT_STATUS_IS_ERR(status)) {
1675                 talloc_free(r);
1676                 return False;
1677         }
1678         
1679         blob = ndr_push_blob(push);
1680         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1681                 talloc_free(r);
1682                 return False;
1683         }
1684         
1685         talloc_free(r);
1686         
1687         return True;
1688 }
1689
1690 static bool api_winreg_SetValue(pipes_struct *p)
1691 {
1692         const struct ndr_interface_call *call;
1693         struct ndr_pull *pull;
1694         struct ndr_push *push;
1695         NTSTATUS status;
1696         DATA_BLOB blob;
1697         struct winreg_SetValue *r;
1698         
1699         call = &ndr_table_winreg.calls[NDR_WINREG_SETVALUE];
1700         
1701         r = talloc(NULL, struct winreg_SetValue);
1702         if (r == NULL) {
1703                 return False;
1704         }
1705         
1706         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1707                 talloc_free(r);
1708                 return False;
1709         }
1710         
1711         pull = ndr_pull_init_blob(&blob, r);
1712         if (pull == NULL) {
1713                 talloc_free(r);
1714                 return False;
1715         }
1716         
1717         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1718         status = call->ndr_pull(pull, NDR_IN, r);
1719         if (NT_STATUS_IS_ERR(status)) {
1720                 talloc_free(r);
1721                 return False;
1722         }
1723         
1724         if (DEBUGLEVEL >= 10)
1725                 NDR_PRINT_IN_DEBUG(winreg_SetValue, r);
1726         
1727         r->out.result = _winreg_SetValue(p, r);
1728         
1729         if (p->rng_fault_state) {
1730                 talloc_free(r);
1731                 /* Return True here, srv_pipe_hnd.c will take care */
1732                 return True;
1733         }
1734         
1735         if (DEBUGLEVEL >= 10)
1736                 NDR_PRINT_OUT_DEBUG(winreg_SetValue, r);
1737         
1738         push = ndr_push_init_ctx(r);
1739         if (push == NULL) {
1740                 talloc_free(r);
1741                 return False;
1742         }
1743         
1744         status = call->ndr_push(push, NDR_OUT, r);
1745         if (NT_STATUS_IS_ERR(status)) {
1746                 talloc_free(r);
1747                 return False;
1748         }
1749         
1750         blob = ndr_push_blob(push);
1751         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1752                 talloc_free(r);
1753                 return False;
1754         }
1755         
1756         talloc_free(r);
1757         
1758         return True;
1759 }
1760
1761 static bool api_winreg_UnLoadKey(pipes_struct *p)
1762 {
1763         const struct ndr_interface_call *call;
1764         struct ndr_pull *pull;
1765         struct ndr_push *push;
1766         NTSTATUS status;
1767         DATA_BLOB blob;
1768         struct winreg_UnLoadKey *r;
1769         
1770         call = &ndr_table_winreg.calls[NDR_WINREG_UNLOADKEY];
1771         
1772         r = talloc(NULL, struct winreg_UnLoadKey);
1773         if (r == NULL) {
1774                 return False;
1775         }
1776         
1777         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1778                 talloc_free(r);
1779                 return False;
1780         }
1781         
1782         pull = ndr_pull_init_blob(&blob, r);
1783         if (pull == NULL) {
1784                 talloc_free(r);
1785                 return False;
1786         }
1787         
1788         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1789         status = call->ndr_pull(pull, NDR_IN, r);
1790         if (NT_STATUS_IS_ERR(status)) {
1791                 talloc_free(r);
1792                 return False;
1793         }
1794         
1795         if (DEBUGLEVEL >= 10)
1796                 NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, r);
1797         
1798         r->out.result = _winreg_UnLoadKey(p, r);
1799         
1800         if (p->rng_fault_state) {
1801                 talloc_free(r);
1802                 /* Return True here, srv_pipe_hnd.c will take care */
1803                 return True;
1804         }
1805         
1806         if (DEBUGLEVEL >= 10)
1807                 NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, r);
1808         
1809         push = ndr_push_init_ctx(r);
1810         if (push == NULL) {
1811                 talloc_free(r);
1812                 return False;
1813         }
1814         
1815         status = call->ndr_push(push, NDR_OUT, r);
1816         if (NT_STATUS_IS_ERR(status)) {
1817                 talloc_free(r);
1818                 return False;
1819         }
1820         
1821         blob = ndr_push_blob(push);
1822         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1823                 talloc_free(r);
1824                 return False;
1825         }
1826         
1827         talloc_free(r);
1828         
1829         return True;
1830 }
1831
1832 static bool api_winreg_InitiateSystemShutdown(pipes_struct *p)
1833 {
1834         const struct ndr_interface_call *call;
1835         struct ndr_pull *pull;
1836         struct ndr_push *push;
1837         NTSTATUS status;
1838         DATA_BLOB blob;
1839         struct winreg_InitiateSystemShutdown *r;
1840         
1841         call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWN];
1842         
1843         r = talloc(NULL, struct winreg_InitiateSystemShutdown);
1844         if (r == NULL) {
1845                 return False;
1846         }
1847         
1848         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1849                 talloc_free(r);
1850                 return False;
1851         }
1852         
1853         pull = ndr_pull_init_blob(&blob, r);
1854         if (pull == NULL) {
1855                 talloc_free(r);
1856                 return False;
1857         }
1858         
1859         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1860         status = call->ndr_pull(pull, NDR_IN, r);
1861         if (NT_STATUS_IS_ERR(status)) {
1862                 talloc_free(r);
1863                 return False;
1864         }
1865         
1866         if (DEBUGLEVEL >= 10)
1867                 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, r);
1868         
1869         r->out.result = _winreg_InitiateSystemShutdown(p, r);
1870         
1871         if (p->rng_fault_state) {
1872                 talloc_free(r);
1873                 /* Return True here, srv_pipe_hnd.c will take care */
1874                 return True;
1875         }
1876         
1877         if (DEBUGLEVEL >= 10)
1878                 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, r);
1879         
1880         push = ndr_push_init_ctx(r);
1881         if (push == NULL) {
1882                 talloc_free(r);
1883                 return False;
1884         }
1885         
1886         status = call->ndr_push(push, NDR_OUT, r);
1887         if (NT_STATUS_IS_ERR(status)) {
1888                 talloc_free(r);
1889                 return False;
1890         }
1891         
1892         blob = ndr_push_blob(push);
1893         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1894                 talloc_free(r);
1895                 return False;
1896         }
1897         
1898         talloc_free(r);
1899         
1900         return True;
1901 }
1902
1903 static bool api_winreg_AbortSystemShutdown(pipes_struct *p)
1904 {
1905         const struct ndr_interface_call *call;
1906         struct ndr_pull *pull;
1907         struct ndr_push *push;
1908         NTSTATUS status;
1909         DATA_BLOB blob;
1910         struct winreg_AbortSystemShutdown *r;
1911         
1912         call = &ndr_table_winreg.calls[NDR_WINREG_ABORTSYSTEMSHUTDOWN];
1913         
1914         r = talloc(NULL, struct winreg_AbortSystemShutdown);
1915         if (r == NULL) {
1916                 return False;
1917         }
1918         
1919         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1920                 talloc_free(r);
1921                 return False;
1922         }
1923         
1924         pull = ndr_pull_init_blob(&blob, r);
1925         if (pull == NULL) {
1926                 talloc_free(r);
1927                 return False;
1928         }
1929         
1930         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1931         status = call->ndr_pull(pull, NDR_IN, r);
1932         if (NT_STATUS_IS_ERR(status)) {
1933                 talloc_free(r);
1934                 return False;
1935         }
1936         
1937         if (DEBUGLEVEL >= 10)
1938                 NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, r);
1939         
1940         r->out.result = _winreg_AbortSystemShutdown(p, r);
1941         
1942         if (p->rng_fault_state) {
1943                 talloc_free(r);
1944                 /* Return True here, srv_pipe_hnd.c will take care */
1945                 return True;
1946         }
1947         
1948         if (DEBUGLEVEL >= 10)
1949                 NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, r);
1950         
1951         push = ndr_push_init_ctx(r);
1952         if (push == NULL) {
1953                 talloc_free(r);
1954                 return False;
1955         }
1956         
1957         status = call->ndr_push(push, NDR_OUT, r);
1958         if (NT_STATUS_IS_ERR(status)) {
1959                 talloc_free(r);
1960                 return False;
1961         }
1962         
1963         blob = ndr_push_blob(push);
1964         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
1965                 talloc_free(r);
1966                 return False;
1967         }
1968         
1969         talloc_free(r);
1970         
1971         return True;
1972 }
1973
1974 static bool api_winreg_GetVersion(pipes_struct *p)
1975 {
1976         const struct ndr_interface_call *call;
1977         struct ndr_pull *pull;
1978         struct ndr_push *push;
1979         NTSTATUS status;
1980         DATA_BLOB blob;
1981         struct winreg_GetVersion *r;
1982         
1983         call = &ndr_table_winreg.calls[NDR_WINREG_GETVERSION];
1984         
1985         r = talloc(NULL, struct winreg_GetVersion);
1986         if (r == NULL) {
1987                 return False;
1988         }
1989         
1990         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1991                 talloc_free(r);
1992                 return False;
1993         }
1994         
1995         pull = ndr_pull_init_blob(&blob, r);
1996         if (pull == NULL) {
1997                 talloc_free(r);
1998                 return False;
1999         }
2000         
2001         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2002         status = call->ndr_pull(pull, NDR_IN, r);
2003         if (NT_STATUS_IS_ERR(status)) {
2004                 talloc_free(r);
2005                 return False;
2006         }
2007         
2008         if (DEBUGLEVEL >= 10)
2009                 NDR_PRINT_IN_DEBUG(winreg_GetVersion, r);
2010         
2011         ZERO_STRUCT(r->out);
2012         r->out.version = talloc_zero(r, uint32_t);
2013         if (r->out.version == NULL) {
2014                 talloc_free(r);
2015                 return False;
2016         }
2017         
2018         r->out.result = _winreg_GetVersion(p, r);
2019         
2020         if (p->rng_fault_state) {
2021                 talloc_free(r);
2022                 /* Return True here, srv_pipe_hnd.c will take care */
2023                 return True;
2024         }
2025         
2026         if (DEBUGLEVEL >= 10)
2027                 NDR_PRINT_OUT_DEBUG(winreg_GetVersion, r);
2028         
2029         push = ndr_push_init_ctx(r);
2030         if (push == NULL) {
2031                 talloc_free(r);
2032                 return False;
2033         }
2034         
2035         status = call->ndr_push(push, NDR_OUT, r);
2036         if (NT_STATUS_IS_ERR(status)) {
2037                 talloc_free(r);
2038                 return False;
2039         }
2040         
2041         blob = ndr_push_blob(push);
2042         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2043                 talloc_free(r);
2044                 return False;
2045         }
2046         
2047         talloc_free(r);
2048         
2049         return True;
2050 }
2051
2052 static bool api_winreg_OpenHKCC(pipes_struct *p)
2053 {
2054         const struct ndr_interface_call *call;
2055         struct ndr_pull *pull;
2056         struct ndr_push *push;
2057         NTSTATUS status;
2058         DATA_BLOB blob;
2059         struct winreg_OpenHKCC *r;
2060         
2061         call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCC];
2062         
2063         r = talloc(NULL, struct winreg_OpenHKCC);
2064         if (r == NULL) {
2065                 return False;
2066         }
2067         
2068         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2069                 talloc_free(r);
2070                 return False;
2071         }
2072         
2073         pull = ndr_pull_init_blob(&blob, r);
2074         if (pull == NULL) {
2075                 talloc_free(r);
2076                 return False;
2077         }
2078         
2079         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2080         status = call->ndr_pull(pull, NDR_IN, r);
2081         if (NT_STATUS_IS_ERR(status)) {
2082                 talloc_free(r);
2083                 return False;
2084         }
2085         
2086         if (DEBUGLEVEL >= 10)
2087                 NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, r);
2088         
2089         ZERO_STRUCT(r->out);
2090         r->out.handle = talloc_zero(r, struct policy_handle);
2091         if (r->out.handle == NULL) {
2092                 talloc_free(r);
2093                 return False;
2094         }
2095         
2096         r->out.result = _winreg_OpenHKCC(p, r);
2097         
2098         if (p->rng_fault_state) {
2099                 talloc_free(r);
2100                 /* Return True here, srv_pipe_hnd.c will take care */
2101                 return True;
2102         }
2103         
2104         if (DEBUGLEVEL >= 10)
2105                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, r);
2106         
2107         push = ndr_push_init_ctx(r);
2108         if (push == NULL) {
2109                 talloc_free(r);
2110                 return False;
2111         }
2112         
2113         status = call->ndr_push(push, NDR_OUT, r);
2114         if (NT_STATUS_IS_ERR(status)) {
2115                 talloc_free(r);
2116                 return False;
2117         }
2118         
2119         blob = ndr_push_blob(push);
2120         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2121                 talloc_free(r);
2122                 return False;
2123         }
2124         
2125         talloc_free(r);
2126         
2127         return True;
2128 }
2129
2130 static bool api_winreg_OpenHKDD(pipes_struct *p)
2131 {
2132         const struct ndr_interface_call *call;
2133         struct ndr_pull *pull;
2134         struct ndr_push *push;
2135         NTSTATUS status;
2136         DATA_BLOB blob;
2137         struct winreg_OpenHKDD *r;
2138         
2139         call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKDD];
2140         
2141         r = talloc(NULL, struct winreg_OpenHKDD);
2142         if (r == NULL) {
2143                 return False;
2144         }
2145         
2146         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2147                 talloc_free(r);
2148                 return False;
2149         }
2150         
2151         pull = ndr_pull_init_blob(&blob, r);
2152         if (pull == NULL) {
2153                 talloc_free(r);
2154                 return False;
2155         }
2156         
2157         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2158         status = call->ndr_pull(pull, NDR_IN, r);
2159         if (NT_STATUS_IS_ERR(status)) {
2160                 talloc_free(r);
2161                 return False;
2162         }
2163         
2164         if (DEBUGLEVEL >= 10)
2165                 NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, r);
2166         
2167         ZERO_STRUCT(r->out);
2168         r->out.handle = talloc_zero(r, struct policy_handle);
2169         if (r->out.handle == NULL) {
2170                 talloc_free(r);
2171                 return False;
2172         }
2173         
2174         r->out.result = _winreg_OpenHKDD(p, r);
2175         
2176         if (p->rng_fault_state) {
2177                 talloc_free(r);
2178                 /* Return True here, srv_pipe_hnd.c will take care */
2179                 return True;
2180         }
2181         
2182         if (DEBUGLEVEL >= 10)
2183                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, r);
2184         
2185         push = ndr_push_init_ctx(r);
2186         if (push == NULL) {
2187                 talloc_free(r);
2188                 return False;
2189         }
2190         
2191         status = call->ndr_push(push, NDR_OUT, r);
2192         if (NT_STATUS_IS_ERR(status)) {
2193                 talloc_free(r);
2194                 return False;
2195         }
2196         
2197         blob = ndr_push_blob(push);
2198         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2199                 talloc_free(r);
2200                 return False;
2201         }
2202         
2203         talloc_free(r);
2204         
2205         return True;
2206 }
2207
2208 static bool api_winreg_QueryMultipleValues(pipes_struct *p)
2209 {
2210         const struct ndr_interface_call *call;
2211         struct ndr_pull *pull;
2212         struct ndr_push *push;
2213         NTSTATUS status;
2214         DATA_BLOB blob;
2215         struct winreg_QueryMultipleValues *r;
2216         
2217         call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES];
2218         
2219         r = talloc(NULL, struct winreg_QueryMultipleValues);
2220         if (r == NULL) {
2221                 return False;
2222         }
2223         
2224         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2225                 talloc_free(r);
2226                 return False;
2227         }
2228         
2229         pull = ndr_pull_init_blob(&blob, r);
2230         if (pull == NULL) {
2231                 talloc_free(r);
2232                 return False;
2233         }
2234         
2235         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2236         status = call->ndr_pull(pull, NDR_IN, r);
2237         if (NT_STATUS_IS_ERR(status)) {
2238                 talloc_free(r);
2239                 return False;
2240         }
2241         
2242         if (DEBUGLEVEL >= 10)
2243                 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, r);
2244         
2245         ZERO_STRUCT(r->out);
2246         r->out.values = r->in.values;
2247         r->out.buffer = r->in.buffer;
2248         r->out.buffer_size = r->in.buffer_size;
2249         r->out.result = _winreg_QueryMultipleValues(p, r);
2250         
2251         if (p->rng_fault_state) {
2252                 talloc_free(r);
2253                 /* Return True here, srv_pipe_hnd.c will take care */
2254                 return True;
2255         }
2256         
2257         if (DEBUGLEVEL >= 10)
2258                 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, r);
2259         
2260         push = ndr_push_init_ctx(r);
2261         if (push == NULL) {
2262                 talloc_free(r);
2263                 return False;
2264         }
2265         
2266         status = call->ndr_push(push, NDR_OUT, r);
2267         if (NT_STATUS_IS_ERR(status)) {
2268                 talloc_free(r);
2269                 return False;
2270         }
2271         
2272         blob = ndr_push_blob(push);
2273         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2274                 talloc_free(r);
2275                 return False;
2276         }
2277         
2278         talloc_free(r);
2279         
2280         return True;
2281 }
2282
2283 static bool api_winreg_InitiateSystemShutdownEx(pipes_struct *p)
2284 {
2285         const struct ndr_interface_call *call;
2286         struct ndr_pull *pull;
2287         struct ndr_push *push;
2288         NTSTATUS status;
2289         DATA_BLOB blob;
2290         struct winreg_InitiateSystemShutdownEx *r;
2291         
2292         call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWNEX];
2293         
2294         r = talloc(NULL, struct winreg_InitiateSystemShutdownEx);
2295         if (r == NULL) {
2296                 return False;
2297         }
2298         
2299         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2300                 talloc_free(r);
2301                 return False;
2302         }
2303         
2304         pull = ndr_pull_init_blob(&blob, r);
2305         if (pull == NULL) {
2306                 talloc_free(r);
2307                 return False;
2308         }
2309         
2310         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2311         status = call->ndr_pull(pull, NDR_IN, r);
2312         if (NT_STATUS_IS_ERR(status)) {
2313                 talloc_free(r);
2314                 return False;
2315         }
2316         
2317         if (DEBUGLEVEL >= 10)
2318                 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, r);
2319         
2320         r->out.result = _winreg_InitiateSystemShutdownEx(p, r);
2321         
2322         if (p->rng_fault_state) {
2323                 talloc_free(r);
2324                 /* Return True here, srv_pipe_hnd.c will take care */
2325                 return True;
2326         }
2327         
2328         if (DEBUGLEVEL >= 10)
2329                 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, r);
2330         
2331         push = ndr_push_init_ctx(r);
2332         if (push == NULL) {
2333                 talloc_free(r);
2334                 return False;
2335         }
2336         
2337         status = call->ndr_push(push, NDR_OUT, r);
2338         if (NT_STATUS_IS_ERR(status)) {
2339                 talloc_free(r);
2340                 return False;
2341         }
2342         
2343         blob = ndr_push_blob(push);
2344         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2345                 talloc_free(r);
2346                 return False;
2347         }
2348         
2349         talloc_free(r);
2350         
2351         return True;
2352 }
2353
2354 static bool api_winreg_SaveKeyEx(pipes_struct *p)
2355 {
2356         const struct ndr_interface_call *call;
2357         struct ndr_pull *pull;
2358         struct ndr_push *push;
2359         NTSTATUS status;
2360         DATA_BLOB blob;
2361         struct winreg_SaveKeyEx *r;
2362         
2363         call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEYEX];
2364         
2365         r = talloc(NULL, struct winreg_SaveKeyEx);
2366         if (r == NULL) {
2367                 return False;
2368         }
2369         
2370         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2371                 talloc_free(r);
2372                 return False;
2373         }
2374         
2375         pull = ndr_pull_init_blob(&blob, r);
2376         if (pull == NULL) {
2377                 talloc_free(r);
2378                 return False;
2379         }
2380         
2381         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2382         status = call->ndr_pull(pull, NDR_IN, r);
2383         if (NT_STATUS_IS_ERR(status)) {
2384                 talloc_free(r);
2385                 return False;
2386         }
2387         
2388         if (DEBUGLEVEL >= 10)
2389                 NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, r);
2390         
2391         r->out.result = _winreg_SaveKeyEx(p, r);
2392         
2393         if (p->rng_fault_state) {
2394                 talloc_free(r);
2395                 /* Return True here, srv_pipe_hnd.c will take care */
2396                 return True;
2397         }
2398         
2399         if (DEBUGLEVEL >= 10)
2400                 NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, r);
2401         
2402         push = ndr_push_init_ctx(r);
2403         if (push == NULL) {
2404                 talloc_free(r);
2405                 return False;
2406         }
2407         
2408         status = call->ndr_push(push, NDR_OUT, r);
2409         if (NT_STATUS_IS_ERR(status)) {
2410                 talloc_free(r);
2411                 return False;
2412         }
2413         
2414         blob = ndr_push_blob(push);
2415         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2416                 talloc_free(r);
2417                 return False;
2418         }
2419         
2420         talloc_free(r);
2421         
2422         return True;
2423 }
2424
2425 static bool api_winreg_OpenHKPT(pipes_struct *p)
2426 {
2427         const struct ndr_interface_call *call;
2428         struct ndr_pull *pull;
2429         struct ndr_push *push;
2430         NTSTATUS status;
2431         DATA_BLOB blob;
2432         struct winreg_OpenHKPT *r;
2433         
2434         call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPT];
2435         
2436         r = talloc(NULL, struct winreg_OpenHKPT);
2437         if (r == NULL) {
2438                 return False;
2439         }
2440         
2441         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2442                 talloc_free(r);
2443                 return False;
2444         }
2445         
2446         pull = ndr_pull_init_blob(&blob, r);
2447         if (pull == NULL) {
2448                 talloc_free(r);
2449                 return False;
2450         }
2451         
2452         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2453         status = call->ndr_pull(pull, NDR_IN, r);
2454         if (NT_STATUS_IS_ERR(status)) {
2455                 talloc_free(r);
2456                 return False;
2457         }
2458         
2459         if (DEBUGLEVEL >= 10)
2460                 NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, r);
2461         
2462         ZERO_STRUCT(r->out);
2463         r->out.handle = talloc_zero(r, struct policy_handle);
2464         if (r->out.handle == NULL) {
2465                 talloc_free(r);
2466                 return False;
2467         }
2468         
2469         r->out.result = _winreg_OpenHKPT(p, r);
2470         
2471         if (p->rng_fault_state) {
2472                 talloc_free(r);
2473                 /* Return True here, srv_pipe_hnd.c will take care */
2474                 return True;
2475         }
2476         
2477         if (DEBUGLEVEL >= 10)
2478                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, r);
2479         
2480         push = ndr_push_init_ctx(r);
2481         if (push == NULL) {
2482                 talloc_free(r);
2483                 return False;
2484         }
2485         
2486         status = call->ndr_push(push, NDR_OUT, r);
2487         if (NT_STATUS_IS_ERR(status)) {
2488                 talloc_free(r);
2489                 return False;
2490         }
2491         
2492         blob = ndr_push_blob(push);
2493         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2494                 talloc_free(r);
2495                 return False;
2496         }
2497         
2498         talloc_free(r);
2499         
2500         return True;
2501 }
2502
2503 static bool api_winreg_OpenHKPN(pipes_struct *p)
2504 {
2505         const struct ndr_interface_call *call;
2506         struct ndr_pull *pull;
2507         struct ndr_push *push;
2508         NTSTATUS status;
2509         DATA_BLOB blob;
2510         struct winreg_OpenHKPN *r;
2511         
2512         call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPN];
2513         
2514         r = talloc(NULL, struct winreg_OpenHKPN);
2515         if (r == NULL) {
2516                 return False;
2517         }
2518         
2519         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2520                 talloc_free(r);
2521                 return False;
2522         }
2523         
2524         pull = ndr_pull_init_blob(&blob, r);
2525         if (pull == NULL) {
2526                 talloc_free(r);
2527                 return False;
2528         }
2529         
2530         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2531         status = call->ndr_pull(pull, NDR_IN, r);
2532         if (NT_STATUS_IS_ERR(status)) {
2533                 talloc_free(r);
2534                 return False;
2535         }
2536         
2537         if (DEBUGLEVEL >= 10)
2538                 NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, r);
2539         
2540         ZERO_STRUCT(r->out);
2541         r->out.handle = talloc_zero(r, struct policy_handle);
2542         if (r->out.handle == NULL) {
2543                 talloc_free(r);
2544                 return False;
2545         }
2546         
2547         r->out.result = _winreg_OpenHKPN(p, r);
2548         
2549         if (p->rng_fault_state) {
2550                 talloc_free(r);
2551                 /* Return True here, srv_pipe_hnd.c will take care */
2552                 return True;
2553         }
2554         
2555         if (DEBUGLEVEL >= 10)
2556                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, r);
2557         
2558         push = ndr_push_init_ctx(r);
2559         if (push == NULL) {
2560                 talloc_free(r);
2561                 return False;
2562         }
2563         
2564         status = call->ndr_push(push, NDR_OUT, r);
2565         if (NT_STATUS_IS_ERR(status)) {
2566                 talloc_free(r);
2567                 return False;
2568         }
2569         
2570         blob = ndr_push_blob(push);
2571         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2572                 talloc_free(r);
2573                 return False;
2574         }
2575         
2576         talloc_free(r);
2577         
2578         return True;
2579 }
2580
2581 static bool api_winreg_QueryMultipleValues2(pipes_struct *p)
2582 {
2583         const struct ndr_interface_call *call;
2584         struct ndr_pull *pull;
2585         struct ndr_push *push;
2586         NTSTATUS status;
2587         DATA_BLOB blob;
2588         struct winreg_QueryMultipleValues2 *r;
2589         
2590         call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES2];
2591         
2592         r = talloc(NULL, struct winreg_QueryMultipleValues2);
2593         if (r == NULL) {
2594                 return False;
2595         }
2596         
2597         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2598                 talloc_free(r);
2599                 return False;
2600         }
2601         
2602         pull = ndr_pull_init_blob(&blob, r);
2603         if (pull == NULL) {
2604                 talloc_free(r);
2605                 return False;
2606         }
2607         
2608         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2609         status = call->ndr_pull(pull, NDR_IN, r);
2610         if (NT_STATUS_IS_ERR(status)) {
2611                 talloc_free(r);
2612                 return False;
2613         }
2614         
2615         if (DEBUGLEVEL >= 10)
2616                 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, r);
2617         
2618         r->out.result = _winreg_QueryMultipleValues2(p, r);
2619         
2620         if (p->rng_fault_state) {
2621                 talloc_free(r);
2622                 /* Return True here, srv_pipe_hnd.c will take care */
2623                 return True;
2624         }
2625         
2626         if (DEBUGLEVEL >= 10)
2627                 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, r);
2628         
2629         push = ndr_push_init_ctx(r);
2630         if (push == NULL) {
2631                 talloc_free(r);
2632                 return False;
2633         }
2634         
2635         status = call->ndr_push(push, NDR_OUT, r);
2636         if (NT_STATUS_IS_ERR(status)) {
2637                 talloc_free(r);
2638                 return False;
2639         }
2640         
2641         blob = ndr_push_blob(push);
2642         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
2643                 talloc_free(r);
2644                 return False;
2645         }
2646         
2647         talloc_free(r);
2648         
2649         return True;
2650 }
2651
2652
2653 /* Tables */
2654 static struct api_struct api_winreg_cmds[] = 
2655 {
2656         {"WINREG_OPENHKCR", NDR_WINREG_OPENHKCR, api_winreg_OpenHKCR},
2657         {"WINREG_OPENHKCU", NDR_WINREG_OPENHKCU, api_winreg_OpenHKCU},
2658         {"WINREG_OPENHKLM", NDR_WINREG_OPENHKLM, api_winreg_OpenHKLM},
2659         {"WINREG_OPENHKPD", NDR_WINREG_OPENHKPD, api_winreg_OpenHKPD},
2660         {"WINREG_OPENHKU", NDR_WINREG_OPENHKU, api_winreg_OpenHKU},
2661         {"WINREG_CLOSEKEY", NDR_WINREG_CLOSEKEY, api_winreg_CloseKey},
2662         {"WINREG_CREATEKEY", NDR_WINREG_CREATEKEY, api_winreg_CreateKey},
2663         {"WINREG_DELETEKEY", NDR_WINREG_DELETEKEY, api_winreg_DeleteKey},
2664         {"WINREG_DELETEVALUE", NDR_WINREG_DELETEVALUE, api_winreg_DeleteValue},
2665         {"WINREG_ENUMKEY", NDR_WINREG_ENUMKEY, api_winreg_EnumKey},
2666         {"WINREG_ENUMVALUE", NDR_WINREG_ENUMVALUE, api_winreg_EnumValue},
2667         {"WINREG_FLUSHKEY", NDR_WINREG_FLUSHKEY, api_winreg_FlushKey},
2668         {"WINREG_GETKEYSECURITY", NDR_WINREG_GETKEYSECURITY, api_winreg_GetKeySecurity},
2669         {"WINREG_LOADKEY", NDR_WINREG_LOADKEY, api_winreg_LoadKey},
2670         {"WINREG_NOTIFYCHANGEKEYVALUE", NDR_WINREG_NOTIFYCHANGEKEYVALUE, api_winreg_NotifyChangeKeyValue},
2671         {"WINREG_OPENKEY", NDR_WINREG_OPENKEY, api_winreg_OpenKey},
2672         {"WINREG_QUERYINFOKEY", NDR_WINREG_QUERYINFOKEY, api_winreg_QueryInfoKey},
2673         {"WINREG_QUERYVALUE", NDR_WINREG_QUERYVALUE, api_winreg_QueryValue},
2674         {"WINREG_REPLACEKEY", NDR_WINREG_REPLACEKEY, api_winreg_ReplaceKey},
2675         {"WINREG_RESTOREKEY", NDR_WINREG_RESTOREKEY, api_winreg_RestoreKey},
2676         {"WINREG_SAVEKEY", NDR_WINREG_SAVEKEY, api_winreg_SaveKey},
2677         {"WINREG_SETKEYSECURITY", NDR_WINREG_SETKEYSECURITY, api_winreg_SetKeySecurity},
2678         {"WINREG_SETVALUE", NDR_WINREG_SETVALUE, api_winreg_SetValue},
2679         {"WINREG_UNLOADKEY", NDR_WINREG_UNLOADKEY, api_winreg_UnLoadKey},
2680         {"WINREG_INITIATESYSTEMSHUTDOWN", NDR_WINREG_INITIATESYSTEMSHUTDOWN, api_winreg_InitiateSystemShutdown},
2681         {"WINREG_ABORTSYSTEMSHUTDOWN", NDR_WINREG_ABORTSYSTEMSHUTDOWN, api_winreg_AbortSystemShutdown},
2682         {"WINREG_GETVERSION", NDR_WINREG_GETVERSION, api_winreg_GetVersion},
2683         {"WINREG_OPENHKCC", NDR_WINREG_OPENHKCC, api_winreg_OpenHKCC},
2684         {"WINREG_OPENHKDD", NDR_WINREG_OPENHKDD, api_winreg_OpenHKDD},
2685         {"WINREG_QUERYMULTIPLEVALUES", NDR_WINREG_QUERYMULTIPLEVALUES, api_winreg_QueryMultipleValues},
2686         {"WINREG_INITIATESYSTEMSHUTDOWNEX", NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, api_winreg_InitiateSystemShutdownEx},
2687         {"WINREG_SAVEKEYEX", NDR_WINREG_SAVEKEYEX, api_winreg_SaveKeyEx},
2688         {"WINREG_OPENHKPT", NDR_WINREG_OPENHKPT, api_winreg_OpenHKPT},
2689         {"WINREG_OPENHKPN", NDR_WINREG_OPENHKPN, api_winreg_OpenHKPN},
2690         {"WINREG_QUERYMULTIPLEVALUES2", NDR_WINREG_QUERYMULTIPLEVALUES2, api_winreg_QueryMultipleValues2},
2691 };
2692
2693 void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns)
2694 {
2695         *fns = api_winreg_cmds;
2696         *n_fns = sizeof(api_winreg_cmds) / sizeof(struct api_struct);
2697 }
2698
2699 NTSTATUS rpc_winreg_init(void)
2700 {
2701         return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "winreg", "winreg", api_winreg_cmds, sizeof(api_winreg_cmds) / sizeof(struct api_struct));
2702 }