Attempt to fix the build
[Samba.git] / librpc / gen_ndr / srv_winreg.c
blobd0873f8d62b9145a2fa59c34499dc4552e239054
1 /*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/srv_winreg.h"
9 static bool api_winreg_OpenHKCR(pipes_struct *p)
11 const struct ndr_interface_call *call;
12 struct ndr_pull *pull;
13 struct ndr_push *push;
14 enum ndr_err_code ndr_err;
15 DATA_BLOB blob;
16 struct winreg_OpenHKCR *r;
18 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCR];
20 r = talloc(talloc_tos(), struct winreg_OpenHKCR);
21 if (r == NULL) {
22 return false;
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26 talloc_free(r);
27 return false;
30 pull = ndr_pull_init_blob(&blob, r, NULL);
31 if (pull == NULL) {
32 talloc_free(r);
33 return false;
36 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37 ndr_err = call->ndr_pull(pull, NDR_IN, r);
38 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
39 talloc_free(r);
40 return false;
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, r);
47 ZERO_STRUCT(r->out);
48 r->out.handle = talloc_zero(r, struct policy_handle);
49 if (r->out.handle == NULL) {
50 talloc_free(r);
51 return false;
54 r->out.result = _winreg_OpenHKCR(p, r);
56 if (p->rng_fault_state) {
57 talloc_free(r);
58 /* Return true here, srv_pipe_hnd.c will take care */
59 return true;
62 if (DEBUGLEVEL >= 10) {
63 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, r);
66 push = ndr_push_init_ctx(r, NULL);
67 if (push == NULL) {
68 talloc_free(r);
69 return false;
72 ndr_err = call->ndr_push(push, NDR_OUT, r);
73 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
74 talloc_free(r);
75 return false;
78 blob = ndr_push_blob(push);
79 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
80 talloc_free(r);
81 return false;
84 talloc_free(r);
86 return true;
89 static bool api_winreg_OpenHKCU(pipes_struct *p)
91 const struct ndr_interface_call *call;
92 struct ndr_pull *pull;
93 struct ndr_push *push;
94 enum ndr_err_code ndr_err;
95 DATA_BLOB blob;
96 struct winreg_OpenHKCU *r;
98 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCU];
100 r = talloc(talloc_tos(), struct winreg_OpenHKCU);
101 if (r == NULL) {
102 return false;
105 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
106 talloc_free(r);
107 return false;
110 pull = ndr_pull_init_blob(&blob, r, NULL);
111 if (pull == NULL) {
112 talloc_free(r);
113 return false;
116 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
117 ndr_err = call->ndr_pull(pull, NDR_IN, r);
118 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
119 talloc_free(r);
120 return false;
123 if (DEBUGLEVEL >= 10) {
124 NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, r);
127 ZERO_STRUCT(r->out);
128 r->out.handle = talloc_zero(r, struct policy_handle);
129 if (r->out.handle == NULL) {
130 talloc_free(r);
131 return false;
134 r->out.result = _winreg_OpenHKCU(p, r);
136 if (p->rng_fault_state) {
137 talloc_free(r);
138 /* Return true here, srv_pipe_hnd.c will take care */
139 return true;
142 if (DEBUGLEVEL >= 10) {
143 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, r);
146 push = ndr_push_init_ctx(r, NULL);
147 if (push == NULL) {
148 talloc_free(r);
149 return false;
152 ndr_err = call->ndr_push(push, NDR_OUT, r);
153 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
154 talloc_free(r);
155 return false;
158 blob = ndr_push_blob(push);
159 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
160 talloc_free(r);
161 return false;
164 talloc_free(r);
166 return true;
169 static bool api_winreg_OpenHKLM(pipes_struct *p)
171 const struct ndr_interface_call *call;
172 struct ndr_pull *pull;
173 struct ndr_push *push;
174 enum ndr_err_code ndr_err;
175 DATA_BLOB blob;
176 struct winreg_OpenHKLM *r;
178 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKLM];
180 r = talloc(talloc_tos(), struct winreg_OpenHKLM);
181 if (r == NULL) {
182 return false;
185 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
186 talloc_free(r);
187 return false;
190 pull = ndr_pull_init_blob(&blob, r, NULL);
191 if (pull == NULL) {
192 talloc_free(r);
193 return false;
196 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
197 ndr_err = call->ndr_pull(pull, NDR_IN, r);
198 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
199 talloc_free(r);
200 return false;
203 if (DEBUGLEVEL >= 10) {
204 NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, r);
207 ZERO_STRUCT(r->out);
208 r->out.handle = talloc_zero(r, struct policy_handle);
209 if (r->out.handle == NULL) {
210 talloc_free(r);
211 return false;
214 r->out.result = _winreg_OpenHKLM(p, r);
216 if (p->rng_fault_state) {
217 talloc_free(r);
218 /* Return true here, srv_pipe_hnd.c will take care */
219 return true;
222 if (DEBUGLEVEL >= 10) {
223 NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, r);
226 push = ndr_push_init_ctx(r, NULL);
227 if (push == NULL) {
228 talloc_free(r);
229 return false;
232 ndr_err = call->ndr_push(push, NDR_OUT, r);
233 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
234 talloc_free(r);
235 return false;
238 blob = ndr_push_blob(push);
239 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
240 talloc_free(r);
241 return false;
244 talloc_free(r);
246 return true;
249 static bool api_winreg_OpenHKPD(pipes_struct *p)
251 const struct ndr_interface_call *call;
252 struct ndr_pull *pull;
253 struct ndr_push *push;
254 enum ndr_err_code ndr_err;
255 DATA_BLOB blob;
256 struct winreg_OpenHKPD *r;
258 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPD];
260 r = talloc(talloc_tos(), struct winreg_OpenHKPD);
261 if (r == NULL) {
262 return false;
265 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
266 talloc_free(r);
267 return false;
270 pull = ndr_pull_init_blob(&blob, r, NULL);
271 if (pull == NULL) {
272 talloc_free(r);
273 return false;
276 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
277 ndr_err = call->ndr_pull(pull, NDR_IN, r);
278 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
279 talloc_free(r);
280 return false;
283 if (DEBUGLEVEL >= 10) {
284 NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, r);
287 ZERO_STRUCT(r->out);
288 r->out.handle = talloc_zero(r, struct policy_handle);
289 if (r->out.handle == NULL) {
290 talloc_free(r);
291 return false;
294 r->out.result = _winreg_OpenHKPD(p, r);
296 if (p->rng_fault_state) {
297 talloc_free(r);
298 /* Return true here, srv_pipe_hnd.c will take care */
299 return true;
302 if (DEBUGLEVEL >= 10) {
303 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, r);
306 push = ndr_push_init_ctx(r, NULL);
307 if (push == NULL) {
308 talloc_free(r);
309 return false;
312 ndr_err = call->ndr_push(push, NDR_OUT, r);
313 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
314 talloc_free(r);
315 return false;
318 blob = ndr_push_blob(push);
319 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
320 talloc_free(r);
321 return false;
324 talloc_free(r);
326 return true;
329 static bool api_winreg_OpenHKU(pipes_struct *p)
331 const struct ndr_interface_call *call;
332 struct ndr_pull *pull;
333 struct ndr_push *push;
334 enum ndr_err_code ndr_err;
335 DATA_BLOB blob;
336 struct winreg_OpenHKU *r;
338 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKU];
340 r = talloc(talloc_tos(), struct winreg_OpenHKU);
341 if (r == NULL) {
342 return false;
345 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
346 talloc_free(r);
347 return false;
350 pull = ndr_pull_init_blob(&blob, r, NULL);
351 if (pull == NULL) {
352 talloc_free(r);
353 return false;
356 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
357 ndr_err = call->ndr_pull(pull, NDR_IN, r);
358 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
359 talloc_free(r);
360 return false;
363 if (DEBUGLEVEL >= 10) {
364 NDR_PRINT_IN_DEBUG(winreg_OpenHKU, r);
367 ZERO_STRUCT(r->out);
368 r->out.handle = talloc_zero(r, struct policy_handle);
369 if (r->out.handle == NULL) {
370 talloc_free(r);
371 return false;
374 r->out.result = _winreg_OpenHKU(p, r);
376 if (p->rng_fault_state) {
377 talloc_free(r);
378 /* Return true here, srv_pipe_hnd.c will take care */
379 return true;
382 if (DEBUGLEVEL >= 10) {
383 NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, r);
386 push = ndr_push_init_ctx(r, NULL);
387 if (push == NULL) {
388 talloc_free(r);
389 return false;
392 ndr_err = call->ndr_push(push, NDR_OUT, r);
393 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
394 talloc_free(r);
395 return false;
398 blob = ndr_push_blob(push);
399 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
400 talloc_free(r);
401 return false;
404 talloc_free(r);
406 return true;
409 static bool api_winreg_CloseKey(pipes_struct *p)
411 const struct ndr_interface_call *call;
412 struct ndr_pull *pull;
413 struct ndr_push *push;
414 enum ndr_err_code ndr_err;
415 DATA_BLOB blob;
416 struct winreg_CloseKey *r;
418 call = &ndr_table_winreg.calls[NDR_WINREG_CLOSEKEY];
420 r = talloc(talloc_tos(), struct winreg_CloseKey);
421 if (r == NULL) {
422 return false;
425 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
426 talloc_free(r);
427 return false;
430 pull = ndr_pull_init_blob(&blob, r, NULL);
431 if (pull == NULL) {
432 talloc_free(r);
433 return false;
436 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
437 ndr_err = call->ndr_pull(pull, NDR_IN, r);
438 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
439 talloc_free(r);
440 return false;
443 if (DEBUGLEVEL >= 10) {
444 NDR_PRINT_IN_DEBUG(winreg_CloseKey, r);
447 ZERO_STRUCT(r->out);
448 r->out.handle = r->in.handle;
449 r->out.result = _winreg_CloseKey(p, r);
451 if (p->rng_fault_state) {
452 talloc_free(r);
453 /* Return true here, srv_pipe_hnd.c will take care */
454 return true;
457 if (DEBUGLEVEL >= 10) {
458 NDR_PRINT_OUT_DEBUG(winreg_CloseKey, r);
461 push = ndr_push_init_ctx(r, NULL);
462 if (push == NULL) {
463 talloc_free(r);
464 return false;
467 ndr_err = call->ndr_push(push, NDR_OUT, r);
468 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
469 talloc_free(r);
470 return false;
473 blob = ndr_push_blob(push);
474 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
475 talloc_free(r);
476 return false;
479 talloc_free(r);
481 return true;
484 static bool api_winreg_CreateKey(pipes_struct *p)
486 const struct ndr_interface_call *call;
487 struct ndr_pull *pull;
488 struct ndr_push *push;
489 enum ndr_err_code ndr_err;
490 DATA_BLOB blob;
491 struct winreg_CreateKey *r;
493 call = &ndr_table_winreg.calls[NDR_WINREG_CREATEKEY];
495 r = talloc(talloc_tos(), struct winreg_CreateKey);
496 if (r == NULL) {
497 return false;
500 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
501 talloc_free(r);
502 return false;
505 pull = ndr_pull_init_blob(&blob, r, NULL);
506 if (pull == NULL) {
507 talloc_free(r);
508 return false;
511 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
512 ndr_err = call->ndr_pull(pull, NDR_IN, r);
513 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
514 talloc_free(r);
515 return false;
518 if (DEBUGLEVEL >= 10) {
519 NDR_PRINT_IN_DEBUG(winreg_CreateKey, r);
522 ZERO_STRUCT(r->out);
523 r->out.action_taken = r->in.action_taken;
524 r->out.new_handle = talloc_zero(r, struct policy_handle);
525 if (r->out.new_handle == NULL) {
526 talloc_free(r);
527 return false;
530 r->out.result = _winreg_CreateKey(p, r);
532 if (p->rng_fault_state) {
533 talloc_free(r);
534 /* Return true here, srv_pipe_hnd.c will take care */
535 return true;
538 if (DEBUGLEVEL >= 10) {
539 NDR_PRINT_OUT_DEBUG(winreg_CreateKey, r);
542 push = ndr_push_init_ctx(r, NULL);
543 if (push == NULL) {
544 talloc_free(r);
545 return false;
548 ndr_err = call->ndr_push(push, NDR_OUT, r);
549 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
550 talloc_free(r);
551 return false;
554 blob = ndr_push_blob(push);
555 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
556 talloc_free(r);
557 return false;
560 talloc_free(r);
562 return true;
565 static bool api_winreg_DeleteKey(pipes_struct *p)
567 const struct ndr_interface_call *call;
568 struct ndr_pull *pull;
569 struct ndr_push *push;
570 enum ndr_err_code ndr_err;
571 DATA_BLOB blob;
572 struct winreg_DeleteKey *r;
574 call = &ndr_table_winreg.calls[NDR_WINREG_DELETEKEY];
576 r = talloc(talloc_tos(), struct winreg_DeleteKey);
577 if (r == NULL) {
578 return false;
581 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
582 talloc_free(r);
583 return false;
586 pull = ndr_pull_init_blob(&blob, r, NULL);
587 if (pull == NULL) {
588 talloc_free(r);
589 return false;
592 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
593 ndr_err = call->ndr_pull(pull, NDR_IN, r);
594 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
595 talloc_free(r);
596 return false;
599 if (DEBUGLEVEL >= 10) {
600 NDR_PRINT_IN_DEBUG(winreg_DeleteKey, r);
603 r->out.result = _winreg_DeleteKey(p, r);
605 if (p->rng_fault_state) {
606 talloc_free(r);
607 /* Return true here, srv_pipe_hnd.c will take care */
608 return true;
611 if (DEBUGLEVEL >= 10) {
612 NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, r);
615 push = ndr_push_init_ctx(r, NULL);
616 if (push == NULL) {
617 talloc_free(r);
618 return false;
621 ndr_err = call->ndr_push(push, NDR_OUT, r);
622 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
623 talloc_free(r);
624 return false;
627 blob = ndr_push_blob(push);
628 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
629 talloc_free(r);
630 return false;
633 talloc_free(r);
635 return true;
638 static bool api_winreg_DeleteValue(pipes_struct *p)
640 const struct ndr_interface_call *call;
641 struct ndr_pull *pull;
642 struct ndr_push *push;
643 enum ndr_err_code ndr_err;
644 DATA_BLOB blob;
645 struct winreg_DeleteValue *r;
647 call = &ndr_table_winreg.calls[NDR_WINREG_DELETEVALUE];
649 r = talloc(talloc_tos(), struct winreg_DeleteValue);
650 if (r == NULL) {
651 return false;
654 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
655 talloc_free(r);
656 return false;
659 pull = ndr_pull_init_blob(&blob, r, NULL);
660 if (pull == NULL) {
661 talloc_free(r);
662 return false;
665 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
666 ndr_err = call->ndr_pull(pull, NDR_IN, r);
667 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
668 talloc_free(r);
669 return false;
672 if (DEBUGLEVEL >= 10) {
673 NDR_PRINT_IN_DEBUG(winreg_DeleteValue, r);
676 r->out.result = _winreg_DeleteValue(p, r);
678 if (p->rng_fault_state) {
679 talloc_free(r);
680 /* Return true here, srv_pipe_hnd.c will take care */
681 return true;
684 if (DEBUGLEVEL >= 10) {
685 NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, r);
688 push = ndr_push_init_ctx(r, NULL);
689 if (push == NULL) {
690 talloc_free(r);
691 return false;
694 ndr_err = call->ndr_push(push, NDR_OUT, r);
695 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
696 talloc_free(r);
697 return false;
700 blob = ndr_push_blob(push);
701 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
702 talloc_free(r);
703 return false;
706 talloc_free(r);
708 return true;
711 static bool api_winreg_EnumKey(pipes_struct *p)
713 const struct ndr_interface_call *call;
714 struct ndr_pull *pull;
715 struct ndr_push *push;
716 enum ndr_err_code ndr_err;
717 DATA_BLOB blob;
718 struct winreg_EnumKey *r;
720 call = &ndr_table_winreg.calls[NDR_WINREG_ENUMKEY];
722 r = talloc(talloc_tos(), struct winreg_EnumKey);
723 if (r == NULL) {
724 return false;
727 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
728 talloc_free(r);
729 return false;
732 pull = ndr_pull_init_blob(&blob, r, NULL);
733 if (pull == NULL) {
734 talloc_free(r);
735 return false;
738 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
739 ndr_err = call->ndr_pull(pull, NDR_IN, r);
740 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
741 talloc_free(r);
742 return false;
745 if (DEBUGLEVEL >= 10) {
746 NDR_PRINT_IN_DEBUG(winreg_EnumKey, r);
749 ZERO_STRUCT(r->out);
750 r->out.name = r->in.name;
751 r->out.keyclass = r->in.keyclass;
752 r->out.last_changed_time = r->in.last_changed_time;
753 r->out.result = _winreg_EnumKey(p, r);
755 if (p->rng_fault_state) {
756 talloc_free(r);
757 /* Return true here, srv_pipe_hnd.c will take care */
758 return true;
761 if (DEBUGLEVEL >= 10) {
762 NDR_PRINT_OUT_DEBUG(winreg_EnumKey, r);
765 push = ndr_push_init_ctx(r, NULL);
766 if (push == NULL) {
767 talloc_free(r);
768 return false;
771 ndr_err = call->ndr_push(push, NDR_OUT, r);
772 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
773 talloc_free(r);
774 return false;
777 blob = ndr_push_blob(push);
778 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
779 talloc_free(r);
780 return false;
783 talloc_free(r);
785 return true;
788 static bool api_winreg_EnumValue(pipes_struct *p)
790 const struct ndr_interface_call *call;
791 struct ndr_pull *pull;
792 struct ndr_push *push;
793 enum ndr_err_code ndr_err;
794 DATA_BLOB blob;
795 struct winreg_EnumValue *r;
797 call = &ndr_table_winreg.calls[NDR_WINREG_ENUMVALUE];
799 r = talloc(talloc_tos(), struct winreg_EnumValue);
800 if (r == NULL) {
801 return false;
804 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
805 talloc_free(r);
806 return false;
809 pull = ndr_pull_init_blob(&blob, r, NULL);
810 if (pull == NULL) {
811 talloc_free(r);
812 return false;
815 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
816 ndr_err = call->ndr_pull(pull, NDR_IN, r);
817 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
818 talloc_free(r);
819 return false;
822 if (DEBUGLEVEL >= 10) {
823 NDR_PRINT_IN_DEBUG(winreg_EnumValue, r);
826 ZERO_STRUCT(r->out);
827 r->out.name = r->in.name;
828 r->out.type = r->in.type;
829 r->out.value = r->in.value;
830 r->out.size = r->in.size;
831 r->out.length = r->in.length;
832 r->out.result = _winreg_EnumValue(p, r);
834 if (p->rng_fault_state) {
835 talloc_free(r);
836 /* Return true here, srv_pipe_hnd.c will take care */
837 return true;
840 if (DEBUGLEVEL >= 10) {
841 NDR_PRINT_OUT_DEBUG(winreg_EnumValue, r);
844 push = ndr_push_init_ctx(r, NULL);
845 if (push == NULL) {
846 talloc_free(r);
847 return false;
850 ndr_err = call->ndr_push(push, NDR_OUT, r);
851 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
852 talloc_free(r);
853 return false;
856 blob = ndr_push_blob(push);
857 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
858 talloc_free(r);
859 return false;
862 talloc_free(r);
864 return true;
867 static bool api_winreg_FlushKey(pipes_struct *p)
869 const struct ndr_interface_call *call;
870 struct ndr_pull *pull;
871 struct ndr_push *push;
872 enum ndr_err_code ndr_err;
873 DATA_BLOB blob;
874 struct winreg_FlushKey *r;
876 call = &ndr_table_winreg.calls[NDR_WINREG_FLUSHKEY];
878 r = talloc(talloc_tos(), struct winreg_FlushKey);
879 if (r == NULL) {
880 return false;
883 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
884 talloc_free(r);
885 return false;
888 pull = ndr_pull_init_blob(&blob, r, NULL);
889 if (pull == NULL) {
890 talloc_free(r);
891 return false;
894 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
895 ndr_err = call->ndr_pull(pull, NDR_IN, r);
896 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
897 talloc_free(r);
898 return false;
901 if (DEBUGLEVEL >= 10) {
902 NDR_PRINT_IN_DEBUG(winreg_FlushKey, r);
905 r->out.result = _winreg_FlushKey(p, r);
907 if (p->rng_fault_state) {
908 talloc_free(r);
909 /* Return true here, srv_pipe_hnd.c will take care */
910 return true;
913 if (DEBUGLEVEL >= 10) {
914 NDR_PRINT_OUT_DEBUG(winreg_FlushKey, r);
917 push = ndr_push_init_ctx(r, NULL);
918 if (push == NULL) {
919 talloc_free(r);
920 return false;
923 ndr_err = call->ndr_push(push, NDR_OUT, r);
924 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
925 talloc_free(r);
926 return false;
929 blob = ndr_push_blob(push);
930 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
931 talloc_free(r);
932 return false;
935 talloc_free(r);
937 return true;
940 static bool api_winreg_GetKeySecurity(pipes_struct *p)
942 const struct ndr_interface_call *call;
943 struct ndr_pull *pull;
944 struct ndr_push *push;
945 enum ndr_err_code ndr_err;
946 DATA_BLOB blob;
947 struct winreg_GetKeySecurity *r;
949 call = &ndr_table_winreg.calls[NDR_WINREG_GETKEYSECURITY];
951 r = talloc(talloc_tos(), struct winreg_GetKeySecurity);
952 if (r == NULL) {
953 return false;
956 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
957 talloc_free(r);
958 return false;
961 pull = ndr_pull_init_blob(&blob, r, NULL);
962 if (pull == NULL) {
963 talloc_free(r);
964 return false;
967 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
968 ndr_err = call->ndr_pull(pull, NDR_IN, r);
969 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
970 talloc_free(r);
971 return false;
974 if (DEBUGLEVEL >= 10) {
975 NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, r);
978 ZERO_STRUCT(r->out);
979 r->out.sd = r->in.sd;
980 r->out.result = _winreg_GetKeySecurity(p, r);
982 if (p->rng_fault_state) {
983 talloc_free(r);
984 /* Return true here, srv_pipe_hnd.c will take care */
985 return true;
988 if (DEBUGLEVEL >= 10) {
989 NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, r);
992 push = ndr_push_init_ctx(r, NULL);
993 if (push == NULL) {
994 talloc_free(r);
995 return false;
998 ndr_err = call->ndr_push(push, NDR_OUT, r);
999 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1000 talloc_free(r);
1001 return false;
1004 blob = ndr_push_blob(push);
1005 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1006 talloc_free(r);
1007 return false;
1010 talloc_free(r);
1012 return true;
1015 static bool api_winreg_LoadKey(pipes_struct *p)
1017 const struct ndr_interface_call *call;
1018 struct ndr_pull *pull;
1019 struct ndr_push *push;
1020 enum ndr_err_code ndr_err;
1021 DATA_BLOB blob;
1022 struct winreg_LoadKey *r;
1024 call = &ndr_table_winreg.calls[NDR_WINREG_LOADKEY];
1026 r = talloc(talloc_tos(), struct winreg_LoadKey);
1027 if (r == NULL) {
1028 return false;
1031 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1032 talloc_free(r);
1033 return false;
1036 pull = ndr_pull_init_blob(&blob, r, NULL);
1037 if (pull == NULL) {
1038 talloc_free(r);
1039 return false;
1042 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1043 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1044 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1045 talloc_free(r);
1046 return false;
1049 if (DEBUGLEVEL >= 10) {
1050 NDR_PRINT_IN_DEBUG(winreg_LoadKey, r);
1053 r->out.result = _winreg_LoadKey(p, r);
1055 if (p->rng_fault_state) {
1056 talloc_free(r);
1057 /* Return true here, srv_pipe_hnd.c will take care */
1058 return true;
1061 if (DEBUGLEVEL >= 10) {
1062 NDR_PRINT_OUT_DEBUG(winreg_LoadKey, r);
1065 push = ndr_push_init_ctx(r, NULL);
1066 if (push == NULL) {
1067 talloc_free(r);
1068 return false;
1071 ndr_err = call->ndr_push(push, NDR_OUT, r);
1072 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1073 talloc_free(r);
1074 return false;
1077 blob = ndr_push_blob(push);
1078 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1079 talloc_free(r);
1080 return false;
1083 talloc_free(r);
1085 return true;
1088 static bool api_winreg_NotifyChangeKeyValue(pipes_struct *p)
1090 const struct ndr_interface_call *call;
1091 struct ndr_pull *pull;
1092 struct ndr_push *push;
1093 enum ndr_err_code ndr_err;
1094 DATA_BLOB blob;
1095 struct winreg_NotifyChangeKeyValue *r;
1097 call = &ndr_table_winreg.calls[NDR_WINREG_NOTIFYCHANGEKEYVALUE];
1099 r = talloc(talloc_tos(), struct winreg_NotifyChangeKeyValue);
1100 if (r == NULL) {
1101 return false;
1104 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1105 talloc_free(r);
1106 return false;
1109 pull = ndr_pull_init_blob(&blob, r, NULL);
1110 if (pull == NULL) {
1111 talloc_free(r);
1112 return false;
1115 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1116 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1117 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1118 talloc_free(r);
1119 return false;
1122 if (DEBUGLEVEL >= 10) {
1123 NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, r);
1126 r->out.result = _winreg_NotifyChangeKeyValue(p, r);
1128 if (p->rng_fault_state) {
1129 talloc_free(r);
1130 /* Return true here, srv_pipe_hnd.c will take care */
1131 return true;
1134 if (DEBUGLEVEL >= 10) {
1135 NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, r);
1138 push = ndr_push_init_ctx(r, NULL);
1139 if (push == NULL) {
1140 talloc_free(r);
1141 return false;
1144 ndr_err = call->ndr_push(push, NDR_OUT, r);
1145 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1146 talloc_free(r);
1147 return false;
1150 blob = ndr_push_blob(push);
1151 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1152 talloc_free(r);
1153 return false;
1156 talloc_free(r);
1158 return true;
1161 static bool api_winreg_OpenKey(pipes_struct *p)
1163 const struct ndr_interface_call *call;
1164 struct ndr_pull *pull;
1165 struct ndr_push *push;
1166 enum ndr_err_code ndr_err;
1167 DATA_BLOB blob;
1168 struct winreg_OpenKey *r;
1170 call = &ndr_table_winreg.calls[NDR_WINREG_OPENKEY];
1172 r = talloc(talloc_tos(), struct winreg_OpenKey);
1173 if (r == NULL) {
1174 return false;
1177 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1178 talloc_free(r);
1179 return false;
1182 pull = ndr_pull_init_blob(&blob, r, NULL);
1183 if (pull == NULL) {
1184 talloc_free(r);
1185 return false;
1188 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1189 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1190 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1191 talloc_free(r);
1192 return false;
1195 if (DEBUGLEVEL >= 10) {
1196 NDR_PRINT_IN_DEBUG(winreg_OpenKey, r);
1199 ZERO_STRUCT(r->out);
1200 r->out.handle = talloc_zero(r, struct policy_handle);
1201 if (r->out.handle == NULL) {
1202 talloc_free(r);
1203 return false;
1206 r->out.result = _winreg_OpenKey(p, r);
1208 if (p->rng_fault_state) {
1209 talloc_free(r);
1210 /* Return true here, srv_pipe_hnd.c will take care */
1211 return true;
1214 if (DEBUGLEVEL >= 10) {
1215 NDR_PRINT_OUT_DEBUG(winreg_OpenKey, r);
1218 push = ndr_push_init_ctx(r, NULL);
1219 if (push == NULL) {
1220 talloc_free(r);
1221 return false;
1224 ndr_err = call->ndr_push(push, NDR_OUT, r);
1225 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1226 talloc_free(r);
1227 return false;
1230 blob = ndr_push_blob(push);
1231 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1232 talloc_free(r);
1233 return false;
1236 talloc_free(r);
1238 return true;
1241 static bool api_winreg_QueryInfoKey(pipes_struct *p)
1243 const struct ndr_interface_call *call;
1244 struct ndr_pull *pull;
1245 struct ndr_push *push;
1246 enum ndr_err_code ndr_err;
1247 DATA_BLOB blob;
1248 struct winreg_QueryInfoKey *r;
1250 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYINFOKEY];
1252 r = talloc(talloc_tos(), struct winreg_QueryInfoKey);
1253 if (r == NULL) {
1254 return false;
1257 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1258 talloc_free(r);
1259 return false;
1262 pull = ndr_pull_init_blob(&blob, r, NULL);
1263 if (pull == NULL) {
1264 talloc_free(r);
1265 return false;
1268 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1269 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1270 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1271 talloc_free(r);
1272 return false;
1275 if (DEBUGLEVEL >= 10) {
1276 NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, r);
1279 ZERO_STRUCT(r->out);
1280 r->out.classname = r->in.classname;
1281 r->out.num_subkeys = talloc_zero(r, uint32_t);
1282 if (r->out.num_subkeys == NULL) {
1283 talloc_free(r);
1284 return false;
1287 r->out.max_subkeylen = talloc_zero(r, uint32_t);
1288 if (r->out.max_subkeylen == NULL) {
1289 talloc_free(r);
1290 return false;
1293 r->out.max_classlen = talloc_zero(r, uint32_t);
1294 if (r->out.max_classlen == NULL) {
1295 talloc_free(r);
1296 return false;
1299 r->out.num_values = talloc_zero(r, uint32_t);
1300 if (r->out.num_values == NULL) {
1301 talloc_free(r);
1302 return false;
1305 r->out.max_valnamelen = talloc_zero(r, uint32_t);
1306 if (r->out.max_valnamelen == NULL) {
1307 talloc_free(r);
1308 return false;
1311 r->out.max_valbufsize = talloc_zero(r, uint32_t);
1312 if (r->out.max_valbufsize == NULL) {
1313 talloc_free(r);
1314 return false;
1317 r->out.secdescsize = talloc_zero(r, uint32_t);
1318 if (r->out.secdescsize == NULL) {
1319 talloc_free(r);
1320 return false;
1323 r->out.last_changed_time = talloc_zero(r, NTTIME);
1324 if (r->out.last_changed_time == NULL) {
1325 talloc_free(r);
1326 return false;
1329 r->out.result = _winreg_QueryInfoKey(p, r);
1331 if (p->rng_fault_state) {
1332 talloc_free(r);
1333 /* Return true here, srv_pipe_hnd.c will take care */
1334 return true;
1337 if (DEBUGLEVEL >= 10) {
1338 NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, r);
1341 push = ndr_push_init_ctx(r, NULL);
1342 if (push == NULL) {
1343 talloc_free(r);
1344 return false;
1347 ndr_err = call->ndr_push(push, NDR_OUT, r);
1348 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1349 talloc_free(r);
1350 return false;
1353 blob = ndr_push_blob(push);
1354 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1355 talloc_free(r);
1356 return false;
1359 talloc_free(r);
1361 return true;
1364 static bool api_winreg_QueryValue(pipes_struct *p)
1366 const struct ndr_interface_call *call;
1367 struct ndr_pull *pull;
1368 struct ndr_push *push;
1369 enum ndr_err_code ndr_err;
1370 DATA_BLOB blob;
1371 struct winreg_QueryValue *r;
1373 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYVALUE];
1375 r = talloc(talloc_tos(), struct winreg_QueryValue);
1376 if (r == NULL) {
1377 return false;
1380 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1381 talloc_free(r);
1382 return false;
1385 pull = ndr_pull_init_blob(&blob, r, NULL);
1386 if (pull == NULL) {
1387 talloc_free(r);
1388 return false;
1391 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1392 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1393 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1394 talloc_free(r);
1395 return false;
1398 if (DEBUGLEVEL >= 10) {
1399 NDR_PRINT_IN_DEBUG(winreg_QueryValue, r);
1402 ZERO_STRUCT(r->out);
1403 r->out.type = r->in.type;
1404 r->out.data = r->in.data;
1405 r->out.data_size = r->in.data_size;
1406 r->out.data_length = r->in.data_length;
1407 r->out.result = _winreg_QueryValue(p, r);
1409 if (p->rng_fault_state) {
1410 talloc_free(r);
1411 /* Return true here, srv_pipe_hnd.c will take care */
1412 return true;
1415 if (DEBUGLEVEL >= 10) {
1416 NDR_PRINT_OUT_DEBUG(winreg_QueryValue, r);
1419 push = ndr_push_init_ctx(r, NULL);
1420 if (push == NULL) {
1421 talloc_free(r);
1422 return false;
1425 ndr_err = call->ndr_push(push, NDR_OUT, r);
1426 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1427 talloc_free(r);
1428 return false;
1431 blob = ndr_push_blob(push);
1432 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1433 talloc_free(r);
1434 return false;
1437 talloc_free(r);
1439 return true;
1442 static bool api_winreg_ReplaceKey(pipes_struct *p)
1444 const struct ndr_interface_call *call;
1445 struct ndr_pull *pull;
1446 struct ndr_push *push;
1447 enum ndr_err_code ndr_err;
1448 DATA_BLOB blob;
1449 struct winreg_ReplaceKey *r;
1451 call = &ndr_table_winreg.calls[NDR_WINREG_REPLACEKEY];
1453 r = talloc(talloc_tos(), struct winreg_ReplaceKey);
1454 if (r == NULL) {
1455 return false;
1458 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1459 talloc_free(r);
1460 return false;
1463 pull = ndr_pull_init_blob(&blob, r, NULL);
1464 if (pull == NULL) {
1465 talloc_free(r);
1466 return false;
1469 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1470 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1471 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1472 talloc_free(r);
1473 return false;
1476 if (DEBUGLEVEL >= 10) {
1477 NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, r);
1480 r->out.result = _winreg_ReplaceKey(p, r);
1482 if (p->rng_fault_state) {
1483 talloc_free(r);
1484 /* Return true here, srv_pipe_hnd.c will take care */
1485 return true;
1488 if (DEBUGLEVEL >= 10) {
1489 NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, r);
1492 push = ndr_push_init_ctx(r, NULL);
1493 if (push == NULL) {
1494 talloc_free(r);
1495 return false;
1498 ndr_err = call->ndr_push(push, NDR_OUT, r);
1499 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1500 talloc_free(r);
1501 return false;
1504 blob = ndr_push_blob(push);
1505 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1506 talloc_free(r);
1507 return false;
1510 talloc_free(r);
1512 return true;
1515 static bool api_winreg_RestoreKey(pipes_struct *p)
1517 const struct ndr_interface_call *call;
1518 struct ndr_pull *pull;
1519 struct ndr_push *push;
1520 enum ndr_err_code ndr_err;
1521 DATA_BLOB blob;
1522 struct winreg_RestoreKey *r;
1524 call = &ndr_table_winreg.calls[NDR_WINREG_RESTOREKEY];
1526 r = talloc(talloc_tos(), struct winreg_RestoreKey);
1527 if (r == NULL) {
1528 return false;
1531 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1532 talloc_free(r);
1533 return false;
1536 pull = ndr_pull_init_blob(&blob, r, NULL);
1537 if (pull == NULL) {
1538 talloc_free(r);
1539 return false;
1542 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1543 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1544 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1545 talloc_free(r);
1546 return false;
1549 if (DEBUGLEVEL >= 10) {
1550 NDR_PRINT_IN_DEBUG(winreg_RestoreKey, r);
1553 r->out.result = _winreg_RestoreKey(p, r);
1555 if (p->rng_fault_state) {
1556 talloc_free(r);
1557 /* Return true here, srv_pipe_hnd.c will take care */
1558 return true;
1561 if (DEBUGLEVEL >= 10) {
1562 NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, r);
1565 push = ndr_push_init_ctx(r, NULL);
1566 if (push == NULL) {
1567 talloc_free(r);
1568 return false;
1571 ndr_err = call->ndr_push(push, NDR_OUT, r);
1572 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1573 talloc_free(r);
1574 return false;
1577 blob = ndr_push_blob(push);
1578 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1579 talloc_free(r);
1580 return false;
1583 talloc_free(r);
1585 return true;
1588 static bool api_winreg_SaveKey(pipes_struct *p)
1590 const struct ndr_interface_call *call;
1591 struct ndr_pull *pull;
1592 struct ndr_push *push;
1593 enum ndr_err_code ndr_err;
1594 DATA_BLOB blob;
1595 struct winreg_SaveKey *r;
1597 call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEY];
1599 r = talloc(talloc_tos(), struct winreg_SaveKey);
1600 if (r == NULL) {
1601 return false;
1604 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1605 talloc_free(r);
1606 return false;
1609 pull = ndr_pull_init_blob(&blob, r, NULL);
1610 if (pull == NULL) {
1611 talloc_free(r);
1612 return false;
1615 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1616 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1617 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1618 talloc_free(r);
1619 return false;
1622 if (DEBUGLEVEL >= 10) {
1623 NDR_PRINT_IN_DEBUG(winreg_SaveKey, r);
1626 r->out.result = _winreg_SaveKey(p, r);
1628 if (p->rng_fault_state) {
1629 talloc_free(r);
1630 /* Return true here, srv_pipe_hnd.c will take care */
1631 return true;
1634 if (DEBUGLEVEL >= 10) {
1635 NDR_PRINT_OUT_DEBUG(winreg_SaveKey, r);
1638 push = ndr_push_init_ctx(r, NULL);
1639 if (push == NULL) {
1640 talloc_free(r);
1641 return false;
1644 ndr_err = call->ndr_push(push, NDR_OUT, r);
1645 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1646 talloc_free(r);
1647 return false;
1650 blob = ndr_push_blob(push);
1651 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1652 talloc_free(r);
1653 return false;
1656 talloc_free(r);
1658 return true;
1661 static bool api_winreg_SetKeySecurity(pipes_struct *p)
1663 const struct ndr_interface_call *call;
1664 struct ndr_pull *pull;
1665 struct ndr_push *push;
1666 enum ndr_err_code ndr_err;
1667 DATA_BLOB blob;
1668 struct winreg_SetKeySecurity *r;
1670 call = &ndr_table_winreg.calls[NDR_WINREG_SETKEYSECURITY];
1672 r = talloc(talloc_tos(), struct winreg_SetKeySecurity);
1673 if (r == NULL) {
1674 return false;
1677 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1678 talloc_free(r);
1679 return false;
1682 pull = ndr_pull_init_blob(&blob, r, NULL);
1683 if (pull == NULL) {
1684 talloc_free(r);
1685 return false;
1688 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1689 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1690 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1691 talloc_free(r);
1692 return false;
1695 if (DEBUGLEVEL >= 10) {
1696 NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, r);
1699 r->out.result = _winreg_SetKeySecurity(p, r);
1701 if (p->rng_fault_state) {
1702 talloc_free(r);
1703 /* Return true here, srv_pipe_hnd.c will take care */
1704 return true;
1707 if (DEBUGLEVEL >= 10) {
1708 NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, r);
1711 push = ndr_push_init_ctx(r, NULL);
1712 if (push == NULL) {
1713 talloc_free(r);
1714 return false;
1717 ndr_err = call->ndr_push(push, NDR_OUT, r);
1718 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1719 talloc_free(r);
1720 return false;
1723 blob = ndr_push_blob(push);
1724 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1725 talloc_free(r);
1726 return false;
1729 talloc_free(r);
1731 return true;
1734 static bool api_winreg_SetValue(pipes_struct *p)
1736 const struct ndr_interface_call *call;
1737 struct ndr_pull *pull;
1738 struct ndr_push *push;
1739 enum ndr_err_code ndr_err;
1740 DATA_BLOB blob;
1741 struct winreg_SetValue *r;
1743 call = &ndr_table_winreg.calls[NDR_WINREG_SETVALUE];
1745 r = talloc(talloc_tos(), struct winreg_SetValue);
1746 if (r == NULL) {
1747 return false;
1750 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1751 talloc_free(r);
1752 return false;
1755 pull = ndr_pull_init_blob(&blob, r, NULL);
1756 if (pull == NULL) {
1757 talloc_free(r);
1758 return false;
1761 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1762 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1763 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1764 talloc_free(r);
1765 return false;
1768 if (DEBUGLEVEL >= 10) {
1769 NDR_PRINT_IN_DEBUG(winreg_SetValue, r);
1772 r->out.result = _winreg_SetValue(p, r);
1774 if (p->rng_fault_state) {
1775 talloc_free(r);
1776 /* Return true here, srv_pipe_hnd.c will take care */
1777 return true;
1780 if (DEBUGLEVEL >= 10) {
1781 NDR_PRINT_OUT_DEBUG(winreg_SetValue, r);
1784 push = ndr_push_init_ctx(r, NULL);
1785 if (push == NULL) {
1786 talloc_free(r);
1787 return false;
1790 ndr_err = call->ndr_push(push, NDR_OUT, r);
1791 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1792 talloc_free(r);
1793 return false;
1796 blob = ndr_push_blob(push);
1797 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1798 talloc_free(r);
1799 return false;
1802 talloc_free(r);
1804 return true;
1807 static bool api_winreg_UnLoadKey(pipes_struct *p)
1809 const struct ndr_interface_call *call;
1810 struct ndr_pull *pull;
1811 struct ndr_push *push;
1812 enum ndr_err_code ndr_err;
1813 DATA_BLOB blob;
1814 struct winreg_UnLoadKey *r;
1816 call = &ndr_table_winreg.calls[NDR_WINREG_UNLOADKEY];
1818 r = talloc(talloc_tos(), struct winreg_UnLoadKey);
1819 if (r == NULL) {
1820 return false;
1823 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1824 talloc_free(r);
1825 return false;
1828 pull = ndr_pull_init_blob(&blob, r, NULL);
1829 if (pull == NULL) {
1830 talloc_free(r);
1831 return false;
1834 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1835 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1836 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1837 talloc_free(r);
1838 return false;
1841 if (DEBUGLEVEL >= 10) {
1842 NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, r);
1845 r->out.result = _winreg_UnLoadKey(p, r);
1847 if (p->rng_fault_state) {
1848 talloc_free(r);
1849 /* Return true here, srv_pipe_hnd.c will take care */
1850 return true;
1853 if (DEBUGLEVEL >= 10) {
1854 NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, r);
1857 push = ndr_push_init_ctx(r, NULL);
1858 if (push == NULL) {
1859 talloc_free(r);
1860 return false;
1863 ndr_err = call->ndr_push(push, NDR_OUT, r);
1864 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1865 talloc_free(r);
1866 return false;
1869 blob = ndr_push_blob(push);
1870 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1871 talloc_free(r);
1872 return false;
1875 talloc_free(r);
1877 return true;
1880 static bool api_winreg_InitiateSystemShutdown(pipes_struct *p)
1882 const struct ndr_interface_call *call;
1883 struct ndr_pull *pull;
1884 struct ndr_push *push;
1885 enum ndr_err_code ndr_err;
1886 DATA_BLOB blob;
1887 struct winreg_InitiateSystemShutdown *r;
1889 call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWN];
1891 r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdown);
1892 if (r == NULL) {
1893 return false;
1896 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1897 talloc_free(r);
1898 return false;
1901 pull = ndr_pull_init_blob(&blob, r, NULL);
1902 if (pull == NULL) {
1903 talloc_free(r);
1904 return false;
1907 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1908 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1909 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1910 talloc_free(r);
1911 return false;
1914 if (DEBUGLEVEL >= 10) {
1915 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, r);
1918 r->out.result = _winreg_InitiateSystemShutdown(p, r);
1920 if (p->rng_fault_state) {
1921 talloc_free(r);
1922 /* Return true here, srv_pipe_hnd.c will take care */
1923 return true;
1926 if (DEBUGLEVEL >= 10) {
1927 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, r);
1930 push = ndr_push_init_ctx(r, NULL);
1931 if (push == NULL) {
1932 talloc_free(r);
1933 return false;
1936 ndr_err = call->ndr_push(push, NDR_OUT, r);
1937 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1938 talloc_free(r);
1939 return false;
1942 blob = ndr_push_blob(push);
1943 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1944 talloc_free(r);
1945 return false;
1948 talloc_free(r);
1950 return true;
1953 static bool api_winreg_AbortSystemShutdown(pipes_struct *p)
1955 const struct ndr_interface_call *call;
1956 struct ndr_pull *pull;
1957 struct ndr_push *push;
1958 enum ndr_err_code ndr_err;
1959 DATA_BLOB blob;
1960 struct winreg_AbortSystemShutdown *r;
1962 call = &ndr_table_winreg.calls[NDR_WINREG_ABORTSYSTEMSHUTDOWN];
1964 r = talloc(talloc_tos(), struct winreg_AbortSystemShutdown);
1965 if (r == NULL) {
1966 return false;
1969 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1970 talloc_free(r);
1971 return false;
1974 pull = ndr_pull_init_blob(&blob, r, NULL);
1975 if (pull == NULL) {
1976 talloc_free(r);
1977 return false;
1980 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1981 ndr_err = call->ndr_pull(pull, NDR_IN, r);
1982 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1983 talloc_free(r);
1984 return false;
1987 if (DEBUGLEVEL >= 10) {
1988 NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, r);
1991 r->out.result = _winreg_AbortSystemShutdown(p, r);
1993 if (p->rng_fault_state) {
1994 talloc_free(r);
1995 /* Return true here, srv_pipe_hnd.c will take care */
1996 return true;
1999 if (DEBUGLEVEL >= 10) {
2000 NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, r);
2003 push = ndr_push_init_ctx(r, NULL);
2004 if (push == NULL) {
2005 talloc_free(r);
2006 return false;
2009 ndr_err = call->ndr_push(push, NDR_OUT, r);
2010 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2011 talloc_free(r);
2012 return false;
2015 blob = ndr_push_blob(push);
2016 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2017 talloc_free(r);
2018 return false;
2021 talloc_free(r);
2023 return true;
2026 static bool api_winreg_GetVersion(pipes_struct *p)
2028 const struct ndr_interface_call *call;
2029 struct ndr_pull *pull;
2030 struct ndr_push *push;
2031 enum ndr_err_code ndr_err;
2032 DATA_BLOB blob;
2033 struct winreg_GetVersion *r;
2035 call = &ndr_table_winreg.calls[NDR_WINREG_GETVERSION];
2037 r = talloc(talloc_tos(), struct winreg_GetVersion);
2038 if (r == NULL) {
2039 return false;
2042 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2043 talloc_free(r);
2044 return false;
2047 pull = ndr_pull_init_blob(&blob, r, NULL);
2048 if (pull == NULL) {
2049 talloc_free(r);
2050 return false;
2053 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2054 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2055 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2056 talloc_free(r);
2057 return false;
2060 if (DEBUGLEVEL >= 10) {
2061 NDR_PRINT_IN_DEBUG(winreg_GetVersion, r);
2064 ZERO_STRUCT(r->out);
2065 r->out.version = talloc_zero(r, uint32_t);
2066 if (r->out.version == NULL) {
2067 talloc_free(r);
2068 return false;
2071 r->out.result = _winreg_GetVersion(p, r);
2073 if (p->rng_fault_state) {
2074 talloc_free(r);
2075 /* Return true here, srv_pipe_hnd.c will take care */
2076 return true;
2079 if (DEBUGLEVEL >= 10) {
2080 NDR_PRINT_OUT_DEBUG(winreg_GetVersion, r);
2083 push = ndr_push_init_ctx(r, NULL);
2084 if (push == NULL) {
2085 talloc_free(r);
2086 return false;
2089 ndr_err = call->ndr_push(push, NDR_OUT, r);
2090 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2091 talloc_free(r);
2092 return false;
2095 blob = ndr_push_blob(push);
2096 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2097 talloc_free(r);
2098 return false;
2101 talloc_free(r);
2103 return true;
2106 static bool api_winreg_OpenHKCC(pipes_struct *p)
2108 const struct ndr_interface_call *call;
2109 struct ndr_pull *pull;
2110 struct ndr_push *push;
2111 enum ndr_err_code ndr_err;
2112 DATA_BLOB blob;
2113 struct winreg_OpenHKCC *r;
2115 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCC];
2117 r = talloc(talloc_tos(), struct winreg_OpenHKCC);
2118 if (r == NULL) {
2119 return false;
2122 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2123 talloc_free(r);
2124 return false;
2127 pull = ndr_pull_init_blob(&blob, r, NULL);
2128 if (pull == NULL) {
2129 talloc_free(r);
2130 return false;
2133 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2134 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2135 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2136 talloc_free(r);
2137 return false;
2140 if (DEBUGLEVEL >= 10) {
2141 NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, r);
2144 ZERO_STRUCT(r->out);
2145 r->out.handle = talloc_zero(r, struct policy_handle);
2146 if (r->out.handle == NULL) {
2147 talloc_free(r);
2148 return false;
2151 r->out.result = _winreg_OpenHKCC(p, r);
2153 if (p->rng_fault_state) {
2154 talloc_free(r);
2155 /* Return true here, srv_pipe_hnd.c will take care */
2156 return true;
2159 if (DEBUGLEVEL >= 10) {
2160 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, r);
2163 push = ndr_push_init_ctx(r, NULL);
2164 if (push == NULL) {
2165 talloc_free(r);
2166 return false;
2169 ndr_err = call->ndr_push(push, NDR_OUT, r);
2170 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2171 talloc_free(r);
2172 return false;
2175 blob = ndr_push_blob(push);
2176 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2177 talloc_free(r);
2178 return false;
2181 talloc_free(r);
2183 return true;
2186 static bool api_winreg_OpenHKDD(pipes_struct *p)
2188 const struct ndr_interface_call *call;
2189 struct ndr_pull *pull;
2190 struct ndr_push *push;
2191 enum ndr_err_code ndr_err;
2192 DATA_BLOB blob;
2193 struct winreg_OpenHKDD *r;
2195 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKDD];
2197 r = talloc(talloc_tos(), struct winreg_OpenHKDD);
2198 if (r == NULL) {
2199 return false;
2202 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2203 talloc_free(r);
2204 return false;
2207 pull = ndr_pull_init_blob(&blob, r, NULL);
2208 if (pull == NULL) {
2209 talloc_free(r);
2210 return false;
2213 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2214 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2215 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2216 talloc_free(r);
2217 return false;
2220 if (DEBUGLEVEL >= 10) {
2221 NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, r);
2224 ZERO_STRUCT(r->out);
2225 r->out.handle = talloc_zero(r, struct policy_handle);
2226 if (r->out.handle == NULL) {
2227 talloc_free(r);
2228 return false;
2231 r->out.result = _winreg_OpenHKDD(p, r);
2233 if (p->rng_fault_state) {
2234 talloc_free(r);
2235 /* Return true here, srv_pipe_hnd.c will take care */
2236 return true;
2239 if (DEBUGLEVEL >= 10) {
2240 NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, r);
2243 push = ndr_push_init_ctx(r, NULL);
2244 if (push == NULL) {
2245 talloc_free(r);
2246 return false;
2249 ndr_err = call->ndr_push(push, NDR_OUT, r);
2250 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2251 talloc_free(r);
2252 return false;
2255 blob = ndr_push_blob(push);
2256 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2257 talloc_free(r);
2258 return false;
2261 talloc_free(r);
2263 return true;
2266 static bool api_winreg_QueryMultipleValues(pipes_struct *p)
2268 const struct ndr_interface_call *call;
2269 struct ndr_pull *pull;
2270 struct ndr_push *push;
2271 enum ndr_err_code ndr_err;
2272 DATA_BLOB blob;
2273 struct winreg_QueryMultipleValues *r;
2275 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES];
2277 r = talloc(talloc_tos(), struct winreg_QueryMultipleValues);
2278 if (r == NULL) {
2279 return false;
2282 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2283 talloc_free(r);
2284 return false;
2287 pull = ndr_pull_init_blob(&blob, r, NULL);
2288 if (pull == NULL) {
2289 talloc_free(r);
2290 return false;
2293 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2294 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2295 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2296 talloc_free(r);
2297 return false;
2300 if (DEBUGLEVEL >= 10) {
2301 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, r);
2304 ZERO_STRUCT(r->out);
2305 r->out.values = r->in.values;
2306 r->out.buffer = r->in.buffer;
2307 r->out.buffer_size = r->in.buffer_size;
2308 r->out.result = _winreg_QueryMultipleValues(p, r);
2310 if (p->rng_fault_state) {
2311 talloc_free(r);
2312 /* Return true here, srv_pipe_hnd.c will take care */
2313 return true;
2316 if (DEBUGLEVEL >= 10) {
2317 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, r);
2320 push = ndr_push_init_ctx(r, NULL);
2321 if (push == NULL) {
2322 talloc_free(r);
2323 return false;
2326 ndr_err = call->ndr_push(push, NDR_OUT, r);
2327 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2328 talloc_free(r);
2329 return false;
2332 blob = ndr_push_blob(push);
2333 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2334 talloc_free(r);
2335 return false;
2338 talloc_free(r);
2340 return true;
2343 static bool api_winreg_InitiateSystemShutdownEx(pipes_struct *p)
2345 const struct ndr_interface_call *call;
2346 struct ndr_pull *pull;
2347 struct ndr_push *push;
2348 enum ndr_err_code ndr_err;
2349 DATA_BLOB blob;
2350 struct winreg_InitiateSystemShutdownEx *r;
2352 call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWNEX];
2354 r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdownEx);
2355 if (r == NULL) {
2356 return false;
2359 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2360 talloc_free(r);
2361 return false;
2364 pull = ndr_pull_init_blob(&blob, r, NULL);
2365 if (pull == NULL) {
2366 talloc_free(r);
2367 return false;
2370 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2371 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2372 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2373 talloc_free(r);
2374 return false;
2377 if (DEBUGLEVEL >= 10) {
2378 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, r);
2381 r->out.result = _winreg_InitiateSystemShutdownEx(p, r);
2383 if (p->rng_fault_state) {
2384 talloc_free(r);
2385 /* Return true here, srv_pipe_hnd.c will take care */
2386 return true;
2389 if (DEBUGLEVEL >= 10) {
2390 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, r);
2393 push = ndr_push_init_ctx(r, NULL);
2394 if (push == NULL) {
2395 talloc_free(r);
2396 return false;
2399 ndr_err = call->ndr_push(push, NDR_OUT, r);
2400 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2401 talloc_free(r);
2402 return false;
2405 blob = ndr_push_blob(push);
2406 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2407 talloc_free(r);
2408 return false;
2411 talloc_free(r);
2413 return true;
2416 static bool api_winreg_SaveKeyEx(pipes_struct *p)
2418 const struct ndr_interface_call *call;
2419 struct ndr_pull *pull;
2420 struct ndr_push *push;
2421 enum ndr_err_code ndr_err;
2422 DATA_BLOB blob;
2423 struct winreg_SaveKeyEx *r;
2425 call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEYEX];
2427 r = talloc(talloc_tos(), struct winreg_SaveKeyEx);
2428 if (r == NULL) {
2429 return false;
2432 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2433 talloc_free(r);
2434 return false;
2437 pull = ndr_pull_init_blob(&blob, r, NULL);
2438 if (pull == NULL) {
2439 talloc_free(r);
2440 return false;
2443 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2444 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2445 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2446 talloc_free(r);
2447 return false;
2450 if (DEBUGLEVEL >= 10) {
2451 NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, r);
2454 r->out.result = _winreg_SaveKeyEx(p, r);
2456 if (p->rng_fault_state) {
2457 talloc_free(r);
2458 /* Return true here, srv_pipe_hnd.c will take care */
2459 return true;
2462 if (DEBUGLEVEL >= 10) {
2463 NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, r);
2466 push = ndr_push_init_ctx(r, NULL);
2467 if (push == NULL) {
2468 talloc_free(r);
2469 return false;
2472 ndr_err = call->ndr_push(push, NDR_OUT, r);
2473 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2474 talloc_free(r);
2475 return false;
2478 blob = ndr_push_blob(push);
2479 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2480 talloc_free(r);
2481 return false;
2484 talloc_free(r);
2486 return true;
2489 static bool api_winreg_OpenHKPT(pipes_struct *p)
2491 const struct ndr_interface_call *call;
2492 struct ndr_pull *pull;
2493 struct ndr_push *push;
2494 enum ndr_err_code ndr_err;
2495 DATA_BLOB blob;
2496 struct winreg_OpenHKPT *r;
2498 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPT];
2500 r = talloc(talloc_tos(), struct winreg_OpenHKPT);
2501 if (r == NULL) {
2502 return false;
2505 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2506 talloc_free(r);
2507 return false;
2510 pull = ndr_pull_init_blob(&blob, r, NULL);
2511 if (pull == NULL) {
2512 talloc_free(r);
2513 return false;
2516 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2517 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2518 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2519 talloc_free(r);
2520 return false;
2523 if (DEBUGLEVEL >= 10) {
2524 NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, r);
2527 ZERO_STRUCT(r->out);
2528 r->out.handle = talloc_zero(r, struct policy_handle);
2529 if (r->out.handle == NULL) {
2530 talloc_free(r);
2531 return false;
2534 r->out.result = _winreg_OpenHKPT(p, r);
2536 if (p->rng_fault_state) {
2537 talloc_free(r);
2538 /* Return true here, srv_pipe_hnd.c will take care */
2539 return true;
2542 if (DEBUGLEVEL >= 10) {
2543 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, r);
2546 push = ndr_push_init_ctx(r, NULL);
2547 if (push == NULL) {
2548 talloc_free(r);
2549 return false;
2552 ndr_err = call->ndr_push(push, NDR_OUT, r);
2553 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2554 talloc_free(r);
2555 return false;
2558 blob = ndr_push_blob(push);
2559 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2560 talloc_free(r);
2561 return false;
2564 talloc_free(r);
2566 return true;
2569 static bool api_winreg_OpenHKPN(pipes_struct *p)
2571 const struct ndr_interface_call *call;
2572 struct ndr_pull *pull;
2573 struct ndr_push *push;
2574 enum ndr_err_code ndr_err;
2575 DATA_BLOB blob;
2576 struct winreg_OpenHKPN *r;
2578 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPN];
2580 r = talloc(talloc_tos(), struct winreg_OpenHKPN);
2581 if (r == NULL) {
2582 return false;
2585 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2586 talloc_free(r);
2587 return false;
2590 pull = ndr_pull_init_blob(&blob, r, NULL);
2591 if (pull == NULL) {
2592 talloc_free(r);
2593 return false;
2596 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2597 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2598 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2599 talloc_free(r);
2600 return false;
2603 if (DEBUGLEVEL >= 10) {
2604 NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, r);
2607 ZERO_STRUCT(r->out);
2608 r->out.handle = talloc_zero(r, struct policy_handle);
2609 if (r->out.handle == NULL) {
2610 talloc_free(r);
2611 return false;
2614 r->out.result = _winreg_OpenHKPN(p, r);
2616 if (p->rng_fault_state) {
2617 talloc_free(r);
2618 /* Return true here, srv_pipe_hnd.c will take care */
2619 return true;
2622 if (DEBUGLEVEL >= 10) {
2623 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, r);
2626 push = ndr_push_init_ctx(r, NULL);
2627 if (push == NULL) {
2628 talloc_free(r);
2629 return false;
2632 ndr_err = call->ndr_push(push, NDR_OUT, r);
2633 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2634 talloc_free(r);
2635 return false;
2638 blob = ndr_push_blob(push);
2639 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2640 talloc_free(r);
2641 return false;
2644 talloc_free(r);
2646 return true;
2649 static bool api_winreg_QueryMultipleValues2(pipes_struct *p)
2651 const struct ndr_interface_call *call;
2652 struct ndr_pull *pull;
2653 struct ndr_push *push;
2654 enum ndr_err_code ndr_err;
2655 DATA_BLOB blob;
2656 struct winreg_QueryMultipleValues2 *r;
2658 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES2];
2660 r = talloc(talloc_tos(), struct winreg_QueryMultipleValues2);
2661 if (r == NULL) {
2662 return false;
2665 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2666 talloc_free(r);
2667 return false;
2670 pull = ndr_pull_init_blob(&blob, r, NULL);
2671 if (pull == NULL) {
2672 talloc_free(r);
2673 return false;
2676 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2677 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2678 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2679 talloc_free(r);
2680 return false;
2683 if (DEBUGLEVEL >= 10) {
2684 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, r);
2687 r->out.result = _winreg_QueryMultipleValues2(p, r);
2689 if (p->rng_fault_state) {
2690 talloc_free(r);
2691 /* Return true here, srv_pipe_hnd.c will take care */
2692 return true;
2695 if (DEBUGLEVEL >= 10) {
2696 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, r);
2699 push = ndr_push_init_ctx(r, NULL);
2700 if (push == NULL) {
2701 talloc_free(r);
2702 return false;
2705 ndr_err = call->ndr_push(push, NDR_OUT, r);
2706 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2707 talloc_free(r);
2708 return false;
2711 blob = ndr_push_blob(push);
2712 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2713 talloc_free(r);
2714 return false;
2717 talloc_free(r);
2719 return true;
2723 /* Tables */
2724 static struct api_struct api_winreg_cmds[] =
2726 {"WINREG_OPENHKCR", NDR_WINREG_OPENHKCR, api_winreg_OpenHKCR},
2727 {"WINREG_OPENHKCU", NDR_WINREG_OPENHKCU, api_winreg_OpenHKCU},
2728 {"WINREG_OPENHKLM", NDR_WINREG_OPENHKLM, api_winreg_OpenHKLM},
2729 {"WINREG_OPENHKPD", NDR_WINREG_OPENHKPD, api_winreg_OpenHKPD},
2730 {"WINREG_OPENHKU", NDR_WINREG_OPENHKU, api_winreg_OpenHKU},
2731 {"WINREG_CLOSEKEY", NDR_WINREG_CLOSEKEY, api_winreg_CloseKey},
2732 {"WINREG_CREATEKEY", NDR_WINREG_CREATEKEY, api_winreg_CreateKey},
2733 {"WINREG_DELETEKEY", NDR_WINREG_DELETEKEY, api_winreg_DeleteKey},
2734 {"WINREG_DELETEVALUE", NDR_WINREG_DELETEVALUE, api_winreg_DeleteValue},
2735 {"WINREG_ENUMKEY", NDR_WINREG_ENUMKEY, api_winreg_EnumKey},
2736 {"WINREG_ENUMVALUE", NDR_WINREG_ENUMVALUE, api_winreg_EnumValue},
2737 {"WINREG_FLUSHKEY", NDR_WINREG_FLUSHKEY, api_winreg_FlushKey},
2738 {"WINREG_GETKEYSECURITY", NDR_WINREG_GETKEYSECURITY, api_winreg_GetKeySecurity},
2739 {"WINREG_LOADKEY", NDR_WINREG_LOADKEY, api_winreg_LoadKey},
2740 {"WINREG_NOTIFYCHANGEKEYVALUE", NDR_WINREG_NOTIFYCHANGEKEYVALUE, api_winreg_NotifyChangeKeyValue},
2741 {"WINREG_OPENKEY", NDR_WINREG_OPENKEY, api_winreg_OpenKey},
2742 {"WINREG_QUERYINFOKEY", NDR_WINREG_QUERYINFOKEY, api_winreg_QueryInfoKey},
2743 {"WINREG_QUERYVALUE", NDR_WINREG_QUERYVALUE, api_winreg_QueryValue},
2744 {"WINREG_REPLACEKEY", NDR_WINREG_REPLACEKEY, api_winreg_ReplaceKey},
2745 {"WINREG_RESTOREKEY", NDR_WINREG_RESTOREKEY, api_winreg_RestoreKey},
2746 {"WINREG_SAVEKEY", NDR_WINREG_SAVEKEY, api_winreg_SaveKey},
2747 {"WINREG_SETKEYSECURITY", NDR_WINREG_SETKEYSECURITY, api_winreg_SetKeySecurity},
2748 {"WINREG_SETVALUE", NDR_WINREG_SETVALUE, api_winreg_SetValue},
2749 {"WINREG_UNLOADKEY", NDR_WINREG_UNLOADKEY, api_winreg_UnLoadKey},
2750 {"WINREG_INITIATESYSTEMSHUTDOWN", NDR_WINREG_INITIATESYSTEMSHUTDOWN, api_winreg_InitiateSystemShutdown},
2751 {"WINREG_ABORTSYSTEMSHUTDOWN", NDR_WINREG_ABORTSYSTEMSHUTDOWN, api_winreg_AbortSystemShutdown},
2752 {"WINREG_GETVERSION", NDR_WINREG_GETVERSION, api_winreg_GetVersion},
2753 {"WINREG_OPENHKCC", NDR_WINREG_OPENHKCC, api_winreg_OpenHKCC},
2754 {"WINREG_OPENHKDD", NDR_WINREG_OPENHKDD, api_winreg_OpenHKDD},
2755 {"WINREG_QUERYMULTIPLEVALUES", NDR_WINREG_QUERYMULTIPLEVALUES, api_winreg_QueryMultipleValues},
2756 {"WINREG_INITIATESYSTEMSHUTDOWNEX", NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, api_winreg_InitiateSystemShutdownEx},
2757 {"WINREG_SAVEKEYEX", NDR_WINREG_SAVEKEYEX, api_winreg_SaveKeyEx},
2758 {"WINREG_OPENHKPT", NDR_WINREG_OPENHKPT, api_winreg_OpenHKPT},
2759 {"WINREG_OPENHKPN", NDR_WINREG_OPENHKPN, api_winreg_OpenHKPN},
2760 {"WINREG_QUERYMULTIPLEVALUES2", NDR_WINREG_QUERYMULTIPLEVALUES2, api_winreg_QueryMultipleValues2},
2763 void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns)
2765 *fns = api_winreg_cmds;
2766 *n_fns = sizeof(api_winreg_cmds) / sizeof(struct api_struct);
2769 NTSTATUS rpc_winreg_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
2771 if (cli->pipes_struct == NULL) {
2772 return NT_STATUS_INVALID_PARAMETER;
2775 switch (opnum)
2777 case NDR_WINREG_OPENHKCR: {
2778 struct winreg_OpenHKCR *r = (struct winreg_OpenHKCR *)_r;
2779 ZERO_STRUCT(r->out);
2780 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2781 if (r->out.handle == NULL) {
2782 return NT_STATUS_NO_MEMORY;
2785 r->out.result = _winreg_OpenHKCR(cli->pipes_struct, r);
2786 return NT_STATUS_OK;
2789 case NDR_WINREG_OPENHKCU: {
2790 struct winreg_OpenHKCU *r = (struct winreg_OpenHKCU *)_r;
2791 ZERO_STRUCT(r->out);
2792 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2793 if (r->out.handle == NULL) {
2794 return NT_STATUS_NO_MEMORY;
2797 r->out.result = _winreg_OpenHKCU(cli->pipes_struct, r);
2798 return NT_STATUS_OK;
2801 case NDR_WINREG_OPENHKLM: {
2802 struct winreg_OpenHKLM *r = (struct winreg_OpenHKLM *)_r;
2803 ZERO_STRUCT(r->out);
2804 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2805 if (r->out.handle == NULL) {
2806 return NT_STATUS_NO_MEMORY;
2809 r->out.result = _winreg_OpenHKLM(cli->pipes_struct, r);
2810 return NT_STATUS_OK;
2813 case NDR_WINREG_OPENHKPD: {
2814 struct winreg_OpenHKPD *r = (struct winreg_OpenHKPD *)_r;
2815 ZERO_STRUCT(r->out);
2816 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2817 if (r->out.handle == NULL) {
2818 return NT_STATUS_NO_MEMORY;
2821 r->out.result = _winreg_OpenHKPD(cli->pipes_struct, r);
2822 return NT_STATUS_OK;
2825 case NDR_WINREG_OPENHKU: {
2826 struct winreg_OpenHKU *r = (struct winreg_OpenHKU *)_r;
2827 ZERO_STRUCT(r->out);
2828 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2829 if (r->out.handle == NULL) {
2830 return NT_STATUS_NO_MEMORY;
2833 r->out.result = _winreg_OpenHKU(cli->pipes_struct, r);
2834 return NT_STATUS_OK;
2837 case NDR_WINREG_CLOSEKEY: {
2838 struct winreg_CloseKey *r = (struct winreg_CloseKey *)_r;
2839 ZERO_STRUCT(r->out);
2840 r->out.handle = r->in.handle;
2841 r->out.result = _winreg_CloseKey(cli->pipes_struct, r);
2842 return NT_STATUS_OK;
2845 case NDR_WINREG_CREATEKEY: {
2846 struct winreg_CreateKey *r = (struct winreg_CreateKey *)_r;
2847 ZERO_STRUCT(r->out);
2848 r->out.action_taken = r->in.action_taken;
2849 r->out.new_handle = talloc_zero(mem_ctx, struct policy_handle);
2850 if (r->out.new_handle == NULL) {
2851 return NT_STATUS_NO_MEMORY;
2854 r->out.result = _winreg_CreateKey(cli->pipes_struct, r);
2855 return NT_STATUS_OK;
2858 case NDR_WINREG_DELETEKEY: {
2859 struct winreg_DeleteKey *r = (struct winreg_DeleteKey *)_r;
2860 r->out.result = _winreg_DeleteKey(cli->pipes_struct, r);
2861 return NT_STATUS_OK;
2864 case NDR_WINREG_DELETEVALUE: {
2865 struct winreg_DeleteValue *r = (struct winreg_DeleteValue *)_r;
2866 r->out.result = _winreg_DeleteValue(cli->pipes_struct, r);
2867 return NT_STATUS_OK;
2870 case NDR_WINREG_ENUMKEY: {
2871 struct winreg_EnumKey *r = (struct winreg_EnumKey *)_r;
2872 ZERO_STRUCT(r->out);
2873 r->out.name = r->in.name;
2874 r->out.keyclass = r->in.keyclass;
2875 r->out.last_changed_time = r->in.last_changed_time;
2876 r->out.result = _winreg_EnumKey(cli->pipes_struct, r);
2877 return NT_STATUS_OK;
2880 case NDR_WINREG_ENUMVALUE: {
2881 struct winreg_EnumValue *r = (struct winreg_EnumValue *)_r;
2882 ZERO_STRUCT(r->out);
2883 r->out.name = r->in.name;
2884 r->out.type = r->in.type;
2885 r->out.value = r->in.value;
2886 r->out.size = r->in.size;
2887 r->out.length = r->in.length;
2888 r->out.result = _winreg_EnumValue(cli->pipes_struct, r);
2889 return NT_STATUS_OK;
2892 case NDR_WINREG_FLUSHKEY: {
2893 struct winreg_FlushKey *r = (struct winreg_FlushKey *)_r;
2894 r->out.result = _winreg_FlushKey(cli->pipes_struct, r);
2895 return NT_STATUS_OK;
2898 case NDR_WINREG_GETKEYSECURITY: {
2899 struct winreg_GetKeySecurity *r = (struct winreg_GetKeySecurity *)_r;
2900 ZERO_STRUCT(r->out);
2901 r->out.sd = r->in.sd;
2902 r->out.result = _winreg_GetKeySecurity(cli->pipes_struct, r);
2903 return NT_STATUS_OK;
2906 case NDR_WINREG_LOADKEY: {
2907 struct winreg_LoadKey *r = (struct winreg_LoadKey *)_r;
2908 r->out.result = _winreg_LoadKey(cli->pipes_struct, r);
2909 return NT_STATUS_OK;
2912 case NDR_WINREG_NOTIFYCHANGEKEYVALUE: {
2913 struct winreg_NotifyChangeKeyValue *r = (struct winreg_NotifyChangeKeyValue *)_r;
2914 r->out.result = _winreg_NotifyChangeKeyValue(cli->pipes_struct, r);
2915 return NT_STATUS_OK;
2918 case NDR_WINREG_OPENKEY: {
2919 struct winreg_OpenKey *r = (struct winreg_OpenKey *)_r;
2920 ZERO_STRUCT(r->out);
2921 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2922 if (r->out.handle == NULL) {
2923 return NT_STATUS_NO_MEMORY;
2926 r->out.result = _winreg_OpenKey(cli->pipes_struct, r);
2927 return NT_STATUS_OK;
2930 case NDR_WINREG_QUERYINFOKEY: {
2931 struct winreg_QueryInfoKey *r = (struct winreg_QueryInfoKey *)_r;
2932 ZERO_STRUCT(r->out);
2933 r->out.classname = r->in.classname;
2934 r->out.num_subkeys = talloc_zero(mem_ctx, uint32_t);
2935 if (r->out.num_subkeys == NULL) {
2936 return NT_STATUS_NO_MEMORY;
2939 r->out.max_subkeylen = talloc_zero(mem_ctx, uint32_t);
2940 if (r->out.max_subkeylen == NULL) {
2941 return NT_STATUS_NO_MEMORY;
2944 r->out.max_classlen = talloc_zero(mem_ctx, uint32_t);
2945 if (r->out.max_classlen == NULL) {
2946 return NT_STATUS_NO_MEMORY;
2949 r->out.num_values = talloc_zero(mem_ctx, uint32_t);
2950 if (r->out.num_values == NULL) {
2951 return NT_STATUS_NO_MEMORY;
2954 r->out.max_valnamelen = talloc_zero(mem_ctx, uint32_t);
2955 if (r->out.max_valnamelen == NULL) {
2956 return NT_STATUS_NO_MEMORY;
2959 r->out.max_valbufsize = talloc_zero(mem_ctx, uint32_t);
2960 if (r->out.max_valbufsize == NULL) {
2961 return NT_STATUS_NO_MEMORY;
2964 r->out.secdescsize = talloc_zero(mem_ctx, uint32_t);
2965 if (r->out.secdescsize == NULL) {
2966 return NT_STATUS_NO_MEMORY;
2969 r->out.last_changed_time = talloc_zero(mem_ctx, NTTIME);
2970 if (r->out.last_changed_time == NULL) {
2971 return NT_STATUS_NO_MEMORY;
2974 r->out.result = _winreg_QueryInfoKey(cli->pipes_struct, r);
2975 return NT_STATUS_OK;
2978 case NDR_WINREG_QUERYVALUE: {
2979 struct winreg_QueryValue *r = (struct winreg_QueryValue *)_r;
2980 ZERO_STRUCT(r->out);
2981 r->out.type = r->in.type;
2982 r->out.data = r->in.data;
2983 r->out.data_size = r->in.data_size;
2984 r->out.data_length = r->in.data_length;
2985 r->out.result = _winreg_QueryValue(cli->pipes_struct, r);
2986 return NT_STATUS_OK;
2989 case NDR_WINREG_REPLACEKEY: {
2990 struct winreg_ReplaceKey *r = (struct winreg_ReplaceKey *)_r;
2991 r->out.result = _winreg_ReplaceKey(cli->pipes_struct, r);
2992 return NT_STATUS_OK;
2995 case NDR_WINREG_RESTOREKEY: {
2996 struct winreg_RestoreKey *r = (struct winreg_RestoreKey *)_r;
2997 r->out.result = _winreg_RestoreKey(cli->pipes_struct, r);
2998 return NT_STATUS_OK;
3001 case NDR_WINREG_SAVEKEY: {
3002 struct winreg_SaveKey *r = (struct winreg_SaveKey *)_r;
3003 r->out.result = _winreg_SaveKey(cli->pipes_struct, r);
3004 return NT_STATUS_OK;
3007 case NDR_WINREG_SETKEYSECURITY: {
3008 struct winreg_SetKeySecurity *r = (struct winreg_SetKeySecurity *)_r;
3009 r->out.result = _winreg_SetKeySecurity(cli->pipes_struct, r);
3010 return NT_STATUS_OK;
3013 case NDR_WINREG_SETVALUE: {
3014 struct winreg_SetValue *r = (struct winreg_SetValue *)_r;
3015 r->out.result = _winreg_SetValue(cli->pipes_struct, r);
3016 return NT_STATUS_OK;
3019 case NDR_WINREG_UNLOADKEY: {
3020 struct winreg_UnLoadKey *r = (struct winreg_UnLoadKey *)_r;
3021 r->out.result = _winreg_UnLoadKey(cli->pipes_struct, r);
3022 return NT_STATUS_OK;
3025 case NDR_WINREG_INITIATESYSTEMSHUTDOWN: {
3026 struct winreg_InitiateSystemShutdown *r = (struct winreg_InitiateSystemShutdown *)_r;
3027 r->out.result = _winreg_InitiateSystemShutdown(cli->pipes_struct, r);
3028 return NT_STATUS_OK;
3031 case NDR_WINREG_ABORTSYSTEMSHUTDOWN: {
3032 struct winreg_AbortSystemShutdown *r = (struct winreg_AbortSystemShutdown *)_r;
3033 r->out.result = _winreg_AbortSystemShutdown(cli->pipes_struct, r);
3034 return NT_STATUS_OK;
3037 case NDR_WINREG_GETVERSION: {
3038 struct winreg_GetVersion *r = (struct winreg_GetVersion *)_r;
3039 ZERO_STRUCT(r->out);
3040 r->out.version = talloc_zero(mem_ctx, uint32_t);
3041 if (r->out.version == NULL) {
3042 return NT_STATUS_NO_MEMORY;
3045 r->out.result = _winreg_GetVersion(cli->pipes_struct, r);
3046 return NT_STATUS_OK;
3049 case NDR_WINREG_OPENHKCC: {
3050 struct winreg_OpenHKCC *r = (struct winreg_OpenHKCC *)_r;
3051 ZERO_STRUCT(r->out);
3052 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3053 if (r->out.handle == NULL) {
3054 return NT_STATUS_NO_MEMORY;
3057 r->out.result = _winreg_OpenHKCC(cli->pipes_struct, r);
3058 return NT_STATUS_OK;
3061 case NDR_WINREG_OPENHKDD: {
3062 struct winreg_OpenHKDD *r = (struct winreg_OpenHKDD *)_r;
3063 ZERO_STRUCT(r->out);
3064 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3065 if (r->out.handle == NULL) {
3066 return NT_STATUS_NO_MEMORY;
3069 r->out.result = _winreg_OpenHKDD(cli->pipes_struct, r);
3070 return NT_STATUS_OK;
3073 case NDR_WINREG_QUERYMULTIPLEVALUES: {
3074 struct winreg_QueryMultipleValues *r = (struct winreg_QueryMultipleValues *)_r;
3075 ZERO_STRUCT(r->out);
3076 r->out.values = r->in.values;
3077 r->out.buffer = r->in.buffer;
3078 r->out.buffer_size = r->in.buffer_size;
3079 r->out.result = _winreg_QueryMultipleValues(cli->pipes_struct, r);
3080 return NT_STATUS_OK;
3083 case NDR_WINREG_INITIATESYSTEMSHUTDOWNEX: {
3084 struct winreg_InitiateSystemShutdownEx *r = (struct winreg_InitiateSystemShutdownEx *)_r;
3085 r->out.result = _winreg_InitiateSystemShutdownEx(cli->pipes_struct, r);
3086 return NT_STATUS_OK;
3089 case NDR_WINREG_SAVEKEYEX: {
3090 struct winreg_SaveKeyEx *r = (struct winreg_SaveKeyEx *)_r;
3091 r->out.result = _winreg_SaveKeyEx(cli->pipes_struct, r);
3092 return NT_STATUS_OK;
3095 case NDR_WINREG_OPENHKPT: {
3096 struct winreg_OpenHKPT *r = (struct winreg_OpenHKPT *)_r;
3097 ZERO_STRUCT(r->out);
3098 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3099 if (r->out.handle == NULL) {
3100 return NT_STATUS_NO_MEMORY;
3103 r->out.result = _winreg_OpenHKPT(cli->pipes_struct, r);
3104 return NT_STATUS_OK;
3107 case NDR_WINREG_OPENHKPN: {
3108 struct winreg_OpenHKPN *r = (struct winreg_OpenHKPN *)_r;
3109 ZERO_STRUCT(r->out);
3110 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3111 if (r->out.handle == NULL) {
3112 return NT_STATUS_NO_MEMORY;
3115 r->out.result = _winreg_OpenHKPN(cli->pipes_struct, r);
3116 return NT_STATUS_OK;
3119 case NDR_WINREG_QUERYMULTIPLEVALUES2: {
3120 struct winreg_QueryMultipleValues2 *r = (struct winreg_QueryMultipleValues2 *)_r;
3121 r->out.result = _winreg_QueryMultipleValues2(cli->pipes_struct, r);
3122 return NT_STATUS_OK;
3125 default:
3126 return NT_STATUS_NOT_IMPLEMENTED;
3130 NTSTATUS rpc_winreg_init(void)
3132 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "winreg", "winreg", &ndr_table_winreg, api_winreg_cmds, sizeof(api_winreg_cmds) / sizeof(struct api_struct));