librpc: rerun "make idl"
[Samba/fernandojvsilva.git] / librpc / gen_ndr / cli_winreg.c
blob426454292ecbc13978daf7f2afe8bb001dd20863
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 struct rpccli_winreg_OpenHKCR_state {
10 struct winreg_OpenHKCR orig;
11 struct winreg_OpenHKCR tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_winreg_OpenHKCR_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_winreg_OpenHKCR_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 uint16_t *_system_name /* [in] [unique] */,
22 uint32_t _access_mask /* [in] */,
23 struct policy_handle *_handle /* [out] [ref] */)
25 struct tevent_req *req;
26 struct rpccli_winreg_OpenHKCR_state *state;
27 struct tevent_req *subreq;
29 req = tevent_req_create(mem_ctx, &state,
30 struct rpccli_winreg_OpenHKCR_state);
31 if (req == NULL) {
32 return NULL;
34 state->out_mem_ctx = NULL;
35 state->dispatch_recv = cli->dispatch_recv;
37 /* In parameters */
38 state->orig.in.system_name = _system_name;
39 state->orig.in.access_mask = _access_mask;
41 /* Out parameters */
42 state->orig.out.handle = _handle;
44 /* Result */
45 ZERO_STRUCT(state->orig.out.result);
47 state->out_mem_ctx = talloc_named_const(state, 0,
48 "rpccli_winreg_OpenHKCR_out_memory");
49 if (tevent_req_nomem(state->out_mem_ctx, req)) {
50 return tevent_req_post(req, ev);
53 /* make a temporary copy, that we pass to the dispatch function */
54 state->tmp = state->orig;
56 subreq = cli->dispatch_send(state, ev, cli,
57 &ndr_table_winreg,
58 NDR_WINREG_OPENHKCR,
59 &state->tmp);
60 if (tevent_req_nomem(subreq, req)) {
61 return tevent_req_post(req, ev);
63 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCR_done, req);
64 return req;
67 static void rpccli_winreg_OpenHKCR_done(struct tevent_req *subreq)
69 struct tevent_req *req = tevent_req_callback_data(
70 subreq, struct tevent_req);
71 struct rpccli_winreg_OpenHKCR_state *state = tevent_req_data(
72 req, struct rpccli_winreg_OpenHKCR_state);
73 NTSTATUS status;
74 TALLOC_CTX *mem_ctx;
76 if (state->out_mem_ctx) {
77 mem_ctx = state->out_mem_ctx;
78 } else {
79 mem_ctx = state;
82 status = state->dispatch_recv(subreq, mem_ctx);
83 TALLOC_FREE(subreq);
84 if (!NT_STATUS_IS_OK(status)) {
85 tevent_req_nterror(req, status);
86 return;
89 /* Copy out parameters */
90 *state->orig.out.handle = *state->tmp.out.handle;
92 /* Copy result */
93 state->orig.out.result = state->tmp.out.result;
95 /* Reset temporary structure */
96 ZERO_STRUCT(state->tmp);
98 tevent_req_done(req);
101 NTSTATUS rpccli_winreg_OpenHKCR_recv(struct tevent_req *req,
102 TALLOC_CTX *mem_ctx,
103 WERROR *result)
105 struct rpccli_winreg_OpenHKCR_state *state = tevent_req_data(
106 req, struct rpccli_winreg_OpenHKCR_state);
107 NTSTATUS status;
109 if (tevent_req_is_nterror(req, &status)) {
110 tevent_req_received(req);
111 return status;
114 /* Steal possbile out parameters to the callers context */
115 talloc_steal(mem_ctx, state->out_mem_ctx);
117 /* Return result */
118 *result = state->orig.out.result;
120 tevent_req_received(req);
121 return NT_STATUS_OK;
124 NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli,
125 TALLOC_CTX *mem_ctx,
126 uint16_t *system_name /* [in] [unique] */,
127 uint32_t access_mask /* [in] */,
128 struct policy_handle *handle /* [out] [ref] */,
129 WERROR *werror)
131 struct winreg_OpenHKCR r;
132 NTSTATUS status;
134 /* In parameters */
135 r.in.system_name = system_name;
136 r.in.access_mask = access_mask;
138 status = cli->dispatch(cli,
139 mem_ctx,
140 &ndr_table_winreg,
141 NDR_WINREG_OPENHKCR,
142 &r);
144 if (!NT_STATUS_IS_OK(status)) {
145 return status;
148 if (NT_STATUS_IS_ERR(status)) {
149 return status;
152 /* Return variables */
153 *handle = *r.out.handle;
155 /* Return result */
156 if (werror) {
157 *werror = r.out.result;
160 return werror_to_ntstatus(r.out.result);
163 struct rpccli_winreg_OpenHKCU_state {
164 struct winreg_OpenHKCU orig;
165 struct winreg_OpenHKCU tmp;
166 TALLOC_CTX *out_mem_ctx;
167 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
170 static void rpccli_winreg_OpenHKCU_done(struct tevent_req *subreq);
172 struct tevent_req *rpccli_winreg_OpenHKCU_send(TALLOC_CTX *mem_ctx,
173 struct tevent_context *ev,
174 struct rpc_pipe_client *cli,
175 uint16_t *_system_name /* [in] [unique] */,
176 uint32_t _access_mask /* [in] */,
177 struct policy_handle *_handle /* [out] [ref] */)
179 struct tevent_req *req;
180 struct rpccli_winreg_OpenHKCU_state *state;
181 struct tevent_req *subreq;
183 req = tevent_req_create(mem_ctx, &state,
184 struct rpccli_winreg_OpenHKCU_state);
185 if (req == NULL) {
186 return NULL;
188 state->out_mem_ctx = NULL;
189 state->dispatch_recv = cli->dispatch_recv;
191 /* In parameters */
192 state->orig.in.system_name = _system_name;
193 state->orig.in.access_mask = _access_mask;
195 /* Out parameters */
196 state->orig.out.handle = _handle;
198 /* Result */
199 ZERO_STRUCT(state->orig.out.result);
201 state->out_mem_ctx = talloc_named_const(state, 0,
202 "rpccli_winreg_OpenHKCU_out_memory");
203 if (tevent_req_nomem(state->out_mem_ctx, req)) {
204 return tevent_req_post(req, ev);
207 /* make a temporary copy, that we pass to the dispatch function */
208 state->tmp = state->orig;
210 subreq = cli->dispatch_send(state, ev, cli,
211 &ndr_table_winreg,
212 NDR_WINREG_OPENHKCU,
213 &state->tmp);
214 if (tevent_req_nomem(subreq, req)) {
215 return tevent_req_post(req, ev);
217 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCU_done, req);
218 return req;
221 static void rpccli_winreg_OpenHKCU_done(struct tevent_req *subreq)
223 struct tevent_req *req = tevent_req_callback_data(
224 subreq, struct tevent_req);
225 struct rpccli_winreg_OpenHKCU_state *state = tevent_req_data(
226 req, struct rpccli_winreg_OpenHKCU_state);
227 NTSTATUS status;
228 TALLOC_CTX *mem_ctx;
230 if (state->out_mem_ctx) {
231 mem_ctx = state->out_mem_ctx;
232 } else {
233 mem_ctx = state;
236 status = state->dispatch_recv(subreq, mem_ctx);
237 TALLOC_FREE(subreq);
238 if (!NT_STATUS_IS_OK(status)) {
239 tevent_req_nterror(req, status);
240 return;
243 /* Copy out parameters */
244 *state->orig.out.handle = *state->tmp.out.handle;
246 /* Copy result */
247 state->orig.out.result = state->tmp.out.result;
249 /* Reset temporary structure */
250 ZERO_STRUCT(state->tmp);
252 tevent_req_done(req);
255 NTSTATUS rpccli_winreg_OpenHKCU_recv(struct tevent_req *req,
256 TALLOC_CTX *mem_ctx,
257 WERROR *result)
259 struct rpccli_winreg_OpenHKCU_state *state = tevent_req_data(
260 req, struct rpccli_winreg_OpenHKCU_state);
261 NTSTATUS status;
263 if (tevent_req_is_nterror(req, &status)) {
264 tevent_req_received(req);
265 return status;
268 /* Steal possbile out parameters to the callers context */
269 talloc_steal(mem_ctx, state->out_mem_ctx);
271 /* Return result */
272 *result = state->orig.out.result;
274 tevent_req_received(req);
275 return NT_STATUS_OK;
278 NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli,
279 TALLOC_CTX *mem_ctx,
280 uint16_t *system_name /* [in] [unique] */,
281 uint32_t access_mask /* [in] */,
282 struct policy_handle *handle /* [out] [ref] */,
283 WERROR *werror)
285 struct winreg_OpenHKCU r;
286 NTSTATUS status;
288 /* In parameters */
289 r.in.system_name = system_name;
290 r.in.access_mask = access_mask;
292 status = cli->dispatch(cli,
293 mem_ctx,
294 &ndr_table_winreg,
295 NDR_WINREG_OPENHKCU,
296 &r);
298 if (!NT_STATUS_IS_OK(status)) {
299 return status;
302 if (NT_STATUS_IS_ERR(status)) {
303 return status;
306 /* Return variables */
307 *handle = *r.out.handle;
309 /* Return result */
310 if (werror) {
311 *werror = r.out.result;
314 return werror_to_ntstatus(r.out.result);
317 struct rpccli_winreg_OpenHKLM_state {
318 struct winreg_OpenHKLM orig;
319 struct winreg_OpenHKLM tmp;
320 TALLOC_CTX *out_mem_ctx;
321 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
324 static void rpccli_winreg_OpenHKLM_done(struct tevent_req *subreq);
326 struct tevent_req *rpccli_winreg_OpenHKLM_send(TALLOC_CTX *mem_ctx,
327 struct tevent_context *ev,
328 struct rpc_pipe_client *cli,
329 uint16_t *_system_name /* [in] [unique] */,
330 uint32_t _access_mask /* [in] */,
331 struct policy_handle *_handle /* [out] [ref] */)
333 struct tevent_req *req;
334 struct rpccli_winreg_OpenHKLM_state *state;
335 struct tevent_req *subreq;
337 req = tevent_req_create(mem_ctx, &state,
338 struct rpccli_winreg_OpenHKLM_state);
339 if (req == NULL) {
340 return NULL;
342 state->out_mem_ctx = NULL;
343 state->dispatch_recv = cli->dispatch_recv;
345 /* In parameters */
346 state->orig.in.system_name = _system_name;
347 state->orig.in.access_mask = _access_mask;
349 /* Out parameters */
350 state->orig.out.handle = _handle;
352 /* Result */
353 ZERO_STRUCT(state->orig.out.result);
355 state->out_mem_ctx = talloc_named_const(state, 0,
356 "rpccli_winreg_OpenHKLM_out_memory");
357 if (tevent_req_nomem(state->out_mem_ctx, req)) {
358 return tevent_req_post(req, ev);
361 /* make a temporary copy, that we pass to the dispatch function */
362 state->tmp = state->orig;
364 subreq = cli->dispatch_send(state, ev, cli,
365 &ndr_table_winreg,
366 NDR_WINREG_OPENHKLM,
367 &state->tmp);
368 if (tevent_req_nomem(subreq, req)) {
369 return tevent_req_post(req, ev);
371 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKLM_done, req);
372 return req;
375 static void rpccli_winreg_OpenHKLM_done(struct tevent_req *subreq)
377 struct tevent_req *req = tevent_req_callback_data(
378 subreq, struct tevent_req);
379 struct rpccli_winreg_OpenHKLM_state *state = tevent_req_data(
380 req, struct rpccli_winreg_OpenHKLM_state);
381 NTSTATUS status;
382 TALLOC_CTX *mem_ctx;
384 if (state->out_mem_ctx) {
385 mem_ctx = state->out_mem_ctx;
386 } else {
387 mem_ctx = state;
390 status = state->dispatch_recv(subreq, mem_ctx);
391 TALLOC_FREE(subreq);
392 if (!NT_STATUS_IS_OK(status)) {
393 tevent_req_nterror(req, status);
394 return;
397 /* Copy out parameters */
398 *state->orig.out.handle = *state->tmp.out.handle;
400 /* Copy result */
401 state->orig.out.result = state->tmp.out.result;
403 /* Reset temporary structure */
404 ZERO_STRUCT(state->tmp);
406 tevent_req_done(req);
409 NTSTATUS rpccli_winreg_OpenHKLM_recv(struct tevent_req *req,
410 TALLOC_CTX *mem_ctx,
411 WERROR *result)
413 struct rpccli_winreg_OpenHKLM_state *state = tevent_req_data(
414 req, struct rpccli_winreg_OpenHKLM_state);
415 NTSTATUS status;
417 if (tevent_req_is_nterror(req, &status)) {
418 tevent_req_received(req);
419 return status;
422 /* Steal possbile out parameters to the callers context */
423 talloc_steal(mem_ctx, state->out_mem_ctx);
425 /* Return result */
426 *result = state->orig.out.result;
428 tevent_req_received(req);
429 return NT_STATUS_OK;
432 NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli,
433 TALLOC_CTX *mem_ctx,
434 uint16_t *system_name /* [in] [unique] */,
435 uint32_t access_mask /* [in] */,
436 struct policy_handle *handle /* [out] [ref] */,
437 WERROR *werror)
439 struct winreg_OpenHKLM r;
440 NTSTATUS status;
442 /* In parameters */
443 r.in.system_name = system_name;
444 r.in.access_mask = access_mask;
446 status = cli->dispatch(cli,
447 mem_ctx,
448 &ndr_table_winreg,
449 NDR_WINREG_OPENHKLM,
450 &r);
452 if (!NT_STATUS_IS_OK(status)) {
453 return status;
456 if (NT_STATUS_IS_ERR(status)) {
457 return status;
460 /* Return variables */
461 *handle = *r.out.handle;
463 /* Return result */
464 if (werror) {
465 *werror = r.out.result;
468 return werror_to_ntstatus(r.out.result);
471 struct rpccli_winreg_OpenHKPD_state {
472 struct winreg_OpenHKPD orig;
473 struct winreg_OpenHKPD tmp;
474 TALLOC_CTX *out_mem_ctx;
475 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
478 static void rpccli_winreg_OpenHKPD_done(struct tevent_req *subreq);
480 struct tevent_req *rpccli_winreg_OpenHKPD_send(TALLOC_CTX *mem_ctx,
481 struct tevent_context *ev,
482 struct rpc_pipe_client *cli,
483 uint16_t *_system_name /* [in] [unique] */,
484 uint32_t _access_mask /* [in] */,
485 struct policy_handle *_handle /* [out] [ref] */)
487 struct tevent_req *req;
488 struct rpccli_winreg_OpenHKPD_state *state;
489 struct tevent_req *subreq;
491 req = tevent_req_create(mem_ctx, &state,
492 struct rpccli_winreg_OpenHKPD_state);
493 if (req == NULL) {
494 return NULL;
496 state->out_mem_ctx = NULL;
497 state->dispatch_recv = cli->dispatch_recv;
499 /* In parameters */
500 state->orig.in.system_name = _system_name;
501 state->orig.in.access_mask = _access_mask;
503 /* Out parameters */
504 state->orig.out.handle = _handle;
506 /* Result */
507 ZERO_STRUCT(state->orig.out.result);
509 state->out_mem_ctx = talloc_named_const(state, 0,
510 "rpccli_winreg_OpenHKPD_out_memory");
511 if (tevent_req_nomem(state->out_mem_ctx, req)) {
512 return tevent_req_post(req, ev);
515 /* make a temporary copy, that we pass to the dispatch function */
516 state->tmp = state->orig;
518 subreq = cli->dispatch_send(state, ev, cli,
519 &ndr_table_winreg,
520 NDR_WINREG_OPENHKPD,
521 &state->tmp);
522 if (tevent_req_nomem(subreq, req)) {
523 return tevent_req_post(req, ev);
525 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPD_done, req);
526 return req;
529 static void rpccli_winreg_OpenHKPD_done(struct tevent_req *subreq)
531 struct tevent_req *req = tevent_req_callback_data(
532 subreq, struct tevent_req);
533 struct rpccli_winreg_OpenHKPD_state *state = tevent_req_data(
534 req, struct rpccli_winreg_OpenHKPD_state);
535 NTSTATUS status;
536 TALLOC_CTX *mem_ctx;
538 if (state->out_mem_ctx) {
539 mem_ctx = state->out_mem_ctx;
540 } else {
541 mem_ctx = state;
544 status = state->dispatch_recv(subreq, mem_ctx);
545 TALLOC_FREE(subreq);
546 if (!NT_STATUS_IS_OK(status)) {
547 tevent_req_nterror(req, status);
548 return;
551 /* Copy out parameters */
552 *state->orig.out.handle = *state->tmp.out.handle;
554 /* Copy result */
555 state->orig.out.result = state->tmp.out.result;
557 /* Reset temporary structure */
558 ZERO_STRUCT(state->tmp);
560 tevent_req_done(req);
563 NTSTATUS rpccli_winreg_OpenHKPD_recv(struct tevent_req *req,
564 TALLOC_CTX *mem_ctx,
565 WERROR *result)
567 struct rpccli_winreg_OpenHKPD_state *state = tevent_req_data(
568 req, struct rpccli_winreg_OpenHKPD_state);
569 NTSTATUS status;
571 if (tevent_req_is_nterror(req, &status)) {
572 tevent_req_received(req);
573 return status;
576 /* Steal possbile out parameters to the callers context */
577 talloc_steal(mem_ctx, state->out_mem_ctx);
579 /* Return result */
580 *result = state->orig.out.result;
582 tevent_req_received(req);
583 return NT_STATUS_OK;
586 NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli,
587 TALLOC_CTX *mem_ctx,
588 uint16_t *system_name /* [in] [unique] */,
589 uint32_t access_mask /* [in] */,
590 struct policy_handle *handle /* [out] [ref] */,
591 WERROR *werror)
593 struct winreg_OpenHKPD r;
594 NTSTATUS status;
596 /* In parameters */
597 r.in.system_name = system_name;
598 r.in.access_mask = access_mask;
600 status = cli->dispatch(cli,
601 mem_ctx,
602 &ndr_table_winreg,
603 NDR_WINREG_OPENHKPD,
604 &r);
606 if (!NT_STATUS_IS_OK(status)) {
607 return status;
610 if (NT_STATUS_IS_ERR(status)) {
611 return status;
614 /* Return variables */
615 *handle = *r.out.handle;
617 /* Return result */
618 if (werror) {
619 *werror = r.out.result;
622 return werror_to_ntstatus(r.out.result);
625 struct rpccli_winreg_OpenHKU_state {
626 struct winreg_OpenHKU orig;
627 struct winreg_OpenHKU tmp;
628 TALLOC_CTX *out_mem_ctx;
629 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
632 static void rpccli_winreg_OpenHKU_done(struct tevent_req *subreq);
634 struct tevent_req *rpccli_winreg_OpenHKU_send(TALLOC_CTX *mem_ctx,
635 struct tevent_context *ev,
636 struct rpc_pipe_client *cli,
637 uint16_t *_system_name /* [in] [unique] */,
638 uint32_t _access_mask /* [in] */,
639 struct policy_handle *_handle /* [out] [ref] */)
641 struct tevent_req *req;
642 struct rpccli_winreg_OpenHKU_state *state;
643 struct tevent_req *subreq;
645 req = tevent_req_create(mem_ctx, &state,
646 struct rpccli_winreg_OpenHKU_state);
647 if (req == NULL) {
648 return NULL;
650 state->out_mem_ctx = NULL;
651 state->dispatch_recv = cli->dispatch_recv;
653 /* In parameters */
654 state->orig.in.system_name = _system_name;
655 state->orig.in.access_mask = _access_mask;
657 /* Out parameters */
658 state->orig.out.handle = _handle;
660 /* Result */
661 ZERO_STRUCT(state->orig.out.result);
663 state->out_mem_ctx = talloc_named_const(state, 0,
664 "rpccli_winreg_OpenHKU_out_memory");
665 if (tevent_req_nomem(state->out_mem_ctx, req)) {
666 return tevent_req_post(req, ev);
669 /* make a temporary copy, that we pass to the dispatch function */
670 state->tmp = state->orig;
672 subreq = cli->dispatch_send(state, ev, cli,
673 &ndr_table_winreg,
674 NDR_WINREG_OPENHKU,
675 &state->tmp);
676 if (tevent_req_nomem(subreq, req)) {
677 return tevent_req_post(req, ev);
679 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKU_done, req);
680 return req;
683 static void rpccli_winreg_OpenHKU_done(struct tevent_req *subreq)
685 struct tevent_req *req = tevent_req_callback_data(
686 subreq, struct tevent_req);
687 struct rpccli_winreg_OpenHKU_state *state = tevent_req_data(
688 req, struct rpccli_winreg_OpenHKU_state);
689 NTSTATUS status;
690 TALLOC_CTX *mem_ctx;
692 if (state->out_mem_ctx) {
693 mem_ctx = state->out_mem_ctx;
694 } else {
695 mem_ctx = state;
698 status = state->dispatch_recv(subreq, mem_ctx);
699 TALLOC_FREE(subreq);
700 if (!NT_STATUS_IS_OK(status)) {
701 tevent_req_nterror(req, status);
702 return;
705 /* Copy out parameters */
706 *state->orig.out.handle = *state->tmp.out.handle;
708 /* Copy result */
709 state->orig.out.result = state->tmp.out.result;
711 /* Reset temporary structure */
712 ZERO_STRUCT(state->tmp);
714 tevent_req_done(req);
717 NTSTATUS rpccli_winreg_OpenHKU_recv(struct tevent_req *req,
718 TALLOC_CTX *mem_ctx,
719 WERROR *result)
721 struct rpccli_winreg_OpenHKU_state *state = tevent_req_data(
722 req, struct rpccli_winreg_OpenHKU_state);
723 NTSTATUS status;
725 if (tevent_req_is_nterror(req, &status)) {
726 tevent_req_received(req);
727 return status;
730 /* Steal possbile out parameters to the callers context */
731 talloc_steal(mem_ctx, state->out_mem_ctx);
733 /* Return result */
734 *result = state->orig.out.result;
736 tevent_req_received(req);
737 return NT_STATUS_OK;
740 NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli,
741 TALLOC_CTX *mem_ctx,
742 uint16_t *system_name /* [in] [unique] */,
743 uint32_t access_mask /* [in] */,
744 struct policy_handle *handle /* [out] [ref] */,
745 WERROR *werror)
747 struct winreg_OpenHKU r;
748 NTSTATUS status;
750 /* In parameters */
751 r.in.system_name = system_name;
752 r.in.access_mask = access_mask;
754 status = cli->dispatch(cli,
755 mem_ctx,
756 &ndr_table_winreg,
757 NDR_WINREG_OPENHKU,
758 &r);
760 if (!NT_STATUS_IS_OK(status)) {
761 return status;
764 if (NT_STATUS_IS_ERR(status)) {
765 return status;
768 /* Return variables */
769 *handle = *r.out.handle;
771 /* Return result */
772 if (werror) {
773 *werror = r.out.result;
776 return werror_to_ntstatus(r.out.result);
779 struct rpccli_winreg_CloseKey_state {
780 struct winreg_CloseKey orig;
781 struct winreg_CloseKey tmp;
782 TALLOC_CTX *out_mem_ctx;
783 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
786 static void rpccli_winreg_CloseKey_done(struct tevent_req *subreq);
788 struct tevent_req *rpccli_winreg_CloseKey_send(TALLOC_CTX *mem_ctx,
789 struct tevent_context *ev,
790 struct rpc_pipe_client *cli,
791 struct policy_handle *_handle /* [in,out] [ref] */)
793 struct tevent_req *req;
794 struct rpccli_winreg_CloseKey_state *state;
795 struct tevent_req *subreq;
797 req = tevent_req_create(mem_ctx, &state,
798 struct rpccli_winreg_CloseKey_state);
799 if (req == NULL) {
800 return NULL;
802 state->out_mem_ctx = NULL;
803 state->dispatch_recv = cli->dispatch_recv;
805 /* In parameters */
806 state->orig.in.handle = _handle;
808 /* Out parameters */
809 state->orig.out.handle = _handle;
811 /* Result */
812 ZERO_STRUCT(state->orig.out.result);
814 state->out_mem_ctx = talloc_named_const(state, 0,
815 "rpccli_winreg_CloseKey_out_memory");
816 if (tevent_req_nomem(state->out_mem_ctx, req)) {
817 return tevent_req_post(req, ev);
820 /* make a temporary copy, that we pass to the dispatch function */
821 state->tmp = state->orig;
823 subreq = cli->dispatch_send(state, ev, cli,
824 &ndr_table_winreg,
825 NDR_WINREG_CLOSEKEY,
826 &state->tmp);
827 if (tevent_req_nomem(subreq, req)) {
828 return tevent_req_post(req, ev);
830 tevent_req_set_callback(subreq, rpccli_winreg_CloseKey_done, req);
831 return req;
834 static void rpccli_winreg_CloseKey_done(struct tevent_req *subreq)
836 struct tevent_req *req = tevent_req_callback_data(
837 subreq, struct tevent_req);
838 struct rpccli_winreg_CloseKey_state *state = tevent_req_data(
839 req, struct rpccli_winreg_CloseKey_state);
840 NTSTATUS status;
841 TALLOC_CTX *mem_ctx;
843 if (state->out_mem_ctx) {
844 mem_ctx = state->out_mem_ctx;
845 } else {
846 mem_ctx = state;
849 status = state->dispatch_recv(subreq, mem_ctx);
850 TALLOC_FREE(subreq);
851 if (!NT_STATUS_IS_OK(status)) {
852 tevent_req_nterror(req, status);
853 return;
856 /* Copy out parameters */
857 *state->orig.out.handle = *state->tmp.out.handle;
859 /* Copy result */
860 state->orig.out.result = state->tmp.out.result;
862 /* Reset temporary structure */
863 ZERO_STRUCT(state->tmp);
865 tevent_req_done(req);
868 NTSTATUS rpccli_winreg_CloseKey_recv(struct tevent_req *req,
869 TALLOC_CTX *mem_ctx,
870 WERROR *result)
872 struct rpccli_winreg_CloseKey_state *state = tevent_req_data(
873 req, struct rpccli_winreg_CloseKey_state);
874 NTSTATUS status;
876 if (tevent_req_is_nterror(req, &status)) {
877 tevent_req_received(req);
878 return status;
881 /* Steal possbile out parameters to the callers context */
882 talloc_steal(mem_ctx, state->out_mem_ctx);
884 /* Return result */
885 *result = state->orig.out.result;
887 tevent_req_received(req);
888 return NT_STATUS_OK;
891 NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli,
892 TALLOC_CTX *mem_ctx,
893 struct policy_handle *handle /* [in,out] [ref] */,
894 WERROR *werror)
896 struct winreg_CloseKey r;
897 NTSTATUS status;
899 /* In parameters */
900 r.in.handle = handle;
902 status = cli->dispatch(cli,
903 mem_ctx,
904 &ndr_table_winreg,
905 NDR_WINREG_CLOSEKEY,
906 &r);
908 if (!NT_STATUS_IS_OK(status)) {
909 return status;
912 if (NT_STATUS_IS_ERR(status)) {
913 return status;
916 /* Return variables */
917 *handle = *r.out.handle;
919 /* Return result */
920 if (werror) {
921 *werror = r.out.result;
924 return werror_to_ntstatus(r.out.result);
927 struct rpccli_winreg_CreateKey_state {
928 struct winreg_CreateKey orig;
929 struct winreg_CreateKey tmp;
930 TALLOC_CTX *out_mem_ctx;
931 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
934 static void rpccli_winreg_CreateKey_done(struct tevent_req *subreq);
936 struct tevent_req *rpccli_winreg_CreateKey_send(TALLOC_CTX *mem_ctx,
937 struct tevent_context *ev,
938 struct rpc_pipe_client *cli,
939 struct policy_handle *_handle /* [in] [ref] */,
940 struct winreg_String _name /* [in] */,
941 struct winreg_String _keyclass /* [in] */,
942 uint32_t _options /* [in] */,
943 uint32_t _access_mask /* [in] */,
944 struct winreg_SecBuf *_secdesc /* [in] [unique] */,
945 struct policy_handle *_new_handle /* [out] [ref] */,
946 enum winreg_CreateAction *_action_taken /* [in,out] [unique] */)
948 struct tevent_req *req;
949 struct rpccli_winreg_CreateKey_state *state;
950 struct tevent_req *subreq;
952 req = tevent_req_create(mem_ctx, &state,
953 struct rpccli_winreg_CreateKey_state);
954 if (req == NULL) {
955 return NULL;
957 state->out_mem_ctx = NULL;
958 state->dispatch_recv = cli->dispatch_recv;
960 /* In parameters */
961 state->orig.in.handle = _handle;
962 state->orig.in.name = _name;
963 state->orig.in.keyclass = _keyclass;
964 state->orig.in.options = _options;
965 state->orig.in.access_mask = _access_mask;
966 state->orig.in.secdesc = _secdesc;
967 state->orig.in.action_taken = _action_taken;
969 /* Out parameters */
970 state->orig.out.new_handle = _new_handle;
971 state->orig.out.action_taken = _action_taken;
973 /* Result */
974 ZERO_STRUCT(state->orig.out.result);
976 state->out_mem_ctx = talloc_named_const(state, 0,
977 "rpccli_winreg_CreateKey_out_memory");
978 if (tevent_req_nomem(state->out_mem_ctx, req)) {
979 return tevent_req_post(req, ev);
982 /* make a temporary copy, that we pass to the dispatch function */
983 state->tmp = state->orig;
985 subreq = cli->dispatch_send(state, ev, cli,
986 &ndr_table_winreg,
987 NDR_WINREG_CREATEKEY,
988 &state->tmp);
989 if (tevent_req_nomem(subreq, req)) {
990 return tevent_req_post(req, ev);
992 tevent_req_set_callback(subreq, rpccli_winreg_CreateKey_done, req);
993 return req;
996 static void rpccli_winreg_CreateKey_done(struct tevent_req *subreq)
998 struct tevent_req *req = tevent_req_callback_data(
999 subreq, struct tevent_req);
1000 struct rpccli_winreg_CreateKey_state *state = tevent_req_data(
1001 req, struct rpccli_winreg_CreateKey_state);
1002 NTSTATUS status;
1003 TALLOC_CTX *mem_ctx;
1005 if (state->out_mem_ctx) {
1006 mem_ctx = state->out_mem_ctx;
1007 } else {
1008 mem_ctx = state;
1011 status = state->dispatch_recv(subreq, mem_ctx);
1012 TALLOC_FREE(subreq);
1013 if (!NT_STATUS_IS_OK(status)) {
1014 tevent_req_nterror(req, status);
1015 return;
1018 /* Copy out parameters */
1019 *state->orig.out.new_handle = *state->tmp.out.new_handle;
1020 if (state->orig.out.action_taken && state->tmp.out.action_taken) {
1021 *state->orig.out.action_taken = *state->tmp.out.action_taken;
1024 /* Copy result */
1025 state->orig.out.result = state->tmp.out.result;
1027 /* Reset temporary structure */
1028 ZERO_STRUCT(state->tmp);
1030 tevent_req_done(req);
1033 NTSTATUS rpccli_winreg_CreateKey_recv(struct tevent_req *req,
1034 TALLOC_CTX *mem_ctx,
1035 WERROR *result)
1037 struct rpccli_winreg_CreateKey_state *state = tevent_req_data(
1038 req, struct rpccli_winreg_CreateKey_state);
1039 NTSTATUS status;
1041 if (tevent_req_is_nterror(req, &status)) {
1042 tevent_req_received(req);
1043 return status;
1046 /* Steal possbile out parameters to the callers context */
1047 talloc_steal(mem_ctx, state->out_mem_ctx);
1049 /* Return result */
1050 *result = state->orig.out.result;
1052 tevent_req_received(req);
1053 return NT_STATUS_OK;
1056 NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli,
1057 TALLOC_CTX *mem_ctx,
1058 struct policy_handle *handle /* [in] [ref] */,
1059 struct winreg_String name /* [in] */,
1060 struct winreg_String keyclass /* [in] */,
1061 uint32_t options /* [in] */,
1062 uint32_t access_mask /* [in] */,
1063 struct winreg_SecBuf *secdesc /* [in] [unique] */,
1064 struct policy_handle *new_handle /* [out] [ref] */,
1065 enum winreg_CreateAction *action_taken /* [in,out] [unique] */,
1066 WERROR *werror)
1068 struct winreg_CreateKey r;
1069 NTSTATUS status;
1071 /* In parameters */
1072 r.in.handle = handle;
1073 r.in.name = name;
1074 r.in.keyclass = keyclass;
1075 r.in.options = options;
1076 r.in.access_mask = access_mask;
1077 r.in.secdesc = secdesc;
1078 r.in.action_taken = action_taken;
1080 status = cli->dispatch(cli,
1081 mem_ctx,
1082 &ndr_table_winreg,
1083 NDR_WINREG_CREATEKEY,
1084 &r);
1086 if (!NT_STATUS_IS_OK(status)) {
1087 return status;
1090 if (NT_STATUS_IS_ERR(status)) {
1091 return status;
1094 /* Return variables */
1095 *new_handle = *r.out.new_handle;
1096 if (action_taken && r.out.action_taken) {
1097 *action_taken = *r.out.action_taken;
1100 /* Return result */
1101 if (werror) {
1102 *werror = r.out.result;
1105 return werror_to_ntstatus(r.out.result);
1108 struct rpccli_winreg_DeleteKey_state {
1109 struct winreg_DeleteKey orig;
1110 struct winreg_DeleteKey tmp;
1111 TALLOC_CTX *out_mem_ctx;
1112 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1115 static void rpccli_winreg_DeleteKey_done(struct tevent_req *subreq);
1117 struct tevent_req *rpccli_winreg_DeleteKey_send(TALLOC_CTX *mem_ctx,
1118 struct tevent_context *ev,
1119 struct rpc_pipe_client *cli,
1120 struct policy_handle *_handle /* [in] [ref] */,
1121 struct winreg_String _key /* [in] */)
1123 struct tevent_req *req;
1124 struct rpccli_winreg_DeleteKey_state *state;
1125 struct tevent_req *subreq;
1127 req = tevent_req_create(mem_ctx, &state,
1128 struct rpccli_winreg_DeleteKey_state);
1129 if (req == NULL) {
1130 return NULL;
1132 state->out_mem_ctx = NULL;
1133 state->dispatch_recv = cli->dispatch_recv;
1135 /* In parameters */
1136 state->orig.in.handle = _handle;
1137 state->orig.in.key = _key;
1139 /* Out parameters */
1141 /* Result */
1142 ZERO_STRUCT(state->orig.out.result);
1144 /* make a temporary copy, that we pass to the dispatch function */
1145 state->tmp = state->orig;
1147 subreq = cli->dispatch_send(state, ev, cli,
1148 &ndr_table_winreg,
1149 NDR_WINREG_DELETEKEY,
1150 &state->tmp);
1151 if (tevent_req_nomem(subreq, req)) {
1152 return tevent_req_post(req, ev);
1154 tevent_req_set_callback(subreq, rpccli_winreg_DeleteKey_done, req);
1155 return req;
1158 static void rpccli_winreg_DeleteKey_done(struct tevent_req *subreq)
1160 struct tevent_req *req = tevent_req_callback_data(
1161 subreq, struct tevent_req);
1162 struct rpccli_winreg_DeleteKey_state *state = tevent_req_data(
1163 req, struct rpccli_winreg_DeleteKey_state);
1164 NTSTATUS status;
1165 TALLOC_CTX *mem_ctx;
1167 if (state->out_mem_ctx) {
1168 mem_ctx = state->out_mem_ctx;
1169 } else {
1170 mem_ctx = state;
1173 status = state->dispatch_recv(subreq, mem_ctx);
1174 TALLOC_FREE(subreq);
1175 if (!NT_STATUS_IS_OK(status)) {
1176 tevent_req_nterror(req, status);
1177 return;
1180 /* Copy out parameters */
1182 /* Copy result */
1183 state->orig.out.result = state->tmp.out.result;
1185 /* Reset temporary structure */
1186 ZERO_STRUCT(state->tmp);
1188 tevent_req_done(req);
1191 NTSTATUS rpccli_winreg_DeleteKey_recv(struct tevent_req *req,
1192 TALLOC_CTX *mem_ctx,
1193 WERROR *result)
1195 struct rpccli_winreg_DeleteKey_state *state = tevent_req_data(
1196 req, struct rpccli_winreg_DeleteKey_state);
1197 NTSTATUS status;
1199 if (tevent_req_is_nterror(req, &status)) {
1200 tevent_req_received(req);
1201 return status;
1204 /* Steal possbile out parameters to the callers context */
1205 talloc_steal(mem_ctx, state->out_mem_ctx);
1207 /* Return result */
1208 *result = state->orig.out.result;
1210 tevent_req_received(req);
1211 return NT_STATUS_OK;
1214 NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli,
1215 TALLOC_CTX *mem_ctx,
1216 struct policy_handle *handle /* [in] [ref] */,
1217 struct winreg_String key /* [in] */,
1218 WERROR *werror)
1220 struct winreg_DeleteKey r;
1221 NTSTATUS status;
1223 /* In parameters */
1224 r.in.handle = handle;
1225 r.in.key = key;
1227 status = cli->dispatch(cli,
1228 mem_ctx,
1229 &ndr_table_winreg,
1230 NDR_WINREG_DELETEKEY,
1231 &r);
1233 if (!NT_STATUS_IS_OK(status)) {
1234 return status;
1237 if (NT_STATUS_IS_ERR(status)) {
1238 return status;
1241 /* Return variables */
1243 /* Return result */
1244 if (werror) {
1245 *werror = r.out.result;
1248 return werror_to_ntstatus(r.out.result);
1251 struct rpccli_winreg_DeleteValue_state {
1252 struct winreg_DeleteValue orig;
1253 struct winreg_DeleteValue tmp;
1254 TALLOC_CTX *out_mem_ctx;
1255 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1258 static void rpccli_winreg_DeleteValue_done(struct tevent_req *subreq);
1260 struct tevent_req *rpccli_winreg_DeleteValue_send(TALLOC_CTX *mem_ctx,
1261 struct tevent_context *ev,
1262 struct rpc_pipe_client *cli,
1263 struct policy_handle *_handle /* [in] [ref] */,
1264 struct winreg_String _value /* [in] */)
1266 struct tevent_req *req;
1267 struct rpccli_winreg_DeleteValue_state *state;
1268 struct tevent_req *subreq;
1270 req = tevent_req_create(mem_ctx, &state,
1271 struct rpccli_winreg_DeleteValue_state);
1272 if (req == NULL) {
1273 return NULL;
1275 state->out_mem_ctx = NULL;
1276 state->dispatch_recv = cli->dispatch_recv;
1278 /* In parameters */
1279 state->orig.in.handle = _handle;
1280 state->orig.in.value = _value;
1282 /* Out parameters */
1284 /* Result */
1285 ZERO_STRUCT(state->orig.out.result);
1287 /* make a temporary copy, that we pass to the dispatch function */
1288 state->tmp = state->orig;
1290 subreq = cli->dispatch_send(state, ev, cli,
1291 &ndr_table_winreg,
1292 NDR_WINREG_DELETEVALUE,
1293 &state->tmp);
1294 if (tevent_req_nomem(subreq, req)) {
1295 return tevent_req_post(req, ev);
1297 tevent_req_set_callback(subreq, rpccli_winreg_DeleteValue_done, req);
1298 return req;
1301 static void rpccli_winreg_DeleteValue_done(struct tevent_req *subreq)
1303 struct tevent_req *req = tevent_req_callback_data(
1304 subreq, struct tevent_req);
1305 struct rpccli_winreg_DeleteValue_state *state = tevent_req_data(
1306 req, struct rpccli_winreg_DeleteValue_state);
1307 NTSTATUS status;
1308 TALLOC_CTX *mem_ctx;
1310 if (state->out_mem_ctx) {
1311 mem_ctx = state->out_mem_ctx;
1312 } else {
1313 mem_ctx = state;
1316 status = state->dispatch_recv(subreq, mem_ctx);
1317 TALLOC_FREE(subreq);
1318 if (!NT_STATUS_IS_OK(status)) {
1319 tevent_req_nterror(req, status);
1320 return;
1323 /* Copy out parameters */
1325 /* Copy result */
1326 state->orig.out.result = state->tmp.out.result;
1328 /* Reset temporary structure */
1329 ZERO_STRUCT(state->tmp);
1331 tevent_req_done(req);
1334 NTSTATUS rpccli_winreg_DeleteValue_recv(struct tevent_req *req,
1335 TALLOC_CTX *mem_ctx,
1336 WERROR *result)
1338 struct rpccli_winreg_DeleteValue_state *state = tevent_req_data(
1339 req, struct rpccli_winreg_DeleteValue_state);
1340 NTSTATUS status;
1342 if (tevent_req_is_nterror(req, &status)) {
1343 tevent_req_received(req);
1344 return status;
1347 /* Steal possbile out parameters to the callers context */
1348 talloc_steal(mem_ctx, state->out_mem_ctx);
1350 /* Return result */
1351 *result = state->orig.out.result;
1353 tevent_req_received(req);
1354 return NT_STATUS_OK;
1357 NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli,
1358 TALLOC_CTX *mem_ctx,
1359 struct policy_handle *handle /* [in] [ref] */,
1360 struct winreg_String value /* [in] */,
1361 WERROR *werror)
1363 struct winreg_DeleteValue r;
1364 NTSTATUS status;
1366 /* In parameters */
1367 r.in.handle = handle;
1368 r.in.value = value;
1370 status = cli->dispatch(cli,
1371 mem_ctx,
1372 &ndr_table_winreg,
1373 NDR_WINREG_DELETEVALUE,
1374 &r);
1376 if (!NT_STATUS_IS_OK(status)) {
1377 return status;
1380 if (NT_STATUS_IS_ERR(status)) {
1381 return status;
1384 /* Return variables */
1386 /* Return result */
1387 if (werror) {
1388 *werror = r.out.result;
1391 return werror_to_ntstatus(r.out.result);
1394 struct rpccli_winreg_EnumKey_state {
1395 struct winreg_EnumKey orig;
1396 struct winreg_EnumKey tmp;
1397 TALLOC_CTX *out_mem_ctx;
1398 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1401 static void rpccli_winreg_EnumKey_done(struct tevent_req *subreq);
1403 struct tevent_req *rpccli_winreg_EnumKey_send(TALLOC_CTX *mem_ctx,
1404 struct tevent_context *ev,
1405 struct rpc_pipe_client *cli,
1406 struct policy_handle *_handle /* [in] [ref] */,
1407 uint32_t _enum_index /* [in] */,
1408 struct winreg_StringBuf *_name /* [in,out] [ref] */,
1409 struct winreg_StringBuf *_keyclass /* [in,out] [unique] */,
1410 NTTIME *_last_changed_time /* [in,out] [unique] */)
1412 struct tevent_req *req;
1413 struct rpccli_winreg_EnumKey_state *state;
1414 struct tevent_req *subreq;
1416 req = tevent_req_create(mem_ctx, &state,
1417 struct rpccli_winreg_EnumKey_state);
1418 if (req == NULL) {
1419 return NULL;
1421 state->out_mem_ctx = NULL;
1422 state->dispatch_recv = cli->dispatch_recv;
1424 /* In parameters */
1425 state->orig.in.handle = _handle;
1426 state->orig.in.enum_index = _enum_index;
1427 state->orig.in.name = _name;
1428 state->orig.in.keyclass = _keyclass;
1429 state->orig.in.last_changed_time = _last_changed_time;
1431 /* Out parameters */
1432 state->orig.out.name = _name;
1433 state->orig.out.keyclass = _keyclass;
1434 state->orig.out.last_changed_time = _last_changed_time;
1436 /* Result */
1437 ZERO_STRUCT(state->orig.out.result);
1439 state->out_mem_ctx = talloc_named_const(state, 0,
1440 "rpccli_winreg_EnumKey_out_memory");
1441 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1442 return tevent_req_post(req, ev);
1445 /* make a temporary copy, that we pass to the dispatch function */
1446 state->tmp = state->orig;
1448 subreq = cli->dispatch_send(state, ev, cli,
1449 &ndr_table_winreg,
1450 NDR_WINREG_ENUMKEY,
1451 &state->tmp);
1452 if (tevent_req_nomem(subreq, req)) {
1453 return tevent_req_post(req, ev);
1455 tevent_req_set_callback(subreq, rpccli_winreg_EnumKey_done, req);
1456 return req;
1459 static void rpccli_winreg_EnumKey_done(struct tevent_req *subreq)
1461 struct tevent_req *req = tevent_req_callback_data(
1462 subreq, struct tevent_req);
1463 struct rpccli_winreg_EnumKey_state *state = tevent_req_data(
1464 req, struct rpccli_winreg_EnumKey_state);
1465 NTSTATUS status;
1466 TALLOC_CTX *mem_ctx;
1468 if (state->out_mem_ctx) {
1469 mem_ctx = state->out_mem_ctx;
1470 } else {
1471 mem_ctx = state;
1474 status = state->dispatch_recv(subreq, mem_ctx);
1475 TALLOC_FREE(subreq);
1476 if (!NT_STATUS_IS_OK(status)) {
1477 tevent_req_nterror(req, status);
1478 return;
1481 /* Copy out parameters */
1482 *state->orig.out.name = *state->tmp.out.name;
1483 if (state->orig.out.keyclass && state->tmp.out.keyclass) {
1484 *state->orig.out.keyclass = *state->tmp.out.keyclass;
1486 if (state->orig.out.last_changed_time && state->tmp.out.last_changed_time) {
1487 *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
1490 /* Copy result */
1491 state->orig.out.result = state->tmp.out.result;
1493 /* Reset temporary structure */
1494 ZERO_STRUCT(state->tmp);
1496 tevent_req_done(req);
1499 NTSTATUS rpccli_winreg_EnumKey_recv(struct tevent_req *req,
1500 TALLOC_CTX *mem_ctx,
1501 WERROR *result)
1503 struct rpccli_winreg_EnumKey_state *state = tevent_req_data(
1504 req, struct rpccli_winreg_EnumKey_state);
1505 NTSTATUS status;
1507 if (tevent_req_is_nterror(req, &status)) {
1508 tevent_req_received(req);
1509 return status;
1512 /* Steal possbile out parameters to the callers context */
1513 talloc_steal(mem_ctx, state->out_mem_ctx);
1515 /* Return result */
1516 *result = state->orig.out.result;
1518 tevent_req_received(req);
1519 return NT_STATUS_OK;
1522 NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli,
1523 TALLOC_CTX *mem_ctx,
1524 struct policy_handle *handle /* [in] [ref] */,
1525 uint32_t enum_index /* [in] */,
1526 struct winreg_StringBuf *name /* [in,out] [ref] */,
1527 struct winreg_StringBuf *keyclass /* [in,out] [unique] */,
1528 NTTIME *last_changed_time /* [in,out] [unique] */,
1529 WERROR *werror)
1531 struct winreg_EnumKey r;
1532 NTSTATUS status;
1534 /* In parameters */
1535 r.in.handle = handle;
1536 r.in.enum_index = enum_index;
1537 r.in.name = name;
1538 r.in.keyclass = keyclass;
1539 r.in.last_changed_time = last_changed_time;
1541 status = cli->dispatch(cli,
1542 mem_ctx,
1543 &ndr_table_winreg,
1544 NDR_WINREG_ENUMKEY,
1545 &r);
1547 if (!NT_STATUS_IS_OK(status)) {
1548 return status;
1551 if (NT_STATUS_IS_ERR(status)) {
1552 return status;
1555 /* Return variables */
1556 *name = *r.out.name;
1557 if (keyclass && r.out.keyclass) {
1558 *keyclass = *r.out.keyclass;
1560 if (last_changed_time && r.out.last_changed_time) {
1561 *last_changed_time = *r.out.last_changed_time;
1564 /* Return result */
1565 if (werror) {
1566 *werror = r.out.result;
1569 return werror_to_ntstatus(r.out.result);
1572 struct rpccli_winreg_EnumValue_state {
1573 struct winreg_EnumValue orig;
1574 struct winreg_EnumValue tmp;
1575 TALLOC_CTX *out_mem_ctx;
1576 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1579 static void rpccli_winreg_EnumValue_done(struct tevent_req *subreq);
1581 struct tevent_req *rpccli_winreg_EnumValue_send(TALLOC_CTX *mem_ctx,
1582 struct tevent_context *ev,
1583 struct rpc_pipe_client *cli,
1584 struct policy_handle *_handle /* [in] [ref] */,
1585 uint32_t _enum_index /* [in] */,
1586 struct winreg_ValNameBuf *_name /* [in,out] [ref] */,
1587 enum winreg_Type *_type /* [in,out] [unique] */,
1588 uint8_t *_value /* [in,out] [unique,length_is(*length),size_is(*size)] */,
1589 uint32_t *_size /* [in,out] [unique] */,
1590 uint32_t *_length /* [in,out] [unique] */)
1592 struct tevent_req *req;
1593 struct rpccli_winreg_EnumValue_state *state;
1594 struct tevent_req *subreq;
1596 req = tevent_req_create(mem_ctx, &state,
1597 struct rpccli_winreg_EnumValue_state);
1598 if (req == NULL) {
1599 return NULL;
1601 state->out_mem_ctx = NULL;
1602 state->dispatch_recv = cli->dispatch_recv;
1604 /* In parameters */
1605 state->orig.in.handle = _handle;
1606 state->orig.in.enum_index = _enum_index;
1607 state->orig.in.name = _name;
1608 state->orig.in.type = _type;
1609 state->orig.in.value = _value;
1610 state->orig.in.size = _size;
1611 state->orig.in.length = _length;
1613 /* Out parameters */
1614 state->orig.out.name = _name;
1615 state->orig.out.type = _type;
1616 state->orig.out.value = _value;
1617 state->orig.out.size = _size;
1618 state->orig.out.length = _length;
1620 /* Result */
1621 ZERO_STRUCT(state->orig.out.result);
1623 state->out_mem_ctx = talloc_named_const(state, 0,
1624 "rpccli_winreg_EnumValue_out_memory");
1625 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1626 return tevent_req_post(req, ev);
1629 /* make a temporary copy, that we pass to the dispatch function */
1630 state->tmp = state->orig;
1632 subreq = cli->dispatch_send(state, ev, cli,
1633 &ndr_table_winreg,
1634 NDR_WINREG_ENUMVALUE,
1635 &state->tmp);
1636 if (tevent_req_nomem(subreq, req)) {
1637 return tevent_req_post(req, ev);
1639 tevent_req_set_callback(subreq, rpccli_winreg_EnumValue_done, req);
1640 return req;
1643 static void rpccli_winreg_EnumValue_done(struct tevent_req *subreq)
1645 struct tevent_req *req = tevent_req_callback_data(
1646 subreq, struct tevent_req);
1647 struct rpccli_winreg_EnumValue_state *state = tevent_req_data(
1648 req, struct rpccli_winreg_EnumValue_state);
1649 NTSTATUS status;
1650 TALLOC_CTX *mem_ctx;
1652 if (state->out_mem_ctx) {
1653 mem_ctx = state->out_mem_ctx;
1654 } else {
1655 mem_ctx = state;
1658 status = state->dispatch_recv(subreq, mem_ctx);
1659 TALLOC_FREE(subreq);
1660 if (!NT_STATUS_IS_OK(status)) {
1661 tevent_req_nterror(req, status);
1662 return;
1665 /* Copy out parameters */
1666 *state->orig.out.name = *state->tmp.out.name;
1667 if (state->orig.out.type && state->tmp.out.type) {
1668 *state->orig.out.type = *state->tmp.out.type;
1670 if (state->orig.out.value && state->tmp.out.value) {
1671 memcpy(state->orig.out.value, state->tmp.out.value, (*state->tmp.in.size) * sizeof(*state->orig.out.value));
1673 if (state->orig.out.size && state->tmp.out.size) {
1674 *state->orig.out.size = *state->tmp.out.size;
1676 if (state->orig.out.length && state->tmp.out.length) {
1677 *state->orig.out.length = *state->tmp.out.length;
1680 /* Copy result */
1681 state->orig.out.result = state->tmp.out.result;
1683 /* Reset temporary structure */
1684 ZERO_STRUCT(state->tmp);
1686 tevent_req_done(req);
1689 NTSTATUS rpccli_winreg_EnumValue_recv(struct tevent_req *req,
1690 TALLOC_CTX *mem_ctx,
1691 WERROR *result)
1693 struct rpccli_winreg_EnumValue_state *state = tevent_req_data(
1694 req, struct rpccli_winreg_EnumValue_state);
1695 NTSTATUS status;
1697 if (tevent_req_is_nterror(req, &status)) {
1698 tevent_req_received(req);
1699 return status;
1702 /* Steal possbile out parameters to the callers context */
1703 talloc_steal(mem_ctx, state->out_mem_ctx);
1705 /* Return result */
1706 *result = state->orig.out.result;
1708 tevent_req_received(req);
1709 return NT_STATUS_OK;
1712 NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
1713 TALLOC_CTX *mem_ctx,
1714 struct policy_handle *handle /* [in] [ref] */,
1715 uint32_t enum_index /* [in] */,
1716 struct winreg_ValNameBuf *name /* [in,out] [ref] */,
1717 enum winreg_Type *type /* [in,out] [unique] */,
1718 uint8_t *value /* [in,out] [unique,length_is(*length),size_is(*size)] */,
1719 uint32_t *size /* [in,out] [unique] */,
1720 uint32_t *length /* [in,out] [unique] */,
1721 WERROR *werror)
1723 struct winreg_EnumValue r;
1724 NTSTATUS status;
1726 /* In parameters */
1727 r.in.handle = handle;
1728 r.in.enum_index = enum_index;
1729 r.in.name = name;
1730 r.in.type = type;
1731 r.in.value = value;
1732 r.in.size = size;
1733 r.in.length = length;
1735 status = cli->dispatch(cli,
1736 mem_ctx,
1737 &ndr_table_winreg,
1738 NDR_WINREG_ENUMVALUE,
1739 &r);
1741 if (!NT_STATUS_IS_OK(status)) {
1742 return status;
1745 if (NT_STATUS_IS_ERR(status)) {
1746 return status;
1749 /* Return variables */
1750 *name = *r.out.name;
1751 if (type && r.out.type) {
1752 *type = *r.out.type;
1754 if (value && r.out.value) {
1755 memcpy(value, r.out.value, (*r.in.size) * sizeof(*value));
1757 if (size && r.out.size) {
1758 *size = *r.out.size;
1760 if (length && r.out.length) {
1761 *length = *r.out.length;
1764 /* Return result */
1765 if (werror) {
1766 *werror = r.out.result;
1769 return werror_to_ntstatus(r.out.result);
1772 struct rpccli_winreg_FlushKey_state {
1773 struct winreg_FlushKey orig;
1774 struct winreg_FlushKey tmp;
1775 TALLOC_CTX *out_mem_ctx;
1776 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1779 static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq);
1781 struct tevent_req *rpccli_winreg_FlushKey_send(TALLOC_CTX *mem_ctx,
1782 struct tevent_context *ev,
1783 struct rpc_pipe_client *cli,
1784 struct policy_handle *_handle /* [in] [ref] */)
1786 struct tevent_req *req;
1787 struct rpccli_winreg_FlushKey_state *state;
1788 struct tevent_req *subreq;
1790 req = tevent_req_create(mem_ctx, &state,
1791 struct rpccli_winreg_FlushKey_state);
1792 if (req == NULL) {
1793 return NULL;
1795 state->out_mem_ctx = NULL;
1796 state->dispatch_recv = cli->dispatch_recv;
1798 /* In parameters */
1799 state->orig.in.handle = _handle;
1801 /* Out parameters */
1803 /* Result */
1804 ZERO_STRUCT(state->orig.out.result);
1806 /* make a temporary copy, that we pass to the dispatch function */
1807 state->tmp = state->orig;
1809 subreq = cli->dispatch_send(state, ev, cli,
1810 &ndr_table_winreg,
1811 NDR_WINREG_FLUSHKEY,
1812 &state->tmp);
1813 if (tevent_req_nomem(subreq, req)) {
1814 return tevent_req_post(req, ev);
1816 tevent_req_set_callback(subreq, rpccli_winreg_FlushKey_done, req);
1817 return req;
1820 static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq)
1822 struct tevent_req *req = tevent_req_callback_data(
1823 subreq, struct tevent_req);
1824 struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
1825 req, struct rpccli_winreg_FlushKey_state);
1826 NTSTATUS status;
1827 TALLOC_CTX *mem_ctx;
1829 if (state->out_mem_ctx) {
1830 mem_ctx = state->out_mem_ctx;
1831 } else {
1832 mem_ctx = state;
1835 status = state->dispatch_recv(subreq, mem_ctx);
1836 TALLOC_FREE(subreq);
1837 if (!NT_STATUS_IS_OK(status)) {
1838 tevent_req_nterror(req, status);
1839 return;
1842 /* Copy out parameters */
1844 /* Copy result */
1845 state->orig.out.result = state->tmp.out.result;
1847 /* Reset temporary structure */
1848 ZERO_STRUCT(state->tmp);
1850 tevent_req_done(req);
1853 NTSTATUS rpccli_winreg_FlushKey_recv(struct tevent_req *req,
1854 TALLOC_CTX *mem_ctx,
1855 WERROR *result)
1857 struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
1858 req, struct rpccli_winreg_FlushKey_state);
1859 NTSTATUS status;
1861 if (tevent_req_is_nterror(req, &status)) {
1862 tevent_req_received(req);
1863 return status;
1866 /* Steal possbile out parameters to the callers context */
1867 talloc_steal(mem_ctx, state->out_mem_ctx);
1869 /* Return result */
1870 *result = state->orig.out.result;
1872 tevent_req_received(req);
1873 return NT_STATUS_OK;
1876 NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli,
1877 TALLOC_CTX *mem_ctx,
1878 struct policy_handle *handle /* [in] [ref] */,
1879 WERROR *werror)
1881 struct winreg_FlushKey r;
1882 NTSTATUS status;
1884 /* In parameters */
1885 r.in.handle = handle;
1887 status = cli->dispatch(cli,
1888 mem_ctx,
1889 &ndr_table_winreg,
1890 NDR_WINREG_FLUSHKEY,
1891 &r);
1893 if (!NT_STATUS_IS_OK(status)) {
1894 return status;
1897 if (NT_STATUS_IS_ERR(status)) {
1898 return status;
1901 /* Return variables */
1903 /* Return result */
1904 if (werror) {
1905 *werror = r.out.result;
1908 return werror_to_ntstatus(r.out.result);
1911 struct rpccli_winreg_GetKeySecurity_state {
1912 struct winreg_GetKeySecurity orig;
1913 struct winreg_GetKeySecurity tmp;
1914 TALLOC_CTX *out_mem_ctx;
1915 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1918 static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq);
1920 struct tevent_req *rpccli_winreg_GetKeySecurity_send(TALLOC_CTX *mem_ctx,
1921 struct tevent_context *ev,
1922 struct rpc_pipe_client *cli,
1923 struct policy_handle *_handle /* [in] [ref] */,
1924 uint32_t _sec_info /* [in] */,
1925 struct KeySecurityData *_sd /* [in,out] [ref] */)
1927 struct tevent_req *req;
1928 struct rpccli_winreg_GetKeySecurity_state *state;
1929 struct tevent_req *subreq;
1931 req = tevent_req_create(mem_ctx, &state,
1932 struct rpccli_winreg_GetKeySecurity_state);
1933 if (req == NULL) {
1934 return NULL;
1936 state->out_mem_ctx = NULL;
1937 state->dispatch_recv = cli->dispatch_recv;
1939 /* In parameters */
1940 state->orig.in.handle = _handle;
1941 state->orig.in.sec_info = _sec_info;
1942 state->orig.in.sd = _sd;
1944 /* Out parameters */
1945 state->orig.out.sd = _sd;
1947 /* Result */
1948 ZERO_STRUCT(state->orig.out.result);
1950 state->out_mem_ctx = talloc_named_const(state, 0,
1951 "rpccli_winreg_GetKeySecurity_out_memory");
1952 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1953 return tevent_req_post(req, ev);
1956 /* make a temporary copy, that we pass to the dispatch function */
1957 state->tmp = state->orig;
1959 subreq = cli->dispatch_send(state, ev, cli,
1960 &ndr_table_winreg,
1961 NDR_WINREG_GETKEYSECURITY,
1962 &state->tmp);
1963 if (tevent_req_nomem(subreq, req)) {
1964 return tevent_req_post(req, ev);
1966 tevent_req_set_callback(subreq, rpccli_winreg_GetKeySecurity_done, req);
1967 return req;
1970 static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq)
1972 struct tevent_req *req = tevent_req_callback_data(
1973 subreq, struct tevent_req);
1974 struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
1975 req, struct rpccli_winreg_GetKeySecurity_state);
1976 NTSTATUS status;
1977 TALLOC_CTX *mem_ctx;
1979 if (state->out_mem_ctx) {
1980 mem_ctx = state->out_mem_ctx;
1981 } else {
1982 mem_ctx = state;
1985 status = state->dispatch_recv(subreq, mem_ctx);
1986 TALLOC_FREE(subreq);
1987 if (!NT_STATUS_IS_OK(status)) {
1988 tevent_req_nterror(req, status);
1989 return;
1992 /* Copy out parameters */
1993 *state->orig.out.sd = *state->tmp.out.sd;
1995 /* Copy result */
1996 state->orig.out.result = state->tmp.out.result;
1998 /* Reset temporary structure */
1999 ZERO_STRUCT(state->tmp);
2001 tevent_req_done(req);
2004 NTSTATUS rpccli_winreg_GetKeySecurity_recv(struct tevent_req *req,
2005 TALLOC_CTX *mem_ctx,
2006 WERROR *result)
2008 struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
2009 req, struct rpccli_winreg_GetKeySecurity_state);
2010 NTSTATUS status;
2012 if (tevent_req_is_nterror(req, &status)) {
2013 tevent_req_received(req);
2014 return status;
2017 /* Steal possbile out parameters to the callers context */
2018 talloc_steal(mem_ctx, state->out_mem_ctx);
2020 /* Return result */
2021 *result = state->orig.out.result;
2023 tevent_req_received(req);
2024 return NT_STATUS_OK;
2027 NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli,
2028 TALLOC_CTX *mem_ctx,
2029 struct policy_handle *handle /* [in] [ref] */,
2030 uint32_t sec_info /* [in] */,
2031 struct KeySecurityData *sd /* [in,out] [ref] */,
2032 WERROR *werror)
2034 struct winreg_GetKeySecurity r;
2035 NTSTATUS status;
2037 /* In parameters */
2038 r.in.handle = handle;
2039 r.in.sec_info = sec_info;
2040 r.in.sd = sd;
2042 status = cli->dispatch(cli,
2043 mem_ctx,
2044 &ndr_table_winreg,
2045 NDR_WINREG_GETKEYSECURITY,
2046 &r);
2048 if (!NT_STATUS_IS_OK(status)) {
2049 return status;
2052 if (NT_STATUS_IS_ERR(status)) {
2053 return status;
2056 /* Return variables */
2057 *sd = *r.out.sd;
2059 /* Return result */
2060 if (werror) {
2061 *werror = r.out.result;
2064 return werror_to_ntstatus(r.out.result);
2067 struct rpccli_winreg_LoadKey_state {
2068 struct winreg_LoadKey orig;
2069 struct winreg_LoadKey tmp;
2070 TALLOC_CTX *out_mem_ctx;
2071 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2074 static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq);
2076 struct tevent_req *rpccli_winreg_LoadKey_send(TALLOC_CTX *mem_ctx,
2077 struct tevent_context *ev,
2078 struct rpc_pipe_client *cli,
2079 struct policy_handle *_handle /* [in] [ref] */,
2080 struct winreg_String *_keyname /* [in] [unique] */,
2081 struct winreg_String *_filename /* [in] [unique] */)
2083 struct tevent_req *req;
2084 struct rpccli_winreg_LoadKey_state *state;
2085 struct tevent_req *subreq;
2087 req = tevent_req_create(mem_ctx, &state,
2088 struct rpccli_winreg_LoadKey_state);
2089 if (req == NULL) {
2090 return NULL;
2092 state->out_mem_ctx = NULL;
2093 state->dispatch_recv = cli->dispatch_recv;
2095 /* In parameters */
2096 state->orig.in.handle = _handle;
2097 state->orig.in.keyname = _keyname;
2098 state->orig.in.filename = _filename;
2100 /* Out parameters */
2102 /* Result */
2103 ZERO_STRUCT(state->orig.out.result);
2105 /* make a temporary copy, that we pass to the dispatch function */
2106 state->tmp = state->orig;
2108 subreq = cli->dispatch_send(state, ev, cli,
2109 &ndr_table_winreg,
2110 NDR_WINREG_LOADKEY,
2111 &state->tmp);
2112 if (tevent_req_nomem(subreq, req)) {
2113 return tevent_req_post(req, ev);
2115 tevent_req_set_callback(subreq, rpccli_winreg_LoadKey_done, req);
2116 return req;
2119 static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq)
2121 struct tevent_req *req = tevent_req_callback_data(
2122 subreq, struct tevent_req);
2123 struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
2124 req, struct rpccli_winreg_LoadKey_state);
2125 NTSTATUS status;
2126 TALLOC_CTX *mem_ctx;
2128 if (state->out_mem_ctx) {
2129 mem_ctx = state->out_mem_ctx;
2130 } else {
2131 mem_ctx = state;
2134 status = state->dispatch_recv(subreq, mem_ctx);
2135 TALLOC_FREE(subreq);
2136 if (!NT_STATUS_IS_OK(status)) {
2137 tevent_req_nterror(req, status);
2138 return;
2141 /* Copy out parameters */
2143 /* Copy result */
2144 state->orig.out.result = state->tmp.out.result;
2146 /* Reset temporary structure */
2147 ZERO_STRUCT(state->tmp);
2149 tevent_req_done(req);
2152 NTSTATUS rpccli_winreg_LoadKey_recv(struct tevent_req *req,
2153 TALLOC_CTX *mem_ctx,
2154 WERROR *result)
2156 struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
2157 req, struct rpccli_winreg_LoadKey_state);
2158 NTSTATUS status;
2160 if (tevent_req_is_nterror(req, &status)) {
2161 tevent_req_received(req);
2162 return status;
2165 /* Steal possbile out parameters to the callers context */
2166 talloc_steal(mem_ctx, state->out_mem_ctx);
2168 /* Return result */
2169 *result = state->orig.out.result;
2171 tevent_req_received(req);
2172 return NT_STATUS_OK;
2175 NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli,
2176 TALLOC_CTX *mem_ctx,
2177 struct policy_handle *handle /* [in] [ref] */,
2178 struct winreg_String *keyname /* [in] [unique] */,
2179 struct winreg_String *filename /* [in] [unique] */,
2180 WERROR *werror)
2182 struct winreg_LoadKey r;
2183 NTSTATUS status;
2185 /* In parameters */
2186 r.in.handle = handle;
2187 r.in.keyname = keyname;
2188 r.in.filename = filename;
2190 status = cli->dispatch(cli,
2191 mem_ctx,
2192 &ndr_table_winreg,
2193 NDR_WINREG_LOADKEY,
2194 &r);
2196 if (!NT_STATUS_IS_OK(status)) {
2197 return status;
2200 if (NT_STATUS_IS_ERR(status)) {
2201 return status;
2204 /* Return variables */
2206 /* Return result */
2207 if (werror) {
2208 *werror = r.out.result;
2211 return werror_to_ntstatus(r.out.result);
2214 struct rpccli_winreg_NotifyChangeKeyValue_state {
2215 struct winreg_NotifyChangeKeyValue orig;
2216 struct winreg_NotifyChangeKeyValue tmp;
2217 TALLOC_CTX *out_mem_ctx;
2218 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2221 static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq);
2223 struct tevent_req *rpccli_winreg_NotifyChangeKeyValue_send(TALLOC_CTX *mem_ctx,
2224 struct tevent_context *ev,
2225 struct rpc_pipe_client *cli,
2226 struct policy_handle *_handle /* [in] [ref] */,
2227 uint8_t _watch_subtree /* [in] */,
2228 uint32_t _notify_filter /* [in] */,
2229 uint32_t _unknown /* [in] */,
2230 struct winreg_String _string1 /* [in] */,
2231 struct winreg_String _string2 /* [in] */,
2232 uint32_t _unknown2 /* [in] */)
2234 struct tevent_req *req;
2235 struct rpccli_winreg_NotifyChangeKeyValue_state *state;
2236 struct tevent_req *subreq;
2238 req = tevent_req_create(mem_ctx, &state,
2239 struct rpccli_winreg_NotifyChangeKeyValue_state);
2240 if (req == NULL) {
2241 return NULL;
2243 state->out_mem_ctx = NULL;
2244 state->dispatch_recv = cli->dispatch_recv;
2246 /* In parameters */
2247 state->orig.in.handle = _handle;
2248 state->orig.in.watch_subtree = _watch_subtree;
2249 state->orig.in.notify_filter = _notify_filter;
2250 state->orig.in.unknown = _unknown;
2251 state->orig.in.string1 = _string1;
2252 state->orig.in.string2 = _string2;
2253 state->orig.in.unknown2 = _unknown2;
2255 /* Out parameters */
2257 /* Result */
2258 ZERO_STRUCT(state->orig.out.result);
2260 /* make a temporary copy, that we pass to the dispatch function */
2261 state->tmp = state->orig;
2263 subreq = cli->dispatch_send(state, ev, cli,
2264 &ndr_table_winreg,
2265 NDR_WINREG_NOTIFYCHANGEKEYVALUE,
2266 &state->tmp);
2267 if (tevent_req_nomem(subreq, req)) {
2268 return tevent_req_post(req, ev);
2270 tevent_req_set_callback(subreq, rpccli_winreg_NotifyChangeKeyValue_done, req);
2271 return req;
2274 static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq)
2276 struct tevent_req *req = tevent_req_callback_data(
2277 subreq, struct tevent_req);
2278 struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
2279 req, struct rpccli_winreg_NotifyChangeKeyValue_state);
2280 NTSTATUS status;
2281 TALLOC_CTX *mem_ctx;
2283 if (state->out_mem_ctx) {
2284 mem_ctx = state->out_mem_ctx;
2285 } else {
2286 mem_ctx = state;
2289 status = state->dispatch_recv(subreq, mem_ctx);
2290 TALLOC_FREE(subreq);
2291 if (!NT_STATUS_IS_OK(status)) {
2292 tevent_req_nterror(req, status);
2293 return;
2296 /* Copy out parameters */
2298 /* Copy result */
2299 state->orig.out.result = state->tmp.out.result;
2301 /* Reset temporary structure */
2302 ZERO_STRUCT(state->tmp);
2304 tevent_req_done(req);
2307 NTSTATUS rpccli_winreg_NotifyChangeKeyValue_recv(struct tevent_req *req,
2308 TALLOC_CTX *mem_ctx,
2309 WERROR *result)
2311 struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
2312 req, struct rpccli_winreg_NotifyChangeKeyValue_state);
2313 NTSTATUS status;
2315 if (tevent_req_is_nterror(req, &status)) {
2316 tevent_req_received(req);
2317 return status;
2320 /* Steal possbile out parameters to the callers context */
2321 talloc_steal(mem_ctx, state->out_mem_ctx);
2323 /* Return result */
2324 *result = state->orig.out.result;
2326 tevent_req_received(req);
2327 return NT_STATUS_OK;
2330 NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli,
2331 TALLOC_CTX *mem_ctx,
2332 struct policy_handle *handle /* [in] [ref] */,
2333 uint8_t watch_subtree /* [in] */,
2334 uint32_t notify_filter /* [in] */,
2335 uint32_t unknown /* [in] */,
2336 struct winreg_String string1 /* [in] */,
2337 struct winreg_String string2 /* [in] */,
2338 uint32_t unknown2 /* [in] */,
2339 WERROR *werror)
2341 struct winreg_NotifyChangeKeyValue r;
2342 NTSTATUS status;
2344 /* In parameters */
2345 r.in.handle = handle;
2346 r.in.watch_subtree = watch_subtree;
2347 r.in.notify_filter = notify_filter;
2348 r.in.unknown = unknown;
2349 r.in.string1 = string1;
2350 r.in.string2 = string2;
2351 r.in.unknown2 = unknown2;
2353 status = cli->dispatch(cli,
2354 mem_ctx,
2355 &ndr_table_winreg,
2356 NDR_WINREG_NOTIFYCHANGEKEYVALUE,
2357 &r);
2359 if (!NT_STATUS_IS_OK(status)) {
2360 return status;
2363 if (NT_STATUS_IS_ERR(status)) {
2364 return status;
2367 /* Return variables */
2369 /* Return result */
2370 if (werror) {
2371 *werror = r.out.result;
2374 return werror_to_ntstatus(r.out.result);
2377 struct rpccli_winreg_OpenKey_state {
2378 struct winreg_OpenKey orig;
2379 struct winreg_OpenKey tmp;
2380 TALLOC_CTX *out_mem_ctx;
2381 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2384 static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq);
2386 struct tevent_req *rpccli_winreg_OpenKey_send(TALLOC_CTX *mem_ctx,
2387 struct tevent_context *ev,
2388 struct rpc_pipe_client *cli,
2389 struct policy_handle *_parent_handle /* [in] [ref] */,
2390 struct winreg_String _keyname /* [in] */,
2391 uint32_t _unknown /* [in] */,
2392 uint32_t _access_mask /* [in] */,
2393 struct policy_handle *_handle /* [out] [ref] */)
2395 struct tevent_req *req;
2396 struct rpccli_winreg_OpenKey_state *state;
2397 struct tevent_req *subreq;
2399 req = tevent_req_create(mem_ctx, &state,
2400 struct rpccli_winreg_OpenKey_state);
2401 if (req == NULL) {
2402 return NULL;
2404 state->out_mem_ctx = NULL;
2405 state->dispatch_recv = cli->dispatch_recv;
2407 /* In parameters */
2408 state->orig.in.parent_handle = _parent_handle;
2409 state->orig.in.keyname = _keyname;
2410 state->orig.in.unknown = _unknown;
2411 state->orig.in.access_mask = _access_mask;
2413 /* Out parameters */
2414 state->orig.out.handle = _handle;
2416 /* Result */
2417 ZERO_STRUCT(state->orig.out.result);
2419 state->out_mem_ctx = talloc_named_const(state, 0,
2420 "rpccli_winreg_OpenKey_out_memory");
2421 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2422 return tevent_req_post(req, ev);
2425 /* make a temporary copy, that we pass to the dispatch function */
2426 state->tmp = state->orig;
2428 subreq = cli->dispatch_send(state, ev, cli,
2429 &ndr_table_winreg,
2430 NDR_WINREG_OPENKEY,
2431 &state->tmp);
2432 if (tevent_req_nomem(subreq, req)) {
2433 return tevent_req_post(req, ev);
2435 tevent_req_set_callback(subreq, rpccli_winreg_OpenKey_done, req);
2436 return req;
2439 static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq)
2441 struct tevent_req *req = tevent_req_callback_data(
2442 subreq, struct tevent_req);
2443 struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
2444 req, struct rpccli_winreg_OpenKey_state);
2445 NTSTATUS status;
2446 TALLOC_CTX *mem_ctx;
2448 if (state->out_mem_ctx) {
2449 mem_ctx = state->out_mem_ctx;
2450 } else {
2451 mem_ctx = state;
2454 status = state->dispatch_recv(subreq, mem_ctx);
2455 TALLOC_FREE(subreq);
2456 if (!NT_STATUS_IS_OK(status)) {
2457 tevent_req_nterror(req, status);
2458 return;
2461 /* Copy out parameters */
2462 *state->orig.out.handle = *state->tmp.out.handle;
2464 /* Copy result */
2465 state->orig.out.result = state->tmp.out.result;
2467 /* Reset temporary structure */
2468 ZERO_STRUCT(state->tmp);
2470 tevent_req_done(req);
2473 NTSTATUS rpccli_winreg_OpenKey_recv(struct tevent_req *req,
2474 TALLOC_CTX *mem_ctx,
2475 WERROR *result)
2477 struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
2478 req, struct rpccli_winreg_OpenKey_state);
2479 NTSTATUS status;
2481 if (tevent_req_is_nterror(req, &status)) {
2482 tevent_req_received(req);
2483 return status;
2486 /* Steal possbile out parameters to the callers context */
2487 talloc_steal(mem_ctx, state->out_mem_ctx);
2489 /* Return result */
2490 *result = state->orig.out.result;
2492 tevent_req_received(req);
2493 return NT_STATUS_OK;
2496 NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli,
2497 TALLOC_CTX *mem_ctx,
2498 struct policy_handle *parent_handle /* [in] [ref] */,
2499 struct winreg_String keyname /* [in] */,
2500 uint32_t unknown /* [in] */,
2501 uint32_t access_mask /* [in] */,
2502 struct policy_handle *handle /* [out] [ref] */,
2503 WERROR *werror)
2505 struct winreg_OpenKey r;
2506 NTSTATUS status;
2508 /* In parameters */
2509 r.in.parent_handle = parent_handle;
2510 r.in.keyname = keyname;
2511 r.in.unknown = unknown;
2512 r.in.access_mask = access_mask;
2514 status = cli->dispatch(cli,
2515 mem_ctx,
2516 &ndr_table_winreg,
2517 NDR_WINREG_OPENKEY,
2518 &r);
2520 if (!NT_STATUS_IS_OK(status)) {
2521 return status;
2524 if (NT_STATUS_IS_ERR(status)) {
2525 return status;
2528 /* Return variables */
2529 *handle = *r.out.handle;
2531 /* Return result */
2532 if (werror) {
2533 *werror = r.out.result;
2536 return werror_to_ntstatus(r.out.result);
2539 struct rpccli_winreg_QueryInfoKey_state {
2540 struct winreg_QueryInfoKey orig;
2541 struct winreg_QueryInfoKey tmp;
2542 TALLOC_CTX *out_mem_ctx;
2543 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2546 static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq);
2548 struct tevent_req *rpccli_winreg_QueryInfoKey_send(TALLOC_CTX *mem_ctx,
2549 struct tevent_context *ev,
2550 struct rpc_pipe_client *cli,
2551 struct policy_handle *_handle /* [in] [ref] */,
2552 struct winreg_String *_classname /* [in,out] [ref] */,
2553 uint32_t *_num_subkeys /* [out] [ref] */,
2554 uint32_t *_max_subkeylen /* [out] [ref] */,
2555 uint32_t *_max_classlen /* [out] [ref] */,
2556 uint32_t *_num_values /* [out] [ref] */,
2557 uint32_t *_max_valnamelen /* [out] [ref] */,
2558 uint32_t *_max_valbufsize /* [out] [ref] */,
2559 uint32_t *_secdescsize /* [out] [ref] */,
2560 NTTIME *_last_changed_time /* [out] [ref] */)
2562 struct tevent_req *req;
2563 struct rpccli_winreg_QueryInfoKey_state *state;
2564 struct tevent_req *subreq;
2566 req = tevent_req_create(mem_ctx, &state,
2567 struct rpccli_winreg_QueryInfoKey_state);
2568 if (req == NULL) {
2569 return NULL;
2571 state->out_mem_ctx = NULL;
2572 state->dispatch_recv = cli->dispatch_recv;
2574 /* In parameters */
2575 state->orig.in.handle = _handle;
2576 state->orig.in.classname = _classname;
2578 /* Out parameters */
2579 state->orig.out.classname = _classname;
2580 state->orig.out.num_subkeys = _num_subkeys;
2581 state->orig.out.max_subkeylen = _max_subkeylen;
2582 state->orig.out.max_classlen = _max_classlen;
2583 state->orig.out.num_values = _num_values;
2584 state->orig.out.max_valnamelen = _max_valnamelen;
2585 state->orig.out.max_valbufsize = _max_valbufsize;
2586 state->orig.out.secdescsize = _secdescsize;
2587 state->orig.out.last_changed_time = _last_changed_time;
2589 /* Result */
2590 ZERO_STRUCT(state->orig.out.result);
2592 state->out_mem_ctx = talloc_named_const(state, 0,
2593 "rpccli_winreg_QueryInfoKey_out_memory");
2594 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2595 return tevent_req_post(req, ev);
2598 /* make a temporary copy, that we pass to the dispatch function */
2599 state->tmp = state->orig;
2601 subreq = cli->dispatch_send(state, ev, cli,
2602 &ndr_table_winreg,
2603 NDR_WINREG_QUERYINFOKEY,
2604 &state->tmp);
2605 if (tevent_req_nomem(subreq, req)) {
2606 return tevent_req_post(req, ev);
2608 tevent_req_set_callback(subreq, rpccli_winreg_QueryInfoKey_done, req);
2609 return req;
2612 static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq)
2614 struct tevent_req *req = tevent_req_callback_data(
2615 subreq, struct tevent_req);
2616 struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
2617 req, struct rpccli_winreg_QueryInfoKey_state);
2618 NTSTATUS status;
2619 TALLOC_CTX *mem_ctx;
2621 if (state->out_mem_ctx) {
2622 mem_ctx = state->out_mem_ctx;
2623 } else {
2624 mem_ctx = state;
2627 status = state->dispatch_recv(subreq, mem_ctx);
2628 TALLOC_FREE(subreq);
2629 if (!NT_STATUS_IS_OK(status)) {
2630 tevent_req_nterror(req, status);
2631 return;
2634 /* Copy out parameters */
2635 *state->orig.out.classname = *state->tmp.out.classname;
2636 *state->orig.out.num_subkeys = *state->tmp.out.num_subkeys;
2637 *state->orig.out.max_subkeylen = *state->tmp.out.max_subkeylen;
2638 *state->orig.out.max_classlen = *state->tmp.out.max_classlen;
2639 *state->orig.out.num_values = *state->tmp.out.num_values;
2640 *state->orig.out.max_valnamelen = *state->tmp.out.max_valnamelen;
2641 *state->orig.out.max_valbufsize = *state->tmp.out.max_valbufsize;
2642 *state->orig.out.secdescsize = *state->tmp.out.secdescsize;
2643 *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
2645 /* Copy result */
2646 state->orig.out.result = state->tmp.out.result;
2648 /* Reset temporary structure */
2649 ZERO_STRUCT(state->tmp);
2651 tevent_req_done(req);
2654 NTSTATUS rpccli_winreg_QueryInfoKey_recv(struct tevent_req *req,
2655 TALLOC_CTX *mem_ctx,
2656 WERROR *result)
2658 struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
2659 req, struct rpccli_winreg_QueryInfoKey_state);
2660 NTSTATUS status;
2662 if (tevent_req_is_nterror(req, &status)) {
2663 tevent_req_received(req);
2664 return status;
2667 /* Steal possbile out parameters to the callers context */
2668 talloc_steal(mem_ctx, state->out_mem_ctx);
2670 /* Return result */
2671 *result = state->orig.out.result;
2673 tevent_req_received(req);
2674 return NT_STATUS_OK;
2677 NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
2678 TALLOC_CTX *mem_ctx,
2679 struct policy_handle *handle /* [in] [ref] */,
2680 struct winreg_String *classname /* [in,out] [ref] */,
2681 uint32_t *num_subkeys /* [out] [ref] */,
2682 uint32_t *max_subkeylen /* [out] [ref] */,
2683 uint32_t *max_classlen /* [out] [ref] */,
2684 uint32_t *num_values /* [out] [ref] */,
2685 uint32_t *max_valnamelen /* [out] [ref] */,
2686 uint32_t *max_valbufsize /* [out] [ref] */,
2687 uint32_t *secdescsize /* [out] [ref] */,
2688 NTTIME *last_changed_time /* [out] [ref] */,
2689 WERROR *werror)
2691 struct winreg_QueryInfoKey r;
2692 NTSTATUS status;
2694 /* In parameters */
2695 r.in.handle = handle;
2696 r.in.classname = classname;
2698 status = cli->dispatch(cli,
2699 mem_ctx,
2700 &ndr_table_winreg,
2701 NDR_WINREG_QUERYINFOKEY,
2702 &r);
2704 if (!NT_STATUS_IS_OK(status)) {
2705 return status;
2708 if (NT_STATUS_IS_ERR(status)) {
2709 return status;
2712 /* Return variables */
2713 *classname = *r.out.classname;
2714 *num_subkeys = *r.out.num_subkeys;
2715 *max_subkeylen = *r.out.max_subkeylen;
2716 *max_classlen = *r.out.max_classlen;
2717 *num_values = *r.out.num_values;
2718 *max_valnamelen = *r.out.max_valnamelen;
2719 *max_valbufsize = *r.out.max_valbufsize;
2720 *secdescsize = *r.out.secdescsize;
2721 *last_changed_time = *r.out.last_changed_time;
2723 /* Return result */
2724 if (werror) {
2725 *werror = r.out.result;
2728 return werror_to_ntstatus(r.out.result);
2731 struct rpccli_winreg_QueryValue_state {
2732 struct winreg_QueryValue orig;
2733 struct winreg_QueryValue tmp;
2734 TALLOC_CTX *out_mem_ctx;
2735 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2738 static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq);
2740 struct tevent_req *rpccli_winreg_QueryValue_send(TALLOC_CTX *mem_ctx,
2741 struct tevent_context *ev,
2742 struct rpc_pipe_client *cli,
2743 struct policy_handle *_handle /* [in] [ref] */,
2744 struct winreg_String *_value_name /* [in] [ref] */,
2745 enum winreg_Type *_type /* [in,out] [unique] */,
2746 uint8_t *_data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */,
2747 uint32_t *_data_size /* [in,out] [unique] */,
2748 uint32_t *_data_length /* [in,out] [unique] */)
2750 struct tevent_req *req;
2751 struct rpccli_winreg_QueryValue_state *state;
2752 struct tevent_req *subreq;
2754 req = tevent_req_create(mem_ctx, &state,
2755 struct rpccli_winreg_QueryValue_state);
2756 if (req == NULL) {
2757 return NULL;
2759 state->out_mem_ctx = NULL;
2760 state->dispatch_recv = cli->dispatch_recv;
2762 /* In parameters */
2763 state->orig.in.handle = _handle;
2764 state->orig.in.value_name = _value_name;
2765 state->orig.in.type = _type;
2766 state->orig.in.data = _data;
2767 state->orig.in.data_size = _data_size;
2768 state->orig.in.data_length = _data_length;
2770 /* Out parameters */
2771 state->orig.out.type = _type;
2772 state->orig.out.data = _data;
2773 state->orig.out.data_size = _data_size;
2774 state->orig.out.data_length = _data_length;
2776 /* Result */
2777 ZERO_STRUCT(state->orig.out.result);
2779 state->out_mem_ctx = talloc_named_const(state, 0,
2780 "rpccli_winreg_QueryValue_out_memory");
2781 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2782 return tevent_req_post(req, ev);
2785 /* make a temporary copy, that we pass to the dispatch function */
2786 state->tmp = state->orig;
2788 subreq = cli->dispatch_send(state, ev, cli,
2789 &ndr_table_winreg,
2790 NDR_WINREG_QUERYVALUE,
2791 &state->tmp);
2792 if (tevent_req_nomem(subreq, req)) {
2793 return tevent_req_post(req, ev);
2795 tevent_req_set_callback(subreq, rpccli_winreg_QueryValue_done, req);
2796 return req;
2799 static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq)
2801 struct tevent_req *req = tevent_req_callback_data(
2802 subreq, struct tevent_req);
2803 struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
2804 req, struct rpccli_winreg_QueryValue_state);
2805 NTSTATUS status;
2806 TALLOC_CTX *mem_ctx;
2808 if (state->out_mem_ctx) {
2809 mem_ctx = state->out_mem_ctx;
2810 } else {
2811 mem_ctx = state;
2814 status = state->dispatch_recv(subreq, mem_ctx);
2815 TALLOC_FREE(subreq);
2816 if (!NT_STATUS_IS_OK(status)) {
2817 tevent_req_nterror(req, status);
2818 return;
2821 /* Copy out parameters */
2822 if (state->orig.out.type && state->tmp.out.type) {
2823 *state->orig.out.type = *state->tmp.out.type;
2825 if (state->orig.out.data && state->tmp.out.data) {
2826 memcpy(state->orig.out.data, state->tmp.out.data, (*state->tmp.in.data_size) * sizeof(*state->orig.out.data));
2828 if (state->orig.out.data_size && state->tmp.out.data_size) {
2829 *state->orig.out.data_size = *state->tmp.out.data_size;
2831 if (state->orig.out.data_length && state->tmp.out.data_length) {
2832 *state->orig.out.data_length = *state->tmp.out.data_length;
2835 /* Copy result */
2836 state->orig.out.result = state->tmp.out.result;
2838 /* Reset temporary structure */
2839 ZERO_STRUCT(state->tmp);
2841 tevent_req_done(req);
2844 NTSTATUS rpccli_winreg_QueryValue_recv(struct tevent_req *req,
2845 TALLOC_CTX *mem_ctx,
2846 WERROR *result)
2848 struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
2849 req, struct rpccli_winreg_QueryValue_state);
2850 NTSTATUS status;
2852 if (tevent_req_is_nterror(req, &status)) {
2853 tevent_req_received(req);
2854 return status;
2857 /* Steal possbile out parameters to the callers context */
2858 talloc_steal(mem_ctx, state->out_mem_ctx);
2860 /* Return result */
2861 *result = state->orig.out.result;
2863 tevent_req_received(req);
2864 return NT_STATUS_OK;
2867 NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
2868 TALLOC_CTX *mem_ctx,
2869 struct policy_handle *handle /* [in] [ref] */,
2870 struct winreg_String *value_name /* [in] [ref] */,
2871 enum winreg_Type *type /* [in,out] [unique] */,
2872 uint8_t *data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */,
2873 uint32_t *data_size /* [in,out] [unique] */,
2874 uint32_t *data_length /* [in,out] [unique] */,
2875 WERROR *werror)
2877 struct winreg_QueryValue r;
2878 NTSTATUS status;
2880 /* In parameters */
2881 r.in.handle = handle;
2882 r.in.value_name = value_name;
2883 r.in.type = type;
2884 r.in.data = data;
2885 r.in.data_size = data_size;
2886 r.in.data_length = data_length;
2888 status = cli->dispatch(cli,
2889 mem_ctx,
2890 &ndr_table_winreg,
2891 NDR_WINREG_QUERYVALUE,
2892 &r);
2894 if (!NT_STATUS_IS_OK(status)) {
2895 return status;
2898 if (NT_STATUS_IS_ERR(status)) {
2899 return status;
2902 /* Return variables */
2903 if (type && r.out.type) {
2904 *type = *r.out.type;
2906 if (data && r.out.data) {
2907 memcpy(data, r.out.data, (*r.in.data_size) * sizeof(*data));
2909 if (data_size && r.out.data_size) {
2910 *data_size = *r.out.data_size;
2912 if (data_length && r.out.data_length) {
2913 *data_length = *r.out.data_length;
2916 /* Return result */
2917 if (werror) {
2918 *werror = r.out.result;
2921 return werror_to_ntstatus(r.out.result);
2924 struct rpccli_winreg_ReplaceKey_state {
2925 struct winreg_ReplaceKey orig;
2926 struct winreg_ReplaceKey tmp;
2927 TALLOC_CTX *out_mem_ctx;
2928 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2931 static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq);
2933 struct tevent_req *rpccli_winreg_ReplaceKey_send(TALLOC_CTX *mem_ctx,
2934 struct tevent_context *ev,
2935 struct rpc_pipe_client *cli)
2937 struct tevent_req *req;
2938 struct rpccli_winreg_ReplaceKey_state *state;
2939 struct tevent_req *subreq;
2941 req = tevent_req_create(mem_ctx, &state,
2942 struct rpccli_winreg_ReplaceKey_state);
2943 if (req == NULL) {
2944 return NULL;
2946 state->out_mem_ctx = NULL;
2947 state->dispatch_recv = cli->dispatch_recv;
2949 /* In parameters */
2951 /* Out parameters */
2953 /* Result */
2954 ZERO_STRUCT(state->orig.out.result);
2956 /* make a temporary copy, that we pass to the dispatch function */
2957 state->tmp = state->orig;
2959 subreq = cli->dispatch_send(state, ev, cli,
2960 &ndr_table_winreg,
2961 NDR_WINREG_REPLACEKEY,
2962 &state->tmp);
2963 if (tevent_req_nomem(subreq, req)) {
2964 return tevent_req_post(req, ev);
2966 tevent_req_set_callback(subreq, rpccli_winreg_ReplaceKey_done, req);
2967 return req;
2970 static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq)
2972 struct tevent_req *req = tevent_req_callback_data(
2973 subreq, struct tevent_req);
2974 struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
2975 req, struct rpccli_winreg_ReplaceKey_state);
2976 NTSTATUS status;
2977 TALLOC_CTX *mem_ctx;
2979 if (state->out_mem_ctx) {
2980 mem_ctx = state->out_mem_ctx;
2981 } else {
2982 mem_ctx = state;
2985 status = state->dispatch_recv(subreq, mem_ctx);
2986 TALLOC_FREE(subreq);
2987 if (!NT_STATUS_IS_OK(status)) {
2988 tevent_req_nterror(req, status);
2989 return;
2992 /* Copy out parameters */
2994 /* Copy result */
2995 state->orig.out.result = state->tmp.out.result;
2997 /* Reset temporary structure */
2998 ZERO_STRUCT(state->tmp);
3000 tevent_req_done(req);
3003 NTSTATUS rpccli_winreg_ReplaceKey_recv(struct tevent_req *req,
3004 TALLOC_CTX *mem_ctx,
3005 WERROR *result)
3007 struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
3008 req, struct rpccli_winreg_ReplaceKey_state);
3009 NTSTATUS status;
3011 if (tevent_req_is_nterror(req, &status)) {
3012 tevent_req_received(req);
3013 return status;
3016 /* Steal possbile out parameters to the callers context */
3017 talloc_steal(mem_ctx, state->out_mem_ctx);
3019 /* Return result */
3020 *result = state->orig.out.result;
3022 tevent_req_received(req);
3023 return NT_STATUS_OK;
3026 NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli,
3027 TALLOC_CTX *mem_ctx,
3028 WERROR *werror)
3030 struct winreg_ReplaceKey r;
3031 NTSTATUS status;
3033 /* In parameters */
3035 status = cli->dispatch(cli,
3036 mem_ctx,
3037 &ndr_table_winreg,
3038 NDR_WINREG_REPLACEKEY,
3039 &r);
3041 if (!NT_STATUS_IS_OK(status)) {
3042 return status;
3045 if (NT_STATUS_IS_ERR(status)) {
3046 return status;
3049 /* Return variables */
3051 /* Return result */
3052 if (werror) {
3053 *werror = r.out.result;
3056 return werror_to_ntstatus(r.out.result);
3059 struct rpccli_winreg_RestoreKey_state {
3060 struct winreg_RestoreKey orig;
3061 struct winreg_RestoreKey tmp;
3062 TALLOC_CTX *out_mem_ctx;
3063 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3066 static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq);
3068 struct tevent_req *rpccli_winreg_RestoreKey_send(TALLOC_CTX *mem_ctx,
3069 struct tevent_context *ev,
3070 struct rpc_pipe_client *cli,
3071 struct policy_handle *_handle /* [in] [ref] */,
3072 struct winreg_String *_filename /* [in] [ref] */,
3073 uint32_t _flags /* [in] */)
3075 struct tevent_req *req;
3076 struct rpccli_winreg_RestoreKey_state *state;
3077 struct tevent_req *subreq;
3079 req = tevent_req_create(mem_ctx, &state,
3080 struct rpccli_winreg_RestoreKey_state);
3081 if (req == NULL) {
3082 return NULL;
3084 state->out_mem_ctx = NULL;
3085 state->dispatch_recv = cli->dispatch_recv;
3087 /* In parameters */
3088 state->orig.in.handle = _handle;
3089 state->orig.in.filename = _filename;
3090 state->orig.in.flags = _flags;
3092 /* Out parameters */
3094 /* Result */
3095 ZERO_STRUCT(state->orig.out.result);
3097 /* make a temporary copy, that we pass to the dispatch function */
3098 state->tmp = state->orig;
3100 subreq = cli->dispatch_send(state, ev, cli,
3101 &ndr_table_winreg,
3102 NDR_WINREG_RESTOREKEY,
3103 &state->tmp);
3104 if (tevent_req_nomem(subreq, req)) {
3105 return tevent_req_post(req, ev);
3107 tevent_req_set_callback(subreq, rpccli_winreg_RestoreKey_done, req);
3108 return req;
3111 static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq)
3113 struct tevent_req *req = tevent_req_callback_data(
3114 subreq, struct tevent_req);
3115 struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
3116 req, struct rpccli_winreg_RestoreKey_state);
3117 NTSTATUS status;
3118 TALLOC_CTX *mem_ctx;
3120 if (state->out_mem_ctx) {
3121 mem_ctx = state->out_mem_ctx;
3122 } else {
3123 mem_ctx = state;
3126 status = state->dispatch_recv(subreq, mem_ctx);
3127 TALLOC_FREE(subreq);
3128 if (!NT_STATUS_IS_OK(status)) {
3129 tevent_req_nterror(req, status);
3130 return;
3133 /* Copy out parameters */
3135 /* Copy result */
3136 state->orig.out.result = state->tmp.out.result;
3138 /* Reset temporary structure */
3139 ZERO_STRUCT(state->tmp);
3141 tevent_req_done(req);
3144 NTSTATUS rpccli_winreg_RestoreKey_recv(struct tevent_req *req,
3145 TALLOC_CTX *mem_ctx,
3146 WERROR *result)
3148 struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
3149 req, struct rpccli_winreg_RestoreKey_state);
3150 NTSTATUS status;
3152 if (tevent_req_is_nterror(req, &status)) {
3153 tevent_req_received(req);
3154 return status;
3157 /* Steal possbile out parameters to the callers context */
3158 talloc_steal(mem_ctx, state->out_mem_ctx);
3160 /* Return result */
3161 *result = state->orig.out.result;
3163 tevent_req_received(req);
3164 return NT_STATUS_OK;
3167 NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli,
3168 TALLOC_CTX *mem_ctx,
3169 struct policy_handle *handle /* [in] [ref] */,
3170 struct winreg_String *filename /* [in] [ref] */,
3171 uint32_t flags /* [in] */,
3172 WERROR *werror)
3174 struct winreg_RestoreKey r;
3175 NTSTATUS status;
3177 /* In parameters */
3178 r.in.handle = handle;
3179 r.in.filename = filename;
3180 r.in.flags = flags;
3182 status = cli->dispatch(cli,
3183 mem_ctx,
3184 &ndr_table_winreg,
3185 NDR_WINREG_RESTOREKEY,
3186 &r);
3188 if (!NT_STATUS_IS_OK(status)) {
3189 return status;
3192 if (NT_STATUS_IS_ERR(status)) {
3193 return status;
3196 /* Return variables */
3198 /* Return result */
3199 if (werror) {
3200 *werror = r.out.result;
3203 return werror_to_ntstatus(r.out.result);
3206 struct rpccli_winreg_SaveKey_state {
3207 struct winreg_SaveKey orig;
3208 struct winreg_SaveKey tmp;
3209 TALLOC_CTX *out_mem_ctx;
3210 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3213 static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq);
3215 struct tevent_req *rpccli_winreg_SaveKey_send(TALLOC_CTX *mem_ctx,
3216 struct tevent_context *ev,
3217 struct rpc_pipe_client *cli,
3218 struct policy_handle *_handle /* [in] [ref] */,
3219 struct winreg_String *_filename /* [in] [ref] */,
3220 struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */)
3222 struct tevent_req *req;
3223 struct rpccli_winreg_SaveKey_state *state;
3224 struct tevent_req *subreq;
3226 req = tevent_req_create(mem_ctx, &state,
3227 struct rpccli_winreg_SaveKey_state);
3228 if (req == NULL) {
3229 return NULL;
3231 state->out_mem_ctx = NULL;
3232 state->dispatch_recv = cli->dispatch_recv;
3234 /* In parameters */
3235 state->orig.in.handle = _handle;
3236 state->orig.in.filename = _filename;
3237 state->orig.in.sec_attrib = _sec_attrib;
3239 /* Out parameters */
3241 /* Result */
3242 ZERO_STRUCT(state->orig.out.result);
3244 /* make a temporary copy, that we pass to the dispatch function */
3245 state->tmp = state->orig;
3247 subreq = cli->dispatch_send(state, ev, cli,
3248 &ndr_table_winreg,
3249 NDR_WINREG_SAVEKEY,
3250 &state->tmp);
3251 if (tevent_req_nomem(subreq, req)) {
3252 return tevent_req_post(req, ev);
3254 tevent_req_set_callback(subreq, rpccli_winreg_SaveKey_done, req);
3255 return req;
3258 static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq)
3260 struct tevent_req *req = tevent_req_callback_data(
3261 subreq, struct tevent_req);
3262 struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
3263 req, struct rpccli_winreg_SaveKey_state);
3264 NTSTATUS status;
3265 TALLOC_CTX *mem_ctx;
3267 if (state->out_mem_ctx) {
3268 mem_ctx = state->out_mem_ctx;
3269 } else {
3270 mem_ctx = state;
3273 status = state->dispatch_recv(subreq, mem_ctx);
3274 TALLOC_FREE(subreq);
3275 if (!NT_STATUS_IS_OK(status)) {
3276 tevent_req_nterror(req, status);
3277 return;
3280 /* Copy out parameters */
3282 /* Copy result */
3283 state->orig.out.result = state->tmp.out.result;
3285 /* Reset temporary structure */
3286 ZERO_STRUCT(state->tmp);
3288 tevent_req_done(req);
3291 NTSTATUS rpccli_winreg_SaveKey_recv(struct tevent_req *req,
3292 TALLOC_CTX *mem_ctx,
3293 WERROR *result)
3295 struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
3296 req, struct rpccli_winreg_SaveKey_state);
3297 NTSTATUS status;
3299 if (tevent_req_is_nterror(req, &status)) {
3300 tevent_req_received(req);
3301 return status;
3304 /* Steal possbile out parameters to the callers context */
3305 talloc_steal(mem_ctx, state->out_mem_ctx);
3307 /* Return result */
3308 *result = state->orig.out.result;
3310 tevent_req_received(req);
3311 return NT_STATUS_OK;
3314 NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
3315 TALLOC_CTX *mem_ctx,
3316 struct policy_handle *handle /* [in] [ref] */,
3317 struct winreg_String *filename /* [in] [ref] */,
3318 struct KeySecurityAttribute *sec_attrib /* [in] [unique] */,
3319 WERROR *werror)
3321 struct winreg_SaveKey r;
3322 NTSTATUS status;
3324 /* In parameters */
3325 r.in.handle = handle;
3326 r.in.filename = filename;
3327 r.in.sec_attrib = sec_attrib;
3329 status = cli->dispatch(cli,
3330 mem_ctx,
3331 &ndr_table_winreg,
3332 NDR_WINREG_SAVEKEY,
3333 &r);
3335 if (!NT_STATUS_IS_OK(status)) {
3336 return status;
3339 if (NT_STATUS_IS_ERR(status)) {
3340 return status;
3343 /* Return variables */
3345 /* Return result */
3346 if (werror) {
3347 *werror = r.out.result;
3350 return werror_to_ntstatus(r.out.result);
3353 struct rpccli_winreg_SetKeySecurity_state {
3354 struct winreg_SetKeySecurity orig;
3355 struct winreg_SetKeySecurity tmp;
3356 TALLOC_CTX *out_mem_ctx;
3357 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3360 static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq);
3362 struct tevent_req *rpccli_winreg_SetKeySecurity_send(TALLOC_CTX *mem_ctx,
3363 struct tevent_context *ev,
3364 struct rpc_pipe_client *cli,
3365 struct policy_handle *_handle /* [in] [ref] */,
3366 uint32_t _sec_info /* [in] */,
3367 struct KeySecurityData *_sd /* [in] [ref] */)
3369 struct tevent_req *req;
3370 struct rpccli_winreg_SetKeySecurity_state *state;
3371 struct tevent_req *subreq;
3373 req = tevent_req_create(mem_ctx, &state,
3374 struct rpccli_winreg_SetKeySecurity_state);
3375 if (req == NULL) {
3376 return NULL;
3378 state->out_mem_ctx = NULL;
3379 state->dispatch_recv = cli->dispatch_recv;
3381 /* In parameters */
3382 state->orig.in.handle = _handle;
3383 state->orig.in.sec_info = _sec_info;
3384 state->orig.in.sd = _sd;
3386 /* Out parameters */
3388 /* Result */
3389 ZERO_STRUCT(state->orig.out.result);
3391 /* make a temporary copy, that we pass to the dispatch function */
3392 state->tmp = state->orig;
3394 subreq = cli->dispatch_send(state, ev, cli,
3395 &ndr_table_winreg,
3396 NDR_WINREG_SETKEYSECURITY,
3397 &state->tmp);
3398 if (tevent_req_nomem(subreq, req)) {
3399 return tevent_req_post(req, ev);
3401 tevent_req_set_callback(subreq, rpccli_winreg_SetKeySecurity_done, req);
3402 return req;
3405 static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq)
3407 struct tevent_req *req = tevent_req_callback_data(
3408 subreq, struct tevent_req);
3409 struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
3410 req, struct rpccli_winreg_SetKeySecurity_state);
3411 NTSTATUS status;
3412 TALLOC_CTX *mem_ctx;
3414 if (state->out_mem_ctx) {
3415 mem_ctx = state->out_mem_ctx;
3416 } else {
3417 mem_ctx = state;
3420 status = state->dispatch_recv(subreq, mem_ctx);
3421 TALLOC_FREE(subreq);
3422 if (!NT_STATUS_IS_OK(status)) {
3423 tevent_req_nterror(req, status);
3424 return;
3427 /* Copy out parameters */
3429 /* Copy result */
3430 state->orig.out.result = state->tmp.out.result;
3432 /* Reset temporary structure */
3433 ZERO_STRUCT(state->tmp);
3435 tevent_req_done(req);
3438 NTSTATUS rpccli_winreg_SetKeySecurity_recv(struct tevent_req *req,
3439 TALLOC_CTX *mem_ctx,
3440 WERROR *result)
3442 struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
3443 req, struct rpccli_winreg_SetKeySecurity_state);
3444 NTSTATUS status;
3446 if (tevent_req_is_nterror(req, &status)) {
3447 tevent_req_received(req);
3448 return status;
3451 /* Steal possbile out parameters to the callers context */
3452 talloc_steal(mem_ctx, state->out_mem_ctx);
3454 /* Return result */
3455 *result = state->orig.out.result;
3457 tevent_req_received(req);
3458 return NT_STATUS_OK;
3461 NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
3462 TALLOC_CTX *mem_ctx,
3463 struct policy_handle *handle /* [in] [ref] */,
3464 uint32_t sec_info /* [in] */,
3465 struct KeySecurityData *sd /* [in] [ref] */,
3466 WERROR *werror)
3468 struct winreg_SetKeySecurity r;
3469 NTSTATUS status;
3471 /* In parameters */
3472 r.in.handle = handle;
3473 r.in.sec_info = sec_info;
3474 r.in.sd = sd;
3476 status = cli->dispatch(cli,
3477 mem_ctx,
3478 &ndr_table_winreg,
3479 NDR_WINREG_SETKEYSECURITY,
3480 &r);
3482 if (!NT_STATUS_IS_OK(status)) {
3483 return status;
3486 if (NT_STATUS_IS_ERR(status)) {
3487 return status;
3490 /* Return variables */
3492 /* Return result */
3493 if (werror) {
3494 *werror = r.out.result;
3497 return werror_to_ntstatus(r.out.result);
3500 struct rpccli_winreg_SetValue_state {
3501 struct winreg_SetValue orig;
3502 struct winreg_SetValue tmp;
3503 TALLOC_CTX *out_mem_ctx;
3504 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3507 static void rpccli_winreg_SetValue_done(struct tevent_req *subreq);
3509 struct tevent_req *rpccli_winreg_SetValue_send(TALLOC_CTX *mem_ctx,
3510 struct tevent_context *ev,
3511 struct rpc_pipe_client *cli,
3512 struct policy_handle *_handle /* [in] [ref] */,
3513 struct winreg_String _name /* [in] */,
3514 enum winreg_Type _type /* [in] */,
3515 uint8_t *_data /* [in] [ref,size_is(size)] */,
3516 uint32_t _size /* [in] */)
3518 struct tevent_req *req;
3519 struct rpccli_winreg_SetValue_state *state;
3520 struct tevent_req *subreq;
3522 req = tevent_req_create(mem_ctx, &state,
3523 struct rpccli_winreg_SetValue_state);
3524 if (req == NULL) {
3525 return NULL;
3527 state->out_mem_ctx = NULL;
3528 state->dispatch_recv = cli->dispatch_recv;
3530 /* In parameters */
3531 state->orig.in.handle = _handle;
3532 state->orig.in.name = _name;
3533 state->orig.in.type = _type;
3534 state->orig.in.data = _data;
3535 state->orig.in.size = _size;
3537 /* Out parameters */
3539 /* Result */
3540 ZERO_STRUCT(state->orig.out.result);
3542 /* make a temporary copy, that we pass to the dispatch function */
3543 state->tmp = state->orig;
3545 subreq = cli->dispatch_send(state, ev, cli,
3546 &ndr_table_winreg,
3547 NDR_WINREG_SETVALUE,
3548 &state->tmp);
3549 if (tevent_req_nomem(subreq, req)) {
3550 return tevent_req_post(req, ev);
3552 tevent_req_set_callback(subreq, rpccli_winreg_SetValue_done, req);
3553 return req;
3556 static void rpccli_winreg_SetValue_done(struct tevent_req *subreq)
3558 struct tevent_req *req = tevent_req_callback_data(
3559 subreq, struct tevent_req);
3560 struct rpccli_winreg_SetValue_state *state = tevent_req_data(
3561 req, struct rpccli_winreg_SetValue_state);
3562 NTSTATUS status;
3563 TALLOC_CTX *mem_ctx;
3565 if (state->out_mem_ctx) {
3566 mem_ctx = state->out_mem_ctx;
3567 } else {
3568 mem_ctx = state;
3571 status = state->dispatch_recv(subreq, mem_ctx);
3572 TALLOC_FREE(subreq);
3573 if (!NT_STATUS_IS_OK(status)) {
3574 tevent_req_nterror(req, status);
3575 return;
3578 /* Copy out parameters */
3580 /* Copy result */
3581 state->orig.out.result = state->tmp.out.result;
3583 /* Reset temporary structure */
3584 ZERO_STRUCT(state->tmp);
3586 tevent_req_done(req);
3589 NTSTATUS rpccli_winreg_SetValue_recv(struct tevent_req *req,
3590 TALLOC_CTX *mem_ctx,
3591 WERROR *result)
3593 struct rpccli_winreg_SetValue_state *state = tevent_req_data(
3594 req, struct rpccli_winreg_SetValue_state);
3595 NTSTATUS status;
3597 if (tevent_req_is_nterror(req, &status)) {
3598 tevent_req_received(req);
3599 return status;
3602 /* Steal possbile out parameters to the callers context */
3603 talloc_steal(mem_ctx, state->out_mem_ctx);
3605 /* Return result */
3606 *result = state->orig.out.result;
3608 tevent_req_received(req);
3609 return NT_STATUS_OK;
3612 NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli,
3613 TALLOC_CTX *mem_ctx,
3614 struct policy_handle *handle /* [in] [ref] */,
3615 struct winreg_String name /* [in] */,
3616 enum winreg_Type type /* [in] */,
3617 uint8_t *data /* [in] [ref,size_is(size)] */,
3618 uint32_t size /* [in] */,
3619 WERROR *werror)
3621 struct winreg_SetValue r;
3622 NTSTATUS status;
3624 /* In parameters */
3625 r.in.handle = handle;
3626 r.in.name = name;
3627 r.in.type = type;
3628 r.in.data = data;
3629 r.in.size = size;
3631 status = cli->dispatch(cli,
3632 mem_ctx,
3633 &ndr_table_winreg,
3634 NDR_WINREG_SETVALUE,
3635 &r);
3637 if (!NT_STATUS_IS_OK(status)) {
3638 return status;
3641 if (NT_STATUS_IS_ERR(status)) {
3642 return status;
3645 /* Return variables */
3647 /* Return result */
3648 if (werror) {
3649 *werror = r.out.result;
3652 return werror_to_ntstatus(r.out.result);
3655 struct rpccli_winreg_UnLoadKey_state {
3656 struct winreg_UnLoadKey orig;
3657 struct winreg_UnLoadKey tmp;
3658 TALLOC_CTX *out_mem_ctx;
3659 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3662 static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq);
3664 struct tevent_req *rpccli_winreg_UnLoadKey_send(TALLOC_CTX *mem_ctx,
3665 struct tevent_context *ev,
3666 struct rpc_pipe_client *cli)
3668 struct tevent_req *req;
3669 struct rpccli_winreg_UnLoadKey_state *state;
3670 struct tevent_req *subreq;
3672 req = tevent_req_create(mem_ctx, &state,
3673 struct rpccli_winreg_UnLoadKey_state);
3674 if (req == NULL) {
3675 return NULL;
3677 state->out_mem_ctx = NULL;
3678 state->dispatch_recv = cli->dispatch_recv;
3680 /* In parameters */
3682 /* Out parameters */
3684 /* Result */
3685 ZERO_STRUCT(state->orig.out.result);
3687 /* make a temporary copy, that we pass to the dispatch function */
3688 state->tmp = state->orig;
3690 subreq = cli->dispatch_send(state, ev, cli,
3691 &ndr_table_winreg,
3692 NDR_WINREG_UNLOADKEY,
3693 &state->tmp);
3694 if (tevent_req_nomem(subreq, req)) {
3695 return tevent_req_post(req, ev);
3697 tevent_req_set_callback(subreq, rpccli_winreg_UnLoadKey_done, req);
3698 return req;
3701 static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq)
3703 struct tevent_req *req = tevent_req_callback_data(
3704 subreq, struct tevent_req);
3705 struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
3706 req, struct rpccli_winreg_UnLoadKey_state);
3707 NTSTATUS status;
3708 TALLOC_CTX *mem_ctx;
3710 if (state->out_mem_ctx) {
3711 mem_ctx = state->out_mem_ctx;
3712 } else {
3713 mem_ctx = state;
3716 status = state->dispatch_recv(subreq, mem_ctx);
3717 TALLOC_FREE(subreq);
3718 if (!NT_STATUS_IS_OK(status)) {
3719 tevent_req_nterror(req, status);
3720 return;
3723 /* Copy out parameters */
3725 /* Copy result */
3726 state->orig.out.result = state->tmp.out.result;
3728 /* Reset temporary structure */
3729 ZERO_STRUCT(state->tmp);
3731 tevent_req_done(req);
3734 NTSTATUS rpccli_winreg_UnLoadKey_recv(struct tevent_req *req,
3735 TALLOC_CTX *mem_ctx,
3736 WERROR *result)
3738 struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
3739 req, struct rpccli_winreg_UnLoadKey_state);
3740 NTSTATUS status;
3742 if (tevent_req_is_nterror(req, &status)) {
3743 tevent_req_received(req);
3744 return status;
3747 /* Steal possbile out parameters to the callers context */
3748 talloc_steal(mem_ctx, state->out_mem_ctx);
3750 /* Return result */
3751 *result = state->orig.out.result;
3753 tevent_req_received(req);
3754 return NT_STATUS_OK;
3757 NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
3758 TALLOC_CTX *mem_ctx,
3759 WERROR *werror)
3761 struct winreg_UnLoadKey r;
3762 NTSTATUS status;
3764 /* In parameters */
3766 status = cli->dispatch(cli,
3767 mem_ctx,
3768 &ndr_table_winreg,
3769 NDR_WINREG_UNLOADKEY,
3770 &r);
3772 if (!NT_STATUS_IS_OK(status)) {
3773 return status;
3776 if (NT_STATUS_IS_ERR(status)) {
3777 return status;
3780 /* Return variables */
3782 /* Return result */
3783 if (werror) {
3784 *werror = r.out.result;
3787 return werror_to_ntstatus(r.out.result);
3790 struct rpccli_winreg_InitiateSystemShutdown_state {
3791 struct winreg_InitiateSystemShutdown orig;
3792 struct winreg_InitiateSystemShutdown tmp;
3793 TALLOC_CTX *out_mem_ctx;
3794 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3797 static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq);
3799 struct tevent_req *rpccli_winreg_InitiateSystemShutdown_send(TALLOC_CTX *mem_ctx,
3800 struct tevent_context *ev,
3801 struct rpc_pipe_client *cli,
3802 uint16_t *_hostname /* [in] [unique] */,
3803 struct lsa_StringLarge *_message /* [in] [unique] */,
3804 uint32_t _timeout /* [in] */,
3805 uint8_t _force_apps /* [in] */,
3806 uint8_t _do_reboot /* [in] */)
3808 struct tevent_req *req;
3809 struct rpccli_winreg_InitiateSystemShutdown_state *state;
3810 struct tevent_req *subreq;
3812 req = tevent_req_create(mem_ctx, &state,
3813 struct rpccli_winreg_InitiateSystemShutdown_state);
3814 if (req == NULL) {
3815 return NULL;
3817 state->out_mem_ctx = NULL;
3818 state->dispatch_recv = cli->dispatch_recv;
3820 /* In parameters */
3821 state->orig.in.hostname = _hostname;
3822 state->orig.in.message = _message;
3823 state->orig.in.timeout = _timeout;
3824 state->orig.in.force_apps = _force_apps;
3825 state->orig.in.do_reboot = _do_reboot;
3827 /* Out parameters */
3829 /* Result */
3830 ZERO_STRUCT(state->orig.out.result);
3832 /* make a temporary copy, that we pass to the dispatch function */
3833 state->tmp = state->orig;
3835 subreq = cli->dispatch_send(state, ev, cli,
3836 &ndr_table_winreg,
3837 NDR_WINREG_INITIATESYSTEMSHUTDOWN,
3838 &state->tmp);
3839 if (tevent_req_nomem(subreq, req)) {
3840 return tevent_req_post(req, ev);
3842 tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdown_done, req);
3843 return req;
3846 static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq)
3848 struct tevent_req *req = tevent_req_callback_data(
3849 subreq, struct tevent_req);
3850 struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
3851 req, struct rpccli_winreg_InitiateSystemShutdown_state);
3852 NTSTATUS status;
3853 TALLOC_CTX *mem_ctx;
3855 if (state->out_mem_ctx) {
3856 mem_ctx = state->out_mem_ctx;
3857 } else {
3858 mem_ctx = state;
3861 status = state->dispatch_recv(subreq, mem_ctx);
3862 TALLOC_FREE(subreq);
3863 if (!NT_STATUS_IS_OK(status)) {
3864 tevent_req_nterror(req, status);
3865 return;
3868 /* Copy out parameters */
3870 /* Copy result */
3871 state->orig.out.result = state->tmp.out.result;
3873 /* Reset temporary structure */
3874 ZERO_STRUCT(state->tmp);
3876 tevent_req_done(req);
3879 NTSTATUS rpccli_winreg_InitiateSystemShutdown_recv(struct tevent_req *req,
3880 TALLOC_CTX *mem_ctx,
3881 WERROR *result)
3883 struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
3884 req, struct rpccli_winreg_InitiateSystemShutdown_state);
3885 NTSTATUS status;
3887 if (tevent_req_is_nterror(req, &status)) {
3888 tevent_req_received(req);
3889 return status;
3892 /* Steal possbile out parameters to the callers context */
3893 talloc_steal(mem_ctx, state->out_mem_ctx);
3895 /* Return result */
3896 *result = state->orig.out.result;
3898 tevent_req_received(req);
3899 return NT_STATUS_OK;
3902 NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
3903 TALLOC_CTX *mem_ctx,
3904 uint16_t *hostname /* [in] [unique] */,
3905 struct lsa_StringLarge *message /* [in] [unique] */,
3906 uint32_t timeout /* [in] */,
3907 uint8_t force_apps /* [in] */,
3908 uint8_t do_reboot /* [in] */,
3909 WERROR *werror)
3911 struct winreg_InitiateSystemShutdown r;
3912 NTSTATUS status;
3914 /* In parameters */
3915 r.in.hostname = hostname;
3916 r.in.message = message;
3917 r.in.timeout = timeout;
3918 r.in.force_apps = force_apps;
3919 r.in.do_reboot = do_reboot;
3921 status = cli->dispatch(cli,
3922 mem_ctx,
3923 &ndr_table_winreg,
3924 NDR_WINREG_INITIATESYSTEMSHUTDOWN,
3925 &r);
3927 if (!NT_STATUS_IS_OK(status)) {
3928 return status;
3931 if (NT_STATUS_IS_ERR(status)) {
3932 return status;
3935 /* Return variables */
3937 /* Return result */
3938 if (werror) {
3939 *werror = r.out.result;
3942 return werror_to_ntstatus(r.out.result);
3945 struct rpccli_winreg_AbortSystemShutdown_state {
3946 struct winreg_AbortSystemShutdown orig;
3947 struct winreg_AbortSystemShutdown tmp;
3948 TALLOC_CTX *out_mem_ctx;
3949 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3952 static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq);
3954 struct tevent_req *rpccli_winreg_AbortSystemShutdown_send(TALLOC_CTX *mem_ctx,
3955 struct tevent_context *ev,
3956 struct rpc_pipe_client *cli,
3957 uint16_t *_server /* [in] [unique] */)
3959 struct tevent_req *req;
3960 struct rpccli_winreg_AbortSystemShutdown_state *state;
3961 struct tevent_req *subreq;
3963 req = tevent_req_create(mem_ctx, &state,
3964 struct rpccli_winreg_AbortSystemShutdown_state);
3965 if (req == NULL) {
3966 return NULL;
3968 state->out_mem_ctx = NULL;
3969 state->dispatch_recv = cli->dispatch_recv;
3971 /* In parameters */
3972 state->orig.in.server = _server;
3974 /* Out parameters */
3976 /* Result */
3977 ZERO_STRUCT(state->orig.out.result);
3979 /* make a temporary copy, that we pass to the dispatch function */
3980 state->tmp = state->orig;
3982 subreq = cli->dispatch_send(state, ev, cli,
3983 &ndr_table_winreg,
3984 NDR_WINREG_ABORTSYSTEMSHUTDOWN,
3985 &state->tmp);
3986 if (tevent_req_nomem(subreq, req)) {
3987 return tevent_req_post(req, ev);
3989 tevent_req_set_callback(subreq, rpccli_winreg_AbortSystemShutdown_done, req);
3990 return req;
3993 static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq)
3995 struct tevent_req *req = tevent_req_callback_data(
3996 subreq, struct tevent_req);
3997 struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
3998 req, struct rpccli_winreg_AbortSystemShutdown_state);
3999 NTSTATUS status;
4000 TALLOC_CTX *mem_ctx;
4002 if (state->out_mem_ctx) {
4003 mem_ctx = state->out_mem_ctx;
4004 } else {
4005 mem_ctx = state;
4008 status = state->dispatch_recv(subreq, mem_ctx);
4009 TALLOC_FREE(subreq);
4010 if (!NT_STATUS_IS_OK(status)) {
4011 tevent_req_nterror(req, status);
4012 return;
4015 /* Copy out parameters */
4017 /* Copy result */
4018 state->orig.out.result = state->tmp.out.result;
4020 /* Reset temporary structure */
4021 ZERO_STRUCT(state->tmp);
4023 tevent_req_done(req);
4026 NTSTATUS rpccli_winreg_AbortSystemShutdown_recv(struct tevent_req *req,
4027 TALLOC_CTX *mem_ctx,
4028 WERROR *result)
4030 struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
4031 req, struct rpccli_winreg_AbortSystemShutdown_state);
4032 NTSTATUS status;
4034 if (tevent_req_is_nterror(req, &status)) {
4035 tevent_req_received(req);
4036 return status;
4039 /* Steal possbile out parameters to the callers context */
4040 talloc_steal(mem_ctx, state->out_mem_ctx);
4042 /* Return result */
4043 *result = state->orig.out.result;
4045 tevent_req_received(req);
4046 return NT_STATUS_OK;
4049 NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
4050 TALLOC_CTX *mem_ctx,
4051 uint16_t *server /* [in] [unique] */,
4052 WERROR *werror)
4054 struct winreg_AbortSystemShutdown r;
4055 NTSTATUS status;
4057 /* In parameters */
4058 r.in.server = server;
4060 status = cli->dispatch(cli,
4061 mem_ctx,
4062 &ndr_table_winreg,
4063 NDR_WINREG_ABORTSYSTEMSHUTDOWN,
4064 &r);
4066 if (!NT_STATUS_IS_OK(status)) {
4067 return status;
4070 if (NT_STATUS_IS_ERR(status)) {
4071 return status;
4074 /* Return variables */
4076 /* Return result */
4077 if (werror) {
4078 *werror = r.out.result;
4081 return werror_to_ntstatus(r.out.result);
4084 struct rpccli_winreg_GetVersion_state {
4085 struct winreg_GetVersion orig;
4086 struct winreg_GetVersion tmp;
4087 TALLOC_CTX *out_mem_ctx;
4088 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4091 static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq);
4093 struct tevent_req *rpccli_winreg_GetVersion_send(TALLOC_CTX *mem_ctx,
4094 struct tevent_context *ev,
4095 struct rpc_pipe_client *cli,
4096 struct policy_handle *_handle /* [in] [ref] */,
4097 uint32_t *_version /* [out] [ref] */)
4099 struct tevent_req *req;
4100 struct rpccli_winreg_GetVersion_state *state;
4101 struct tevent_req *subreq;
4103 req = tevent_req_create(mem_ctx, &state,
4104 struct rpccli_winreg_GetVersion_state);
4105 if (req == NULL) {
4106 return NULL;
4108 state->out_mem_ctx = NULL;
4109 state->dispatch_recv = cli->dispatch_recv;
4111 /* In parameters */
4112 state->orig.in.handle = _handle;
4114 /* Out parameters */
4115 state->orig.out.version = _version;
4117 /* Result */
4118 ZERO_STRUCT(state->orig.out.result);
4120 state->out_mem_ctx = talloc_named_const(state, 0,
4121 "rpccli_winreg_GetVersion_out_memory");
4122 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4123 return tevent_req_post(req, ev);
4126 /* make a temporary copy, that we pass to the dispatch function */
4127 state->tmp = state->orig;
4129 subreq = cli->dispatch_send(state, ev, cli,
4130 &ndr_table_winreg,
4131 NDR_WINREG_GETVERSION,
4132 &state->tmp);
4133 if (tevent_req_nomem(subreq, req)) {
4134 return tevent_req_post(req, ev);
4136 tevent_req_set_callback(subreq, rpccli_winreg_GetVersion_done, req);
4137 return req;
4140 static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq)
4142 struct tevent_req *req = tevent_req_callback_data(
4143 subreq, struct tevent_req);
4144 struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
4145 req, struct rpccli_winreg_GetVersion_state);
4146 NTSTATUS status;
4147 TALLOC_CTX *mem_ctx;
4149 if (state->out_mem_ctx) {
4150 mem_ctx = state->out_mem_ctx;
4151 } else {
4152 mem_ctx = state;
4155 status = state->dispatch_recv(subreq, mem_ctx);
4156 TALLOC_FREE(subreq);
4157 if (!NT_STATUS_IS_OK(status)) {
4158 tevent_req_nterror(req, status);
4159 return;
4162 /* Copy out parameters */
4163 *state->orig.out.version = *state->tmp.out.version;
4165 /* Copy result */
4166 state->orig.out.result = state->tmp.out.result;
4168 /* Reset temporary structure */
4169 ZERO_STRUCT(state->tmp);
4171 tevent_req_done(req);
4174 NTSTATUS rpccli_winreg_GetVersion_recv(struct tevent_req *req,
4175 TALLOC_CTX *mem_ctx,
4176 WERROR *result)
4178 struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
4179 req, struct rpccli_winreg_GetVersion_state);
4180 NTSTATUS status;
4182 if (tevent_req_is_nterror(req, &status)) {
4183 tevent_req_received(req);
4184 return status;
4187 /* Steal possbile out parameters to the callers context */
4188 talloc_steal(mem_ctx, state->out_mem_ctx);
4190 /* Return result */
4191 *result = state->orig.out.result;
4193 tevent_req_received(req);
4194 return NT_STATUS_OK;
4197 NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli,
4198 TALLOC_CTX *mem_ctx,
4199 struct policy_handle *handle /* [in] [ref] */,
4200 uint32_t *version /* [out] [ref] */,
4201 WERROR *werror)
4203 struct winreg_GetVersion r;
4204 NTSTATUS status;
4206 /* In parameters */
4207 r.in.handle = handle;
4209 status = cli->dispatch(cli,
4210 mem_ctx,
4211 &ndr_table_winreg,
4212 NDR_WINREG_GETVERSION,
4213 &r);
4215 if (!NT_STATUS_IS_OK(status)) {
4216 return status;
4219 if (NT_STATUS_IS_ERR(status)) {
4220 return status;
4223 /* Return variables */
4224 *version = *r.out.version;
4226 /* Return result */
4227 if (werror) {
4228 *werror = r.out.result;
4231 return werror_to_ntstatus(r.out.result);
4234 struct rpccli_winreg_OpenHKCC_state {
4235 struct winreg_OpenHKCC orig;
4236 struct winreg_OpenHKCC tmp;
4237 TALLOC_CTX *out_mem_ctx;
4238 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4241 static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq);
4243 struct tevent_req *rpccli_winreg_OpenHKCC_send(TALLOC_CTX *mem_ctx,
4244 struct tevent_context *ev,
4245 struct rpc_pipe_client *cli,
4246 uint16_t *_system_name /* [in] [unique] */,
4247 uint32_t _access_mask /* [in] */,
4248 struct policy_handle *_handle /* [out] [ref] */)
4250 struct tevent_req *req;
4251 struct rpccli_winreg_OpenHKCC_state *state;
4252 struct tevent_req *subreq;
4254 req = tevent_req_create(mem_ctx, &state,
4255 struct rpccli_winreg_OpenHKCC_state);
4256 if (req == NULL) {
4257 return NULL;
4259 state->out_mem_ctx = NULL;
4260 state->dispatch_recv = cli->dispatch_recv;
4262 /* In parameters */
4263 state->orig.in.system_name = _system_name;
4264 state->orig.in.access_mask = _access_mask;
4266 /* Out parameters */
4267 state->orig.out.handle = _handle;
4269 /* Result */
4270 ZERO_STRUCT(state->orig.out.result);
4272 state->out_mem_ctx = talloc_named_const(state, 0,
4273 "rpccli_winreg_OpenHKCC_out_memory");
4274 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4275 return tevent_req_post(req, ev);
4278 /* make a temporary copy, that we pass to the dispatch function */
4279 state->tmp = state->orig;
4281 subreq = cli->dispatch_send(state, ev, cli,
4282 &ndr_table_winreg,
4283 NDR_WINREG_OPENHKCC,
4284 &state->tmp);
4285 if (tevent_req_nomem(subreq, req)) {
4286 return tevent_req_post(req, ev);
4288 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCC_done, req);
4289 return req;
4292 static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq)
4294 struct tevent_req *req = tevent_req_callback_data(
4295 subreq, struct tevent_req);
4296 struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
4297 req, struct rpccli_winreg_OpenHKCC_state);
4298 NTSTATUS status;
4299 TALLOC_CTX *mem_ctx;
4301 if (state->out_mem_ctx) {
4302 mem_ctx = state->out_mem_ctx;
4303 } else {
4304 mem_ctx = state;
4307 status = state->dispatch_recv(subreq, mem_ctx);
4308 TALLOC_FREE(subreq);
4309 if (!NT_STATUS_IS_OK(status)) {
4310 tevent_req_nterror(req, status);
4311 return;
4314 /* Copy out parameters */
4315 *state->orig.out.handle = *state->tmp.out.handle;
4317 /* Copy result */
4318 state->orig.out.result = state->tmp.out.result;
4320 /* Reset temporary structure */
4321 ZERO_STRUCT(state->tmp);
4323 tevent_req_done(req);
4326 NTSTATUS rpccli_winreg_OpenHKCC_recv(struct tevent_req *req,
4327 TALLOC_CTX *mem_ctx,
4328 WERROR *result)
4330 struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
4331 req, struct rpccli_winreg_OpenHKCC_state);
4332 NTSTATUS status;
4334 if (tevent_req_is_nterror(req, &status)) {
4335 tevent_req_received(req);
4336 return status;
4339 /* Steal possbile out parameters to the callers context */
4340 talloc_steal(mem_ctx, state->out_mem_ctx);
4342 /* Return result */
4343 *result = state->orig.out.result;
4345 tevent_req_received(req);
4346 return NT_STATUS_OK;
4349 NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
4350 TALLOC_CTX *mem_ctx,
4351 uint16_t *system_name /* [in] [unique] */,
4352 uint32_t access_mask /* [in] */,
4353 struct policy_handle *handle /* [out] [ref] */,
4354 WERROR *werror)
4356 struct winreg_OpenHKCC r;
4357 NTSTATUS status;
4359 /* In parameters */
4360 r.in.system_name = system_name;
4361 r.in.access_mask = access_mask;
4363 status = cli->dispatch(cli,
4364 mem_ctx,
4365 &ndr_table_winreg,
4366 NDR_WINREG_OPENHKCC,
4367 &r);
4369 if (!NT_STATUS_IS_OK(status)) {
4370 return status;
4373 if (NT_STATUS_IS_ERR(status)) {
4374 return status;
4377 /* Return variables */
4378 *handle = *r.out.handle;
4380 /* Return result */
4381 if (werror) {
4382 *werror = r.out.result;
4385 return werror_to_ntstatus(r.out.result);
4388 struct rpccli_winreg_OpenHKDD_state {
4389 struct winreg_OpenHKDD orig;
4390 struct winreg_OpenHKDD tmp;
4391 TALLOC_CTX *out_mem_ctx;
4392 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4395 static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq);
4397 struct tevent_req *rpccli_winreg_OpenHKDD_send(TALLOC_CTX *mem_ctx,
4398 struct tevent_context *ev,
4399 struct rpc_pipe_client *cli,
4400 uint16_t *_system_name /* [in] [unique] */,
4401 uint32_t _access_mask /* [in] */,
4402 struct policy_handle *_handle /* [out] [ref] */)
4404 struct tevent_req *req;
4405 struct rpccli_winreg_OpenHKDD_state *state;
4406 struct tevent_req *subreq;
4408 req = tevent_req_create(mem_ctx, &state,
4409 struct rpccli_winreg_OpenHKDD_state);
4410 if (req == NULL) {
4411 return NULL;
4413 state->out_mem_ctx = NULL;
4414 state->dispatch_recv = cli->dispatch_recv;
4416 /* In parameters */
4417 state->orig.in.system_name = _system_name;
4418 state->orig.in.access_mask = _access_mask;
4420 /* Out parameters */
4421 state->orig.out.handle = _handle;
4423 /* Result */
4424 ZERO_STRUCT(state->orig.out.result);
4426 state->out_mem_ctx = talloc_named_const(state, 0,
4427 "rpccli_winreg_OpenHKDD_out_memory");
4428 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4429 return tevent_req_post(req, ev);
4432 /* make a temporary copy, that we pass to the dispatch function */
4433 state->tmp = state->orig;
4435 subreq = cli->dispatch_send(state, ev, cli,
4436 &ndr_table_winreg,
4437 NDR_WINREG_OPENHKDD,
4438 &state->tmp);
4439 if (tevent_req_nomem(subreq, req)) {
4440 return tevent_req_post(req, ev);
4442 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKDD_done, req);
4443 return req;
4446 static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq)
4448 struct tevent_req *req = tevent_req_callback_data(
4449 subreq, struct tevent_req);
4450 struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
4451 req, struct rpccli_winreg_OpenHKDD_state);
4452 NTSTATUS status;
4453 TALLOC_CTX *mem_ctx;
4455 if (state->out_mem_ctx) {
4456 mem_ctx = state->out_mem_ctx;
4457 } else {
4458 mem_ctx = state;
4461 status = state->dispatch_recv(subreq, mem_ctx);
4462 TALLOC_FREE(subreq);
4463 if (!NT_STATUS_IS_OK(status)) {
4464 tevent_req_nterror(req, status);
4465 return;
4468 /* Copy out parameters */
4469 *state->orig.out.handle = *state->tmp.out.handle;
4471 /* Copy result */
4472 state->orig.out.result = state->tmp.out.result;
4474 /* Reset temporary structure */
4475 ZERO_STRUCT(state->tmp);
4477 tevent_req_done(req);
4480 NTSTATUS rpccli_winreg_OpenHKDD_recv(struct tevent_req *req,
4481 TALLOC_CTX *mem_ctx,
4482 WERROR *result)
4484 struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
4485 req, struct rpccli_winreg_OpenHKDD_state);
4486 NTSTATUS status;
4488 if (tevent_req_is_nterror(req, &status)) {
4489 tevent_req_received(req);
4490 return status;
4493 /* Steal possbile out parameters to the callers context */
4494 talloc_steal(mem_ctx, state->out_mem_ctx);
4496 /* Return result */
4497 *result = state->orig.out.result;
4499 tevent_req_received(req);
4500 return NT_STATUS_OK;
4503 NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli,
4504 TALLOC_CTX *mem_ctx,
4505 uint16_t *system_name /* [in] [unique] */,
4506 uint32_t access_mask /* [in] */,
4507 struct policy_handle *handle /* [out] [ref] */,
4508 WERROR *werror)
4510 struct winreg_OpenHKDD r;
4511 NTSTATUS status;
4513 /* In parameters */
4514 r.in.system_name = system_name;
4515 r.in.access_mask = access_mask;
4517 status = cli->dispatch(cli,
4518 mem_ctx,
4519 &ndr_table_winreg,
4520 NDR_WINREG_OPENHKDD,
4521 &r);
4523 if (!NT_STATUS_IS_OK(status)) {
4524 return status;
4527 if (NT_STATUS_IS_ERR(status)) {
4528 return status;
4531 /* Return variables */
4532 *handle = *r.out.handle;
4534 /* Return result */
4535 if (werror) {
4536 *werror = r.out.result;
4539 return werror_to_ntstatus(r.out.result);
4542 struct rpccli_winreg_QueryMultipleValues_state {
4543 struct winreg_QueryMultipleValues orig;
4544 struct winreg_QueryMultipleValues tmp;
4545 TALLOC_CTX *out_mem_ctx;
4546 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4549 static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq);
4551 struct tevent_req *rpccli_winreg_QueryMultipleValues_send(TALLOC_CTX *mem_ctx,
4552 struct tevent_context *ev,
4553 struct rpc_pipe_client *cli,
4554 struct policy_handle *_key_handle /* [in] [ref] */,
4555 struct QueryMultipleValue *_values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
4556 uint32_t _num_values /* [in] */,
4557 uint8_t *_buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
4558 uint32_t *_buffer_size /* [in,out] [ref] */)
4560 struct tevent_req *req;
4561 struct rpccli_winreg_QueryMultipleValues_state *state;
4562 struct tevent_req *subreq;
4564 req = tevent_req_create(mem_ctx, &state,
4565 struct rpccli_winreg_QueryMultipleValues_state);
4566 if (req == NULL) {
4567 return NULL;
4569 state->out_mem_ctx = NULL;
4570 state->dispatch_recv = cli->dispatch_recv;
4572 /* In parameters */
4573 state->orig.in.key_handle = _key_handle;
4574 state->orig.in.values = _values;
4575 state->orig.in.num_values = _num_values;
4576 state->orig.in.buffer = _buffer;
4577 state->orig.in.buffer_size = _buffer_size;
4579 /* Out parameters */
4580 state->orig.out.values = _values;
4581 state->orig.out.buffer = _buffer;
4582 state->orig.out.buffer_size = _buffer_size;
4584 /* Result */
4585 ZERO_STRUCT(state->orig.out.result);
4587 state->out_mem_ctx = talloc_named_const(state, 0,
4588 "rpccli_winreg_QueryMultipleValues_out_memory");
4589 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4590 return tevent_req_post(req, ev);
4593 /* make a temporary copy, that we pass to the dispatch function */
4594 state->tmp = state->orig;
4596 subreq = cli->dispatch_send(state, ev, cli,
4597 &ndr_table_winreg,
4598 NDR_WINREG_QUERYMULTIPLEVALUES,
4599 &state->tmp);
4600 if (tevent_req_nomem(subreq, req)) {
4601 return tevent_req_post(req, ev);
4603 tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues_done, req);
4604 return req;
4607 static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq)
4609 struct tevent_req *req = tevent_req_callback_data(
4610 subreq, struct tevent_req);
4611 struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
4612 req, struct rpccli_winreg_QueryMultipleValues_state);
4613 NTSTATUS status;
4614 TALLOC_CTX *mem_ctx;
4616 if (state->out_mem_ctx) {
4617 mem_ctx = state->out_mem_ctx;
4618 } else {
4619 mem_ctx = state;
4622 status = state->dispatch_recv(subreq, mem_ctx);
4623 TALLOC_FREE(subreq);
4624 if (!NT_STATUS_IS_OK(status)) {
4625 tevent_req_nterror(req, status);
4626 return;
4629 /* Copy out parameters */
4630 memcpy(state->orig.out.values, state->tmp.out.values, (state->tmp.in.num_values) * sizeof(*state->orig.out.values));
4631 if (state->orig.out.buffer && state->tmp.out.buffer) {
4632 memcpy(state->orig.out.buffer, state->tmp.out.buffer, (*state->tmp.in.buffer_size) * sizeof(*state->orig.out.buffer));
4634 *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
4636 /* Copy result */
4637 state->orig.out.result = state->tmp.out.result;
4639 /* Reset temporary structure */
4640 ZERO_STRUCT(state->tmp);
4642 tevent_req_done(req);
4645 NTSTATUS rpccli_winreg_QueryMultipleValues_recv(struct tevent_req *req,
4646 TALLOC_CTX *mem_ctx,
4647 WERROR *result)
4649 struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
4650 req, struct rpccli_winreg_QueryMultipleValues_state);
4651 NTSTATUS status;
4653 if (tevent_req_is_nterror(req, &status)) {
4654 tevent_req_received(req);
4655 return status;
4658 /* Steal possbile out parameters to the callers context */
4659 talloc_steal(mem_ctx, state->out_mem_ctx);
4661 /* Return result */
4662 *result = state->orig.out.result;
4664 tevent_req_received(req);
4665 return NT_STATUS_OK;
4668 NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
4669 TALLOC_CTX *mem_ctx,
4670 struct policy_handle *key_handle /* [in] [ref] */,
4671 struct QueryMultipleValue *values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
4672 uint32_t num_values /* [in] */,
4673 uint8_t *buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
4674 uint32_t *buffer_size /* [in,out] [ref] */,
4675 WERROR *werror)
4677 struct winreg_QueryMultipleValues r;
4678 NTSTATUS status;
4680 /* In parameters */
4681 r.in.key_handle = key_handle;
4682 r.in.values = values;
4683 r.in.num_values = num_values;
4684 r.in.buffer = buffer;
4685 r.in.buffer_size = buffer_size;
4687 status = cli->dispatch(cli,
4688 mem_ctx,
4689 &ndr_table_winreg,
4690 NDR_WINREG_QUERYMULTIPLEVALUES,
4691 &r);
4693 if (!NT_STATUS_IS_OK(status)) {
4694 return status;
4697 if (NT_STATUS_IS_ERR(status)) {
4698 return status;
4701 /* Return variables */
4702 memcpy(values, r.out.values, (r.in.num_values) * sizeof(*values));
4703 if (buffer && r.out.buffer) {
4704 memcpy(buffer, r.out.buffer, (*r.in.buffer_size) * sizeof(*buffer));
4706 *buffer_size = *r.out.buffer_size;
4708 /* Return result */
4709 if (werror) {
4710 *werror = r.out.result;
4713 return werror_to_ntstatus(r.out.result);
4716 struct rpccli_winreg_InitiateSystemShutdownEx_state {
4717 struct winreg_InitiateSystemShutdownEx orig;
4718 struct winreg_InitiateSystemShutdownEx tmp;
4719 TALLOC_CTX *out_mem_ctx;
4720 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4723 static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq);
4725 struct tevent_req *rpccli_winreg_InitiateSystemShutdownEx_send(TALLOC_CTX *mem_ctx,
4726 struct tevent_context *ev,
4727 struct rpc_pipe_client *cli,
4728 uint16_t *_hostname /* [in] [unique] */,
4729 struct lsa_StringLarge *_message /* [in] [unique] */,
4730 uint32_t _timeout /* [in] */,
4731 uint8_t _force_apps /* [in] */,
4732 uint8_t _do_reboot /* [in] */,
4733 uint32_t _reason /* [in] */)
4735 struct tevent_req *req;
4736 struct rpccli_winreg_InitiateSystemShutdownEx_state *state;
4737 struct tevent_req *subreq;
4739 req = tevent_req_create(mem_ctx, &state,
4740 struct rpccli_winreg_InitiateSystemShutdownEx_state);
4741 if (req == NULL) {
4742 return NULL;
4744 state->out_mem_ctx = NULL;
4745 state->dispatch_recv = cli->dispatch_recv;
4747 /* In parameters */
4748 state->orig.in.hostname = _hostname;
4749 state->orig.in.message = _message;
4750 state->orig.in.timeout = _timeout;
4751 state->orig.in.force_apps = _force_apps;
4752 state->orig.in.do_reboot = _do_reboot;
4753 state->orig.in.reason = _reason;
4755 /* Out parameters */
4757 /* Result */
4758 ZERO_STRUCT(state->orig.out.result);
4760 /* make a temporary copy, that we pass to the dispatch function */
4761 state->tmp = state->orig;
4763 subreq = cli->dispatch_send(state, ev, cli,
4764 &ndr_table_winreg,
4765 NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
4766 &state->tmp);
4767 if (tevent_req_nomem(subreq, req)) {
4768 return tevent_req_post(req, ev);
4770 tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdownEx_done, req);
4771 return req;
4774 static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq)
4776 struct tevent_req *req = tevent_req_callback_data(
4777 subreq, struct tevent_req);
4778 struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
4779 req, struct rpccli_winreg_InitiateSystemShutdownEx_state);
4780 NTSTATUS status;
4781 TALLOC_CTX *mem_ctx;
4783 if (state->out_mem_ctx) {
4784 mem_ctx = state->out_mem_ctx;
4785 } else {
4786 mem_ctx = state;
4789 status = state->dispatch_recv(subreq, mem_ctx);
4790 TALLOC_FREE(subreq);
4791 if (!NT_STATUS_IS_OK(status)) {
4792 tevent_req_nterror(req, status);
4793 return;
4796 /* Copy out parameters */
4798 /* Copy result */
4799 state->orig.out.result = state->tmp.out.result;
4801 /* Reset temporary structure */
4802 ZERO_STRUCT(state->tmp);
4804 tevent_req_done(req);
4807 NTSTATUS rpccli_winreg_InitiateSystemShutdownEx_recv(struct tevent_req *req,
4808 TALLOC_CTX *mem_ctx,
4809 WERROR *result)
4811 struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
4812 req, struct rpccli_winreg_InitiateSystemShutdownEx_state);
4813 NTSTATUS status;
4815 if (tevent_req_is_nterror(req, &status)) {
4816 tevent_req_received(req);
4817 return status;
4820 /* Steal possbile out parameters to the callers context */
4821 talloc_steal(mem_ctx, state->out_mem_ctx);
4823 /* Return result */
4824 *result = state->orig.out.result;
4826 tevent_req_received(req);
4827 return NT_STATUS_OK;
4830 NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
4831 TALLOC_CTX *mem_ctx,
4832 uint16_t *hostname /* [in] [unique] */,
4833 struct lsa_StringLarge *message /* [in] [unique] */,
4834 uint32_t timeout /* [in] */,
4835 uint8_t force_apps /* [in] */,
4836 uint8_t do_reboot /* [in] */,
4837 uint32_t reason /* [in] */,
4838 WERROR *werror)
4840 struct winreg_InitiateSystemShutdownEx r;
4841 NTSTATUS status;
4843 /* In parameters */
4844 r.in.hostname = hostname;
4845 r.in.message = message;
4846 r.in.timeout = timeout;
4847 r.in.force_apps = force_apps;
4848 r.in.do_reboot = do_reboot;
4849 r.in.reason = reason;
4851 status = cli->dispatch(cli,
4852 mem_ctx,
4853 &ndr_table_winreg,
4854 NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
4855 &r);
4857 if (!NT_STATUS_IS_OK(status)) {
4858 return status;
4861 if (NT_STATUS_IS_ERR(status)) {
4862 return status;
4865 /* Return variables */
4867 /* Return result */
4868 if (werror) {
4869 *werror = r.out.result;
4872 return werror_to_ntstatus(r.out.result);
4875 struct rpccli_winreg_SaveKeyEx_state {
4876 struct winreg_SaveKeyEx orig;
4877 struct winreg_SaveKeyEx tmp;
4878 TALLOC_CTX *out_mem_ctx;
4879 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4882 static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq);
4884 struct tevent_req *rpccli_winreg_SaveKeyEx_send(TALLOC_CTX *mem_ctx,
4885 struct tevent_context *ev,
4886 struct rpc_pipe_client *cli)
4888 struct tevent_req *req;
4889 struct rpccli_winreg_SaveKeyEx_state *state;
4890 struct tevent_req *subreq;
4892 req = tevent_req_create(mem_ctx, &state,
4893 struct rpccli_winreg_SaveKeyEx_state);
4894 if (req == NULL) {
4895 return NULL;
4897 state->out_mem_ctx = NULL;
4898 state->dispatch_recv = cli->dispatch_recv;
4900 /* In parameters */
4902 /* Out parameters */
4904 /* Result */
4905 ZERO_STRUCT(state->orig.out.result);
4907 /* make a temporary copy, that we pass to the dispatch function */
4908 state->tmp = state->orig;
4910 subreq = cli->dispatch_send(state, ev, cli,
4911 &ndr_table_winreg,
4912 NDR_WINREG_SAVEKEYEX,
4913 &state->tmp);
4914 if (tevent_req_nomem(subreq, req)) {
4915 return tevent_req_post(req, ev);
4917 tevent_req_set_callback(subreq, rpccli_winreg_SaveKeyEx_done, req);
4918 return req;
4921 static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq)
4923 struct tevent_req *req = tevent_req_callback_data(
4924 subreq, struct tevent_req);
4925 struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
4926 req, struct rpccli_winreg_SaveKeyEx_state);
4927 NTSTATUS status;
4928 TALLOC_CTX *mem_ctx;
4930 if (state->out_mem_ctx) {
4931 mem_ctx = state->out_mem_ctx;
4932 } else {
4933 mem_ctx = state;
4936 status = state->dispatch_recv(subreq, mem_ctx);
4937 TALLOC_FREE(subreq);
4938 if (!NT_STATUS_IS_OK(status)) {
4939 tevent_req_nterror(req, status);
4940 return;
4943 /* Copy out parameters */
4945 /* Copy result */
4946 state->orig.out.result = state->tmp.out.result;
4948 /* Reset temporary structure */
4949 ZERO_STRUCT(state->tmp);
4951 tevent_req_done(req);
4954 NTSTATUS rpccli_winreg_SaveKeyEx_recv(struct tevent_req *req,
4955 TALLOC_CTX *mem_ctx,
4956 WERROR *result)
4958 struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
4959 req, struct rpccli_winreg_SaveKeyEx_state);
4960 NTSTATUS status;
4962 if (tevent_req_is_nterror(req, &status)) {
4963 tevent_req_received(req);
4964 return status;
4967 /* Steal possbile out parameters to the callers context */
4968 talloc_steal(mem_ctx, state->out_mem_ctx);
4970 /* Return result */
4971 *result = state->orig.out.result;
4973 tevent_req_received(req);
4974 return NT_STATUS_OK;
4977 NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli,
4978 TALLOC_CTX *mem_ctx,
4979 WERROR *werror)
4981 struct winreg_SaveKeyEx r;
4982 NTSTATUS status;
4984 /* In parameters */
4986 status = cli->dispatch(cli,
4987 mem_ctx,
4988 &ndr_table_winreg,
4989 NDR_WINREG_SAVEKEYEX,
4990 &r);
4992 if (!NT_STATUS_IS_OK(status)) {
4993 return status;
4996 if (NT_STATUS_IS_ERR(status)) {
4997 return status;
5000 /* Return variables */
5002 /* Return result */
5003 if (werror) {
5004 *werror = r.out.result;
5007 return werror_to_ntstatus(r.out.result);
5010 struct rpccli_winreg_OpenHKPT_state {
5011 struct winreg_OpenHKPT orig;
5012 struct winreg_OpenHKPT tmp;
5013 TALLOC_CTX *out_mem_ctx;
5014 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5017 static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq);
5019 struct tevent_req *rpccli_winreg_OpenHKPT_send(TALLOC_CTX *mem_ctx,
5020 struct tevent_context *ev,
5021 struct rpc_pipe_client *cli,
5022 uint16_t *_system_name /* [in] [unique] */,
5023 uint32_t _access_mask /* [in] */,
5024 struct policy_handle *_handle /* [out] [ref] */)
5026 struct tevent_req *req;
5027 struct rpccli_winreg_OpenHKPT_state *state;
5028 struct tevent_req *subreq;
5030 req = tevent_req_create(mem_ctx, &state,
5031 struct rpccli_winreg_OpenHKPT_state);
5032 if (req == NULL) {
5033 return NULL;
5035 state->out_mem_ctx = NULL;
5036 state->dispatch_recv = cli->dispatch_recv;
5038 /* In parameters */
5039 state->orig.in.system_name = _system_name;
5040 state->orig.in.access_mask = _access_mask;
5042 /* Out parameters */
5043 state->orig.out.handle = _handle;
5045 /* Result */
5046 ZERO_STRUCT(state->orig.out.result);
5048 state->out_mem_ctx = talloc_named_const(state, 0,
5049 "rpccli_winreg_OpenHKPT_out_memory");
5050 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5051 return tevent_req_post(req, ev);
5054 /* make a temporary copy, that we pass to the dispatch function */
5055 state->tmp = state->orig;
5057 subreq = cli->dispatch_send(state, ev, cli,
5058 &ndr_table_winreg,
5059 NDR_WINREG_OPENHKPT,
5060 &state->tmp);
5061 if (tevent_req_nomem(subreq, req)) {
5062 return tevent_req_post(req, ev);
5064 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPT_done, req);
5065 return req;
5068 static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq)
5070 struct tevent_req *req = tevent_req_callback_data(
5071 subreq, struct tevent_req);
5072 struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
5073 req, struct rpccli_winreg_OpenHKPT_state);
5074 NTSTATUS status;
5075 TALLOC_CTX *mem_ctx;
5077 if (state->out_mem_ctx) {
5078 mem_ctx = state->out_mem_ctx;
5079 } else {
5080 mem_ctx = state;
5083 status = state->dispatch_recv(subreq, mem_ctx);
5084 TALLOC_FREE(subreq);
5085 if (!NT_STATUS_IS_OK(status)) {
5086 tevent_req_nterror(req, status);
5087 return;
5090 /* Copy out parameters */
5091 *state->orig.out.handle = *state->tmp.out.handle;
5093 /* Copy result */
5094 state->orig.out.result = state->tmp.out.result;
5096 /* Reset temporary structure */
5097 ZERO_STRUCT(state->tmp);
5099 tevent_req_done(req);
5102 NTSTATUS rpccli_winreg_OpenHKPT_recv(struct tevent_req *req,
5103 TALLOC_CTX *mem_ctx,
5104 WERROR *result)
5106 struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
5107 req, struct rpccli_winreg_OpenHKPT_state);
5108 NTSTATUS status;
5110 if (tevent_req_is_nterror(req, &status)) {
5111 tevent_req_received(req);
5112 return status;
5115 /* Steal possbile out parameters to the callers context */
5116 talloc_steal(mem_ctx, state->out_mem_ctx);
5118 /* Return result */
5119 *result = state->orig.out.result;
5121 tevent_req_received(req);
5122 return NT_STATUS_OK;
5125 NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli,
5126 TALLOC_CTX *mem_ctx,
5127 uint16_t *system_name /* [in] [unique] */,
5128 uint32_t access_mask /* [in] */,
5129 struct policy_handle *handle /* [out] [ref] */,
5130 WERROR *werror)
5132 struct winreg_OpenHKPT r;
5133 NTSTATUS status;
5135 /* In parameters */
5136 r.in.system_name = system_name;
5137 r.in.access_mask = access_mask;
5139 status = cli->dispatch(cli,
5140 mem_ctx,
5141 &ndr_table_winreg,
5142 NDR_WINREG_OPENHKPT,
5143 &r);
5145 if (!NT_STATUS_IS_OK(status)) {
5146 return status;
5149 if (NT_STATUS_IS_ERR(status)) {
5150 return status;
5153 /* Return variables */
5154 *handle = *r.out.handle;
5156 /* Return result */
5157 if (werror) {
5158 *werror = r.out.result;
5161 return werror_to_ntstatus(r.out.result);
5164 struct rpccli_winreg_OpenHKPN_state {
5165 struct winreg_OpenHKPN orig;
5166 struct winreg_OpenHKPN tmp;
5167 TALLOC_CTX *out_mem_ctx;
5168 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5171 static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq);
5173 struct tevent_req *rpccli_winreg_OpenHKPN_send(TALLOC_CTX *mem_ctx,
5174 struct tevent_context *ev,
5175 struct rpc_pipe_client *cli,
5176 uint16_t *_system_name /* [in] [unique] */,
5177 uint32_t _access_mask /* [in] */,
5178 struct policy_handle *_handle /* [out] [ref] */)
5180 struct tevent_req *req;
5181 struct rpccli_winreg_OpenHKPN_state *state;
5182 struct tevent_req *subreq;
5184 req = tevent_req_create(mem_ctx, &state,
5185 struct rpccli_winreg_OpenHKPN_state);
5186 if (req == NULL) {
5187 return NULL;
5189 state->out_mem_ctx = NULL;
5190 state->dispatch_recv = cli->dispatch_recv;
5192 /* In parameters */
5193 state->orig.in.system_name = _system_name;
5194 state->orig.in.access_mask = _access_mask;
5196 /* Out parameters */
5197 state->orig.out.handle = _handle;
5199 /* Result */
5200 ZERO_STRUCT(state->orig.out.result);
5202 state->out_mem_ctx = talloc_named_const(state, 0,
5203 "rpccli_winreg_OpenHKPN_out_memory");
5204 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5205 return tevent_req_post(req, ev);
5208 /* make a temporary copy, that we pass to the dispatch function */
5209 state->tmp = state->orig;
5211 subreq = cli->dispatch_send(state, ev, cli,
5212 &ndr_table_winreg,
5213 NDR_WINREG_OPENHKPN,
5214 &state->tmp);
5215 if (tevent_req_nomem(subreq, req)) {
5216 return tevent_req_post(req, ev);
5218 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPN_done, req);
5219 return req;
5222 static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq)
5224 struct tevent_req *req = tevent_req_callback_data(
5225 subreq, struct tevent_req);
5226 struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
5227 req, struct rpccli_winreg_OpenHKPN_state);
5228 NTSTATUS status;
5229 TALLOC_CTX *mem_ctx;
5231 if (state->out_mem_ctx) {
5232 mem_ctx = state->out_mem_ctx;
5233 } else {
5234 mem_ctx = state;
5237 status = state->dispatch_recv(subreq, mem_ctx);
5238 TALLOC_FREE(subreq);
5239 if (!NT_STATUS_IS_OK(status)) {
5240 tevent_req_nterror(req, status);
5241 return;
5244 /* Copy out parameters */
5245 *state->orig.out.handle = *state->tmp.out.handle;
5247 /* Copy result */
5248 state->orig.out.result = state->tmp.out.result;
5250 /* Reset temporary structure */
5251 ZERO_STRUCT(state->tmp);
5253 tevent_req_done(req);
5256 NTSTATUS rpccli_winreg_OpenHKPN_recv(struct tevent_req *req,
5257 TALLOC_CTX *mem_ctx,
5258 WERROR *result)
5260 struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
5261 req, struct rpccli_winreg_OpenHKPN_state);
5262 NTSTATUS status;
5264 if (tevent_req_is_nterror(req, &status)) {
5265 tevent_req_received(req);
5266 return status;
5269 /* Steal possbile out parameters to the callers context */
5270 talloc_steal(mem_ctx, state->out_mem_ctx);
5272 /* Return result */
5273 *result = state->orig.out.result;
5275 tevent_req_received(req);
5276 return NT_STATUS_OK;
5279 NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli,
5280 TALLOC_CTX *mem_ctx,
5281 uint16_t *system_name /* [in] [unique] */,
5282 uint32_t access_mask /* [in] */,
5283 struct policy_handle *handle /* [out] [ref] */,
5284 WERROR *werror)
5286 struct winreg_OpenHKPN r;
5287 NTSTATUS status;
5289 /* In parameters */
5290 r.in.system_name = system_name;
5291 r.in.access_mask = access_mask;
5293 status = cli->dispatch(cli,
5294 mem_ctx,
5295 &ndr_table_winreg,
5296 NDR_WINREG_OPENHKPN,
5297 &r);
5299 if (!NT_STATUS_IS_OK(status)) {
5300 return status;
5303 if (NT_STATUS_IS_ERR(status)) {
5304 return status;
5307 /* Return variables */
5308 *handle = *r.out.handle;
5310 /* Return result */
5311 if (werror) {
5312 *werror = r.out.result;
5315 return werror_to_ntstatus(r.out.result);
5318 struct rpccli_winreg_QueryMultipleValues2_state {
5319 struct winreg_QueryMultipleValues2 orig;
5320 struct winreg_QueryMultipleValues2 tmp;
5321 TALLOC_CTX *out_mem_ctx;
5322 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5325 static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq);
5327 struct tevent_req *rpccli_winreg_QueryMultipleValues2_send(TALLOC_CTX *mem_ctx,
5328 struct tevent_context *ev,
5329 struct rpc_pipe_client *cli)
5331 struct tevent_req *req;
5332 struct rpccli_winreg_QueryMultipleValues2_state *state;
5333 struct tevent_req *subreq;
5335 req = tevent_req_create(mem_ctx, &state,
5336 struct rpccli_winreg_QueryMultipleValues2_state);
5337 if (req == NULL) {
5338 return NULL;
5340 state->out_mem_ctx = NULL;
5341 state->dispatch_recv = cli->dispatch_recv;
5343 /* In parameters */
5345 /* Out parameters */
5347 /* Result */
5348 ZERO_STRUCT(state->orig.out.result);
5350 /* make a temporary copy, that we pass to the dispatch function */
5351 state->tmp = state->orig;
5353 subreq = cli->dispatch_send(state, ev, cli,
5354 &ndr_table_winreg,
5355 NDR_WINREG_QUERYMULTIPLEVALUES2,
5356 &state->tmp);
5357 if (tevent_req_nomem(subreq, req)) {
5358 return tevent_req_post(req, ev);
5360 tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues2_done, req);
5361 return req;
5364 static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq)
5366 struct tevent_req *req = tevent_req_callback_data(
5367 subreq, struct tevent_req);
5368 struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
5369 req, struct rpccli_winreg_QueryMultipleValues2_state);
5370 NTSTATUS status;
5371 TALLOC_CTX *mem_ctx;
5373 if (state->out_mem_ctx) {
5374 mem_ctx = state->out_mem_ctx;
5375 } else {
5376 mem_ctx = state;
5379 status = state->dispatch_recv(subreq, mem_ctx);
5380 TALLOC_FREE(subreq);
5381 if (!NT_STATUS_IS_OK(status)) {
5382 tevent_req_nterror(req, status);
5383 return;
5386 /* Copy out parameters */
5388 /* Copy result */
5389 state->orig.out.result = state->tmp.out.result;
5391 /* Reset temporary structure */
5392 ZERO_STRUCT(state->tmp);
5394 tevent_req_done(req);
5397 NTSTATUS rpccli_winreg_QueryMultipleValues2_recv(struct tevent_req *req,
5398 TALLOC_CTX *mem_ctx,
5399 WERROR *result)
5401 struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
5402 req, struct rpccli_winreg_QueryMultipleValues2_state);
5403 NTSTATUS status;
5405 if (tevent_req_is_nterror(req, &status)) {
5406 tevent_req_received(req);
5407 return status;
5410 /* Steal possbile out parameters to the callers context */
5411 talloc_steal(mem_ctx, state->out_mem_ctx);
5413 /* Return result */
5414 *result = state->orig.out.result;
5416 tevent_req_received(req);
5417 return NT_STATUS_OK;
5420 NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli,
5421 TALLOC_CTX *mem_ctx,
5422 WERROR *werror)
5424 struct winreg_QueryMultipleValues2 r;
5425 NTSTATUS status;
5427 /* In parameters */
5429 status = cli->dispatch(cli,
5430 mem_ctx,
5431 &ndr_table_winreg,
5432 NDR_WINREG_QUERYMULTIPLEVALUES2,
5433 &r);
5435 if (!NT_STATUS_IS_OK(status)) {
5436 return status;
5439 if (NT_STATUS_IS_ERR(status)) {
5440 return status;
5443 /* Return variables */
5445 /* Return result */
5446 if (werror) {
5447 *werror = r.out.result;
5450 return werror_to_ntstatus(r.out.result);