/* [<][>][^][v][top][bottom][index][help] */
DEFINITIONS
This source file includes following definitions.
- api_winreg_OpenHKCR
- api_winreg_OpenHKCU
- api_winreg_OpenHKLM
- api_winreg_OpenHKPD
- api_winreg_OpenHKU
- api_winreg_CloseKey
- api_winreg_CreateKey
- api_winreg_DeleteKey
- api_winreg_DeleteValue
- api_winreg_EnumKey
- api_winreg_EnumValue
- api_winreg_FlushKey
- api_winreg_GetKeySecurity
- api_winreg_LoadKey
- api_winreg_NotifyChangeKeyValue
- api_winreg_OpenKey
- api_winreg_QueryInfoKey
- api_winreg_QueryValue
- api_winreg_ReplaceKey
- api_winreg_RestoreKey
- api_winreg_SaveKey
- api_winreg_SetKeySecurity
- api_winreg_SetValue
- api_winreg_UnLoadKey
- api_winreg_InitiateSystemShutdown
- api_winreg_AbortSystemShutdown
- api_winreg_GetVersion
- api_winreg_OpenHKCC
- api_winreg_OpenHKDD
- api_winreg_QueryMultipleValues
- api_winreg_InitiateSystemShutdownEx
- api_winreg_SaveKeyEx
- api_winreg_OpenHKPT
- api_winreg_OpenHKPN
- api_winreg_QueryMultipleValues2
- winreg_get_pipe_fns
- rpc_winreg_dispatch
- rpc_winreg_init
1 /*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
5
6 #include "includes.h"
7 #include "../librpc/gen_ndr/srv_winreg.h"
8
9 static bool api_winreg_OpenHKCR(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
10 {
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;
17
18 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCR];
19
20 r = talloc(talloc_tos(), struct winreg_OpenHKCR);
21 if (r == NULL) {
22 return false;
23 }
24
25 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26 talloc_free(r);
27 return false;
28 }
29
30 pull = ndr_pull_init_blob(&blob, r, NULL);
31 if (pull == NULL) {
32 talloc_free(r);
33 return false;
34 }
35
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;
41 }
42
43 if (DEBUGLEVEL >= 10) {
44 NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, r);
45 }
46
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;
52 }
53
54 r->out.result = _winreg_OpenHKCR(p, r);
55
56 if (p->rng_fault_state) {
57 talloc_free(r);
58 /* Return true here, srv_pipe_hnd.c will take care */
59 return true;
60 }
61
62 if (DEBUGLEVEL >= 10) {
63 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, r);
64 }
65
66 push = ndr_push_init_ctx(r, NULL);
67 if (push == NULL) {
68 talloc_free(r);
69 return false;
70 }
71
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;
76 }
77
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;
82 }
83
84 talloc_free(r);
85
86 return true;
87 }
88
89 static bool api_winreg_OpenHKCU(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
90 {
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;
97
98 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCU];
99
100 r = talloc(talloc_tos(), struct winreg_OpenHKCU);
101 if (r == NULL) {
102 return false;
103 }
104
105 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
106 talloc_free(r);
107 return false;
108 }
109
110 pull = ndr_pull_init_blob(&blob, r, NULL);
111 if (pull == NULL) {
112 talloc_free(r);
113 return false;
114 }
115
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;
121 }
122
123 if (DEBUGLEVEL >= 10) {
124 NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, r);
125 }
126
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;
132 }
133
134 r->out.result = _winreg_OpenHKCU(p, r);
135
136 if (p->rng_fault_state) {
137 talloc_free(r);
138 /* Return true here, srv_pipe_hnd.c will take care */
139 return true;
140 }
141
142 if (DEBUGLEVEL >= 10) {
143 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, r);
144 }
145
146 push = ndr_push_init_ctx(r, NULL);
147 if (push == NULL) {
148 talloc_free(r);
149 return false;
150 }
151
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;
156 }
157
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;
162 }
163
164 talloc_free(r);
165
166 return true;
167 }
168
169 static bool api_winreg_OpenHKLM(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
170 {
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;
177
178 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKLM];
179
180 r = talloc(talloc_tos(), struct winreg_OpenHKLM);
181 if (r == NULL) {
182 return false;
183 }
184
185 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
186 talloc_free(r);
187 return false;
188 }
189
190 pull = ndr_pull_init_blob(&blob, r, NULL);
191 if (pull == NULL) {
192 talloc_free(r);
193 return false;
194 }
195
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;
201 }
202
203 if (DEBUGLEVEL >= 10) {
204 NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, r);
205 }
206
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;
212 }
213
214 r->out.result = _winreg_OpenHKLM(p, r);
215
216 if (p->rng_fault_state) {
217 talloc_free(r);
218 /* Return true here, srv_pipe_hnd.c will take care */
219 return true;
220 }
221
222 if (DEBUGLEVEL >= 10) {
223 NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, r);
224 }
225
226 push = ndr_push_init_ctx(r, NULL);
227 if (push == NULL) {
228 talloc_free(r);
229 return false;
230 }
231
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;
236 }
237
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;
242 }
243
244 talloc_free(r);
245
246 return true;
247 }
248
249 static bool api_winreg_OpenHKPD(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
250 {
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;
257
258 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPD];
259
260 r = talloc(talloc_tos(), struct winreg_OpenHKPD);
261 if (r == NULL) {
262 return false;
263 }
264
265 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
266 talloc_free(r);
267 return false;
268 }
269
270 pull = ndr_pull_init_blob(&blob, r, NULL);
271 if (pull == NULL) {
272 talloc_free(r);
273 return false;
274 }
275
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;
281 }
282
283 if (DEBUGLEVEL >= 10) {
284 NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, r);
285 }
286
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;
292 }
293
294 r->out.result = _winreg_OpenHKPD(p, r);
295
296 if (p->rng_fault_state) {
297 talloc_free(r);
298 /* Return true here, srv_pipe_hnd.c will take care */
299 return true;
300 }
301
302 if (DEBUGLEVEL >= 10) {
303 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, r);
304 }
305
306 push = ndr_push_init_ctx(r, NULL);
307 if (push == NULL) {
308 talloc_free(r);
309 return false;
310 }
311
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;
316 }
317
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;
322 }
323
324 talloc_free(r);
325
326 return true;
327 }
328
329 static bool api_winreg_OpenHKU(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
330 {
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;
337
338 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKU];
339
340 r = talloc(talloc_tos(), struct winreg_OpenHKU);
341 if (r == NULL) {
342 return false;
343 }
344
345 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
346 talloc_free(r);
347 return false;
348 }
349
350 pull = ndr_pull_init_blob(&blob, r, NULL);
351 if (pull == NULL) {
352 talloc_free(r);
353 return false;
354 }
355
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;
361 }
362
363 if (DEBUGLEVEL >= 10) {
364 NDR_PRINT_IN_DEBUG(winreg_OpenHKU, r);
365 }
366
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;
372 }
373
374 r->out.result = _winreg_OpenHKU(p, r);
375
376 if (p->rng_fault_state) {
377 talloc_free(r);
378 /* Return true here, srv_pipe_hnd.c will take care */
379 return true;
380 }
381
382 if (DEBUGLEVEL >= 10) {
383 NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, r);
384 }
385
386 push = ndr_push_init_ctx(r, NULL);
387 if (push == NULL) {
388 talloc_free(r);
389 return false;
390 }
391
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;
396 }
397
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;
402 }
403
404 talloc_free(r);
405
406 return true;
407 }
408
409 static bool api_winreg_CloseKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
410 {
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;
417
418 call = &ndr_table_winreg.calls[NDR_WINREG_CLOSEKEY];
419
420 r = talloc(talloc_tos(), struct winreg_CloseKey);
421 if (r == NULL) {
422 return false;
423 }
424
425 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
426 talloc_free(r);
427 return false;
428 }
429
430 pull = ndr_pull_init_blob(&blob, r, NULL);
431 if (pull == NULL) {
432 talloc_free(r);
433 return false;
434 }
435
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;
441 }
442
443 if (DEBUGLEVEL >= 10) {
444 NDR_PRINT_IN_DEBUG(winreg_CloseKey, r);
445 }
446
447 ZERO_STRUCT(r->out);
448 r->out.handle = r->in.handle;
449 r->out.result = _winreg_CloseKey(p, r);
450
451 if (p->rng_fault_state) {
452 talloc_free(r);
453 /* Return true here, srv_pipe_hnd.c will take care */
454 return true;
455 }
456
457 if (DEBUGLEVEL >= 10) {
458 NDR_PRINT_OUT_DEBUG(winreg_CloseKey, r);
459 }
460
461 push = ndr_push_init_ctx(r, NULL);
462 if (push == NULL) {
463 talloc_free(r);
464 return false;
465 }
466
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;
471 }
472
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;
477 }
478
479 talloc_free(r);
480
481 return true;
482 }
483
484 static bool api_winreg_CreateKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
485 {
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;
492
493 call = &ndr_table_winreg.calls[NDR_WINREG_CREATEKEY];
494
495 r = talloc(talloc_tos(), struct winreg_CreateKey);
496 if (r == NULL) {
497 return false;
498 }
499
500 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
501 talloc_free(r);
502 return false;
503 }
504
505 pull = ndr_pull_init_blob(&blob, r, NULL);
506 if (pull == NULL) {
507 talloc_free(r);
508 return false;
509 }
510
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;
516 }
517
518 if (DEBUGLEVEL >= 10) {
519 NDR_PRINT_IN_DEBUG(winreg_CreateKey, r);
520 }
521
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;
528 }
529
530 r->out.result = _winreg_CreateKey(p, r);
531
532 if (p->rng_fault_state) {
533 talloc_free(r);
534 /* Return true here, srv_pipe_hnd.c will take care */
535 return true;
536 }
537
538 if (DEBUGLEVEL >= 10) {
539 NDR_PRINT_OUT_DEBUG(winreg_CreateKey, r);
540 }
541
542 push = ndr_push_init_ctx(r, NULL);
543 if (push == NULL) {
544 talloc_free(r);
545 return false;
546 }
547
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;
552 }
553
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;
558 }
559
560 talloc_free(r);
561
562 return true;
563 }
564
565 static bool api_winreg_DeleteKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
566 {
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;
573
574 call = &ndr_table_winreg.calls[NDR_WINREG_DELETEKEY];
575
576 r = talloc(talloc_tos(), struct winreg_DeleteKey);
577 if (r == NULL) {
578 return false;
579 }
580
581 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
582 talloc_free(r);
583 return false;
584 }
585
586 pull = ndr_pull_init_blob(&blob, r, NULL);
587 if (pull == NULL) {
588 talloc_free(r);
589 return false;
590 }
591
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;
597 }
598
599 if (DEBUGLEVEL >= 10) {
600 NDR_PRINT_IN_DEBUG(winreg_DeleteKey, r);
601 }
602
603 r->out.result = _winreg_DeleteKey(p, r);
604
605 if (p->rng_fault_state) {
606 talloc_free(r);
607 /* Return true here, srv_pipe_hnd.c will take care */
608 return true;
609 }
610
611 if (DEBUGLEVEL >= 10) {
612 NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, r);
613 }
614
615 push = ndr_push_init_ctx(r, NULL);
616 if (push == NULL) {
617 talloc_free(r);
618 return false;
619 }
620
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;
625 }
626
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;
631 }
632
633 talloc_free(r);
634
635 return true;
636 }
637
638 static bool api_winreg_DeleteValue(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
639 {
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;
646
647 call = &ndr_table_winreg.calls[NDR_WINREG_DELETEVALUE];
648
649 r = talloc(talloc_tos(), struct winreg_DeleteValue);
650 if (r == NULL) {
651 return false;
652 }
653
654 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
655 talloc_free(r);
656 return false;
657 }
658
659 pull = ndr_pull_init_blob(&blob, r, NULL);
660 if (pull == NULL) {
661 talloc_free(r);
662 return false;
663 }
664
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;
670 }
671
672 if (DEBUGLEVEL >= 10) {
673 NDR_PRINT_IN_DEBUG(winreg_DeleteValue, r);
674 }
675
676 r->out.result = _winreg_DeleteValue(p, r);
677
678 if (p->rng_fault_state) {
679 talloc_free(r);
680 /* Return true here, srv_pipe_hnd.c will take care */
681 return true;
682 }
683
684 if (DEBUGLEVEL >= 10) {
685 NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, r);
686 }
687
688 push = ndr_push_init_ctx(r, NULL);
689 if (push == NULL) {
690 talloc_free(r);
691 return false;
692 }
693
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;
698 }
699
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;
704 }
705
706 talloc_free(r);
707
708 return true;
709 }
710
711 static bool api_winreg_EnumKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
712 {
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;
719
720 call = &ndr_table_winreg.calls[NDR_WINREG_ENUMKEY];
721
722 r = talloc(talloc_tos(), struct winreg_EnumKey);
723 if (r == NULL) {
724 return false;
725 }
726
727 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
728 talloc_free(r);
729 return false;
730 }
731
732 pull = ndr_pull_init_blob(&blob, r, NULL);
733 if (pull == NULL) {
734 talloc_free(r);
735 return false;
736 }
737
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;
743 }
744
745 if (DEBUGLEVEL >= 10) {
746 NDR_PRINT_IN_DEBUG(winreg_EnumKey, r);
747 }
748
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);
754
755 if (p->rng_fault_state) {
756 talloc_free(r);
757 /* Return true here, srv_pipe_hnd.c will take care */
758 return true;
759 }
760
761 if (DEBUGLEVEL >= 10) {
762 NDR_PRINT_OUT_DEBUG(winreg_EnumKey, r);
763 }
764
765 push = ndr_push_init_ctx(r, NULL);
766 if (push == NULL) {
767 talloc_free(r);
768 return false;
769 }
770
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;
775 }
776
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;
781 }
782
783 talloc_free(r);
784
785 return true;
786 }
787
788 static bool api_winreg_EnumValue(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
789 {
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;
796
797 call = &ndr_table_winreg.calls[NDR_WINREG_ENUMVALUE];
798
799 r = talloc(talloc_tos(), struct winreg_EnumValue);
800 if (r == NULL) {
801 return false;
802 }
803
804 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
805 talloc_free(r);
806 return false;
807 }
808
809 pull = ndr_pull_init_blob(&blob, r, NULL);
810 if (pull == NULL) {
811 talloc_free(r);
812 return false;
813 }
814
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;
820 }
821
822 if (DEBUGLEVEL >= 10) {
823 NDR_PRINT_IN_DEBUG(winreg_EnumValue, r);
824 }
825
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);
833
834 if (p->rng_fault_state) {
835 talloc_free(r);
836 /* Return true here, srv_pipe_hnd.c will take care */
837 return true;
838 }
839
840 if (DEBUGLEVEL >= 10) {
841 NDR_PRINT_OUT_DEBUG(winreg_EnumValue, r);
842 }
843
844 push = ndr_push_init_ctx(r, NULL);
845 if (push == NULL) {
846 talloc_free(r);
847 return false;
848 }
849
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;
854 }
855
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;
860 }
861
862 talloc_free(r);
863
864 return true;
865 }
866
867 static bool api_winreg_FlushKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
868 {
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;
875
876 call = &ndr_table_winreg.calls[NDR_WINREG_FLUSHKEY];
877
878 r = talloc(talloc_tos(), struct winreg_FlushKey);
879 if (r == NULL) {
880 return false;
881 }
882
883 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
884 talloc_free(r);
885 return false;
886 }
887
888 pull = ndr_pull_init_blob(&blob, r, NULL);
889 if (pull == NULL) {
890 talloc_free(r);
891 return false;
892 }
893
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;
899 }
900
901 if (DEBUGLEVEL >= 10) {
902 NDR_PRINT_IN_DEBUG(winreg_FlushKey, r);
903 }
904
905 r->out.result = _winreg_FlushKey(p, r);
906
907 if (p->rng_fault_state) {
908 talloc_free(r);
909 /* Return true here, srv_pipe_hnd.c will take care */
910 return true;
911 }
912
913 if (DEBUGLEVEL >= 10) {
914 NDR_PRINT_OUT_DEBUG(winreg_FlushKey, r);
915 }
916
917 push = ndr_push_init_ctx(r, NULL);
918 if (push == NULL) {
919 talloc_free(r);
920 return false;
921 }
922
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;
927 }
928
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;
933 }
934
935 talloc_free(r);
936
937 return true;
938 }
939
940 static bool api_winreg_GetKeySecurity(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
941 {
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;
948
949 call = &ndr_table_winreg.calls[NDR_WINREG_GETKEYSECURITY];
950
951 r = talloc(talloc_tos(), struct winreg_GetKeySecurity);
952 if (r == NULL) {
953 return false;
954 }
955
956 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
957 talloc_free(r);
958 return false;
959 }
960
961 pull = ndr_pull_init_blob(&blob, r, NULL);
962 if (pull == NULL) {
963 talloc_free(r);
964 return false;
965 }
966
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;
972 }
973
974 if (DEBUGLEVEL >= 10) {
975 NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, r);
976 }
977
978 ZERO_STRUCT(r->out);
979 r->out.sd = r->in.sd;
980 r->out.result = _winreg_GetKeySecurity(p, r);
981
982 if (p->rng_fault_state) {
983 talloc_free(r);
984 /* Return true here, srv_pipe_hnd.c will take care */
985 return true;
986 }
987
988 if (DEBUGLEVEL >= 10) {
989 NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, r);
990 }
991
992 push = ndr_push_init_ctx(r, NULL);
993 if (push == NULL) {
994 talloc_free(r);
995 return false;
996 }
997
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;
1002 }
1003
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;
1008 }
1009
1010 talloc_free(r);
1011
1012 return true;
1013 }
1014
1015 static bool api_winreg_LoadKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1016 {
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;
1023
1024 call = &ndr_table_winreg.calls[NDR_WINREG_LOADKEY];
1025
1026 r = talloc(talloc_tos(), struct winreg_LoadKey);
1027 if (r == NULL) {
1028 return false;
1029 }
1030
1031 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1032 talloc_free(r);
1033 return false;
1034 }
1035
1036 pull = ndr_pull_init_blob(&blob, r, NULL);
1037 if (pull == NULL) {
1038 talloc_free(r);
1039 return false;
1040 }
1041
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;
1047 }
1048
1049 if (DEBUGLEVEL >= 10) {
1050 NDR_PRINT_IN_DEBUG(winreg_LoadKey, r);
1051 }
1052
1053 r->out.result = _winreg_LoadKey(p, r);
1054
1055 if (p->rng_fault_state) {
1056 talloc_free(r);
1057 /* Return true here, srv_pipe_hnd.c will take care */
1058 return true;
1059 }
1060
1061 if (DEBUGLEVEL >= 10) {
1062 NDR_PRINT_OUT_DEBUG(winreg_LoadKey, r);
1063 }
1064
1065 push = ndr_push_init_ctx(r, NULL);
1066 if (push == NULL) {
1067 talloc_free(r);
1068 return false;
1069 }
1070
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;
1075 }
1076
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;
1081 }
1082
1083 talloc_free(r);
1084
1085 return true;
1086 }
1087
1088 static bool api_winreg_NotifyChangeKeyValue(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1089 {
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;
1096
1097 call = &ndr_table_winreg.calls[NDR_WINREG_NOTIFYCHANGEKEYVALUE];
1098
1099 r = talloc(talloc_tos(), struct winreg_NotifyChangeKeyValue);
1100 if (r == NULL) {
1101 return false;
1102 }
1103
1104 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1105 talloc_free(r);
1106 return false;
1107 }
1108
1109 pull = ndr_pull_init_blob(&blob, r, NULL);
1110 if (pull == NULL) {
1111 talloc_free(r);
1112 return false;
1113 }
1114
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;
1120 }
1121
1122 if (DEBUGLEVEL >= 10) {
1123 NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, r);
1124 }
1125
1126 r->out.result = _winreg_NotifyChangeKeyValue(p, r);
1127
1128 if (p->rng_fault_state) {
1129 talloc_free(r);
1130 /* Return true here, srv_pipe_hnd.c will take care */
1131 return true;
1132 }
1133
1134 if (DEBUGLEVEL >= 10) {
1135 NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, r);
1136 }
1137
1138 push = ndr_push_init_ctx(r, NULL);
1139 if (push == NULL) {
1140 talloc_free(r);
1141 return false;
1142 }
1143
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;
1148 }
1149
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;
1154 }
1155
1156 talloc_free(r);
1157
1158 return true;
1159 }
1160
1161 static bool api_winreg_OpenKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1162 {
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;
1169
1170 call = &ndr_table_winreg.calls[NDR_WINREG_OPENKEY];
1171
1172 r = talloc(talloc_tos(), struct winreg_OpenKey);
1173 if (r == NULL) {
1174 return false;
1175 }
1176
1177 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1178 talloc_free(r);
1179 return false;
1180 }
1181
1182 pull = ndr_pull_init_blob(&blob, r, NULL);
1183 if (pull == NULL) {
1184 talloc_free(r);
1185 return false;
1186 }
1187
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;
1193 }
1194
1195 if (DEBUGLEVEL >= 10) {
1196 NDR_PRINT_IN_DEBUG(winreg_OpenKey, r);
1197 }
1198
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;
1204 }
1205
1206 r->out.result = _winreg_OpenKey(p, r);
1207
1208 if (p->rng_fault_state) {
1209 talloc_free(r);
1210 /* Return true here, srv_pipe_hnd.c will take care */
1211 return true;
1212 }
1213
1214 if (DEBUGLEVEL >= 10) {
1215 NDR_PRINT_OUT_DEBUG(winreg_OpenKey, r);
1216 }
1217
1218 push = ndr_push_init_ctx(r, NULL);
1219 if (push == NULL) {
1220 talloc_free(r);
1221 return false;
1222 }
1223
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;
1228 }
1229
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;
1234 }
1235
1236 talloc_free(r);
1237
1238 return true;
1239 }
1240
1241 static bool api_winreg_QueryInfoKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1242 {
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;
1249
1250 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYINFOKEY];
1251
1252 r = talloc(talloc_tos(), struct winreg_QueryInfoKey);
1253 if (r == NULL) {
1254 return false;
1255 }
1256
1257 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1258 talloc_free(r);
1259 return false;
1260 }
1261
1262 pull = ndr_pull_init_blob(&blob, r, NULL);
1263 if (pull == NULL) {
1264 talloc_free(r);
1265 return false;
1266 }
1267
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;
1273 }
1274
1275 if (DEBUGLEVEL >= 10) {
1276 NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, r);
1277 }
1278
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;
1285 }
1286
1287 r->out.max_subkeylen = talloc_zero(r, uint32_t);
1288 if (r->out.max_subkeylen == NULL) {
1289 talloc_free(r);
1290 return false;
1291 }
1292
1293 r->out.max_classlen = talloc_zero(r, uint32_t);
1294 if (r->out.max_classlen == NULL) {
1295 talloc_free(r);
1296 return false;
1297 }
1298
1299 r->out.num_values = talloc_zero(r, uint32_t);
1300 if (r->out.num_values == NULL) {
1301 talloc_free(r);
1302 return false;
1303 }
1304
1305 r->out.max_valnamelen = talloc_zero(r, uint32_t);
1306 if (r->out.max_valnamelen == NULL) {
1307 talloc_free(r);
1308 return false;
1309 }
1310
1311 r->out.max_valbufsize = talloc_zero(r, uint32_t);
1312 if (r->out.max_valbufsize == NULL) {
1313 talloc_free(r);
1314 return false;
1315 }
1316
1317 r->out.secdescsize = talloc_zero(r, uint32_t);
1318 if (r->out.secdescsize == NULL) {
1319 talloc_free(r);
1320 return false;
1321 }
1322
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;
1327 }
1328
1329 r->out.result = _winreg_QueryInfoKey(p, r);
1330
1331 if (p->rng_fault_state) {
1332 talloc_free(r);
1333 /* Return true here, srv_pipe_hnd.c will take care */
1334 return true;
1335 }
1336
1337 if (DEBUGLEVEL >= 10) {
1338 NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, r);
1339 }
1340
1341 push = ndr_push_init_ctx(r, NULL);
1342 if (push == NULL) {
1343 talloc_free(r);
1344 return false;
1345 }
1346
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;
1351 }
1352
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;
1357 }
1358
1359 talloc_free(r);
1360
1361 return true;
1362 }
1363
1364 static bool api_winreg_QueryValue(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1365 {
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;
1372
1373 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYVALUE];
1374
1375 r = talloc(talloc_tos(), struct winreg_QueryValue);
1376 if (r == NULL) {
1377 return false;
1378 }
1379
1380 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1381 talloc_free(r);
1382 return false;
1383 }
1384
1385 pull = ndr_pull_init_blob(&blob, r, NULL);
1386 if (pull == NULL) {
1387 talloc_free(r);
1388 return false;
1389 }
1390
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;
1396 }
1397
1398 if (DEBUGLEVEL >= 10) {
1399 NDR_PRINT_IN_DEBUG(winreg_QueryValue, r);
1400 }
1401
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);
1408
1409 if (p->rng_fault_state) {
1410 talloc_free(r);
1411 /* Return true here, srv_pipe_hnd.c will take care */
1412 return true;
1413 }
1414
1415 if (DEBUGLEVEL >= 10) {
1416 NDR_PRINT_OUT_DEBUG(winreg_QueryValue, r);
1417 }
1418
1419 push = ndr_push_init_ctx(r, NULL);
1420 if (push == NULL) {
1421 talloc_free(r);
1422 return false;
1423 }
1424
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;
1429 }
1430
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;
1435 }
1436
1437 talloc_free(r);
1438
1439 return true;
1440 }
1441
1442 static bool api_winreg_ReplaceKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1443 {
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;
1450
1451 call = &ndr_table_winreg.calls[NDR_WINREG_REPLACEKEY];
1452
1453 r = talloc(talloc_tos(), struct winreg_ReplaceKey);
1454 if (r == NULL) {
1455 return false;
1456 }
1457
1458 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1459 talloc_free(r);
1460 return false;
1461 }
1462
1463 pull = ndr_pull_init_blob(&blob, r, NULL);
1464 if (pull == NULL) {
1465 talloc_free(r);
1466 return false;
1467 }
1468
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;
1474 }
1475
1476 if (DEBUGLEVEL >= 10) {
1477 NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, r);
1478 }
1479
1480 r->out.result = _winreg_ReplaceKey(p, r);
1481
1482 if (p->rng_fault_state) {
1483 talloc_free(r);
1484 /* Return true here, srv_pipe_hnd.c will take care */
1485 return true;
1486 }
1487
1488 if (DEBUGLEVEL >= 10) {
1489 NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, r);
1490 }
1491
1492 push = ndr_push_init_ctx(r, NULL);
1493 if (push == NULL) {
1494 talloc_free(r);
1495 return false;
1496 }
1497
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;
1502 }
1503
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;
1508 }
1509
1510 talloc_free(r);
1511
1512 return true;
1513 }
1514
1515 static bool api_winreg_RestoreKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1516 {
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;
1523
1524 call = &ndr_table_winreg.calls[NDR_WINREG_RESTOREKEY];
1525
1526 r = talloc(talloc_tos(), struct winreg_RestoreKey);
1527 if (r == NULL) {
1528 return false;
1529 }
1530
1531 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1532 talloc_free(r);
1533 return false;
1534 }
1535
1536 pull = ndr_pull_init_blob(&blob, r, NULL);
1537 if (pull == NULL) {
1538 talloc_free(r);
1539 return false;
1540 }
1541
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;
1547 }
1548
1549 if (DEBUGLEVEL >= 10) {
1550 NDR_PRINT_IN_DEBUG(winreg_RestoreKey, r);
1551 }
1552
1553 r->out.result = _winreg_RestoreKey(p, r);
1554
1555 if (p->rng_fault_state) {
1556 talloc_free(r);
1557 /* Return true here, srv_pipe_hnd.c will take care */
1558 return true;
1559 }
1560
1561 if (DEBUGLEVEL >= 10) {
1562 NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, r);
1563 }
1564
1565 push = ndr_push_init_ctx(r, NULL);
1566 if (push == NULL) {
1567 talloc_free(r);
1568 return false;
1569 }
1570
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;
1575 }
1576
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;
1581 }
1582
1583 talloc_free(r);
1584
1585 return true;
1586 }
1587
1588 static bool api_winreg_SaveKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1589 {
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;
1596
1597 call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEY];
1598
1599 r = talloc(talloc_tos(), struct winreg_SaveKey);
1600 if (r == NULL) {
1601 return false;
1602 }
1603
1604 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1605 talloc_free(r);
1606 return false;
1607 }
1608
1609 pull = ndr_pull_init_blob(&blob, r, NULL);
1610 if (pull == NULL) {
1611 talloc_free(r);
1612 return false;
1613 }
1614
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;
1620 }
1621
1622 if (DEBUGLEVEL >= 10) {
1623 NDR_PRINT_IN_DEBUG(winreg_SaveKey, r);
1624 }
1625
1626 r->out.result = _winreg_SaveKey(p, r);
1627
1628 if (p->rng_fault_state) {
1629 talloc_free(r);
1630 /* Return true here, srv_pipe_hnd.c will take care */
1631 return true;
1632 }
1633
1634 if (DEBUGLEVEL >= 10) {
1635 NDR_PRINT_OUT_DEBUG(winreg_SaveKey, r);
1636 }
1637
1638 push = ndr_push_init_ctx(r, NULL);
1639 if (push == NULL) {
1640 talloc_free(r);
1641 return false;
1642 }
1643
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;
1648 }
1649
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;
1654 }
1655
1656 talloc_free(r);
1657
1658 return true;
1659 }
1660
1661 static bool api_winreg_SetKeySecurity(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1662 {
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;
1669
1670 call = &ndr_table_winreg.calls[NDR_WINREG_SETKEYSECURITY];
1671
1672 r = talloc(talloc_tos(), struct winreg_SetKeySecurity);
1673 if (r == NULL) {
1674 return false;
1675 }
1676
1677 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1678 talloc_free(r);
1679 return false;
1680 }
1681
1682 pull = ndr_pull_init_blob(&blob, r, NULL);
1683 if (pull == NULL) {
1684 talloc_free(r);
1685 return false;
1686 }
1687
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;
1693 }
1694
1695 if (DEBUGLEVEL >= 10) {
1696 NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, r);
1697 }
1698
1699 r->out.result = _winreg_SetKeySecurity(p, r);
1700
1701 if (p->rng_fault_state) {
1702 talloc_free(r);
1703 /* Return true here, srv_pipe_hnd.c will take care */
1704 return true;
1705 }
1706
1707 if (DEBUGLEVEL >= 10) {
1708 NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, r);
1709 }
1710
1711 push = ndr_push_init_ctx(r, NULL);
1712 if (push == NULL) {
1713 talloc_free(r);
1714 return false;
1715 }
1716
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;
1721 }
1722
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;
1727 }
1728
1729 talloc_free(r);
1730
1731 return true;
1732 }
1733
1734 static bool api_winreg_SetValue(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1735 {
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;
1742
1743 call = &ndr_table_winreg.calls[NDR_WINREG_SETVALUE];
1744
1745 r = talloc(talloc_tos(), struct winreg_SetValue);
1746 if (r == NULL) {
1747 return false;
1748 }
1749
1750 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1751 talloc_free(r);
1752 return false;
1753 }
1754
1755 pull = ndr_pull_init_blob(&blob, r, NULL);
1756 if (pull == NULL) {
1757 talloc_free(r);
1758 return false;
1759 }
1760
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;
1766 }
1767
1768 if (DEBUGLEVEL >= 10) {
1769 NDR_PRINT_IN_DEBUG(winreg_SetValue, r);
1770 }
1771
1772 r->out.result = _winreg_SetValue(p, r);
1773
1774 if (p->rng_fault_state) {
1775 talloc_free(r);
1776 /* Return true here, srv_pipe_hnd.c will take care */
1777 return true;
1778 }
1779
1780 if (DEBUGLEVEL >= 10) {
1781 NDR_PRINT_OUT_DEBUG(winreg_SetValue, r);
1782 }
1783
1784 push = ndr_push_init_ctx(r, NULL);
1785 if (push == NULL) {
1786 talloc_free(r);
1787 return false;
1788 }
1789
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;
1794 }
1795
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;
1800 }
1801
1802 talloc_free(r);
1803
1804 return true;
1805 }
1806
1807 static bool api_winreg_UnLoadKey(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1808 {
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;
1815
1816 call = &ndr_table_winreg.calls[NDR_WINREG_UNLOADKEY];
1817
1818 r = talloc(talloc_tos(), struct winreg_UnLoadKey);
1819 if (r == NULL) {
1820 return false;
1821 }
1822
1823 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1824 talloc_free(r);
1825 return false;
1826 }
1827
1828 pull = ndr_pull_init_blob(&blob, r, NULL);
1829 if (pull == NULL) {
1830 talloc_free(r);
1831 return false;
1832 }
1833
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;
1839 }
1840
1841 if (DEBUGLEVEL >= 10) {
1842 NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, r);
1843 }
1844
1845 r->out.result = _winreg_UnLoadKey(p, r);
1846
1847 if (p->rng_fault_state) {
1848 talloc_free(r);
1849 /* Return true here, srv_pipe_hnd.c will take care */
1850 return true;
1851 }
1852
1853 if (DEBUGLEVEL >= 10) {
1854 NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, r);
1855 }
1856
1857 push = ndr_push_init_ctx(r, NULL);
1858 if (push == NULL) {
1859 talloc_free(r);
1860 return false;
1861 }
1862
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;
1867 }
1868
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;
1873 }
1874
1875 talloc_free(r);
1876
1877 return true;
1878 }
1879
1880 static bool api_winreg_InitiateSystemShutdown(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1881 {
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;
1888
1889 call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWN];
1890
1891 r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdown);
1892 if (r == NULL) {
1893 return false;
1894 }
1895
1896 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1897 talloc_free(r);
1898 return false;
1899 }
1900
1901 pull = ndr_pull_init_blob(&blob, r, NULL);
1902 if (pull == NULL) {
1903 talloc_free(r);
1904 return false;
1905 }
1906
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;
1912 }
1913
1914 if (DEBUGLEVEL >= 10) {
1915 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, r);
1916 }
1917
1918 r->out.result = _winreg_InitiateSystemShutdown(p, r);
1919
1920 if (p->rng_fault_state) {
1921 talloc_free(r);
1922 /* Return true here, srv_pipe_hnd.c will take care */
1923 return true;
1924 }
1925
1926 if (DEBUGLEVEL >= 10) {
1927 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, r);
1928 }
1929
1930 push = ndr_push_init_ctx(r, NULL);
1931 if (push == NULL) {
1932 talloc_free(r);
1933 return false;
1934 }
1935
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;
1940 }
1941
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;
1946 }
1947
1948 talloc_free(r);
1949
1950 return true;
1951 }
1952
1953 static bool api_winreg_AbortSystemShutdown(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
1954 {
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;
1961
1962 call = &ndr_table_winreg.calls[NDR_WINREG_ABORTSYSTEMSHUTDOWN];
1963
1964 r = talloc(talloc_tos(), struct winreg_AbortSystemShutdown);
1965 if (r == NULL) {
1966 return false;
1967 }
1968
1969 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1970 talloc_free(r);
1971 return false;
1972 }
1973
1974 pull = ndr_pull_init_blob(&blob, r, NULL);
1975 if (pull == NULL) {
1976 talloc_free(r);
1977 return false;
1978 }
1979
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;
1985 }
1986
1987 if (DEBUGLEVEL >= 10) {
1988 NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, r);
1989 }
1990
1991 r->out.result = _winreg_AbortSystemShutdown(p, r);
1992
1993 if (p->rng_fault_state) {
1994 talloc_free(r);
1995 /* Return true here, srv_pipe_hnd.c will take care */
1996 return true;
1997 }
1998
1999 if (DEBUGLEVEL >= 10) {
2000 NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, r);
2001 }
2002
2003 push = ndr_push_init_ctx(r, NULL);
2004 if (push == NULL) {
2005 talloc_free(r);
2006 return false;
2007 }
2008
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;
2013 }
2014
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;
2019 }
2020
2021 talloc_free(r);
2022
2023 return true;
2024 }
2025
2026 static bool api_winreg_GetVersion(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
2027 {
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;
2034
2035 call = &ndr_table_winreg.calls[NDR_WINREG_GETVERSION];
2036
2037 r = talloc(talloc_tos(), struct winreg_GetVersion);
2038 if (r == NULL) {
2039 return false;
2040 }
2041
2042 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2043 talloc_free(r);
2044 return false;
2045 }
2046
2047 pull = ndr_pull_init_blob(&blob, r, NULL);
2048 if (pull == NULL) {
2049 talloc_free(r);
2050 return false;
2051 }
2052
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;
2058 }
2059
2060 if (DEBUGLEVEL >= 10) {
2061 NDR_PRINT_IN_DEBUG(winreg_GetVersion, r);
2062 }
2063
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;
2069 }
2070
2071 r->out.result = _winreg_GetVersion(p, r);
2072
2073 if (p->rng_fault_state) {
2074 talloc_free(r);
2075 /* Return true here, srv_pipe_hnd.c will take care */
2076 return true;
2077 }
2078
2079 if (DEBUGLEVEL >= 10) {
2080 NDR_PRINT_OUT_DEBUG(winreg_GetVersion, r);
2081 }
2082
2083 push = ndr_push_init_ctx(r, NULL);
2084 if (push == NULL) {
2085 talloc_free(r);
2086 return false;
2087 }
2088
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;
2093 }
2094
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;
2099 }
2100
2101 talloc_free(r);
2102
2103 return true;
2104 }
2105
2106 static bool api_winreg_OpenHKCC(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
2107 {
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;
2114
2115 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKCC];
2116
2117 r = talloc(talloc_tos(), struct winreg_OpenHKCC);
2118 if (r == NULL) {
2119 return false;
2120 }
2121
2122 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2123 talloc_free(r);
2124 return false;
2125 }
2126
2127 pull = ndr_pull_init_blob(&blob, r, NULL);
2128 if (pull == NULL) {
2129 talloc_free(r);
2130 return false;
2131 }
2132
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;
2138 }
2139
2140 if (DEBUGLEVEL >= 10) {
2141 NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, r);
2142 }
2143
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;
2149 }
2150
2151 r->out.result = _winreg_OpenHKCC(p, r);
2152
2153 if (p->rng_fault_state) {
2154 talloc_free(r);
2155 /* Return true here, srv_pipe_hnd.c will take care */
2156 return true;
2157 }
2158
2159 if (DEBUGLEVEL >= 10) {
2160 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, r);
2161 }
2162
2163 push = ndr_push_init_ctx(r, NULL);
2164 if (push == NULL) {
2165 talloc_free(r);
2166 return false;
2167 }
2168
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;
2173 }
2174
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;
2179 }
2180
2181 talloc_free(r);
2182
2183 return true;
2184 }
2185
2186 static bool api_winreg_OpenHKDD(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
2187 {
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;
2194
2195 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKDD];
2196
2197 r = talloc(talloc_tos(), struct winreg_OpenHKDD);
2198 if (r == NULL) {
2199 return false;
2200 }
2201
2202 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2203 talloc_free(r);
2204 return false;
2205 }
2206
2207 pull = ndr_pull_init_blob(&blob, r, NULL);
2208 if (pull == NULL) {
2209 talloc_free(r);
2210 return false;
2211 }
2212
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;
2218 }
2219
2220 if (DEBUGLEVEL >= 10) {
2221 NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, r);
2222 }
2223
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;
2229 }
2230
2231 r->out.result = _winreg_OpenHKDD(p, r);
2232
2233 if (p->rng_fault_state) {
2234 talloc_free(r);
2235 /* Return true here, srv_pipe_hnd.c will take care */
2236 return true;
2237 }
2238
2239 if (DEBUGLEVEL >= 10) {
2240 NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, r);
2241 }
2242
2243 push = ndr_push_init_ctx(r, NULL);
2244 if (push == NULL) {
2245 talloc_free(r);
2246 return false;
2247 }
2248
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;
2253 }
2254
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;
2259 }
2260
2261 talloc_free(r);
2262
2263 return true;
2264 }
2265
2266 static bool api_winreg_QueryMultipleValues(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
2267 {
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;
2274
2275 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES];
2276
2277 r = talloc(talloc_tos(), struct winreg_QueryMultipleValues);
2278 if (r == NULL) {
2279 return false;
2280 }
2281
2282 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2283 talloc_free(r);
2284 return false;
2285 }
2286
2287 pull = ndr_pull_init_blob(&blob, r, NULL);
2288 if (pull == NULL) {
2289 talloc_free(r);
2290 return false;
2291 }
2292
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;
2298 }
2299
2300 if (DEBUGLEVEL >= 10) {
2301 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, r);
2302 }
2303
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);
2309
2310 if (p->rng_fault_state) {
2311 talloc_free(r);
2312 /* Return true here, srv_pipe_hnd.c will take care */
2313 return true;
2314 }
2315
2316 if (DEBUGLEVEL >= 10) {
2317 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, r);
2318 }
2319
2320 push = ndr_push_init_ctx(r, NULL);
2321 if (push == NULL) {
2322 talloc_free(r);
2323 return false;
2324 }
2325
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;
2330 }
2331
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;
2336 }
2337
2338 talloc_free(r);
2339
2340 return true;
2341 }
2342
2343 static bool api_winreg_InitiateSystemShutdownEx(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
2344 {
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;
2351
2352 call = &ndr_table_winreg.calls[NDR_WINREG_INITIATESYSTEMSHUTDOWNEX];
2353
2354 r = talloc(talloc_tos(), struct winreg_InitiateSystemShutdownEx);
2355 if (r == NULL) {
2356 return false;
2357 }
2358
2359 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2360 talloc_free(r);
2361 return false;
2362 }
2363
2364 pull = ndr_pull_init_blob(&blob, r, NULL);
2365 if (pull == NULL) {
2366 talloc_free(r);
2367 return false;
2368 }
2369
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;
2375 }
2376
2377 if (DEBUGLEVEL >= 10) {
2378 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, r);
2379 }
2380
2381 r->out.result = _winreg_InitiateSystemShutdownEx(p, r);
2382
2383 if (p->rng_fault_state) {
2384 talloc_free(r);
2385 /* Return true here, srv_pipe_hnd.c will take care */
2386 return true;
2387 }
2388
2389 if (DEBUGLEVEL >= 10) {
2390 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, r);
2391 }
2392
2393 push = ndr_push_init_ctx(r, NULL);
2394 if (push == NULL) {
2395 talloc_free(r);
2396 return false;
2397 }
2398
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;
2403 }
2404
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;
2409 }
2410
2411 talloc_free(r);
2412
2413 return true;
2414 }
2415
2416 static bool api_winreg_SaveKeyEx(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
2417 {
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;
2424
2425 call = &ndr_table_winreg.calls[NDR_WINREG_SAVEKEYEX];
2426
2427 r = talloc(talloc_tos(), struct winreg_SaveKeyEx);
2428 if (r == NULL) {
2429 return false;
2430 }
2431
2432 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2433 talloc_free(r);
2434 return false;
2435 }
2436
2437 pull = ndr_pull_init_blob(&blob, r, NULL);
2438 if (pull == NULL) {
2439 talloc_free(r);
2440 return false;
2441 }
2442
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;
2448 }
2449
2450 if (DEBUGLEVEL >= 10) {
2451 NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, r);
2452 }
2453
2454 r->out.result = _winreg_SaveKeyEx(p, r);
2455
2456 if (p->rng_fault_state) {
2457 talloc_free(r);
2458 /* Return true here, srv_pipe_hnd.c will take care */
2459 return true;
2460 }
2461
2462 if (DEBUGLEVEL >= 10) {
2463 NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, r);
2464 }
2465
2466 push = ndr_push_init_ctx(r, NULL);
2467 if (push == NULL) {
2468 talloc_free(r);
2469 return false;
2470 }
2471
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;
2476 }
2477
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;
2482 }
2483
2484 talloc_free(r);
2485
2486 return true;
2487 }
2488
2489 static bool api_winreg_OpenHKPT(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
2490 {
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;
2497
2498 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPT];
2499
2500 r = talloc(talloc_tos(), struct winreg_OpenHKPT);
2501 if (r == NULL) {
2502 return false;
2503 }
2504
2505 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2506 talloc_free(r);
2507 return false;
2508 }
2509
2510 pull = ndr_pull_init_blob(&blob, r, NULL);
2511 if (pull == NULL) {
2512 talloc_free(r);
2513 return false;
2514 }
2515
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;
2521 }
2522
2523 if (DEBUGLEVEL >= 10) {
2524 NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, r);
2525 }
2526
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;
2532 }
2533
2534 r->out.result = _winreg_OpenHKPT(p, r);
2535
2536 if (p->rng_fault_state) {
2537 talloc_free(r);
2538 /* Return true here, srv_pipe_hnd.c will take care */
2539 return true;
2540 }
2541
2542 if (DEBUGLEVEL >= 10) {
2543 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, r);
2544 }
2545
2546 push = ndr_push_init_ctx(r, NULL);
2547 if (push == NULL) {
2548 talloc_free(r);
2549 return false;
2550 }
2551
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;
2556 }
2557
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;
2562 }
2563
2564 talloc_free(r);
2565
2566 return true;
2567 }
2568
2569 static bool api_winreg_OpenHKPN(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
2570 {
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;
2577
2578 call = &ndr_table_winreg.calls[NDR_WINREG_OPENHKPN];
2579
2580 r = talloc(talloc_tos(), struct winreg_OpenHKPN);
2581 if (r == NULL) {
2582 return false;
2583 }
2584
2585 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2586 talloc_free(r);
2587 return false;
2588 }
2589
2590 pull = ndr_pull_init_blob(&blob, r, NULL);
2591 if (pull == NULL) {
2592 talloc_free(r);
2593 return false;
2594 }
2595
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;
2601 }
2602
2603 if (DEBUGLEVEL >= 10) {
2604 NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, r);
2605 }
2606
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;
2612 }
2613
2614 r->out.result = _winreg_OpenHKPN(p, r);
2615
2616 if (p->rng_fault_state) {
2617 talloc_free(r);
2618 /* Return true here, srv_pipe_hnd.c will take care */
2619 return true;
2620 }
2621
2622 if (DEBUGLEVEL >= 10) {
2623 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, r);
2624 }
2625
2626 push = ndr_push_init_ctx(r, NULL);
2627 if (push == NULL) {
2628 talloc_free(r);
2629 return false;
2630 }
2631
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;
2636 }
2637
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;
2642 }
2643
2644 talloc_free(r);
2645
2646 return true;
2647 }
2648
2649 static bool api_winreg_QueryMultipleValues2(pipes_struct *p)
/* [<][>][^][v][top][bottom][index][help] */
2650 {
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;
2657
2658 call = &ndr_table_winreg.calls[NDR_WINREG_QUERYMULTIPLEVALUES2];
2659
2660 r = talloc(talloc_tos(), struct winreg_QueryMultipleValues2);
2661 if (r == NULL) {
2662 return false;
2663 }
2664
2665 if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2666 talloc_free(r);
2667 return false;
2668 }
2669
2670 pull = ndr_pull_init_blob(&blob, r, NULL);
2671 if (pull == NULL) {
2672 talloc_free(r);
2673 return false;
2674 }
2675
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;
2681 }
2682
2683 if (DEBUGLEVEL >= 10) {
2684 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, r);
2685 }
2686
2687 r->out.result = _winreg_QueryMultipleValues2(p, r);
2688
2689 if (p->rng_fault_state) {
2690 talloc_free(r);
2691 /* Return true here, srv_pipe_hnd.c will take care */
2692 return true;
2693 }
2694
2695 if (DEBUGLEVEL >= 10) {
2696 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, r);
2697 }
2698
2699 push = ndr_push_init_ctx(r, NULL);
2700 if (push == NULL) {
2701 talloc_free(r);
2702 return false;
2703 }
2704
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;
2709 }
2710
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;
2715 }
2716
2717 talloc_free(r);
2718
2719 return true;
2720 }
2721
2722
2723 /* Tables */
2724 static struct api_struct api_winreg_cmds[] =
2725 {
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},
2761 };
2762
2763 void winreg_get_pipe_fns(struct api_struct **fns, int *n_fns)
/* [<][>][^][v][top][bottom][index][help] */
2764 {
2765 *fns = api_winreg_cmds;
2766 *n_fns = sizeof(api_winreg_cmds) / sizeof(struct api_struct);
2767 }
2768
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)
/* [<][>][^][v][top][bottom][index][help] */
2770 {
2771 if (cli->pipes_struct == NULL) {
2772 return NT_STATUS_INVALID_PARAMETER;
2773 }
2774
2775 switch (opnum)
2776 {
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;
2783 }
2784
2785 r->out.result = _winreg_OpenHKCR(cli->pipes_struct, r);
2786 return NT_STATUS_OK;
2787 }
2788
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;
2795 }
2796
2797 r->out.result = _winreg_OpenHKCU(cli->pipes_struct, r);
2798 return NT_STATUS_OK;
2799 }
2800
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;
2807 }
2808
2809 r->out.result = _winreg_OpenHKLM(cli->pipes_struct, r);
2810 return NT_STATUS_OK;
2811 }
2812
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;
2819 }
2820
2821 r->out.result = _winreg_OpenHKPD(cli->pipes_struct, r);
2822 return NT_STATUS_OK;
2823 }
2824
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;
2831 }
2832
2833 r->out.result = _winreg_OpenHKU(cli->pipes_struct, r);
2834 return NT_STATUS_OK;
2835 }
2836
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;
2843 }
2844
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;
2852 }
2853
2854 r->out.result = _winreg_CreateKey(cli->pipes_struct, r);
2855 return NT_STATUS_OK;
2856 }
2857
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;
2862 }
2863
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;
2868 }
2869
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;
2878 }
2879
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;
2890 }
2891
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;
2896 }
2897
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;
2904 }
2905
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;
2910 }
2911
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;
2916 }
2917
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;
2924 }
2925
2926 r->out.result = _winreg_OpenKey(cli->pipes_struct, r);
2927 return NT_STATUS_OK;
2928 }
2929
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;
2937 }
2938
2939 r->out.max_subkeylen = talloc_zero(mem_ctx, uint32_t);
2940 if (r->out.max_subkeylen == NULL) {
2941 return NT_STATUS_NO_MEMORY;
2942 }
2943
2944 r->out.max_classlen = talloc_zero(mem_ctx, uint32_t);
2945 if (r->out.max_classlen == NULL) {
2946 return NT_STATUS_NO_MEMORY;
2947 }
2948
2949 r->out.num_values = talloc_zero(mem_ctx, uint32_t);
2950 if (r->out.num_values == NULL) {
2951 return NT_STATUS_NO_MEMORY;
2952 }
2953
2954 r->out.max_valnamelen = talloc_zero(mem_ctx, uint32_t);
2955 if (r->out.max_valnamelen == NULL) {
2956 return NT_STATUS_NO_MEMORY;
2957 }
2958
2959 r->out.max_valbufsize = talloc_zero(mem_ctx, uint32_t);
2960 if (r->out.max_valbufsize == NULL) {
2961 return NT_STATUS_NO_MEMORY;
2962 }
2963
2964 r->out.secdescsize = talloc_zero(mem_ctx, uint32_t);
2965 if (r->out.secdescsize == NULL) {
2966 return NT_STATUS_NO_MEMORY;
2967 }
2968
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;
2972 }
2973
2974 r->out.result = _winreg_QueryInfoKey(cli->pipes_struct, r);
2975 return NT_STATUS_OK;
2976 }
2977
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;
2987 }
2988
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;
2993 }
2994
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;
2999 }
3000
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;
3005 }
3006
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;
3011 }
3012
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;
3017 }
3018
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;
3023 }
3024
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;
3029 }
3030
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;
3035 }
3036
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;
3043 }
3044
3045 r->out.result = _winreg_GetVersion(cli->pipes_struct, r);
3046 return NT_STATUS_OK;
3047 }
3048
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;
3055 }
3056
3057 r->out.result = _winreg_OpenHKCC(cli->pipes_struct, r);
3058 return NT_STATUS_OK;
3059 }
3060
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;
3067 }
3068
3069 r->out.result = _winreg_OpenHKDD(cli->pipes_struct, r);
3070 return NT_STATUS_OK;
3071 }
3072
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;
3081 }
3082
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;
3087 }
3088
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;
3093 }
3094
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;
3101 }
3102
3103 r->out.result = _winreg_OpenHKPT(cli->pipes_struct, r);
3104 return NT_STATUS_OK;
3105 }
3106
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;
3113 }
3114
3115 r->out.result = _winreg_OpenHKPN(cli->pipes_struct, r);
3116 return NT_STATUS_OK;
3117 }
3118
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;
3123 }
3124
3125 default:
3126 return NT_STATUS_NOT_IMPLEMENTED;
3127 }
3128 }
3129
3130 NTSTATUS rpc_winreg_init(void)
/* [<][>][^][v][top][bottom][index][help] */
3131 {
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));
3133 }