2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
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;
16 struct winreg_OpenHKCR *r;
18 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCR];
20 r = talloc(talloc_tos(), struct winreg_OpenHKCR);
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
30 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, r);
48 r->out.handle = talloc_zero(r, struct policy_handle);
49 if (r->out.handle == NULL) {
54 r->out.result = _winreg_OpenHKCR(p, r);
56 if (p->rng_fault_state) {
58 /* Return true here, srv_pipe_hnd.c will take care */
62 if (DEBUGLEVEL >= 10) {
63 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, r);
66 push = ndr_push_init_ctx(r, NULL);
72 ndr_err = call->ndr_push(push, NDR_OUT, r);
73 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
78 blob = ndr_push_blob(push);
79 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
96 struct winreg_OpenHKCU *r;
98 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCU];
100 r = talloc(talloc_tos(), struct winreg_OpenHKCU);
105 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
110 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
123 if (DEBUGLEVEL >= 10) {
124 NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, r);
128 r->out.handle = talloc_zero(r, struct policy_handle);
129 if (r->out.handle == NULL) {
134 r->out.result = _winreg_OpenHKCU(p, r);
136 if (p->rng_fault_state) {
138 /* Return true here, srv_pipe_hnd.c will take care */
142 if (DEBUGLEVEL >= 10) {
143 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, r);
146 push = ndr_push_init_ctx(r, NULL);
152 ndr_err = call->ndr_push(push, NDR_OUT, r);
153 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
158 blob = ndr_push_blob(push);
159 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
176 struct winreg_OpenHKLM *r;
178 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKLM];
180 r = talloc(talloc_tos(), struct winreg_OpenHKLM);
185 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
190 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
203 if (DEBUGLEVEL >= 10) {
204 NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, r);
208 r->out.handle = talloc_zero(r, struct policy_handle);
209 if (r->out.handle == NULL) {
214 r->out.result = _winreg_OpenHKLM(p, r);
216 if (p->rng_fault_state) {
218 /* Return true here, srv_pipe_hnd.c will take care */
222 if (DEBUGLEVEL >= 10) {
223 NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, r);
226 push = ndr_push_init_ctx(r, NULL);
232 ndr_err = call->ndr_push(push, NDR_OUT, r);
233 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
238 blob = ndr_push_blob(push);
239 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
256 struct winreg_OpenHKPD *r;
258 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPD];
260 r = talloc(talloc_tos(), struct winreg_OpenHKPD);
265 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
270 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
283 if (DEBUGLEVEL >= 10) {
284 NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, r);
288 r->out.handle = talloc_zero(r, struct policy_handle);
289 if (r->out.handle == NULL) {
294 r->out.result = _winreg_OpenHKPD(p, r);
296 if (p->rng_fault_state) {
298 /* Return true here, srv_pipe_hnd.c will take care */
302 if (DEBUGLEVEL >= 10) {
303 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, r);
306 push = ndr_push_init_ctx(r, NULL);
312 ndr_err = call->ndr_push(push, NDR_OUT, r);
313 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
318 blob = ndr_push_blob(push);
319 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
336 struct winreg_OpenHKU *r;
338 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKU];
340 r = talloc(talloc_tos(), struct winreg_OpenHKU);
345 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
350 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
363 if (DEBUGLEVEL >= 10) {
364 NDR_PRINT_IN_DEBUG(winreg_OpenHKU, r);
368 r->out.handle = talloc_zero(r, struct policy_handle);
369 if (r->out.handle == NULL) {
374 r->out.result = _winreg_OpenHKU(p, r);
376 if (p->rng_fault_state) {
378 /* Return true here, srv_pipe_hnd.c will take care */
382 if (DEBUGLEVEL >= 10) {
383 NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, r);
386 push = ndr_push_init_ctx(r, NULL);
392 ndr_err = call->ndr_push(push, NDR_OUT, r);
393 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
398 blob = ndr_push_blob(push);
399 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
416 struct winreg_CloseKey *r;
418 call = &ndr_table_winreg.calls[NDR_WINREG_CLOSEKEY];
420 r = talloc(talloc_tos(), struct winreg_CloseKey);
425 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
430 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
443 if (DEBUGLEVEL >= 10) {
444 NDR_PRINT_IN_DEBUG(winreg_CloseKey, r);
448 r->out.handle = r->in.handle;
449 r->out.result = _winreg_CloseKey(p, r);
451 if (p->rng_fault_state) {
453 /* Return true here, srv_pipe_hnd.c will take care */
457 if (DEBUGLEVEL >= 10) {
458 NDR_PRINT_OUT_DEBUG(winreg_CloseKey, r);
461 push = ndr_push_init_ctx(r, NULL);
467 ndr_err = call->ndr_push(push, NDR_OUT, r);
468 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
473 blob = ndr_push_blob(push);
474 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
491 struct winreg_CreateKey *r;
493 call = &ndr_table_winreg.calls[NDR_WINREG_CREATEKEY];
495 r = talloc(talloc_tos(), struct winreg_CreateKey);
500 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
505 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
518 if (DEBUGLEVEL >= 10) {
519 NDR_PRINT_IN_DEBUG(winreg_CreateKey, r);
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) {
530 r->out.result = _winreg_CreateKey(p, r);
532 if (p->rng_fault_state) {
534 /* Return true here, srv_pipe_hnd.c will take care */
538 if (DEBUGLEVEL >= 10) {
539 NDR_PRINT_OUT_DEBUG(winreg_CreateKey, r);
542 push = ndr_push_init_ctx(r, NULL);
548 ndr_err = call->ndr_push(push, NDR_OUT, r);
549 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
554 blob = ndr_push_blob(push);
555 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
572 struct winreg_DeleteKey *r;
574 call = &ndr_table_winreg.calls[NDR_WINREG_DELETEKEY];
576 r = talloc(talloc_tos(), struct winreg_DeleteKey);
581 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
586 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
607 /* Return true here, srv_pipe_hnd.c will take care */
611 if (DEBUGLEVEL >= 10) {
612 NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, r);
615 push = ndr_push_init_ctx(r, NULL);
621 ndr_err = call->ndr_push(push, NDR_OUT, r);
622 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
627 blob = ndr_push_blob(push);
628 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
645 struct winreg_DeleteValue *r;
647 call = &ndr_table_winreg.calls[NDR_WINREG_DELETEVALUE];
649 r = talloc(talloc_tos(), struct winreg_DeleteValue);
654 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
659 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
680 /* Return true here, srv_pipe_hnd.c will take care */
684 if (DEBUGLEVEL >= 10) {
685 NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, r);
688 push = ndr_push_init_ctx(r, NULL);
694 ndr_err = call->ndr_push(push, NDR_OUT, r);
695 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
700 blob = ndr_push_blob(push);
701 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
718 struct winreg_EnumKey *r;
720 call = &ndr_table_winreg.calls[NDR_WINREG_ENUMKEY];
722 r = talloc(talloc_tos(), struct winreg_EnumKey);
727 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
732 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
745 if (DEBUGLEVEL >= 10) {
746 NDR_PRINT_IN_DEBUG(winreg_EnumKey, r);
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) {
757 /* Return true here, srv_pipe_hnd.c will take care */
761 if (DEBUGLEVEL >= 10) {
762 NDR_PRINT_OUT_DEBUG(winreg_EnumKey, r);
765 push = ndr_push_init_ctx(r, NULL);
771 ndr_err = call->ndr_push(push, NDR_OUT, r);
772 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
777 blob = ndr_push_blob(push);
778 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
795 struct winreg_EnumValue *r;
797 call = &ndr_table_winreg.calls[NDR_WINREG_ENUMVALUE];
799 r = talloc(talloc_tos(), struct winreg_EnumValue);
804 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
809 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
822 if (DEBUGLEVEL >= 10) {
823 NDR_PRINT_IN_DEBUG(winreg_EnumValue, r);
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) {
836 /* Return true here, srv_pipe_hnd.c will take care */
840 if (DEBUGLEVEL >= 10) {
841 NDR_PRINT_OUT_DEBUG(winreg_EnumValue, r);
844 push = ndr_push_init_ctx(r, NULL);
850 ndr_err = call->ndr_push(push, NDR_OUT, r);
851 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
856 blob = ndr_push_blob(push);
857 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
874 struct winreg_FlushKey *r;
876 call = &ndr_table_winreg.calls[NDR_WINREG_FLUSHKEY];
878 r = talloc(talloc_tos(), struct winreg_FlushKey);
883 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
888 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
909 /* Return true here, srv_pipe_hnd.c will take care */
913 if (DEBUGLEVEL >= 10) {
914 NDR_PRINT_OUT_DEBUG(winreg_FlushKey, r);
917 push = ndr_push_init_ctx(r, NULL);
923 ndr_err = call->ndr_push(push, NDR_OUT, r);
924 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
929 blob = ndr_push_blob(push);
930 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
947 struct winreg_GetKeySecurity *r;
949 call = &ndr_table_winreg.calls[NDR_WINREG_GETKEYSECURITY];
951 r = talloc(talloc_tos(), struct winreg_GetKeySecurity);
956 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
961 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
974 if (DEBUGLEVEL >= 10) {
975 NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, r);
979 r->out.sd = r->in.sd;
980 r->out.result = _winreg_GetKeySecurity(p, r);
982 if (p->rng_fault_state) {
984 /* Return true here, srv_pipe_hnd.c will take care */
988 if (DEBUGLEVEL >= 10) {
989 NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, r);
992 push = ndr_push_init_ctx(r, NULL);
998 ndr_err = call->ndr_push(push, NDR_OUT, r);
999 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1004 blob = ndr_push_blob(push);
1005 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1022 struct winreg_LoadKey *r;
1024 call = &ndr_table_winreg.calls[NDR_WINREG_LOADKEY];
1026 r = talloc(talloc_tos(), struct winreg_LoadKey);
1031 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1036 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1057 /* Return true here, srv_pipe_hnd.c will take care */
1061 if (DEBUGLEVEL >= 10) {
1062 NDR_PRINT_OUT_DEBUG(winreg_LoadKey, r);
1065 push = ndr_push_init_ctx(r, NULL);
1071 ndr_err = call->ndr_push(push, NDR_OUT, r);
1072 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1077 blob = ndr_push_blob(push);
1078 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1095 struct winreg_NotifyChangeKeyValue *r;
1097 call = &ndr_table_winreg.calls[NDR_WINREG_NOTIFYCHANGEKEYVALUE];
1099 r = talloc(talloc_tos(), struct winreg_NotifyChangeKeyValue);
1104 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1109 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1130 /* Return true here, srv_pipe_hnd.c will take care */
1134 if (DEBUGLEVEL >= 10) {
1135 NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, r);
1138 push = ndr_push_init_ctx(r, NULL);
1144 ndr_err = call->ndr_push(push, NDR_OUT, r);
1145 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1150 blob = ndr_push_blob(push);
1151 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1168 struct winreg_OpenKey *r;
1170 call = &ndr_table_winreg.calls[NDR_WINREG_OPENKEY];
1172 r = talloc(talloc_tos(), struct winreg_OpenKey);
1177 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1182 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1206 r->out.result = _winreg_OpenKey(p, r);
1208 if (p->rng_fault_state) {
1210 /* Return true here, srv_pipe_hnd.c will take care */
1214 if (DEBUGLEVEL >= 10) {
1215 NDR_PRINT_OUT_DEBUG(winreg_OpenKey, r);
1218 push = ndr_push_init_ctx(r, NULL);
1224 ndr_err = call->ndr_push(push, NDR_OUT, r);
1225 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1230 blob = ndr_push_blob(push);
1231 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1248 struct winreg_QueryInfoKey *r;
1250 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYINFOKEY];
1252 r = talloc(talloc_tos(), struct winreg_QueryInfoKey);
1257 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1262 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1287 r->out.max_subkeylen = talloc_zero(r, uint32_t);
1288 if (r->out.max_subkeylen == NULL) {
1293 r->out.max_classlen = talloc_zero(r, uint32_t);
1294 if (r->out.max_classlen == NULL) {
1299 r->out.num_values = talloc_zero(r, uint32_t);
1300 if (r->out.num_values == NULL) {
1305 r->out.max_valnamelen = talloc_zero(r, uint32_t);
1306 if (r->out.max_valnamelen == NULL) {
1311 r->out.max_valbufsize = talloc_zero(r, uint32_t);
1312 if (r->out.max_valbufsize == NULL) {
1317 r->out.secdescsize = talloc_zero(r, uint32_t);
1318 if (r->out.secdescsize == NULL) {
1323 r->out.last_changed_time = talloc_zero(r, NTTIME);
1324 if (r->out.last_changed_time == NULL) {
1329 r->out.result = _winreg_QueryInfoKey(p, r);
1331 if (p->rng_fault_state) {
1333 /* Return true here, srv_pipe_hnd.c will take care */
1337 if (DEBUGLEVEL >= 10) {
1338 NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, r);
1341 push = ndr_push_init_ctx(r, NULL);
1347 ndr_err = call->ndr_push(push, NDR_OUT, r);
1348 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1353 blob = ndr_push_blob(push);
1354 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1371 struct winreg_QueryValue *r;
1373 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYVALUE];
1375 r = talloc(talloc_tos(), struct winreg_QueryValue);
1380 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1385 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1411 /* Return true here, srv_pipe_hnd.c will take care */
1415 if (DEBUGLEVEL >= 10) {
1416 NDR_PRINT_OUT_DEBUG(winreg_QueryValue, r);
1419 push = ndr_push_init_ctx(r, NULL);
1425 ndr_err = call->ndr_push(push, NDR_OUT, r);
1426 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1431 blob = ndr_push_blob(push);
1432 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1449 struct winreg_ReplaceKey *r;
1451 call = &ndr_table_winreg.calls[NDR_WINREG_REPLACEKEY];
1453 r = talloc(talloc_tos(), struct winreg_ReplaceKey);
1458 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1463 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1484 /* Return true here, srv_pipe_hnd.c will take care */
1488 if (DEBUGLEVEL >= 10) {
1489 NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, r);
1492 push = ndr_push_init_ctx(r, NULL);
1498 ndr_err = call->ndr_push(push, NDR_OUT, r);
1499 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1504 blob = ndr_push_blob(push);
1505 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1522 struct winreg_RestoreKey *r;
1524 call = &ndr_table_winreg.calls[NDR_WINREG_RESTOREKEY];
1526 r = talloc(talloc_tos(), struct winreg_RestoreKey);
1531 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1536 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1557 /* Return true here, srv_pipe_hnd.c will take care */
1561 if (DEBUGLEVEL >= 10) {
1562 NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, r);
1565 push = ndr_push_init_ctx(r, NULL);
1571 ndr_err = call->ndr_push(push, NDR_OUT, r);
1572 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1577 blob = ndr_push_blob(push);
1578 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1595 struct winreg_SaveKey *r;
1597 call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEY];
1599 r = talloc(talloc_tos(), struct winreg_SaveKey);
1604 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1609 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1630 /* Return true here, srv_pipe_hnd.c will take care */
1634 if (DEBUGLEVEL >= 10) {
1635 NDR_PRINT_OUT_DEBUG(winreg_SaveKey, r);
1638 push = ndr_push_init_ctx(r, NULL);
1644 ndr_err = call->ndr_push(push, NDR_OUT, r);
1645 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1650 blob = ndr_push_blob(push);
1651 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1668 struct winreg_SetKeySecurity *r;
1670 call = &ndr_table_winreg.calls[NDR_WINREG_SETKEYSECURITY];
1672 r = talloc(talloc_tos(), struct winreg_SetKeySecurity);
1677 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1682 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1703 /* Return true here, srv_pipe_hnd.c will take care */
1707 if (DEBUGLEVEL >= 10) {
1708 NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, r);
1711 push = ndr_push_init_ctx(r, NULL);
1717 ndr_err = call->ndr_push(push, NDR_OUT, r);
1718 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1723 blob = ndr_push_blob(push);
1724 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1741 struct winreg_SetValue *r;
1743 call = &ndr_table_winreg.calls[NDR_WINREG_SETVALUE];
1745 r = talloc(talloc_tos(), struct winreg_SetValue);
1750 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1755 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1776 /* Return true here, srv_pipe_hnd.c will take care */
1780 if (DEBUGLEVEL >= 10) {
1781 NDR_PRINT_OUT_DEBUG(winreg_SetValue, r);
1784 push = ndr_push_init_ctx(r, NULL);
1790 ndr_err = call->ndr_push(push, NDR_OUT, r);
1791 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1796 blob = ndr_push_blob(push);
1797 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1814 struct winreg_UnLoadKey *r;
1816 call = &ndr_table_winreg.calls[NDR_WINREG_UNLOADKEY];
1818 r = talloc(talloc_tos(), struct winreg_UnLoadKey);
1823 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1828 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1849 /* Return true here, srv_pipe_hnd.c will take care */
1853 if (DEBUGLEVEL >= 10) {
1854 NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, r);
1857 push = ndr_push_init_ctx(r, NULL);
1863 ndr_err = call->ndr_push(push, NDR_OUT, r);
1864 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1869 blob = ndr_push_blob(push);
1870 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1887 struct winreg_InitiateSystemShutdown *r;
1889 call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWN];
1891 r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdown);
1896 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1901 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1922 /* Return true here, srv_pipe_hnd.c will take care */
1926 if (DEBUGLEVEL >= 10) {
1927 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, r);
1930 push = ndr_push_init_ctx(r, NULL);
1936 ndr_err = call->ndr_push(push, NDR_OUT, r);
1937 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1942 blob = ndr_push_blob(push);
1943 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
1960 struct winreg_AbortSystemShutdown *r;
1962 call = &ndr_table_winreg.calls[NDR_WINREG_ABORTSYSTEMSHUTDOWN];
1964 r = talloc(talloc_tos(), struct winreg_AbortSystemShutdown);
1969 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1974 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
1995 /* Return true here, srv_pipe_hnd.c will take care */
1999 if (DEBUGLEVEL >= 10) {
2000 NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, r);
2003 push = ndr_push_init_ctx(r, NULL);
2009 ndr_err = call->ndr_push(push, NDR_OUT, r);
2010 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2015 blob = ndr_push_blob(push);
2016 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
2033 struct winreg_GetVersion *r;
2035 call = &ndr_table_winreg.calls[NDR_WINREG_GETVERSION];
2037 r = talloc(talloc_tos(), struct winreg_GetVersion);
2042 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2047 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
2071 r->out.result = _winreg_GetVersion(p, r);
2073 if (p->rng_fault_state) {
2075 /* Return true here, srv_pipe_hnd.c will take care */
2079 if (DEBUGLEVEL >= 10) {
2080 NDR_PRINT_OUT_DEBUG(winreg_GetVersion, r);
2083 push = ndr_push_init_ctx(r, NULL);
2089 ndr_err = call->ndr_push(push, NDR_OUT, r);
2090 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2095 blob = ndr_push_blob(push);
2096 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
2113 struct winreg_OpenHKCC *r;
2115 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCC];
2117 r = talloc(talloc_tos(), struct winreg_OpenHKCC);
2122 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2127 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
2151 r->out.result = _winreg_OpenHKCC(p, r);
2153 if (p->rng_fault_state) {
2155 /* Return true here, srv_pipe_hnd.c will take care */
2159 if (DEBUGLEVEL >= 10) {
2160 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, r);
2163 push = ndr_push_init_ctx(r, NULL);
2169 ndr_err = call->ndr_push(push, NDR_OUT, r);
2170 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2175 blob = ndr_push_blob(push);
2176 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
2193 struct winreg_OpenHKDD *r;
2195 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKDD];
2197 r = talloc(talloc_tos(), struct winreg_OpenHKDD);
2202 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2207 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
2231 r->out.result = _winreg_OpenHKDD(p, r);
2233 if (p->rng_fault_state) {
2235 /* Return true here, srv_pipe_hnd.c will take care */
2239 if (DEBUGLEVEL >= 10) {
2240 NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, r);
2243 push = ndr_push_init_ctx(r, NULL);
2249 ndr_err = call->ndr_push(push, NDR_OUT, r);
2250 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2255 blob = ndr_push_blob(push);
2256 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
2273 struct winreg_QueryMultipleValues *r;
2275 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES];
2277 r = talloc(talloc_tos(), struct winreg_QueryMultipleValues);
2282 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2287 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
2312 /* Return true here, srv_pipe_hnd.c will take care */
2316 if (DEBUGLEVEL >= 10) {
2317 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, r);
2320 push = ndr_push_init_ctx(r, NULL);
2326 ndr_err = call->ndr_push(push, NDR_OUT, r);
2327 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2332 blob = ndr_push_blob(push);
2333 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
2350 struct winreg_InitiateSystemShutdownEx *r;
2352 call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWNEX];
2354 r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdownEx);
2359 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2364 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
2385 /* Return true here, srv_pipe_hnd.c will take care */
2389 if (DEBUGLEVEL >= 10) {
2390 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, r);
2393 push = ndr_push_init_ctx(r, NULL);
2399 ndr_err = call->ndr_push(push, NDR_OUT, r);
2400 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2405 blob = ndr_push_blob(push);
2406 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
2423 struct winreg_SaveKeyEx *r;
2425 call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEYEX];
2427 r = talloc(talloc_tos(), struct winreg_SaveKeyEx);
2432 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2437 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
2458 /* Return true here, srv_pipe_hnd.c will take care */
2462 if (DEBUGLEVEL >= 10) {
2463 NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, r);
2466 push = ndr_push_init_ctx(r, NULL);
2472 ndr_err = call->ndr_push(push, NDR_OUT, r);
2473 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2478 blob = ndr_push_blob(push);
2479 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
2496 struct winreg_OpenHKPT *r;
2498 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPT];
2500 r = talloc(talloc_tos(), struct winreg_OpenHKPT);
2505 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2510 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
2534 r->out.result = _winreg_OpenHKPT(p, r);
2536 if (p->rng_fault_state) {
2538 /* Return true here, srv_pipe_hnd.c will take care */
2542 if (DEBUGLEVEL >= 10) {
2543 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, r);
2546 push = ndr_push_init_ctx(r, NULL);
2552 ndr_err = call->ndr_push(push, NDR_OUT, r);
2553 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2558 blob = ndr_push_blob(push);
2559 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
2576 struct winreg_OpenHKPN *r;
2578 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPN];
2580 r = talloc(talloc_tos(), struct winreg_OpenHKPN);
2585 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2590 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
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) {
2614 r->out.result = _winreg_OpenHKPN(p, r);
2616 if (p->rng_fault_state) {
2618 /* Return true here, srv_pipe_hnd.c will take care */
2622 if (DEBUGLEVEL >= 10) {
2623 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, r);
2626 push = ndr_push_init_ctx(r, NULL);
2632 ndr_err = call->ndr_push(push, NDR_OUT, r);
2633 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2638 blob = ndr_push_blob(push);
2639 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
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;
2656 struct winreg_QueryMultipleValues2 *r;
2658 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES2];
2660 r = talloc(talloc_tos(), struct winreg_QueryMultipleValues2);
2665 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2670 pull = ndr_pull_init_blob(&blob, r, NULL);
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)) {
2683 if (DEBUGLEVEL >= 10) {
2684 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, r);
2687 ZERO_STRUCT(r->out);
2688 r->out.values = r->in.values;
2689 r->out.buffer = r->in.buffer;
2690 r->out.needed = talloc_zero(r, uint32_t);
2691 if (r->out.needed == NULL) {
2696 r->out.result = _winreg_QueryMultipleValues2(p, r);
2698 if (p->rng_fault_state) {
2700 /* Return true here, srv_pipe_hnd.c will take care */
2704 if (DEBUGLEVEL >= 10) {
2705 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, r);
2708 push = ndr_push_init_ctx(r, NULL);
2714 ndr_err = call->ndr_push(push, NDR_OUT, r);
2715 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2720 blob = ndr_push_blob(push);
2721 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2731 static bool api_winreg_DeleteKeyEx(pipes_struct *p)
2733 const struct ndr_interface_call *call;
2734 struct ndr_pull *pull;
2735 struct ndr_push *push;
2736 enum ndr_err_code ndr_err;
2738 struct winreg_DeleteKeyEx *r;
2740 call = &ndr_table_winreg.calls[NDR_WINREG_DELETEKEYEX];
2742 r = talloc(talloc_tos(), struct winreg_DeleteKeyEx);
2747 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2752 pull = ndr_pull_init_blob(&blob, r, NULL);
2758 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2759 ndr_err = call->ndr_pull(pull, NDR_IN, r);
2760 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2765 if (DEBUGLEVEL >= 10) {
2766 NDR_PRINT_IN_DEBUG(winreg_DeleteKeyEx, r);
2769 r->out.result = _winreg_DeleteKeyEx(p, r);
2771 if (p->rng_fault_state) {
2773 /* Return true here, srv_pipe_hnd.c will take care */
2777 if (DEBUGLEVEL >= 10) {
2778 NDR_PRINT_OUT_DEBUG(winreg_DeleteKeyEx, r);
2781 push = ndr_push_init_ctx(r, NULL);
2787 ndr_err = call->ndr_push(push, NDR_OUT, r);
2788 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2793 blob = ndr_push_blob(push);
2794 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2806 static struct api_struct api_winreg_cmds[] =
2808 {"WINREG_OPENHKCR", NDR_WINREG_OPENHKCR, api_winreg_OpenHKCR},
2809 {"WINREG_OPENHKCU", NDR_WINREG_OPENHKCU, api_winreg_OpenHKCU},
2810 {"WINREG_OPENHKLM", NDR_WINREG_OPENHKLM, api_winreg_OpenHKLM},
2811 {"WINREG_OPENHKPD", NDR_WINREG_OPENHKPD, api_winreg_OpenHKPD},
2812 {"WINREG_OPENHKU", NDR_WINREG_OPENHKU, api_winreg_OpenHKU},
2813 {"WINREG_CLOSEKEY", NDR_WINREG_CLOSEKEY, api_winreg_CloseKey},
2814 {"WINREG_CREATEKEY", NDR_WINREG_CREATEKEY, api_winreg_CreateKey},
2815 {"WINREG_DELETEKEY", NDR_WINREG_DELETEKEY, api_winreg_DeleteKey},
2816 {"WINREG_DELETEVALUE", NDR_WINREG_DELETEVALUE, api_winreg_DeleteValue},
2817 {"WINREG_ENUMKEY", NDR_WINREG_ENUMKEY, api_winreg_EnumKey},
2818 {"WINREG_ENUMVALUE", NDR_WINREG_ENUMVALUE, api_winreg_EnumValue},
2819 {"WINREG_FLUSHKEY", NDR_WINREG_FLUSHKEY, api_winreg_FlushKey},
2820 {"WINREG_GETKEYSECURITY", NDR_WINREG_GETKEYSECURITY, api_winreg_GetKeySecurity},
2821 {"WINREG_LOADKEY", NDR_WINREG_LOADKEY, api_winreg_LoadKey},
2822 {"WINREG_NOTIFYCHANGEKEYVALUE", NDR_WINREG_NOTIFYCHANGEKEYVALUE, api_winreg_NotifyChangeKeyValue},
2823 {"WINREG_OPENKEY", NDR_WINREG_OPENKEY, api_winreg_OpenKey},
2824 {"WINREG_QUERYINFOKEY", NDR_WINREG_QUERYINFOKEY, api_winreg_QueryInfoKey},
2825 {"WINREG_QUERYVALUE", NDR_WINREG_QUERYVALUE, api_winreg_QueryValue},
2826 {"WINREG_REPLACEKEY", NDR_WINREG_REPLACEKEY, api_winreg_ReplaceKey},
2827 {"WINREG_RESTOREKEY", NDR_WINREG_RESTOREKEY, api_winreg_RestoreKey},
2828 {"WINREG_SAVEKEY", NDR_WINREG_SAVEKEY, api_winreg_SaveKey},
2829 {"WINREG_SETKEYSECURITY", NDR_WINREG_SETKEYSECURITY, api_winreg_SetKeySecurity},
2830 {"WINREG_SETVALUE", NDR_WINREG_SETVALUE, api_winreg_SetValue},
2831 {"WINREG_UNLOADKEY", NDR_WINREG_UNLOADKEY, api_winreg_UnLoadKey},
2832 {"WINREG_INITIATESYSTEMSHUTDOWN", NDR_WINREG_INITIATESYSTEMSHUTDOWN, api_winreg_InitiateSystemShutdown},
2833 {"WINREG_ABORTSYSTEMSHUTDOWN", NDR_WINREG_ABORTSYSTEMSHUTDOWN, api_winreg_AbortSystemShutdown},
2834 {"WINREG_GETVERSION", NDR_WINREG_GETVERSION, api_winreg_GetVersion},
2835 {"WINREG_OPENHKCC", NDR_WINREG_OPENHKCC, api_winreg_OpenHKCC},
2836 {"WINREG_OPENHKDD", NDR_WINREG_OPENHKDD, api_winreg_OpenHKDD},
2837 {"WINREG_QUERYMULTIPLEVALUES", NDR_WINREG_QUERYMULTIPLEVALUES, api_winreg_QueryMultipleValues},
2838 {"WINREG_INITIATESYSTEMSHUTDOWNEX", NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, api_winreg_InitiateSystemShutdownEx},
2839 {"WINREG_SAVEKEYEX", NDR_WINREG_SAVEKEYEX, api_winreg_SaveKeyEx},
2840 {"WINREG_OPENHKPT", NDR_WINREG_OPENHKPT, api_winreg_OpenHKPT},
2841 {"WINREG_OPENHKPN", NDR_WINREG_OPENHKPN, api_winreg_OpenHKPN},
2842 {"WINREG_QUERYMULTIPLEVALUES2", NDR_WINREG_QUERYMULTIPLEVALUES2, api_winreg_QueryMultipleValues2},
2843 {"WINREG_DELETEKEYEX", NDR_WINREG_DELETEKEYEX, api_winreg_DeleteKeyEx},
2846 void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns)
2848 *fns = api_winreg_cmds;
2849 *n_fns = sizeof(api_winreg_cmds) / sizeof(struct api_struct);
2852 NTSTATUS rpc_winreg_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
2854 if (cli->pipes_struct == NULL) {
2855 return NT_STATUS_INVALID_PARAMETER;
2860 case NDR_WINREG_OPENHKCR: {
2861 struct winreg_OpenHKCR *r = (struct winreg_OpenHKCR *)_r;
2862 ZERO_STRUCT(r->out);
2863 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2864 if (r->out.handle == NULL) {
2865 return NT_STATUS_NO_MEMORY;
2868 r->out.result = _winreg_OpenHKCR(cli->pipes_struct, r);
2869 return NT_STATUS_OK;
2872 case NDR_WINREG_OPENHKCU: {
2873 struct winreg_OpenHKCU *r = (struct winreg_OpenHKCU *)_r;
2874 ZERO_STRUCT(r->out);
2875 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2876 if (r->out.handle == NULL) {
2877 return NT_STATUS_NO_MEMORY;
2880 r->out.result = _winreg_OpenHKCU(cli->pipes_struct, r);
2881 return NT_STATUS_OK;
2884 case NDR_WINREG_OPENHKLM: {
2885 struct winreg_OpenHKLM *r = (struct winreg_OpenHKLM *)_r;
2886 ZERO_STRUCT(r->out);
2887 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2888 if (r->out.handle == NULL) {
2889 return NT_STATUS_NO_MEMORY;
2892 r->out.result = _winreg_OpenHKLM(cli->pipes_struct, r);
2893 return NT_STATUS_OK;
2896 case NDR_WINREG_OPENHKPD: {
2897 struct winreg_OpenHKPD *r = (struct winreg_OpenHKPD *)_r;
2898 ZERO_STRUCT(r->out);
2899 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2900 if (r->out.handle == NULL) {
2901 return NT_STATUS_NO_MEMORY;
2904 r->out.result = _winreg_OpenHKPD(cli->pipes_struct, r);
2905 return NT_STATUS_OK;
2908 case NDR_WINREG_OPENHKU: {
2909 struct winreg_OpenHKU *r = (struct winreg_OpenHKU *)_r;
2910 ZERO_STRUCT(r->out);
2911 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
2912 if (r->out.handle == NULL) {
2913 return NT_STATUS_NO_MEMORY;
2916 r->out.result = _winreg_OpenHKU(cli->pipes_struct, r);
2917 return NT_STATUS_OK;
2920 case NDR_WINREG_CLOSEKEY: {
2921 struct winreg_CloseKey *r = (struct winreg_CloseKey *)_r;
2922 ZERO_STRUCT(r->out);
2923 r->out.handle = r->in.handle;
2924 r->out.result = _winreg_CloseKey(cli->pipes_struct, r);
2925 return NT_STATUS_OK;
2928 case NDR_WINREG_CREATEKEY: {
2929 struct winreg_CreateKey *r = (struct winreg_CreateKey *)_r;
2930 ZERO_STRUCT(r->out);
2931 r->out.action_taken = r->in.action_taken;
2932 r->out.new_handle = talloc_zero(mem_ctx, struct policy_handle);
2933 if (r->out.new_handle == NULL) {
2934 return NT_STATUS_NO_MEMORY;
2937 r->out.result = _winreg_CreateKey(cli->pipes_struct, r);
2938 return NT_STATUS_OK;
2941 case NDR_WINREG_DELETEKEY: {
2942 struct winreg_DeleteKey *r = (struct winreg_DeleteKey *)_r;
2943 r->out.result = _winreg_DeleteKey(cli->pipes_struct, r);
2944 return NT_STATUS_OK;
2947 case NDR_WINREG_DELETEVALUE: {
2948 struct winreg_DeleteValue *r = (struct winreg_DeleteValue *)_r;
2949 r->out.result = _winreg_DeleteValue(cli->pipes_struct, r);
2950 return NT_STATUS_OK;
2953 case NDR_WINREG_ENUMKEY: {
2954 struct winreg_EnumKey *r = (struct winreg_EnumKey *)_r;
2955 ZERO_STRUCT(r->out);
2956 r->out.name = r->in.name;
2957 r->out.keyclass = r->in.keyclass;
2958 r->out.last_changed_time = r->in.last_changed_time;
2959 r->out.result = _winreg_EnumKey(cli->pipes_struct, r);
2960 return NT_STATUS_OK;
2963 case NDR_WINREG_ENUMVALUE: {
2964 struct winreg_EnumValue *r = (struct winreg_EnumValue *)_r;
2965 ZERO_STRUCT(r->out);
2966 r->out.name = r->in.name;
2967 r->out.type = r->in.type;
2968 r->out.value = r->in.value;
2969 r->out.size = r->in.size;
2970 r->out.length = r->in.length;
2971 r->out.result = _winreg_EnumValue(cli->pipes_struct, r);
2972 return NT_STATUS_OK;
2975 case NDR_WINREG_FLUSHKEY: {
2976 struct winreg_FlushKey *r = (struct winreg_FlushKey *)_r;
2977 r->out.result = _winreg_FlushKey(cli->pipes_struct, r);
2978 return NT_STATUS_OK;
2981 case NDR_WINREG_GETKEYSECURITY: {
2982 struct winreg_GetKeySecurity *r = (struct winreg_GetKeySecurity *)_r;
2983 ZERO_STRUCT(r->out);
2984 r->out.sd = r->in.sd;
2985 r->out.result = _winreg_GetKeySecurity(cli->pipes_struct, r);
2986 return NT_STATUS_OK;
2989 case NDR_WINREG_LOADKEY: {
2990 struct winreg_LoadKey *r = (struct winreg_LoadKey *)_r;
2991 r->out.result = _winreg_LoadKey(cli->pipes_struct, r);
2992 return NT_STATUS_OK;
2995 case NDR_WINREG_NOTIFYCHANGEKEYVALUE: {
2996 struct winreg_NotifyChangeKeyValue *r = (struct winreg_NotifyChangeKeyValue *)_r;
2997 r->out.result = _winreg_NotifyChangeKeyValue(cli->pipes_struct, r);
2998 return NT_STATUS_OK;
3001 case NDR_WINREG_OPENKEY: {
3002 struct winreg_OpenKey *r = (struct winreg_OpenKey *)_r;
3003 ZERO_STRUCT(r->out);
3004 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3005 if (r->out.handle == NULL) {
3006 return NT_STATUS_NO_MEMORY;
3009 r->out.result = _winreg_OpenKey(cli->pipes_struct, r);
3010 return NT_STATUS_OK;
3013 case NDR_WINREG_QUERYINFOKEY: {
3014 struct winreg_QueryInfoKey *r = (struct winreg_QueryInfoKey *)_r;
3015 ZERO_STRUCT(r->out);
3016 r->out.classname = r->in.classname;
3017 r->out.num_subkeys = talloc_zero(mem_ctx, uint32_t);
3018 if (r->out.num_subkeys == NULL) {
3019 return NT_STATUS_NO_MEMORY;
3022 r->out.max_subkeylen = talloc_zero(mem_ctx, uint32_t);
3023 if (r->out.max_subkeylen == NULL) {
3024 return NT_STATUS_NO_MEMORY;
3027 r->out.max_classlen = talloc_zero(mem_ctx, uint32_t);
3028 if (r->out.max_classlen == NULL) {
3029 return NT_STATUS_NO_MEMORY;
3032 r->out.num_values = talloc_zero(mem_ctx, uint32_t);
3033 if (r->out.num_values == NULL) {
3034 return NT_STATUS_NO_MEMORY;
3037 r->out.max_valnamelen = talloc_zero(mem_ctx, uint32_t);
3038 if (r->out.max_valnamelen == NULL) {
3039 return NT_STATUS_NO_MEMORY;
3042 r->out.max_valbufsize = talloc_zero(mem_ctx, uint32_t);
3043 if (r->out.max_valbufsize == NULL) {
3044 return NT_STATUS_NO_MEMORY;
3047 r->out.secdescsize = talloc_zero(mem_ctx, uint32_t);
3048 if (r->out.secdescsize == NULL) {
3049 return NT_STATUS_NO_MEMORY;
3052 r->out.last_changed_time = talloc_zero(mem_ctx, NTTIME);
3053 if (r->out.last_changed_time == NULL) {
3054 return NT_STATUS_NO_MEMORY;
3057 r->out.result = _winreg_QueryInfoKey(cli->pipes_struct, r);
3058 return NT_STATUS_OK;
3061 case NDR_WINREG_QUERYVALUE: {
3062 struct winreg_QueryValue *r = (struct winreg_QueryValue *)_r;
3063 ZERO_STRUCT(r->out);
3064 r->out.type = r->in.type;
3065 r->out.data = r->in.data;
3066 r->out.data_size = r->in.data_size;
3067 r->out.data_length = r->in.data_length;
3068 r->out.result = _winreg_QueryValue(cli->pipes_struct, r);
3069 return NT_STATUS_OK;
3072 case NDR_WINREG_REPLACEKEY: {
3073 struct winreg_ReplaceKey *r = (struct winreg_ReplaceKey *)_r;
3074 r->out.result = _winreg_ReplaceKey(cli->pipes_struct, r);
3075 return NT_STATUS_OK;
3078 case NDR_WINREG_RESTOREKEY: {
3079 struct winreg_RestoreKey *r = (struct winreg_RestoreKey *)_r;
3080 r->out.result = _winreg_RestoreKey(cli->pipes_struct, r);
3081 return NT_STATUS_OK;
3084 case NDR_WINREG_SAVEKEY: {
3085 struct winreg_SaveKey *r = (struct winreg_SaveKey *)_r;
3086 r->out.result = _winreg_SaveKey(cli->pipes_struct, r);
3087 return NT_STATUS_OK;
3090 case NDR_WINREG_SETKEYSECURITY: {
3091 struct winreg_SetKeySecurity *r = (struct winreg_SetKeySecurity *)_r;
3092 r->out.result = _winreg_SetKeySecurity(cli->pipes_struct, r);
3093 return NT_STATUS_OK;
3096 case NDR_WINREG_SETVALUE: {
3097 struct winreg_SetValue *r = (struct winreg_SetValue *)_r;
3098 r->out.result = _winreg_SetValue(cli->pipes_struct, r);
3099 return NT_STATUS_OK;
3102 case NDR_WINREG_UNLOADKEY: {
3103 struct winreg_UnLoadKey *r = (struct winreg_UnLoadKey *)_r;
3104 r->out.result = _winreg_UnLoadKey(cli->pipes_struct, r);
3105 return NT_STATUS_OK;
3108 case NDR_WINREG_INITIATESYSTEMSHUTDOWN: {
3109 struct winreg_InitiateSystemShutdown *r = (struct winreg_InitiateSystemShutdown *)_r;
3110 r->out.result = _winreg_InitiateSystemShutdown(cli->pipes_struct, r);
3111 return NT_STATUS_OK;
3114 case NDR_WINREG_ABORTSYSTEMSHUTDOWN: {
3115 struct winreg_AbortSystemShutdown *r = (struct winreg_AbortSystemShutdown *)_r;
3116 r->out.result = _winreg_AbortSystemShutdown(cli->pipes_struct, r);
3117 return NT_STATUS_OK;
3120 case NDR_WINREG_GETVERSION: {
3121 struct winreg_GetVersion *r = (struct winreg_GetVersion *)_r;
3122 ZERO_STRUCT(r->out);
3123 r->out.version = talloc_zero(mem_ctx, uint32_t);
3124 if (r->out.version == NULL) {
3125 return NT_STATUS_NO_MEMORY;
3128 r->out.result = _winreg_GetVersion(cli->pipes_struct, r);
3129 return NT_STATUS_OK;
3132 case NDR_WINREG_OPENHKCC: {
3133 struct winreg_OpenHKCC *r = (struct winreg_OpenHKCC *)_r;
3134 ZERO_STRUCT(r->out);
3135 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3136 if (r->out.handle == NULL) {
3137 return NT_STATUS_NO_MEMORY;
3140 r->out.result = _winreg_OpenHKCC(cli->pipes_struct, r);
3141 return NT_STATUS_OK;
3144 case NDR_WINREG_OPENHKDD: {
3145 struct winreg_OpenHKDD *r = (struct winreg_OpenHKDD *)_r;
3146 ZERO_STRUCT(r->out);
3147 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3148 if (r->out.handle == NULL) {
3149 return NT_STATUS_NO_MEMORY;
3152 r->out.result = _winreg_OpenHKDD(cli->pipes_struct, r);
3153 return NT_STATUS_OK;
3156 case NDR_WINREG_QUERYMULTIPLEVALUES: {
3157 struct winreg_QueryMultipleValues *r = (struct winreg_QueryMultipleValues *)_r;
3158 ZERO_STRUCT(r->out);
3159 r->out.values = r->in.values;
3160 r->out.buffer = r->in.buffer;
3161 r->out.buffer_size = r->in.buffer_size;
3162 r->out.result = _winreg_QueryMultipleValues(cli->pipes_struct, r);
3163 return NT_STATUS_OK;
3166 case NDR_WINREG_INITIATESYSTEMSHUTDOWNEX: {
3167 struct winreg_InitiateSystemShutdownEx *r = (struct winreg_InitiateSystemShutdownEx *)_r;
3168 r->out.result = _winreg_InitiateSystemShutdownEx(cli->pipes_struct, r);
3169 return NT_STATUS_OK;
3172 case NDR_WINREG_SAVEKEYEX: {
3173 struct winreg_SaveKeyEx *r = (struct winreg_SaveKeyEx *)_r;
3174 r->out.result = _winreg_SaveKeyEx(cli->pipes_struct, r);
3175 return NT_STATUS_OK;
3178 case NDR_WINREG_OPENHKPT: {
3179 struct winreg_OpenHKPT *r = (struct winreg_OpenHKPT *)_r;
3180 ZERO_STRUCT(r->out);
3181 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3182 if (r->out.handle == NULL) {
3183 return NT_STATUS_NO_MEMORY;
3186 r->out.result = _winreg_OpenHKPT(cli->pipes_struct, r);
3187 return NT_STATUS_OK;
3190 case NDR_WINREG_OPENHKPN: {
3191 struct winreg_OpenHKPN *r = (struct winreg_OpenHKPN *)_r;
3192 ZERO_STRUCT(r->out);
3193 r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
3194 if (r->out.handle == NULL) {
3195 return NT_STATUS_NO_MEMORY;
3198 r->out.result = _winreg_OpenHKPN(cli->pipes_struct, r);
3199 return NT_STATUS_OK;
3202 case NDR_WINREG_QUERYMULTIPLEVALUES2: {
3203 struct winreg_QueryMultipleValues2 *r = (struct winreg_QueryMultipleValues2 *)_r;
3204 ZERO_STRUCT(r->out);
3205 r->out.values = r->in.values;
3206 r->out.buffer = r->in.buffer;
3207 r->out.needed = talloc_zero(mem_ctx, uint32_t);
3208 if (r->out.needed == NULL) {
3209 return NT_STATUS_NO_MEMORY;
3212 r->out.result = _winreg_QueryMultipleValues2(cli->pipes_struct, r);
3213 return NT_STATUS_OK;
3216 case NDR_WINREG_DELETEKEYEX: {
3217 struct winreg_DeleteKeyEx *r = (struct winreg_DeleteKeyEx *)_r;
3218 r->out.result = _winreg_DeleteKeyEx(cli->pipes_struct, r);
3219 return NT_STATUS_OK;
3223 return NT_STATUS_NOT_IMPLEMENTED;
3227 NTSTATUS rpc_winreg_init(void)
3229 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "winreg", "winreg", &ndr_table_winreg, api_winreg_cmds, sizeof(api_winreg_cmds) / sizeof(struct api_struct));