r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / librpc / gen_ndr / cli_winreg.c
blob9b25a6113bd6194be2194cd7282a037bdad28c44
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "librpc/gen_ndr/cli_winreg.h"
9 NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle)
11 struct winreg_OpenHKCR r;
12 NTSTATUS status;
14 /* In parameters */
15 r.in.system_name = system_name;
16 r.in.access_mask = access_mask;
18 if (DEBUGLEVEL >= 10)
19 NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, &r);
21 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENHKCR, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenHKCR, (ndr_push_flags_fn_t)ndr_push_winreg_OpenHKCR);
23 if (!NT_STATUS_IS_OK(status)) {
24 return status;
27 if (DEBUGLEVEL >= 10)
28 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, &r);
30 if (NT_STATUS_IS_ERR(status)) {
31 return status;
34 /* Return variables */
35 *handle = *r.out.handle;
37 /* Return result */
38 return werror_to_ntstatus(r.out.result);
41 NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle)
43 struct winreg_OpenHKCU r;
44 NTSTATUS status;
46 /* In parameters */
47 r.in.system_name = system_name;
48 r.in.access_mask = access_mask;
50 if (DEBUGLEVEL >= 10)
51 NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, &r);
53 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENHKCU, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenHKCU, (ndr_push_flags_fn_t)ndr_push_winreg_OpenHKCU);
55 if (!NT_STATUS_IS_OK(status)) {
56 return status;
59 if (DEBUGLEVEL >= 10)
60 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, &r);
62 if (NT_STATUS_IS_ERR(status)) {
63 return status;
66 /* Return variables */
67 *handle = *r.out.handle;
69 /* Return result */
70 return werror_to_ntstatus(r.out.result);
73 NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle)
75 struct winreg_OpenHKLM r;
76 NTSTATUS status;
78 /* In parameters */
79 r.in.system_name = system_name;
80 r.in.access_mask = access_mask;
82 if (DEBUGLEVEL >= 10)
83 NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, &r);
85 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENHKLM, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenHKLM, (ndr_push_flags_fn_t)ndr_push_winreg_OpenHKLM);
87 if (!NT_STATUS_IS_OK(status)) {
88 return status;
91 if (DEBUGLEVEL >= 10)
92 NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, &r);
94 if (NT_STATUS_IS_ERR(status)) {
95 return status;
98 /* Return variables */
99 *handle = *r.out.handle;
101 /* Return result */
102 return werror_to_ntstatus(r.out.result);
105 NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle)
107 struct winreg_OpenHKPD r;
108 NTSTATUS status;
110 /* In parameters */
111 r.in.system_name = system_name;
112 r.in.access_mask = access_mask;
114 if (DEBUGLEVEL >= 10)
115 NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, &r);
117 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENHKPD, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenHKPD, (ndr_push_flags_fn_t)ndr_push_winreg_OpenHKPD);
119 if (!NT_STATUS_IS_OK(status)) {
120 return status;
123 if (DEBUGLEVEL >= 10)
124 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, &r);
126 if (NT_STATUS_IS_ERR(status)) {
127 return status;
130 /* Return variables */
131 *handle = *r.out.handle;
133 /* Return result */
134 return werror_to_ntstatus(r.out.result);
137 NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle)
139 struct winreg_OpenHKU r;
140 NTSTATUS status;
142 /* In parameters */
143 r.in.system_name = system_name;
144 r.in.access_mask = access_mask;
146 if (DEBUGLEVEL >= 10)
147 NDR_PRINT_IN_DEBUG(winreg_OpenHKU, &r);
149 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENHKU, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenHKU, (ndr_push_flags_fn_t)ndr_push_winreg_OpenHKU);
151 if (!NT_STATUS_IS_OK(status)) {
152 return status;
155 if (DEBUGLEVEL >= 10)
156 NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, &r);
158 if (NT_STATUS_IS_ERR(status)) {
159 return status;
162 /* Return variables */
163 *handle = *r.out.handle;
165 /* Return result */
166 return werror_to_ntstatus(r.out.result);
169 NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle)
171 struct winreg_CloseKey r;
172 NTSTATUS status;
174 /* In parameters */
175 r.in.handle = handle;
177 if (DEBUGLEVEL >= 10)
178 NDR_PRINT_IN_DEBUG(winreg_CloseKey, &r);
180 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_CLOSEKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_CloseKey, (ndr_push_flags_fn_t)ndr_push_winreg_CloseKey);
182 if (!NT_STATUS_IS_OK(status)) {
183 return status;
186 if (DEBUGLEVEL >= 10)
187 NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &r);
189 if (NT_STATUS_IS_ERR(status)) {
190 return status;
193 /* Return variables */
194 *handle = *r.out.handle;
196 /* Return result */
197 return werror_to_ntstatus(r.out.result);
200 NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String name, struct winreg_String keyclass, uint32_t options, uint32_t access_mask, struct winreg_SecBuf *secdesc, struct policy_handle *new_handle, enum winreg_CreateAction *action_taken)
202 struct winreg_CreateKey r;
203 NTSTATUS status;
205 /* In parameters */
206 r.in.handle = handle;
207 r.in.name = name;
208 r.in.keyclass = keyclass;
209 r.in.options = options;
210 r.in.access_mask = access_mask;
211 r.in.secdesc = secdesc;
212 r.in.action_taken = action_taken;
214 if (DEBUGLEVEL >= 10)
215 NDR_PRINT_IN_DEBUG(winreg_CreateKey, &r);
217 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_CREATEKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_CreateKey, (ndr_push_flags_fn_t)ndr_push_winreg_CreateKey);
219 if (!NT_STATUS_IS_OK(status)) {
220 return status;
223 if (DEBUGLEVEL >= 10)
224 NDR_PRINT_OUT_DEBUG(winreg_CreateKey, &r);
226 if (NT_STATUS_IS_ERR(status)) {
227 return status;
230 /* Return variables */
231 *new_handle = *r.out.new_handle;
232 if ( action_taken ) {
233 *action_taken = *r.out.action_taken;
236 /* Return result */
237 return werror_to_ntstatus(r.out.result);
240 NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String key)
242 struct winreg_DeleteKey r;
243 NTSTATUS status;
245 /* In parameters */
246 r.in.handle = handle;
247 r.in.key = key;
249 if (DEBUGLEVEL >= 10)
250 NDR_PRINT_IN_DEBUG(winreg_DeleteKey, &r);
252 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_DELETEKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_DeleteKey, (ndr_push_flags_fn_t)ndr_push_winreg_DeleteKey);
254 if (!NT_STATUS_IS_OK(status)) {
255 return status;
258 if (DEBUGLEVEL >= 10)
259 NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, &r);
261 if (NT_STATUS_IS_ERR(status)) {
262 return status;
265 /* Return variables */
267 /* Return result */
268 return werror_to_ntstatus(r.out.result);
271 NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String value)
273 struct winreg_DeleteValue r;
274 NTSTATUS status;
276 /* In parameters */
277 r.in.handle = handle;
278 r.in.value = value;
280 if (DEBUGLEVEL >= 10)
281 NDR_PRINT_IN_DEBUG(winreg_DeleteValue, &r);
283 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_DELETEVALUE, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_DeleteValue, (ndr_push_flags_fn_t)ndr_push_winreg_DeleteValue);
285 if (!NT_STATUS_IS_OK(status)) {
286 return status;
289 if (DEBUGLEVEL >= 10)
290 NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, &r);
292 if (NT_STATUS_IS_ERR(status)) {
293 return status;
296 /* Return variables */
298 /* Return result */
299 return werror_to_ntstatus(r.out.result);
302 NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_StringBuf *name, struct winreg_StringBuf *keyclass, NTTIME *last_changed_time)
304 struct winreg_EnumKey r;
305 NTSTATUS status;
307 /* In parameters */
308 r.in.handle = handle;
309 r.in.enum_index = enum_index;
310 r.in.name = name;
311 r.in.keyclass = keyclass;
312 r.in.last_changed_time = last_changed_time;
314 if (DEBUGLEVEL >= 10)
315 NDR_PRINT_IN_DEBUG(winreg_EnumKey, &r);
317 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_ENUMKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_EnumKey, (ndr_push_flags_fn_t)ndr_push_winreg_EnumKey);
319 if (!NT_STATUS_IS_OK(status)) {
320 return status;
323 if (DEBUGLEVEL >= 10)
324 NDR_PRINT_OUT_DEBUG(winreg_EnumKey, &r);
326 if (NT_STATUS_IS_ERR(status)) {
327 return status;
330 /* Return variables */
331 *name = *r.out.name;
332 if ( keyclass ) {
333 *keyclass = *r.out.keyclass;
335 if ( last_changed_time ) {
336 *last_changed_time = *r.out.last_changed_time;
339 /* Return result */
340 return werror_to_ntstatus(r.out.result);
343 NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t enum_index, struct winreg_ValNameBuf *name, enum winreg_Type *type, uint8_t *value, uint32_t *size, uint32_t *length)
345 struct winreg_EnumValue r;
346 NTSTATUS status;
348 /* In parameters */
349 r.in.handle = handle;
350 r.in.enum_index = enum_index;
351 r.in.name = name;
352 r.in.type = type;
353 r.in.value = value;
354 r.in.size = size;
355 r.in.length = length;
357 if (DEBUGLEVEL >= 10)
358 NDR_PRINT_IN_DEBUG(winreg_EnumValue, &r);
360 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_ENUMVALUE, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_EnumValue, (ndr_push_flags_fn_t)ndr_push_winreg_EnumValue);
362 if (!NT_STATUS_IS_OK(status)) {
363 return status;
366 if (DEBUGLEVEL >= 10)
367 NDR_PRINT_OUT_DEBUG(winreg_EnumValue, &r);
369 if (NT_STATUS_IS_ERR(status)) {
370 return status;
373 /* Return variables */
374 *name = *r.out.name;
375 if ( type ) {
376 *type = *r.out.type;
378 if ( value ) {
379 *value = *r.out.value;
381 if ( size ) {
382 *size = *r.out.size;
384 if ( length ) {
385 *length = *r.out.length;
388 /* Return result */
389 return werror_to_ntstatus(r.out.result);
392 NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle)
394 struct winreg_FlushKey r;
395 NTSTATUS status;
397 /* In parameters */
398 r.in.handle = handle;
400 if (DEBUGLEVEL >= 10)
401 NDR_PRINT_IN_DEBUG(winreg_FlushKey, &r);
403 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_FLUSHKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_FlushKey, (ndr_push_flags_fn_t)ndr_push_winreg_FlushKey);
405 if (!NT_STATUS_IS_OK(status)) {
406 return status;
409 if (DEBUGLEVEL >= 10)
410 NDR_PRINT_OUT_DEBUG(winreg_FlushKey, &r);
412 if (NT_STATUS_IS_ERR(status)) {
413 return status;
416 /* Return variables */
418 /* Return result */
419 return werror_to_ntstatus(r.out.result);
422 NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t sec_info, struct KeySecurityData *sd)
424 struct winreg_GetKeySecurity r;
425 NTSTATUS status;
427 /* In parameters */
428 r.in.handle = handle;
429 r.in.sec_info = sec_info;
430 r.in.sd = sd;
432 if (DEBUGLEVEL >= 10)
433 NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, &r);
435 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_GETKEYSECURITY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_GetKeySecurity, (ndr_push_flags_fn_t)ndr_push_winreg_GetKeySecurity);
437 if (!NT_STATUS_IS_OK(status)) {
438 return status;
441 if (DEBUGLEVEL >= 10)
442 NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, &r);
444 if (NT_STATUS_IS_ERR(status)) {
445 return status;
448 /* Return variables */
449 *sd = *r.out.sd;
451 /* Return result */
452 return werror_to_ntstatus(r.out.result);
455 NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String *keyname, struct winreg_String *filename)
457 struct winreg_LoadKey r;
458 NTSTATUS status;
460 /* In parameters */
461 r.in.handle = handle;
462 r.in.keyname = keyname;
463 r.in.filename = filename;
465 if (DEBUGLEVEL >= 10)
466 NDR_PRINT_IN_DEBUG(winreg_LoadKey, &r);
468 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_LOADKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_LoadKey, (ndr_push_flags_fn_t)ndr_push_winreg_LoadKey);
470 if (!NT_STATUS_IS_OK(status)) {
471 return status;
474 if (DEBUGLEVEL >= 10)
475 NDR_PRINT_OUT_DEBUG(winreg_LoadKey, &r);
477 if (NT_STATUS_IS_ERR(status)) {
478 return status;
481 /* Return variables */
483 /* Return result */
484 return werror_to_ntstatus(r.out.result);
487 NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint8_t watch_subtree, uint32_t notify_filter, uint32_t unknown, struct winreg_String string1, struct winreg_String string2, uint32_t unknown2)
489 struct winreg_NotifyChangeKeyValue r;
490 NTSTATUS status;
492 /* In parameters */
493 r.in.handle = handle;
494 r.in.watch_subtree = watch_subtree;
495 r.in.notify_filter = notify_filter;
496 r.in.unknown = unknown;
497 r.in.string1 = string1;
498 r.in.string2 = string2;
499 r.in.unknown2 = unknown2;
501 if (DEBUGLEVEL >= 10)
502 NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, &r);
504 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_NOTIFYCHANGEKEYVALUE, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_NotifyChangeKeyValue, (ndr_push_flags_fn_t)ndr_push_winreg_NotifyChangeKeyValue);
506 if (!NT_STATUS_IS_OK(status)) {
507 return status;
510 if (DEBUGLEVEL >= 10)
511 NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, &r);
513 if (NT_STATUS_IS_ERR(status)) {
514 return status;
517 /* Return variables */
519 /* Return result */
520 return werror_to_ntstatus(r.out.result);
523 NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *parent_handle, struct winreg_String keyname, uint32_t unknown, uint32_t access_mask, struct policy_handle *handle)
525 struct winreg_OpenKey r;
526 NTSTATUS status;
528 /* In parameters */
529 r.in.parent_handle = parent_handle;
530 r.in.keyname = keyname;
531 r.in.unknown = unknown;
532 r.in.access_mask = access_mask;
534 if (DEBUGLEVEL >= 10)
535 NDR_PRINT_IN_DEBUG(winreg_OpenKey, &r);
537 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenKey, (ndr_push_flags_fn_t)ndr_push_winreg_OpenKey);
539 if (!NT_STATUS_IS_OK(status)) {
540 return status;
543 if (DEBUGLEVEL >= 10)
544 NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &r);
546 if (NT_STATUS_IS_ERR(status)) {
547 return status;
550 /* Return variables */
551 *handle = *r.out.handle;
553 /* Return result */
554 return werror_to_ntstatus(r.out.result);
557 NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String *classname, uint32_t *num_subkeys, uint32_t *max_subkeylen, uint32_t *max_classlen, uint32_t *num_values, uint32_t *max_valnamelen, uint32_t *max_valbufsize, uint32_t *secdescsize, NTTIME *last_changed_time)
559 struct winreg_QueryInfoKey r;
560 NTSTATUS status;
562 /* In parameters */
563 r.in.handle = handle;
564 r.in.classname = classname;
566 if (DEBUGLEVEL >= 10)
567 NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, &r);
569 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_QUERYINFOKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_QueryInfoKey, (ndr_push_flags_fn_t)ndr_push_winreg_QueryInfoKey);
571 if (!NT_STATUS_IS_OK(status)) {
572 return status;
575 if (DEBUGLEVEL >= 10)
576 NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, &r);
578 if (NT_STATUS_IS_ERR(status)) {
579 return status;
582 /* Return variables */
583 *classname = *r.out.classname;
584 *num_subkeys = *r.out.num_subkeys;
585 *max_subkeylen = *r.out.max_subkeylen;
586 *max_classlen = *r.out.max_classlen;
587 *num_values = *r.out.num_values;
588 *max_valnamelen = *r.out.max_valnamelen;
589 *max_valbufsize = *r.out.max_valbufsize;
590 *secdescsize = *r.out.secdescsize;
591 *last_changed_time = *r.out.last_changed_time;
593 /* Return result */
594 return werror_to_ntstatus(r.out.result);
597 NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String value_name, enum winreg_Type *type, uint8_t *data, uint32_t *data_size, uint32_t *value_length)
599 struct winreg_QueryValue r;
600 NTSTATUS status;
602 /* In parameters */
603 r.in.handle = handle;
604 r.in.value_name = value_name;
605 r.in.type = type;
606 r.in.data = data;
607 r.in.data_size = data_size;
608 r.in.value_length = value_length;
610 if (DEBUGLEVEL >= 10)
611 NDR_PRINT_IN_DEBUG(winreg_QueryValue, &r);
613 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_QUERYVALUE, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_QueryValue, (ndr_push_flags_fn_t)ndr_push_winreg_QueryValue);
615 if (!NT_STATUS_IS_OK(status)) {
616 return status;
619 if (DEBUGLEVEL >= 10)
620 NDR_PRINT_OUT_DEBUG(winreg_QueryValue, &r);
622 if (NT_STATUS_IS_ERR(status)) {
623 return status;
626 /* Return variables */
627 if ( type ) {
628 *type = *r.out.type;
630 if ( data ) {
631 *data = *r.out.data;
633 if ( data_size ) {
634 *data_size = *r.out.data_size;
636 if ( value_length ) {
637 *value_length = *r.out.value_length;
640 /* Return result */
641 return werror_to_ntstatus(r.out.result);
644 NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
646 struct winreg_ReplaceKey r;
647 NTSTATUS status;
649 /* In parameters */
651 if (DEBUGLEVEL >= 10)
652 NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, &r);
654 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_REPLACEKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_ReplaceKey, (ndr_push_flags_fn_t)ndr_push_winreg_ReplaceKey);
656 if (!NT_STATUS_IS_OK(status)) {
657 return status;
660 if (DEBUGLEVEL >= 10)
661 NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, &r);
663 if (NT_STATUS_IS_ERR(status)) {
664 return status;
667 /* Return variables */
669 /* Return result */
670 return werror_to_ntstatus(r.out.result);
673 NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String *filename, uint32_t flags)
675 struct winreg_RestoreKey r;
676 NTSTATUS status;
678 /* In parameters */
679 r.in.handle = handle;
680 r.in.filename = filename;
681 r.in.flags = flags;
683 if (DEBUGLEVEL >= 10)
684 NDR_PRINT_IN_DEBUG(winreg_RestoreKey, &r);
686 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_RESTOREKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_RestoreKey, (ndr_push_flags_fn_t)ndr_push_winreg_RestoreKey);
688 if (!NT_STATUS_IS_OK(status)) {
689 return status;
692 if (DEBUGLEVEL >= 10)
693 NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, &r);
695 if (NT_STATUS_IS_ERR(status)) {
696 return status;
699 /* Return variables */
701 /* Return result */
702 return werror_to_ntstatus(r.out.result);
705 NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String *filename, struct KeySecurityAttribute *sec_attrib)
707 struct winreg_SaveKey r;
708 NTSTATUS status;
710 /* In parameters */
711 r.in.handle = handle;
712 r.in.filename = filename;
713 r.in.sec_attrib = sec_attrib;
715 if (DEBUGLEVEL >= 10)
716 NDR_PRINT_IN_DEBUG(winreg_SaveKey, &r);
718 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_SAVEKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_SaveKey, (ndr_push_flags_fn_t)ndr_push_winreg_SaveKey);
720 if (!NT_STATUS_IS_OK(status)) {
721 return status;
724 if (DEBUGLEVEL >= 10)
725 NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &r);
727 if (NT_STATUS_IS_ERR(status)) {
728 return status;
731 /* Return variables */
733 /* Return result */
734 return werror_to_ntstatus(r.out.result);
737 NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t access_mask, struct KeySecurityData *sd)
739 struct winreg_SetKeySecurity r;
740 NTSTATUS status;
742 /* In parameters */
743 r.in.handle = handle;
744 r.in.access_mask = access_mask;
745 r.in.sd = sd;
747 if (DEBUGLEVEL >= 10)
748 NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &r);
750 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_SETKEYSECURITY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_SetKeySecurity, (ndr_push_flags_fn_t)ndr_push_winreg_SetKeySecurity);
752 if (!NT_STATUS_IS_OK(status)) {
753 return status;
756 if (DEBUGLEVEL >= 10)
757 NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &r);
759 if (NT_STATUS_IS_ERR(status)) {
760 return status;
763 /* Return variables */
765 /* Return result */
766 return werror_to_ntstatus(r.out.result);
769 NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct winreg_String name, enum winreg_Type type, uint8_t *data, uint32_t size)
771 struct winreg_SetValue r;
772 NTSTATUS status;
774 /* In parameters */
775 r.in.handle = handle;
776 r.in.name = name;
777 r.in.type = type;
778 r.in.data = data;
779 r.in.size = size;
781 if (DEBUGLEVEL >= 10)
782 NDR_PRINT_IN_DEBUG(winreg_SetValue, &r);
784 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_SETVALUE, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_SetValue, (ndr_push_flags_fn_t)ndr_push_winreg_SetValue);
786 if (!NT_STATUS_IS_OK(status)) {
787 return status;
790 if (DEBUGLEVEL >= 10)
791 NDR_PRINT_OUT_DEBUG(winreg_SetValue, &r);
793 if (NT_STATUS_IS_ERR(status)) {
794 return status;
797 /* Return variables */
799 /* Return result */
800 return werror_to_ntstatus(r.out.result);
803 NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
805 struct winreg_UnLoadKey r;
806 NTSTATUS status;
808 /* In parameters */
810 if (DEBUGLEVEL >= 10)
811 NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, &r);
813 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_UNLOADKEY, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_UnLoadKey, (ndr_push_flags_fn_t)ndr_push_winreg_UnLoadKey);
815 if (!NT_STATUS_IS_OK(status)) {
816 return status;
819 if (DEBUGLEVEL >= 10)
820 NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &r);
822 if (NT_STATUS_IS_ERR(status)) {
823 return status;
826 /* Return variables */
828 /* Return result */
829 return werror_to_ntstatus(r.out.result);
832 NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *hostname, struct initshutdown_String *message, uint32_t timeout, uint8_t force_apps, uint8_t reboot)
834 struct winreg_InitiateSystemShutdown r;
835 NTSTATUS status;
837 /* In parameters */
838 r.in.hostname = hostname;
839 r.in.message = message;
840 r.in.timeout = timeout;
841 r.in.force_apps = force_apps;
842 r.in.reboot = reboot;
844 if (DEBUGLEVEL >= 10)
845 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, &r);
847 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_INITIATESYSTEMSHUTDOWN, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_InitiateSystemShutdown, (ndr_push_flags_fn_t)ndr_push_winreg_InitiateSystemShutdown);
849 if (!NT_STATUS_IS_OK(status)) {
850 return status;
853 if (DEBUGLEVEL >= 10)
854 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &r);
856 if (NT_STATUS_IS_ERR(status)) {
857 return status;
860 /* Return variables */
862 /* Return result */
863 return werror_to_ntstatus(r.out.result);
866 NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *server)
868 struct winreg_AbortSystemShutdown r;
869 NTSTATUS status;
871 /* In parameters */
872 r.in.server = server;
874 if (DEBUGLEVEL >= 10)
875 NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, &r);
877 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_ABORTSYSTEMSHUTDOWN, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_AbortSystemShutdown, (ndr_push_flags_fn_t)ndr_push_winreg_AbortSystemShutdown);
879 if (!NT_STATUS_IS_OK(status)) {
880 return status;
883 if (DEBUGLEVEL >= 10)
884 NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &r);
886 if (NT_STATUS_IS_ERR(status)) {
887 return status;
890 /* Return variables */
892 /* Return result */
893 return werror_to_ntstatus(r.out.result);
896 NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle, uint32_t *version)
898 struct winreg_GetVersion r;
899 NTSTATUS status;
901 /* In parameters */
902 r.in.handle = handle;
904 if (DEBUGLEVEL >= 10)
905 NDR_PRINT_IN_DEBUG(winreg_GetVersion, &r);
907 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_GETVERSION, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_GetVersion, (ndr_push_flags_fn_t)ndr_push_winreg_GetVersion);
909 if (!NT_STATUS_IS_OK(status)) {
910 return status;
913 if (DEBUGLEVEL >= 10)
914 NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &r);
916 if (NT_STATUS_IS_ERR(status)) {
917 return status;
920 /* Return variables */
921 *version = *r.out.version;
923 /* Return result */
924 return werror_to_ntstatus(r.out.result);
927 NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle)
929 struct winreg_OpenHKCC r;
930 NTSTATUS status;
932 /* In parameters */
933 r.in.system_name = system_name;
934 r.in.access_mask = access_mask;
936 if (DEBUGLEVEL >= 10)
937 NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, &r);
939 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENHKCC, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenHKCC, (ndr_push_flags_fn_t)ndr_push_winreg_OpenHKCC);
941 if (!NT_STATUS_IS_OK(status)) {
942 return status;
945 if (DEBUGLEVEL >= 10)
946 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &r);
948 if (NT_STATUS_IS_ERR(status)) {
949 return status;
952 /* Return variables */
953 *handle = *r.out.handle;
955 /* Return result */
956 return werror_to_ntstatus(r.out.result);
959 NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle)
961 struct winreg_OpenHKDD r;
962 NTSTATUS status;
964 /* In parameters */
965 r.in.system_name = system_name;
966 r.in.access_mask = access_mask;
968 if (DEBUGLEVEL >= 10)
969 NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, &r);
971 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENHKDD, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenHKDD, (ndr_push_flags_fn_t)ndr_push_winreg_OpenHKDD);
973 if (!NT_STATUS_IS_OK(status)) {
974 return status;
977 if (DEBUGLEVEL >= 10)
978 NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &r);
980 if (NT_STATUS_IS_ERR(status)) {
981 return status;
984 /* Return variables */
985 *handle = *r.out.handle;
987 /* Return result */
988 return werror_to_ntstatus(r.out.result);
991 NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *key_handle, struct QueryMultipleValue *values, uint32_t num_values, uint8_t *buffer, uint32_t *buffer_size)
993 struct winreg_QueryMultipleValues r;
994 NTSTATUS status;
996 /* In parameters */
997 r.in.key_handle = key_handle;
998 r.in.values = values;
999 r.in.num_values = num_values;
1000 r.in.buffer = buffer;
1001 r.in.buffer_size = buffer_size;
1003 if (DEBUGLEVEL >= 10)
1004 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, &r);
1006 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_QUERYMULTIPLEVALUES, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_QueryMultipleValues, (ndr_push_flags_fn_t)ndr_push_winreg_QueryMultipleValues);
1008 if (!NT_STATUS_IS_OK(status)) {
1009 return status;
1012 if (DEBUGLEVEL >= 10)
1013 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, &r);
1015 if (NT_STATUS_IS_ERR(status)) {
1016 return status;
1019 /* Return variables */
1020 *values = *r.out.values;
1021 if ( buffer ) {
1022 *buffer = *r.out.buffer;
1024 *buffer_size = *r.out.buffer_size;
1026 /* Return result */
1027 return werror_to_ntstatus(r.out.result);
1030 NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *hostname, struct initshutdown_String *message, uint32_t timeout, uint8_t force_apps, uint8_t reboot, uint32_t reason)
1032 struct winreg_InitiateSystemShutdownEx r;
1033 NTSTATUS status;
1035 /* In parameters */
1036 r.in.hostname = hostname;
1037 r.in.message = message;
1038 r.in.timeout = timeout;
1039 r.in.force_apps = force_apps;
1040 r.in.reboot = reboot;
1041 r.in.reason = reason;
1043 if (DEBUGLEVEL >= 10)
1044 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, &r);
1046 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_INITIATESYSTEMSHUTDOWNEX, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_InitiateSystemShutdownEx, (ndr_push_flags_fn_t)ndr_push_winreg_InitiateSystemShutdownEx);
1048 if (!NT_STATUS_IS_OK(status)) {
1049 return status;
1052 if (DEBUGLEVEL >= 10)
1053 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, &r);
1055 if (NT_STATUS_IS_ERR(status)) {
1056 return status;
1059 /* Return variables */
1061 /* Return result */
1062 return werror_to_ntstatus(r.out.result);
1065 NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1067 struct winreg_SaveKeyEx r;
1068 NTSTATUS status;
1070 /* In parameters */
1072 if (DEBUGLEVEL >= 10)
1073 NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, &r);
1075 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_SAVEKEYEX, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_SaveKeyEx, (ndr_push_flags_fn_t)ndr_push_winreg_SaveKeyEx);
1077 if (!NT_STATUS_IS_OK(status)) {
1078 return status;
1081 if (DEBUGLEVEL >= 10)
1082 NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, &r);
1084 if (NT_STATUS_IS_ERR(status)) {
1085 return status;
1088 /* Return variables */
1090 /* Return result */
1091 return werror_to_ntstatus(r.out.result);
1094 NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle)
1096 struct winreg_OpenHKPT r;
1097 NTSTATUS status;
1099 /* In parameters */
1100 r.in.system_name = system_name;
1101 r.in.access_mask = access_mask;
1103 if (DEBUGLEVEL >= 10)
1104 NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, &r);
1106 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENHKPT, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenHKPT, (ndr_push_flags_fn_t)ndr_push_winreg_OpenHKPT);
1108 if (!NT_STATUS_IS_OK(status)) {
1109 return status;
1112 if (DEBUGLEVEL >= 10)
1113 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, &r);
1115 if (NT_STATUS_IS_ERR(status)) {
1116 return status;
1119 /* Return variables */
1120 *handle = *r.out.handle;
1122 /* Return result */
1123 return werror_to_ntstatus(r.out.result);
1126 NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint16_t *system_name, uint32_t access_mask, struct policy_handle *handle)
1128 struct winreg_OpenHKPN r;
1129 NTSTATUS status;
1131 /* In parameters */
1132 r.in.system_name = system_name;
1133 r.in.access_mask = access_mask;
1135 if (DEBUGLEVEL >= 10)
1136 NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, &r);
1138 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_OPENHKPN, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_OpenHKPN, (ndr_push_flags_fn_t)ndr_push_winreg_OpenHKPN);
1140 if (!NT_STATUS_IS_OK(status)) {
1141 return status;
1144 if (DEBUGLEVEL >= 10)
1145 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, &r);
1147 if (NT_STATUS_IS_ERR(status)) {
1148 return status;
1151 /* Return variables */
1152 *handle = *r.out.handle;
1154 /* Return result */
1155 return werror_to_ntstatus(r.out.result);
1158 NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
1160 struct winreg_QueryMultipleValues2 r;
1161 NTSTATUS status;
1163 /* In parameters */
1165 if (DEBUGLEVEL >= 10)
1166 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, &r);
1168 status = cli_do_rpc_ndr(cli, mem_ctx, PI_WINREG, DCERPC_WINREG_QUERYMULTIPLEVALUES2, &r, (ndr_pull_flags_fn_t)ndr_pull_winreg_QueryMultipleValues2, (ndr_push_flags_fn_t)ndr_push_winreg_QueryMultipleValues2);
1170 if (!NT_STATUS_IS_OK(status)) {
1171 return status;
1174 if (DEBUGLEVEL >= 10)
1175 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, &r);
1177 if (NT_STATUS_IS_ERR(status)) {
1178 return status;
1181 /* Return variables */
1183 /* Return result */
1184 return werror_to_ntstatus(r.out.result);