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