Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
[ira/wip.git] / source3 / librpc / gen_ndr / cli_winreg.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/cli_winreg.h"
8
9 NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli,
10                                 TALLOC_CTX *mem_ctx,
11                                 uint16_t *system_name,
12                                 uint32_t access_mask,
13                                 struct policy_handle *handle,
14                                 WERROR *werror)
15 {
16         struct winreg_OpenHKCR r;
17         NTSTATUS status;
18
19         /* In parameters */
20         r.in.system_name = system_name;
21         r.in.access_mask = access_mask;
22
23         if (DEBUGLEVEL >= 10) {
24                 NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, &r);
25         }
26
27         status = cli_do_rpc_ndr(cli,
28                                 mem_ctx,
29                                 PI_WINREG,
30                                 &ndr_table_winreg,
31                                 NDR_WINREG_OPENHKCR,
32                                 &r);
33
34         if (!NT_STATUS_IS_OK(status)) {
35                 return status;
36         }
37
38         if (DEBUGLEVEL >= 10) {
39                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, &r);
40         }
41
42         if (NT_STATUS_IS_ERR(status)) {
43                 return status;
44         }
45
46         /* Return variables */
47         *handle = *r.out.handle;
48
49         /* Return result */
50         if (werror) {
51                 *werror = r.out.result;
52         }
53
54         return werror_to_ntstatus(r.out.result);
55 }
56
57 NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli,
58                                 TALLOC_CTX *mem_ctx,
59                                 uint16_t *system_name,
60                                 uint32_t access_mask,
61                                 struct policy_handle *handle,
62                                 WERROR *werror)
63 {
64         struct winreg_OpenHKCU r;
65         NTSTATUS status;
66
67         /* In parameters */
68         r.in.system_name = system_name;
69         r.in.access_mask = access_mask;
70
71         if (DEBUGLEVEL >= 10) {
72                 NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, &r);
73         }
74
75         status = cli_do_rpc_ndr(cli,
76                                 mem_ctx,
77                                 PI_WINREG,
78                                 &ndr_table_winreg,
79                                 NDR_WINREG_OPENHKCU,
80                                 &r);
81
82         if (!NT_STATUS_IS_OK(status)) {
83                 return status;
84         }
85
86         if (DEBUGLEVEL >= 10) {
87                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, &r);
88         }
89
90         if (NT_STATUS_IS_ERR(status)) {
91                 return status;
92         }
93
94         /* Return variables */
95         *handle = *r.out.handle;
96
97         /* Return result */
98         if (werror) {
99                 *werror = r.out.result;
100         }
101
102         return werror_to_ntstatus(r.out.result);
103 }
104
105 NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli,
106                                 TALLOC_CTX *mem_ctx,
107                                 uint16_t *system_name,
108                                 uint32_t access_mask,
109                                 struct policy_handle *handle,
110                                 WERROR *werror)
111 {
112         struct winreg_OpenHKLM r;
113         NTSTATUS status;
114
115         /* In parameters */
116         r.in.system_name = system_name;
117         r.in.access_mask = access_mask;
118
119         if (DEBUGLEVEL >= 10) {
120                 NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, &r);
121         }
122
123         status = cli_do_rpc_ndr(cli,
124                                 mem_ctx,
125                                 PI_WINREG,
126                                 &ndr_table_winreg,
127                                 NDR_WINREG_OPENHKLM,
128                                 &r);
129
130         if (!NT_STATUS_IS_OK(status)) {
131                 return status;
132         }
133
134         if (DEBUGLEVEL >= 10) {
135                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, &r);
136         }
137
138         if (NT_STATUS_IS_ERR(status)) {
139                 return status;
140         }
141
142         /* Return variables */
143         *handle = *r.out.handle;
144
145         /* Return result */
146         if (werror) {
147                 *werror = r.out.result;
148         }
149
150         return werror_to_ntstatus(r.out.result);
151 }
152
153 NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli,
154                                 TALLOC_CTX *mem_ctx,
155                                 uint16_t *system_name,
156                                 uint32_t access_mask,
157                                 struct policy_handle *handle,
158                                 WERROR *werror)
159 {
160         struct winreg_OpenHKPD r;
161         NTSTATUS status;
162
163         /* In parameters */
164         r.in.system_name = system_name;
165         r.in.access_mask = access_mask;
166
167         if (DEBUGLEVEL >= 10) {
168                 NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, &r);
169         }
170
171         status = cli_do_rpc_ndr(cli,
172                                 mem_ctx,
173                                 PI_WINREG,
174                                 &ndr_table_winreg,
175                                 NDR_WINREG_OPENHKPD,
176                                 &r);
177
178         if (!NT_STATUS_IS_OK(status)) {
179                 return status;
180         }
181
182         if (DEBUGLEVEL >= 10) {
183                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, &r);
184         }
185
186         if (NT_STATUS_IS_ERR(status)) {
187                 return status;
188         }
189
190         /* Return variables */
191         *handle = *r.out.handle;
192
193         /* Return result */
194         if (werror) {
195                 *werror = r.out.result;
196         }
197
198         return werror_to_ntstatus(r.out.result);
199 }
200
201 NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli,
202                                TALLOC_CTX *mem_ctx,
203                                uint16_t *system_name,
204                                uint32_t access_mask,
205                                struct policy_handle *handle,
206                                WERROR *werror)
207 {
208         struct winreg_OpenHKU r;
209         NTSTATUS status;
210
211         /* In parameters */
212         r.in.system_name = system_name;
213         r.in.access_mask = access_mask;
214
215         if (DEBUGLEVEL >= 10) {
216                 NDR_PRINT_IN_DEBUG(winreg_OpenHKU, &r);
217         }
218
219         status = cli_do_rpc_ndr(cli,
220                                 mem_ctx,
221                                 PI_WINREG,
222                                 &ndr_table_winreg,
223                                 NDR_WINREG_OPENHKU,
224                                 &r);
225
226         if (!NT_STATUS_IS_OK(status)) {
227                 return status;
228         }
229
230         if (DEBUGLEVEL >= 10) {
231                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, &r);
232         }
233
234         if (NT_STATUS_IS_ERR(status)) {
235                 return status;
236         }
237
238         /* Return variables */
239         *handle = *r.out.handle;
240
241         /* Return result */
242         if (werror) {
243                 *werror = r.out.result;
244         }
245
246         return werror_to_ntstatus(r.out.result);
247 }
248
249 NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli,
250                                 TALLOC_CTX *mem_ctx,
251                                 struct policy_handle *handle,
252                                 WERROR *werror)
253 {
254         struct winreg_CloseKey r;
255         NTSTATUS status;
256
257         /* In parameters */
258         r.in.handle = handle;
259
260         if (DEBUGLEVEL >= 10) {
261                 NDR_PRINT_IN_DEBUG(winreg_CloseKey, &r);
262         }
263
264         status = cli_do_rpc_ndr(cli,
265                                 mem_ctx,
266                                 PI_WINREG,
267                                 &ndr_table_winreg,
268                                 NDR_WINREG_CLOSEKEY,
269                                 &r);
270
271         if (!NT_STATUS_IS_OK(status)) {
272                 return status;
273         }
274
275         if (DEBUGLEVEL >= 10) {
276                 NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &r);
277         }
278
279         if (NT_STATUS_IS_ERR(status)) {
280                 return status;
281         }
282
283         /* Return variables */
284         *handle = *r.out.handle;
285
286         /* Return result */
287         if (werror) {
288                 *werror = r.out.result;
289         }
290
291         return werror_to_ntstatus(r.out.result);
292 }
293
294 NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli,
295                                  TALLOC_CTX *mem_ctx,
296                                  struct policy_handle *handle,
297                                  struct winreg_String name,
298                                  struct winreg_String keyclass,
299                                  uint32_t options,
300                                  uint32_t access_mask,
301                                  struct winreg_SecBuf *secdesc,
302                                  struct policy_handle *new_handle,
303                                  enum winreg_CreateAction *action_taken,
304                                  WERROR *werror)
305 {
306         struct winreg_CreateKey r;
307         NTSTATUS status;
308
309         /* In parameters */
310         r.in.handle = handle;
311         r.in.name = name;
312         r.in.keyclass = keyclass;
313         r.in.options = options;
314         r.in.access_mask = access_mask;
315         r.in.secdesc = secdesc;
316         r.in.action_taken = action_taken;
317
318         if (DEBUGLEVEL >= 10) {
319                 NDR_PRINT_IN_DEBUG(winreg_CreateKey, &r);
320         }
321
322         status = cli_do_rpc_ndr(cli,
323                                 mem_ctx,
324                                 PI_WINREG,
325                                 &ndr_table_winreg,
326                                 NDR_WINREG_CREATEKEY,
327                                 &r);
328
329         if (!NT_STATUS_IS_OK(status)) {
330                 return status;
331         }
332
333         if (DEBUGLEVEL >= 10) {
334                 NDR_PRINT_OUT_DEBUG(winreg_CreateKey, &r);
335         }
336
337         if (NT_STATUS_IS_ERR(status)) {
338                 return status;
339         }
340
341         /* Return variables */
342         *new_handle = *r.out.new_handle;
343         if (action_taken && r.out.action_taken) {
344                 *action_taken = *r.out.action_taken;
345         }
346
347         /* Return result */
348         if (werror) {
349                 *werror = r.out.result;
350         }
351
352         return werror_to_ntstatus(r.out.result);
353 }
354
355 NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli,
356                                  TALLOC_CTX *mem_ctx,
357                                  struct policy_handle *handle,
358                                  struct winreg_String key,
359                                  WERROR *werror)
360 {
361         struct winreg_DeleteKey r;
362         NTSTATUS status;
363
364         /* In parameters */
365         r.in.handle = handle;
366         r.in.key = key;
367
368         if (DEBUGLEVEL >= 10) {
369                 NDR_PRINT_IN_DEBUG(winreg_DeleteKey, &r);
370         }
371
372         status = cli_do_rpc_ndr(cli,
373                                 mem_ctx,
374                                 PI_WINREG,
375                                 &ndr_table_winreg,
376                                 NDR_WINREG_DELETEKEY,
377                                 &r);
378
379         if (!NT_STATUS_IS_OK(status)) {
380                 return status;
381         }
382
383         if (DEBUGLEVEL >= 10) {
384                 NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, &r);
385         }
386
387         if (NT_STATUS_IS_ERR(status)) {
388                 return status;
389         }
390
391         /* Return variables */
392
393         /* Return result */
394         if (werror) {
395                 *werror = r.out.result;
396         }
397
398         return werror_to_ntstatus(r.out.result);
399 }
400
401 NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli,
402                                    TALLOC_CTX *mem_ctx,
403                                    struct policy_handle *handle,
404                                    struct winreg_String value,
405                                    WERROR *werror)
406 {
407         struct winreg_DeleteValue r;
408         NTSTATUS status;
409
410         /* In parameters */
411         r.in.handle = handle;
412         r.in.value = value;
413
414         if (DEBUGLEVEL >= 10) {
415                 NDR_PRINT_IN_DEBUG(winreg_DeleteValue, &r);
416         }
417
418         status = cli_do_rpc_ndr(cli,
419                                 mem_ctx,
420                                 PI_WINREG,
421                                 &ndr_table_winreg,
422                                 NDR_WINREG_DELETEVALUE,
423                                 &r);
424
425         if (!NT_STATUS_IS_OK(status)) {
426                 return status;
427         }
428
429         if (DEBUGLEVEL >= 10) {
430                 NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, &r);
431         }
432
433         if (NT_STATUS_IS_ERR(status)) {
434                 return status;
435         }
436
437         /* Return variables */
438
439         /* Return result */
440         if (werror) {
441                 *werror = r.out.result;
442         }
443
444         return werror_to_ntstatus(r.out.result);
445 }
446
447 NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli,
448                                TALLOC_CTX *mem_ctx,
449                                struct policy_handle *handle,
450                                uint32_t enum_index,
451                                struct winreg_StringBuf *name,
452                                struct winreg_StringBuf *keyclass,
453                                NTTIME *last_changed_time,
454                                WERROR *werror)
455 {
456         struct winreg_EnumKey r;
457         NTSTATUS status;
458
459         /* In parameters */
460         r.in.handle = handle;
461         r.in.enum_index = enum_index;
462         r.in.name = name;
463         r.in.keyclass = keyclass;
464         r.in.last_changed_time = last_changed_time;
465
466         if (DEBUGLEVEL >= 10) {
467                 NDR_PRINT_IN_DEBUG(winreg_EnumKey, &r);
468         }
469
470         status = cli_do_rpc_ndr(cli,
471                                 mem_ctx,
472                                 PI_WINREG,
473                                 &ndr_table_winreg,
474                                 NDR_WINREG_ENUMKEY,
475                                 &r);
476
477         if (!NT_STATUS_IS_OK(status)) {
478                 return status;
479         }
480
481         if (DEBUGLEVEL >= 10) {
482                 NDR_PRINT_OUT_DEBUG(winreg_EnumKey, &r);
483         }
484
485         if (NT_STATUS_IS_ERR(status)) {
486                 return status;
487         }
488
489         /* Return variables */
490         *name = *r.out.name;
491         if (keyclass && r.out.keyclass) {
492                 *keyclass = *r.out.keyclass;
493         }
494         if (last_changed_time && r.out.last_changed_time) {
495                 *last_changed_time = *r.out.last_changed_time;
496         }
497
498         /* Return result */
499         if (werror) {
500                 *werror = r.out.result;
501         }
502
503         return werror_to_ntstatus(r.out.result);
504 }
505
506 NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
507                                  TALLOC_CTX *mem_ctx,
508                                  struct policy_handle *handle,
509                                  uint32_t enum_index,
510                                  struct winreg_ValNameBuf *name,
511                                  enum winreg_Type *type,
512                                  uint8_t *value,
513                                  uint32_t *size,
514                                  uint32_t *length,
515                                  WERROR *werror)
516 {
517         struct winreg_EnumValue r;
518         NTSTATUS status;
519
520         /* In parameters */
521         r.in.handle = handle;
522         r.in.enum_index = enum_index;
523         r.in.name = name;
524         r.in.type = type;
525         r.in.value = value;
526         r.in.size = size;
527         r.in.length = length;
528
529         if (DEBUGLEVEL >= 10) {
530                 NDR_PRINT_IN_DEBUG(winreg_EnumValue, &r);
531         }
532
533         status = cli_do_rpc_ndr(cli,
534                                 mem_ctx,
535                                 PI_WINREG,
536                                 &ndr_table_winreg,
537                                 NDR_WINREG_ENUMVALUE,
538                                 &r);
539
540         if (!NT_STATUS_IS_OK(status)) {
541                 return status;
542         }
543
544         if (DEBUGLEVEL >= 10) {
545                 NDR_PRINT_OUT_DEBUG(winreg_EnumValue, &r);
546         }
547
548         if (NT_STATUS_IS_ERR(status)) {
549                 return status;
550         }
551
552         /* Return variables */
553         *name = *r.out.name;
554         if (type && r.out.type) {
555                 *type = *r.out.type;
556         }
557         if (value && r.out.value) {
558                 memcpy(value, r.out.value, *r.in.size);
559         }
560         if (size && r.out.size) {
561                 *size = *r.out.size;
562         }
563         if (length && r.out.length) {
564                 *length = *r.out.length;
565         }
566
567         /* Return result */
568         if (werror) {
569                 *werror = r.out.result;
570         }
571
572         return werror_to_ntstatus(r.out.result);
573 }
574
575 NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli,
576                                 TALLOC_CTX *mem_ctx,
577                                 struct policy_handle *handle,
578                                 WERROR *werror)
579 {
580         struct winreg_FlushKey r;
581         NTSTATUS status;
582
583         /* In parameters */
584         r.in.handle = handle;
585
586         if (DEBUGLEVEL >= 10) {
587                 NDR_PRINT_IN_DEBUG(winreg_FlushKey, &r);
588         }
589
590         status = cli_do_rpc_ndr(cli,
591                                 mem_ctx,
592                                 PI_WINREG,
593                                 &ndr_table_winreg,
594                                 NDR_WINREG_FLUSHKEY,
595                                 &r);
596
597         if (!NT_STATUS_IS_OK(status)) {
598                 return status;
599         }
600
601         if (DEBUGLEVEL >= 10) {
602                 NDR_PRINT_OUT_DEBUG(winreg_FlushKey, &r);
603         }
604
605         if (NT_STATUS_IS_ERR(status)) {
606                 return status;
607         }
608
609         /* Return variables */
610
611         /* Return result */
612         if (werror) {
613                 *werror = r.out.result;
614         }
615
616         return werror_to_ntstatus(r.out.result);
617 }
618
619 NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli,
620                                       TALLOC_CTX *mem_ctx,
621                                       struct policy_handle *handle,
622                                       uint32_t sec_info,
623                                       struct KeySecurityData *sd,
624                                       WERROR *werror)
625 {
626         struct winreg_GetKeySecurity r;
627         NTSTATUS status;
628
629         /* In parameters */
630         r.in.handle = handle;
631         r.in.sec_info = sec_info;
632         r.in.sd = sd;
633
634         if (DEBUGLEVEL >= 10) {
635                 NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, &r);
636         }
637
638         status = cli_do_rpc_ndr(cli,
639                                 mem_ctx,
640                                 PI_WINREG,
641                                 &ndr_table_winreg,
642                                 NDR_WINREG_GETKEYSECURITY,
643                                 &r);
644
645         if (!NT_STATUS_IS_OK(status)) {
646                 return status;
647         }
648
649         if (DEBUGLEVEL >= 10) {
650                 NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, &r);
651         }
652
653         if (NT_STATUS_IS_ERR(status)) {
654                 return status;
655         }
656
657         /* Return variables */
658         *sd = *r.out.sd;
659
660         /* Return result */
661         if (werror) {
662                 *werror = r.out.result;
663         }
664
665         return werror_to_ntstatus(r.out.result);
666 }
667
668 NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli,
669                                TALLOC_CTX *mem_ctx,
670                                struct policy_handle *handle,
671                                struct winreg_String *keyname,
672                                struct winreg_String *filename,
673                                WERROR *werror)
674 {
675         struct winreg_LoadKey r;
676         NTSTATUS status;
677
678         /* In parameters */
679         r.in.handle = handle;
680         r.in.keyname = keyname;
681         r.in.filename = filename;
682
683         if (DEBUGLEVEL >= 10) {
684                 NDR_PRINT_IN_DEBUG(winreg_LoadKey, &r);
685         }
686
687         status = cli_do_rpc_ndr(cli,
688                                 mem_ctx,
689                                 PI_WINREG,
690                                 &ndr_table_winreg,
691                                 NDR_WINREG_LOADKEY,
692                                 &r);
693
694         if (!NT_STATUS_IS_OK(status)) {
695                 return status;
696         }
697
698         if (DEBUGLEVEL >= 10) {
699                 NDR_PRINT_OUT_DEBUG(winreg_LoadKey, &r);
700         }
701
702         if (NT_STATUS_IS_ERR(status)) {
703                 return status;
704         }
705
706         /* Return variables */
707
708         /* Return result */
709         if (werror) {
710                 *werror = r.out.result;
711         }
712
713         return werror_to_ntstatus(r.out.result);
714 }
715
716 NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli,
717                                             TALLOC_CTX *mem_ctx,
718                                             struct policy_handle *handle,
719                                             uint8_t watch_subtree,
720                                             uint32_t notify_filter,
721                                             uint32_t unknown,
722                                             struct winreg_String string1,
723                                             struct winreg_String string2,
724                                             uint32_t unknown2,
725                                             WERROR *werror)
726 {
727         struct winreg_NotifyChangeKeyValue r;
728         NTSTATUS status;
729
730         /* In parameters */
731         r.in.handle = handle;
732         r.in.watch_subtree = watch_subtree;
733         r.in.notify_filter = notify_filter;
734         r.in.unknown = unknown;
735         r.in.string1 = string1;
736         r.in.string2 = string2;
737         r.in.unknown2 = unknown2;
738
739         if (DEBUGLEVEL >= 10) {
740                 NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, &r);
741         }
742
743         status = cli_do_rpc_ndr(cli,
744                                 mem_ctx,
745                                 PI_WINREG,
746                                 &ndr_table_winreg,
747                                 NDR_WINREG_NOTIFYCHANGEKEYVALUE,
748                                 &r);
749
750         if (!NT_STATUS_IS_OK(status)) {
751                 return status;
752         }
753
754         if (DEBUGLEVEL >= 10) {
755                 NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, &r);
756         }
757
758         if (NT_STATUS_IS_ERR(status)) {
759                 return status;
760         }
761
762         /* Return variables */
763
764         /* Return result */
765         if (werror) {
766                 *werror = r.out.result;
767         }
768
769         return werror_to_ntstatus(r.out.result);
770 }
771
772 NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli,
773                                TALLOC_CTX *mem_ctx,
774                                struct policy_handle *parent_handle,
775                                struct winreg_String keyname,
776                                uint32_t unknown,
777                                uint32_t access_mask,
778                                struct policy_handle *handle,
779                                WERROR *werror)
780 {
781         struct winreg_OpenKey r;
782         NTSTATUS status;
783
784         /* In parameters */
785         r.in.parent_handle = parent_handle;
786         r.in.keyname = keyname;
787         r.in.unknown = unknown;
788         r.in.access_mask = access_mask;
789
790         if (DEBUGLEVEL >= 10) {
791                 NDR_PRINT_IN_DEBUG(winreg_OpenKey, &r);
792         }
793
794         status = cli_do_rpc_ndr(cli,
795                                 mem_ctx,
796                                 PI_WINREG,
797                                 &ndr_table_winreg,
798                                 NDR_WINREG_OPENKEY,
799                                 &r);
800
801         if (!NT_STATUS_IS_OK(status)) {
802                 return status;
803         }
804
805         if (DEBUGLEVEL >= 10) {
806                 NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &r);
807         }
808
809         if (NT_STATUS_IS_ERR(status)) {
810                 return status;
811         }
812
813         /* Return variables */
814         *handle = *r.out.handle;
815
816         /* Return result */
817         if (werror) {
818                 *werror = r.out.result;
819         }
820
821         return werror_to_ntstatus(r.out.result);
822 }
823
824 NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
825                                     TALLOC_CTX *mem_ctx,
826                                     struct policy_handle *handle,
827                                     struct winreg_String *classname,
828                                     uint32_t *num_subkeys,
829                                     uint32_t *max_subkeylen,
830                                     uint32_t *max_classlen,
831                                     uint32_t *num_values,
832                                     uint32_t *max_valnamelen,
833                                     uint32_t *max_valbufsize,
834                                     uint32_t *secdescsize,
835                                     NTTIME *last_changed_time,
836                                     WERROR *werror)
837 {
838         struct winreg_QueryInfoKey r;
839         NTSTATUS status;
840
841         /* In parameters */
842         r.in.handle = handle;
843         r.in.classname = classname;
844
845         if (DEBUGLEVEL >= 10) {
846                 NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, &r);
847         }
848
849         status = cli_do_rpc_ndr(cli,
850                                 mem_ctx,
851                                 PI_WINREG,
852                                 &ndr_table_winreg,
853                                 NDR_WINREG_QUERYINFOKEY,
854                                 &r);
855
856         if (!NT_STATUS_IS_OK(status)) {
857                 return status;
858         }
859
860         if (DEBUGLEVEL >= 10) {
861                 NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, &r);
862         }
863
864         if (NT_STATUS_IS_ERR(status)) {
865                 return status;
866         }
867
868         /* Return variables */
869         *classname = *r.out.classname;
870         *num_subkeys = *r.out.num_subkeys;
871         *max_subkeylen = *r.out.max_subkeylen;
872         *max_classlen = *r.out.max_classlen;
873         *num_values = *r.out.num_values;
874         *max_valnamelen = *r.out.max_valnamelen;
875         *max_valbufsize = *r.out.max_valbufsize;
876         *secdescsize = *r.out.secdescsize;
877         *last_changed_time = *r.out.last_changed_time;
878
879         /* Return result */
880         if (werror) {
881                 *werror = r.out.result;
882         }
883
884         return werror_to_ntstatus(r.out.result);
885 }
886
887 NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
888                                   TALLOC_CTX *mem_ctx,
889                                   struct policy_handle *handle,
890                                   struct winreg_String value_name,
891                                   enum winreg_Type *type,
892                                   uint8_t *data,
893                                   uint32_t *data_size,
894                                   uint32_t *value_length,
895                                   WERROR *werror)
896 {
897         struct winreg_QueryValue r;
898         NTSTATUS status;
899
900         /* In parameters */
901         r.in.handle = handle;
902         r.in.value_name = value_name;
903         r.in.type = type;
904         r.in.data = data;
905         r.in.data_size = data_size;
906         r.in.value_length = value_length;
907
908         if (DEBUGLEVEL >= 10) {
909                 NDR_PRINT_IN_DEBUG(winreg_QueryValue, &r);
910         }
911
912         status = cli_do_rpc_ndr(cli,
913                                 mem_ctx,
914                                 PI_WINREG,
915                                 &ndr_table_winreg,
916                                 NDR_WINREG_QUERYVALUE,
917                                 &r);
918
919         if (!NT_STATUS_IS_OK(status)) {
920                 return status;
921         }
922
923         if (DEBUGLEVEL >= 10) {
924                 NDR_PRINT_OUT_DEBUG(winreg_QueryValue, &r);
925         }
926
927         if (NT_STATUS_IS_ERR(status)) {
928                 return status;
929         }
930
931         /* Return variables */
932         if (type && r.out.type) {
933                 *type = *r.out.type;
934         }
935         if (data && r.out.data) {
936                 memcpy(data, r.out.data, *r.in.data_size);
937         }
938         if (data_size && r.out.data_size) {
939                 *data_size = *r.out.data_size;
940         }
941         if (value_length && r.out.value_length) {
942                 *value_length = *r.out.value_length;
943         }
944
945         /* Return result */
946         if (werror) {
947                 *werror = r.out.result;
948         }
949
950         return werror_to_ntstatus(r.out.result);
951 }
952
953 NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli,
954                                   TALLOC_CTX *mem_ctx,
955                                   WERROR *werror)
956 {
957         struct winreg_ReplaceKey r;
958         NTSTATUS status;
959
960         /* In parameters */
961
962         if (DEBUGLEVEL >= 10) {
963                 NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, &r);
964         }
965
966         status = cli_do_rpc_ndr(cli,
967                                 mem_ctx,
968                                 PI_WINREG,
969                                 &ndr_table_winreg,
970                                 NDR_WINREG_REPLACEKEY,
971                                 &r);
972
973         if (!NT_STATUS_IS_OK(status)) {
974                 return status;
975         }
976
977         if (DEBUGLEVEL >= 10) {
978                 NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, &r);
979         }
980
981         if (NT_STATUS_IS_ERR(status)) {
982                 return status;
983         }
984
985         /* Return variables */
986
987         /* Return result */
988         if (werror) {
989                 *werror = r.out.result;
990         }
991
992         return werror_to_ntstatus(r.out.result);
993 }
994
995 NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli,
996                                   TALLOC_CTX *mem_ctx,
997                                   struct policy_handle *handle,
998                                   struct winreg_String *filename,
999                                   uint32_t flags,
1000                                   WERROR *werror)
1001 {
1002         struct winreg_RestoreKey r;
1003         NTSTATUS status;
1004
1005         /* In parameters */
1006         r.in.handle = handle;
1007         r.in.filename = filename;
1008         r.in.flags = flags;
1009
1010         if (DEBUGLEVEL >= 10) {
1011                 NDR_PRINT_IN_DEBUG(winreg_RestoreKey, &r);
1012         }
1013
1014         status = cli_do_rpc_ndr(cli,
1015                                 mem_ctx,
1016                                 PI_WINREG,
1017                                 &ndr_table_winreg,
1018                                 NDR_WINREG_RESTOREKEY,
1019                                 &r);
1020
1021         if (!NT_STATUS_IS_OK(status)) {
1022                 return status;
1023         }
1024
1025         if (DEBUGLEVEL >= 10) {
1026                 NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, &r);
1027         }
1028
1029         if (NT_STATUS_IS_ERR(status)) {
1030                 return status;
1031         }
1032
1033         /* Return variables */
1034
1035         /* Return result */
1036         if (werror) {
1037                 *werror = r.out.result;
1038         }
1039
1040         return werror_to_ntstatus(r.out.result);
1041 }
1042
1043 NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
1044                                TALLOC_CTX *mem_ctx,
1045                                struct policy_handle *handle,
1046                                struct winreg_String *filename,
1047                                struct KeySecurityAttribute *sec_attrib,
1048                                WERROR *werror)
1049 {
1050         struct winreg_SaveKey r;
1051         NTSTATUS status;
1052
1053         /* In parameters */
1054         r.in.handle = handle;
1055         r.in.filename = filename;
1056         r.in.sec_attrib = sec_attrib;
1057
1058         if (DEBUGLEVEL >= 10) {
1059                 NDR_PRINT_IN_DEBUG(winreg_SaveKey, &r);
1060         }
1061
1062         status = cli_do_rpc_ndr(cli,
1063                                 mem_ctx,
1064                                 PI_WINREG,
1065                                 &ndr_table_winreg,
1066                                 NDR_WINREG_SAVEKEY,
1067                                 &r);
1068
1069         if (!NT_STATUS_IS_OK(status)) {
1070                 return status;
1071         }
1072
1073         if (DEBUGLEVEL >= 10) {
1074                 NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &r);
1075         }
1076
1077         if (NT_STATUS_IS_ERR(status)) {
1078                 return status;
1079         }
1080
1081         /* Return variables */
1082
1083         /* Return result */
1084         if (werror) {
1085                 *werror = r.out.result;
1086         }
1087
1088         return werror_to_ntstatus(r.out.result);
1089 }
1090
1091 NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
1092                                       TALLOC_CTX *mem_ctx,
1093                                       struct policy_handle *handle,
1094                                       uint32_t access_mask,
1095                                       struct KeySecurityData *sd,
1096                                       WERROR *werror)
1097 {
1098         struct winreg_SetKeySecurity r;
1099         NTSTATUS status;
1100
1101         /* In parameters */
1102         r.in.handle = handle;
1103         r.in.access_mask = access_mask;
1104         r.in.sd = sd;
1105
1106         if (DEBUGLEVEL >= 10) {
1107                 NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &r);
1108         }
1109
1110         status = cli_do_rpc_ndr(cli,
1111                                 mem_ctx,
1112                                 PI_WINREG,
1113                                 &ndr_table_winreg,
1114                                 NDR_WINREG_SETKEYSECURITY,
1115                                 &r);
1116
1117         if (!NT_STATUS_IS_OK(status)) {
1118                 return status;
1119         }
1120
1121         if (DEBUGLEVEL >= 10) {
1122                 NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &r);
1123         }
1124
1125         if (NT_STATUS_IS_ERR(status)) {
1126                 return status;
1127         }
1128
1129         /* Return variables */
1130
1131         /* Return result */
1132         if (werror) {
1133                 *werror = r.out.result;
1134         }
1135
1136         return werror_to_ntstatus(r.out.result);
1137 }
1138
1139 NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli,
1140                                 TALLOC_CTX *mem_ctx,
1141                                 struct policy_handle *handle,
1142                                 struct winreg_String name,
1143                                 enum winreg_Type type,
1144                                 uint8_t *data,
1145                                 uint32_t size,
1146                                 WERROR *werror)
1147 {
1148         struct winreg_SetValue r;
1149         NTSTATUS status;
1150
1151         /* In parameters */
1152         r.in.handle = handle;
1153         r.in.name = name;
1154         r.in.type = type;
1155         r.in.data = data;
1156         r.in.size = size;
1157
1158         if (DEBUGLEVEL >= 10) {
1159                 NDR_PRINT_IN_DEBUG(winreg_SetValue, &r);
1160         }
1161
1162         status = cli_do_rpc_ndr(cli,
1163                                 mem_ctx,
1164                                 PI_WINREG,
1165                                 &ndr_table_winreg,
1166                                 NDR_WINREG_SETVALUE,
1167                                 &r);
1168
1169         if (!NT_STATUS_IS_OK(status)) {
1170                 return status;
1171         }
1172
1173         if (DEBUGLEVEL >= 10) {
1174                 NDR_PRINT_OUT_DEBUG(winreg_SetValue, &r);
1175         }
1176
1177         if (NT_STATUS_IS_ERR(status)) {
1178                 return status;
1179         }
1180
1181         /* Return variables */
1182
1183         /* Return result */
1184         if (werror) {
1185                 *werror = r.out.result;
1186         }
1187
1188         return werror_to_ntstatus(r.out.result);
1189 }
1190
1191 NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
1192                                  TALLOC_CTX *mem_ctx,
1193                                  WERROR *werror)
1194 {
1195         struct winreg_UnLoadKey r;
1196         NTSTATUS status;
1197
1198         /* In parameters */
1199
1200         if (DEBUGLEVEL >= 10) {
1201                 NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, &r);
1202         }
1203
1204         status = cli_do_rpc_ndr(cli,
1205                                 mem_ctx,
1206                                 PI_WINREG,
1207                                 &ndr_table_winreg,
1208                                 NDR_WINREG_UNLOADKEY,
1209                                 &r);
1210
1211         if (!NT_STATUS_IS_OK(status)) {
1212                 return status;
1213         }
1214
1215         if (DEBUGLEVEL >= 10) {
1216                 NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &r);
1217         }
1218
1219         if (NT_STATUS_IS_ERR(status)) {
1220                 return status;
1221         }
1222
1223         /* Return variables */
1224
1225         /* Return result */
1226         if (werror) {
1227                 *werror = r.out.result;
1228         }
1229
1230         return werror_to_ntstatus(r.out.result);
1231 }
1232
1233 NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
1234                                               TALLOC_CTX *mem_ctx,
1235                                               uint16_t *hostname,
1236                                               struct initshutdown_String *message,
1237                                               uint32_t timeout,
1238                                               uint8_t force_apps,
1239                                               uint8_t reboot,
1240                                               WERROR *werror)
1241 {
1242         struct winreg_InitiateSystemShutdown r;
1243         NTSTATUS status;
1244
1245         /* In parameters */
1246         r.in.hostname = hostname;
1247         r.in.message = message;
1248         r.in.timeout = timeout;
1249         r.in.force_apps = force_apps;
1250         r.in.reboot = reboot;
1251
1252         if (DEBUGLEVEL >= 10) {
1253                 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, &r);
1254         }
1255
1256         status = cli_do_rpc_ndr(cli,
1257                                 mem_ctx,
1258                                 PI_WINREG,
1259                                 &ndr_table_winreg,
1260                                 NDR_WINREG_INITIATESYSTEMSHUTDOWN,
1261                                 &r);
1262
1263         if (!NT_STATUS_IS_OK(status)) {
1264                 return status;
1265         }
1266
1267         if (DEBUGLEVEL >= 10) {
1268                 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &r);
1269         }
1270
1271         if (NT_STATUS_IS_ERR(status)) {
1272                 return status;
1273         }
1274
1275         /* Return variables */
1276
1277         /* Return result */
1278         if (werror) {
1279                 *werror = r.out.result;
1280         }
1281
1282         return werror_to_ntstatus(r.out.result);
1283 }
1284
1285 NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
1286                                            TALLOC_CTX *mem_ctx,
1287                                            uint16_t *server,
1288                                            WERROR *werror)
1289 {
1290         struct winreg_AbortSystemShutdown r;
1291         NTSTATUS status;
1292
1293         /* In parameters */
1294         r.in.server = server;
1295
1296         if (DEBUGLEVEL >= 10) {
1297                 NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, &r);
1298         }
1299
1300         status = cli_do_rpc_ndr(cli,
1301                                 mem_ctx,
1302                                 PI_WINREG,
1303                                 &ndr_table_winreg,
1304                                 NDR_WINREG_ABORTSYSTEMSHUTDOWN,
1305                                 &r);
1306
1307         if (!NT_STATUS_IS_OK(status)) {
1308                 return status;
1309         }
1310
1311         if (DEBUGLEVEL >= 10) {
1312                 NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &r);
1313         }
1314
1315         if (NT_STATUS_IS_ERR(status)) {
1316                 return status;
1317         }
1318
1319         /* Return variables */
1320
1321         /* Return result */
1322         if (werror) {
1323                 *werror = r.out.result;
1324         }
1325
1326         return werror_to_ntstatus(r.out.result);
1327 }
1328
1329 NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli,
1330                                   TALLOC_CTX *mem_ctx,
1331                                   struct policy_handle *handle,
1332                                   uint32_t *version,
1333                                   WERROR *werror)
1334 {
1335         struct winreg_GetVersion r;
1336         NTSTATUS status;
1337
1338         /* In parameters */
1339         r.in.handle = handle;
1340
1341         if (DEBUGLEVEL >= 10) {
1342                 NDR_PRINT_IN_DEBUG(winreg_GetVersion, &r);
1343         }
1344
1345         status = cli_do_rpc_ndr(cli,
1346                                 mem_ctx,
1347                                 PI_WINREG,
1348                                 &ndr_table_winreg,
1349                                 NDR_WINREG_GETVERSION,
1350                                 &r);
1351
1352         if (!NT_STATUS_IS_OK(status)) {
1353                 return status;
1354         }
1355
1356         if (DEBUGLEVEL >= 10) {
1357                 NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &r);
1358         }
1359
1360         if (NT_STATUS_IS_ERR(status)) {
1361                 return status;
1362         }
1363
1364         /* Return variables */
1365         *version = *r.out.version;
1366
1367         /* Return result */
1368         if (werror) {
1369                 *werror = r.out.result;
1370         }
1371
1372         return werror_to_ntstatus(r.out.result);
1373 }
1374
1375 NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
1376                                 TALLOC_CTX *mem_ctx,
1377                                 uint16_t *system_name,
1378                                 uint32_t access_mask,
1379                                 struct policy_handle *handle,
1380                                 WERROR *werror)
1381 {
1382         struct winreg_OpenHKCC r;
1383         NTSTATUS status;
1384
1385         /* In parameters */
1386         r.in.system_name = system_name;
1387         r.in.access_mask = access_mask;
1388
1389         if (DEBUGLEVEL >= 10) {
1390                 NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, &r);
1391         }
1392
1393         status = cli_do_rpc_ndr(cli,
1394                                 mem_ctx,
1395                                 PI_WINREG,
1396                                 &ndr_table_winreg,
1397                                 NDR_WINREG_OPENHKCC,
1398                                 &r);
1399
1400         if (!NT_STATUS_IS_OK(status)) {
1401                 return status;
1402         }
1403
1404         if (DEBUGLEVEL >= 10) {
1405                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &r);
1406         }
1407
1408         if (NT_STATUS_IS_ERR(status)) {
1409                 return status;
1410         }
1411
1412         /* Return variables */
1413         *handle = *r.out.handle;
1414
1415         /* Return result */
1416         if (werror) {
1417                 *werror = r.out.result;
1418         }
1419
1420         return werror_to_ntstatus(r.out.result);
1421 }
1422
1423 NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli,
1424                                 TALLOC_CTX *mem_ctx,
1425                                 uint16_t *system_name,
1426                                 uint32_t access_mask,
1427                                 struct policy_handle *handle,
1428                                 WERROR *werror)
1429 {
1430         struct winreg_OpenHKDD r;
1431         NTSTATUS status;
1432
1433         /* In parameters */
1434         r.in.system_name = system_name;
1435         r.in.access_mask = access_mask;
1436
1437         if (DEBUGLEVEL >= 10) {
1438                 NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, &r);
1439         }
1440
1441         status = cli_do_rpc_ndr(cli,
1442                                 mem_ctx,
1443                                 PI_WINREG,
1444                                 &ndr_table_winreg,
1445                                 NDR_WINREG_OPENHKDD,
1446                                 &r);
1447
1448         if (!NT_STATUS_IS_OK(status)) {
1449                 return status;
1450         }
1451
1452         if (DEBUGLEVEL >= 10) {
1453                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &r);
1454         }
1455
1456         if (NT_STATUS_IS_ERR(status)) {
1457                 return status;
1458         }
1459
1460         /* Return variables */
1461         *handle = *r.out.handle;
1462
1463         /* Return result */
1464         if (werror) {
1465                 *werror = r.out.result;
1466         }
1467
1468         return werror_to_ntstatus(r.out.result);
1469 }
1470
1471 NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
1472                                            TALLOC_CTX *mem_ctx,
1473                                            struct policy_handle *key_handle,
1474                                            struct QueryMultipleValue *values,
1475                                            uint32_t num_values,
1476                                            uint8_t *buffer,
1477                                            uint32_t *buffer_size,
1478                                            WERROR *werror)
1479 {
1480         struct winreg_QueryMultipleValues r;
1481         NTSTATUS status;
1482
1483         /* In parameters */
1484         r.in.key_handle = key_handle;
1485         r.in.values = values;
1486         r.in.num_values = num_values;
1487         r.in.buffer = buffer;
1488         r.in.buffer_size = buffer_size;
1489
1490         if (DEBUGLEVEL >= 10) {
1491                 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, &r);
1492         }
1493
1494         status = cli_do_rpc_ndr(cli,
1495                                 mem_ctx,
1496                                 PI_WINREG,
1497                                 &ndr_table_winreg,
1498                                 NDR_WINREG_QUERYMULTIPLEVALUES,
1499                                 &r);
1500
1501         if (!NT_STATUS_IS_OK(status)) {
1502                 return status;
1503         }
1504
1505         if (DEBUGLEVEL >= 10) {
1506                 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, &r);
1507         }
1508
1509         if (NT_STATUS_IS_ERR(status)) {
1510                 return status;
1511         }
1512
1513         /* Return variables */
1514         memcpy(values, r.out.values, r.in.num_values);
1515         if (buffer && r.out.buffer) {
1516                 memcpy(buffer, r.out.buffer, *r.in.buffer_size);
1517         }
1518         *buffer_size = *r.out.buffer_size;
1519
1520         /* Return result */
1521         if (werror) {
1522                 *werror = r.out.result;
1523         }
1524
1525         return werror_to_ntstatus(r.out.result);
1526 }
1527
1528 NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
1529                                                 TALLOC_CTX *mem_ctx,
1530                                                 uint16_t *hostname,
1531                                                 struct initshutdown_String *message,
1532                                                 uint32_t timeout,
1533                                                 uint8_t force_apps,
1534                                                 uint8_t reboot,
1535                                                 uint32_t reason,
1536                                                 WERROR *werror)
1537 {
1538         struct winreg_InitiateSystemShutdownEx r;
1539         NTSTATUS status;
1540
1541         /* In parameters */
1542         r.in.hostname = hostname;
1543         r.in.message = message;
1544         r.in.timeout = timeout;
1545         r.in.force_apps = force_apps;
1546         r.in.reboot = reboot;
1547         r.in.reason = reason;
1548
1549         if (DEBUGLEVEL >= 10) {
1550                 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, &r);
1551         }
1552
1553         status = cli_do_rpc_ndr(cli,
1554                                 mem_ctx,
1555                                 PI_WINREG,
1556                                 &ndr_table_winreg,
1557                                 NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
1558                                 &r);
1559
1560         if (!NT_STATUS_IS_OK(status)) {
1561                 return status;
1562         }
1563
1564         if (DEBUGLEVEL >= 10) {
1565                 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, &r);
1566         }
1567
1568         if (NT_STATUS_IS_ERR(status)) {
1569                 return status;
1570         }
1571
1572         /* Return variables */
1573
1574         /* Return result */
1575         if (werror) {
1576                 *werror = r.out.result;
1577         }
1578
1579         return werror_to_ntstatus(r.out.result);
1580 }
1581
1582 NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli,
1583                                  TALLOC_CTX *mem_ctx,
1584                                  WERROR *werror)
1585 {
1586         struct winreg_SaveKeyEx r;
1587         NTSTATUS status;
1588
1589         /* In parameters */
1590
1591         if (DEBUGLEVEL >= 10) {
1592                 NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, &r);
1593         }
1594
1595         status = cli_do_rpc_ndr(cli,
1596                                 mem_ctx,
1597                                 PI_WINREG,
1598                                 &ndr_table_winreg,
1599                                 NDR_WINREG_SAVEKEYEX,
1600                                 &r);
1601
1602         if (!NT_STATUS_IS_OK(status)) {
1603                 return status;
1604         }
1605
1606         if (DEBUGLEVEL >= 10) {
1607                 NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, &r);
1608         }
1609
1610         if (NT_STATUS_IS_ERR(status)) {
1611                 return status;
1612         }
1613
1614         /* Return variables */
1615
1616         /* Return result */
1617         if (werror) {
1618                 *werror = r.out.result;
1619         }
1620
1621         return werror_to_ntstatus(r.out.result);
1622 }
1623
1624 NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli,
1625                                 TALLOC_CTX *mem_ctx,
1626                                 uint16_t *system_name,
1627                                 uint32_t access_mask,
1628                                 struct policy_handle *handle,
1629                                 WERROR *werror)
1630 {
1631         struct winreg_OpenHKPT r;
1632         NTSTATUS status;
1633
1634         /* In parameters */
1635         r.in.system_name = system_name;
1636         r.in.access_mask = access_mask;
1637
1638         if (DEBUGLEVEL >= 10) {
1639                 NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, &r);
1640         }
1641
1642         status = cli_do_rpc_ndr(cli,
1643                                 mem_ctx,
1644                                 PI_WINREG,
1645                                 &ndr_table_winreg,
1646                                 NDR_WINREG_OPENHKPT,
1647                                 &r);
1648
1649         if (!NT_STATUS_IS_OK(status)) {
1650                 return status;
1651         }
1652
1653         if (DEBUGLEVEL >= 10) {
1654                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, &r);
1655         }
1656
1657         if (NT_STATUS_IS_ERR(status)) {
1658                 return status;
1659         }
1660
1661         /* Return variables */
1662         *handle = *r.out.handle;
1663
1664         /* Return result */
1665         if (werror) {
1666                 *werror = r.out.result;
1667         }
1668
1669         return werror_to_ntstatus(r.out.result);
1670 }
1671
1672 NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli,
1673                                 TALLOC_CTX *mem_ctx,
1674                                 uint16_t *system_name,
1675                                 uint32_t access_mask,
1676                                 struct policy_handle *handle,
1677                                 WERROR *werror)
1678 {
1679         struct winreg_OpenHKPN r;
1680         NTSTATUS status;
1681
1682         /* In parameters */
1683         r.in.system_name = system_name;
1684         r.in.access_mask = access_mask;
1685
1686         if (DEBUGLEVEL >= 10) {
1687                 NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, &r);
1688         }
1689
1690         status = cli_do_rpc_ndr(cli,
1691                                 mem_ctx,
1692                                 PI_WINREG,
1693                                 &ndr_table_winreg,
1694                                 NDR_WINREG_OPENHKPN,
1695                                 &r);
1696
1697         if (!NT_STATUS_IS_OK(status)) {
1698                 return status;
1699         }
1700
1701         if (DEBUGLEVEL >= 10) {
1702                 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, &r);
1703         }
1704
1705         if (NT_STATUS_IS_ERR(status)) {
1706                 return status;
1707         }
1708
1709         /* Return variables */
1710         *handle = *r.out.handle;
1711
1712         /* Return result */
1713         if (werror) {
1714                 *werror = r.out.result;
1715         }
1716
1717         return werror_to_ntstatus(r.out.result);
1718 }
1719
1720 NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli,
1721                                             TALLOC_CTX *mem_ctx,
1722                                             WERROR *werror)
1723 {
1724         struct winreg_QueryMultipleValues2 r;
1725         NTSTATUS status;
1726
1727         /* In parameters */
1728
1729         if (DEBUGLEVEL >= 10) {
1730                 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, &r);
1731         }
1732
1733         status = cli_do_rpc_ndr(cli,
1734                                 mem_ctx,
1735                                 PI_WINREG,
1736                                 &ndr_table_winreg,
1737                                 NDR_WINREG_QUERYMULTIPLEVALUES2,
1738                                 &r);
1739
1740         if (!NT_STATUS_IS_OK(status)) {
1741                 return status;
1742         }
1743
1744         if (DEBUGLEVEL >= 10) {
1745                 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, &r);
1746         }
1747
1748         if (NT_STATUS_IS_ERR(status)) {
1749                 return status;
1750         }
1751
1752         /* Return variables */
1753
1754         /* Return result */
1755         if (werror) {
1756                 *werror = r.out.result;
1757         }
1758
1759         return werror_to_ntstatus(r.out.result);
1760 }
1761