WHATSNEW: Start release notes for Samba 3.5.21.
[Samba.git] / librpc / gen_ndr / cli_winreg.c
blob15017d250577724fefda5163bb347cc69decd007
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 if ((*state->tmp.out.size) > (*state->tmp.in.size)) {
1672 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
1673 return;
1675 if ((*state->tmp.out.length) > (*state->tmp.out.size)) {
1676 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
1677 return;
1679 memcpy(state->orig.out.value, state->tmp.out.value, (*state->tmp.out.length) * sizeof(*state->orig.out.value));
1681 if (state->orig.out.size && state->tmp.out.size) {
1682 *state->orig.out.size = *state->tmp.out.size;
1684 if (state->orig.out.length && state->tmp.out.length) {
1685 *state->orig.out.length = *state->tmp.out.length;
1688 /* Copy result */
1689 state->orig.out.result = state->tmp.out.result;
1691 /* Reset temporary structure */
1692 ZERO_STRUCT(state->tmp);
1694 tevent_req_done(req);
1697 NTSTATUS rpccli_winreg_EnumValue_recv(struct tevent_req *req,
1698 TALLOC_CTX *mem_ctx,
1699 WERROR *result)
1701 struct rpccli_winreg_EnumValue_state *state = tevent_req_data(
1702 req, struct rpccli_winreg_EnumValue_state);
1703 NTSTATUS status;
1705 if (tevent_req_is_nterror(req, &status)) {
1706 tevent_req_received(req);
1707 return status;
1710 /* Steal possbile out parameters to the callers context */
1711 talloc_steal(mem_ctx, state->out_mem_ctx);
1713 /* Return result */
1714 *result = state->orig.out.result;
1716 tevent_req_received(req);
1717 return NT_STATUS_OK;
1720 NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
1721 TALLOC_CTX *mem_ctx,
1722 struct policy_handle *handle /* [in] [ref] */,
1723 uint32_t enum_index /* [in] */,
1724 struct winreg_ValNameBuf *name /* [in,out] [ref] */,
1725 enum winreg_Type *type /* [in,out] [unique] */,
1726 uint8_t *value /* [in,out] [unique,length_is(*length),size_is(*size)] */,
1727 uint32_t *size /* [in,out] [unique] */,
1728 uint32_t *length /* [in,out] [unique] */,
1729 WERROR *werror)
1731 struct winreg_EnumValue r;
1732 NTSTATUS status;
1734 /* In parameters */
1735 r.in.handle = handle;
1736 r.in.enum_index = enum_index;
1737 r.in.name = name;
1738 r.in.type = type;
1739 r.in.value = value;
1740 r.in.size = size;
1741 r.in.length = length;
1743 status = cli->dispatch(cli,
1744 mem_ctx,
1745 &ndr_table_winreg,
1746 NDR_WINREG_ENUMVALUE,
1747 &r);
1749 if (!NT_STATUS_IS_OK(status)) {
1750 return status;
1753 if (NT_STATUS_IS_ERR(status)) {
1754 return status;
1757 /* Return variables */
1758 *name = *r.out.name;
1759 if (type && r.out.type) {
1760 *type = *r.out.type;
1762 if (value && r.out.value) {
1763 if ((*r.out.size) > (*r.in.size)) {
1764 return NT_STATUS_INVALID_NETWORK_RESPONSE;
1766 if ((*r.out.length) > (*r.out.size)) {
1767 return NT_STATUS_INVALID_NETWORK_RESPONSE;
1769 memcpy(value, r.out.value, (*r.out.length) * sizeof(*value));
1771 if (size && r.out.size) {
1772 *size = *r.out.size;
1774 if (length && r.out.length) {
1775 *length = *r.out.length;
1778 /* Return result */
1779 if (werror) {
1780 *werror = r.out.result;
1783 return werror_to_ntstatus(r.out.result);
1786 struct rpccli_winreg_FlushKey_state {
1787 struct winreg_FlushKey orig;
1788 struct winreg_FlushKey tmp;
1789 TALLOC_CTX *out_mem_ctx;
1790 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1793 static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq);
1795 struct tevent_req *rpccli_winreg_FlushKey_send(TALLOC_CTX *mem_ctx,
1796 struct tevent_context *ev,
1797 struct rpc_pipe_client *cli,
1798 struct policy_handle *_handle /* [in] [ref] */)
1800 struct tevent_req *req;
1801 struct rpccli_winreg_FlushKey_state *state;
1802 struct tevent_req *subreq;
1804 req = tevent_req_create(mem_ctx, &state,
1805 struct rpccli_winreg_FlushKey_state);
1806 if (req == NULL) {
1807 return NULL;
1809 state->out_mem_ctx = NULL;
1810 state->dispatch_recv = cli->dispatch_recv;
1812 /* In parameters */
1813 state->orig.in.handle = _handle;
1815 /* Out parameters */
1817 /* Result */
1818 ZERO_STRUCT(state->orig.out.result);
1820 /* make a temporary copy, that we pass to the dispatch function */
1821 state->tmp = state->orig;
1823 subreq = cli->dispatch_send(state, ev, cli,
1824 &ndr_table_winreg,
1825 NDR_WINREG_FLUSHKEY,
1826 &state->tmp);
1827 if (tevent_req_nomem(subreq, req)) {
1828 return tevent_req_post(req, ev);
1830 tevent_req_set_callback(subreq, rpccli_winreg_FlushKey_done, req);
1831 return req;
1834 static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq)
1836 struct tevent_req *req = tevent_req_callback_data(
1837 subreq, struct tevent_req);
1838 struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
1839 req, struct rpccli_winreg_FlushKey_state);
1840 NTSTATUS status;
1841 TALLOC_CTX *mem_ctx;
1843 if (state->out_mem_ctx) {
1844 mem_ctx = state->out_mem_ctx;
1845 } else {
1846 mem_ctx = state;
1849 status = state->dispatch_recv(subreq, mem_ctx);
1850 TALLOC_FREE(subreq);
1851 if (!NT_STATUS_IS_OK(status)) {
1852 tevent_req_nterror(req, status);
1853 return;
1856 /* Copy out parameters */
1858 /* Copy result */
1859 state->orig.out.result = state->tmp.out.result;
1861 /* Reset temporary structure */
1862 ZERO_STRUCT(state->tmp);
1864 tevent_req_done(req);
1867 NTSTATUS rpccli_winreg_FlushKey_recv(struct tevent_req *req,
1868 TALLOC_CTX *mem_ctx,
1869 WERROR *result)
1871 struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
1872 req, struct rpccli_winreg_FlushKey_state);
1873 NTSTATUS status;
1875 if (tevent_req_is_nterror(req, &status)) {
1876 tevent_req_received(req);
1877 return status;
1880 /* Steal possbile out parameters to the callers context */
1881 talloc_steal(mem_ctx, state->out_mem_ctx);
1883 /* Return result */
1884 *result = state->orig.out.result;
1886 tevent_req_received(req);
1887 return NT_STATUS_OK;
1890 NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli,
1891 TALLOC_CTX *mem_ctx,
1892 struct policy_handle *handle /* [in] [ref] */,
1893 WERROR *werror)
1895 struct winreg_FlushKey r;
1896 NTSTATUS status;
1898 /* In parameters */
1899 r.in.handle = handle;
1901 status = cli->dispatch(cli,
1902 mem_ctx,
1903 &ndr_table_winreg,
1904 NDR_WINREG_FLUSHKEY,
1905 &r);
1907 if (!NT_STATUS_IS_OK(status)) {
1908 return status;
1911 if (NT_STATUS_IS_ERR(status)) {
1912 return status;
1915 /* Return variables */
1917 /* Return result */
1918 if (werror) {
1919 *werror = r.out.result;
1922 return werror_to_ntstatus(r.out.result);
1925 struct rpccli_winreg_GetKeySecurity_state {
1926 struct winreg_GetKeySecurity orig;
1927 struct winreg_GetKeySecurity tmp;
1928 TALLOC_CTX *out_mem_ctx;
1929 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1932 static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq);
1934 struct tevent_req *rpccli_winreg_GetKeySecurity_send(TALLOC_CTX *mem_ctx,
1935 struct tevent_context *ev,
1936 struct rpc_pipe_client *cli,
1937 struct policy_handle *_handle /* [in] [ref] */,
1938 uint32_t _sec_info /* [in] */,
1939 struct KeySecurityData *_sd /* [in,out] [ref] */)
1941 struct tevent_req *req;
1942 struct rpccli_winreg_GetKeySecurity_state *state;
1943 struct tevent_req *subreq;
1945 req = tevent_req_create(mem_ctx, &state,
1946 struct rpccli_winreg_GetKeySecurity_state);
1947 if (req == NULL) {
1948 return NULL;
1950 state->out_mem_ctx = NULL;
1951 state->dispatch_recv = cli->dispatch_recv;
1953 /* In parameters */
1954 state->orig.in.handle = _handle;
1955 state->orig.in.sec_info = _sec_info;
1956 state->orig.in.sd = _sd;
1958 /* Out parameters */
1959 state->orig.out.sd = _sd;
1961 /* Result */
1962 ZERO_STRUCT(state->orig.out.result);
1964 state->out_mem_ctx = talloc_named_const(state, 0,
1965 "rpccli_winreg_GetKeySecurity_out_memory");
1966 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1967 return tevent_req_post(req, ev);
1970 /* make a temporary copy, that we pass to the dispatch function */
1971 state->tmp = state->orig;
1973 subreq = cli->dispatch_send(state, ev, cli,
1974 &ndr_table_winreg,
1975 NDR_WINREG_GETKEYSECURITY,
1976 &state->tmp);
1977 if (tevent_req_nomem(subreq, req)) {
1978 return tevent_req_post(req, ev);
1980 tevent_req_set_callback(subreq, rpccli_winreg_GetKeySecurity_done, req);
1981 return req;
1984 static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq)
1986 struct tevent_req *req = tevent_req_callback_data(
1987 subreq, struct tevent_req);
1988 struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
1989 req, struct rpccli_winreg_GetKeySecurity_state);
1990 NTSTATUS status;
1991 TALLOC_CTX *mem_ctx;
1993 if (state->out_mem_ctx) {
1994 mem_ctx = state->out_mem_ctx;
1995 } else {
1996 mem_ctx = state;
1999 status = state->dispatch_recv(subreq, mem_ctx);
2000 TALLOC_FREE(subreq);
2001 if (!NT_STATUS_IS_OK(status)) {
2002 tevent_req_nterror(req, status);
2003 return;
2006 /* Copy out parameters */
2007 *state->orig.out.sd = *state->tmp.out.sd;
2009 /* Copy result */
2010 state->orig.out.result = state->tmp.out.result;
2012 /* Reset temporary structure */
2013 ZERO_STRUCT(state->tmp);
2015 tevent_req_done(req);
2018 NTSTATUS rpccli_winreg_GetKeySecurity_recv(struct tevent_req *req,
2019 TALLOC_CTX *mem_ctx,
2020 WERROR *result)
2022 struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
2023 req, struct rpccli_winreg_GetKeySecurity_state);
2024 NTSTATUS status;
2026 if (tevent_req_is_nterror(req, &status)) {
2027 tevent_req_received(req);
2028 return status;
2031 /* Steal possbile out parameters to the callers context */
2032 talloc_steal(mem_ctx, state->out_mem_ctx);
2034 /* Return result */
2035 *result = state->orig.out.result;
2037 tevent_req_received(req);
2038 return NT_STATUS_OK;
2041 NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli,
2042 TALLOC_CTX *mem_ctx,
2043 struct policy_handle *handle /* [in] [ref] */,
2044 uint32_t sec_info /* [in] */,
2045 struct KeySecurityData *sd /* [in,out] [ref] */,
2046 WERROR *werror)
2048 struct winreg_GetKeySecurity r;
2049 NTSTATUS status;
2051 /* In parameters */
2052 r.in.handle = handle;
2053 r.in.sec_info = sec_info;
2054 r.in.sd = sd;
2056 status = cli->dispatch(cli,
2057 mem_ctx,
2058 &ndr_table_winreg,
2059 NDR_WINREG_GETKEYSECURITY,
2060 &r);
2062 if (!NT_STATUS_IS_OK(status)) {
2063 return status;
2066 if (NT_STATUS_IS_ERR(status)) {
2067 return status;
2070 /* Return variables */
2071 *sd = *r.out.sd;
2073 /* Return result */
2074 if (werror) {
2075 *werror = r.out.result;
2078 return werror_to_ntstatus(r.out.result);
2081 struct rpccli_winreg_LoadKey_state {
2082 struct winreg_LoadKey orig;
2083 struct winreg_LoadKey tmp;
2084 TALLOC_CTX *out_mem_ctx;
2085 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2088 static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq);
2090 struct tevent_req *rpccli_winreg_LoadKey_send(TALLOC_CTX *mem_ctx,
2091 struct tevent_context *ev,
2092 struct rpc_pipe_client *cli,
2093 struct policy_handle *_handle /* [in] [ref] */,
2094 struct winreg_String *_keyname /* [in] [unique] */,
2095 struct winreg_String *_filename /* [in] [unique] */)
2097 struct tevent_req *req;
2098 struct rpccli_winreg_LoadKey_state *state;
2099 struct tevent_req *subreq;
2101 req = tevent_req_create(mem_ctx, &state,
2102 struct rpccli_winreg_LoadKey_state);
2103 if (req == NULL) {
2104 return NULL;
2106 state->out_mem_ctx = NULL;
2107 state->dispatch_recv = cli->dispatch_recv;
2109 /* In parameters */
2110 state->orig.in.handle = _handle;
2111 state->orig.in.keyname = _keyname;
2112 state->orig.in.filename = _filename;
2114 /* Out parameters */
2116 /* Result */
2117 ZERO_STRUCT(state->orig.out.result);
2119 /* make a temporary copy, that we pass to the dispatch function */
2120 state->tmp = state->orig;
2122 subreq = cli->dispatch_send(state, ev, cli,
2123 &ndr_table_winreg,
2124 NDR_WINREG_LOADKEY,
2125 &state->tmp);
2126 if (tevent_req_nomem(subreq, req)) {
2127 return tevent_req_post(req, ev);
2129 tevent_req_set_callback(subreq, rpccli_winreg_LoadKey_done, req);
2130 return req;
2133 static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq)
2135 struct tevent_req *req = tevent_req_callback_data(
2136 subreq, struct tevent_req);
2137 struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
2138 req, struct rpccli_winreg_LoadKey_state);
2139 NTSTATUS status;
2140 TALLOC_CTX *mem_ctx;
2142 if (state->out_mem_ctx) {
2143 mem_ctx = state->out_mem_ctx;
2144 } else {
2145 mem_ctx = state;
2148 status = state->dispatch_recv(subreq, mem_ctx);
2149 TALLOC_FREE(subreq);
2150 if (!NT_STATUS_IS_OK(status)) {
2151 tevent_req_nterror(req, status);
2152 return;
2155 /* Copy out parameters */
2157 /* Copy result */
2158 state->orig.out.result = state->tmp.out.result;
2160 /* Reset temporary structure */
2161 ZERO_STRUCT(state->tmp);
2163 tevent_req_done(req);
2166 NTSTATUS rpccli_winreg_LoadKey_recv(struct tevent_req *req,
2167 TALLOC_CTX *mem_ctx,
2168 WERROR *result)
2170 struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
2171 req, struct rpccli_winreg_LoadKey_state);
2172 NTSTATUS status;
2174 if (tevent_req_is_nterror(req, &status)) {
2175 tevent_req_received(req);
2176 return status;
2179 /* Steal possbile out parameters to the callers context */
2180 talloc_steal(mem_ctx, state->out_mem_ctx);
2182 /* Return result */
2183 *result = state->orig.out.result;
2185 tevent_req_received(req);
2186 return NT_STATUS_OK;
2189 NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli,
2190 TALLOC_CTX *mem_ctx,
2191 struct policy_handle *handle /* [in] [ref] */,
2192 struct winreg_String *keyname /* [in] [unique] */,
2193 struct winreg_String *filename /* [in] [unique] */,
2194 WERROR *werror)
2196 struct winreg_LoadKey r;
2197 NTSTATUS status;
2199 /* In parameters */
2200 r.in.handle = handle;
2201 r.in.keyname = keyname;
2202 r.in.filename = filename;
2204 status = cli->dispatch(cli,
2205 mem_ctx,
2206 &ndr_table_winreg,
2207 NDR_WINREG_LOADKEY,
2208 &r);
2210 if (!NT_STATUS_IS_OK(status)) {
2211 return status;
2214 if (NT_STATUS_IS_ERR(status)) {
2215 return status;
2218 /* Return variables */
2220 /* Return result */
2221 if (werror) {
2222 *werror = r.out.result;
2225 return werror_to_ntstatus(r.out.result);
2228 struct rpccli_winreg_NotifyChangeKeyValue_state {
2229 struct winreg_NotifyChangeKeyValue orig;
2230 struct winreg_NotifyChangeKeyValue tmp;
2231 TALLOC_CTX *out_mem_ctx;
2232 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2235 static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq);
2237 struct tevent_req *rpccli_winreg_NotifyChangeKeyValue_send(TALLOC_CTX *mem_ctx,
2238 struct tevent_context *ev,
2239 struct rpc_pipe_client *cli,
2240 struct policy_handle *_handle /* [in] [ref] */,
2241 uint8_t _watch_subtree /* [in] */,
2242 uint32_t _notify_filter /* [in] */,
2243 uint32_t _unknown /* [in] */,
2244 struct winreg_String _string1 /* [in] */,
2245 struct winreg_String _string2 /* [in] */,
2246 uint32_t _unknown2 /* [in] */)
2248 struct tevent_req *req;
2249 struct rpccli_winreg_NotifyChangeKeyValue_state *state;
2250 struct tevent_req *subreq;
2252 req = tevent_req_create(mem_ctx, &state,
2253 struct rpccli_winreg_NotifyChangeKeyValue_state);
2254 if (req == NULL) {
2255 return NULL;
2257 state->out_mem_ctx = NULL;
2258 state->dispatch_recv = cli->dispatch_recv;
2260 /* In parameters */
2261 state->orig.in.handle = _handle;
2262 state->orig.in.watch_subtree = _watch_subtree;
2263 state->orig.in.notify_filter = _notify_filter;
2264 state->orig.in.unknown = _unknown;
2265 state->orig.in.string1 = _string1;
2266 state->orig.in.string2 = _string2;
2267 state->orig.in.unknown2 = _unknown2;
2269 /* Out parameters */
2271 /* Result */
2272 ZERO_STRUCT(state->orig.out.result);
2274 /* make a temporary copy, that we pass to the dispatch function */
2275 state->tmp = state->orig;
2277 subreq = cli->dispatch_send(state, ev, cli,
2278 &ndr_table_winreg,
2279 NDR_WINREG_NOTIFYCHANGEKEYVALUE,
2280 &state->tmp);
2281 if (tevent_req_nomem(subreq, req)) {
2282 return tevent_req_post(req, ev);
2284 tevent_req_set_callback(subreq, rpccli_winreg_NotifyChangeKeyValue_done, req);
2285 return req;
2288 static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq)
2290 struct tevent_req *req = tevent_req_callback_data(
2291 subreq, struct tevent_req);
2292 struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
2293 req, struct rpccli_winreg_NotifyChangeKeyValue_state);
2294 NTSTATUS status;
2295 TALLOC_CTX *mem_ctx;
2297 if (state->out_mem_ctx) {
2298 mem_ctx = state->out_mem_ctx;
2299 } else {
2300 mem_ctx = state;
2303 status = state->dispatch_recv(subreq, mem_ctx);
2304 TALLOC_FREE(subreq);
2305 if (!NT_STATUS_IS_OK(status)) {
2306 tevent_req_nterror(req, status);
2307 return;
2310 /* Copy out parameters */
2312 /* Copy result */
2313 state->orig.out.result = state->tmp.out.result;
2315 /* Reset temporary structure */
2316 ZERO_STRUCT(state->tmp);
2318 tevent_req_done(req);
2321 NTSTATUS rpccli_winreg_NotifyChangeKeyValue_recv(struct tevent_req *req,
2322 TALLOC_CTX *mem_ctx,
2323 WERROR *result)
2325 struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
2326 req, struct rpccli_winreg_NotifyChangeKeyValue_state);
2327 NTSTATUS status;
2329 if (tevent_req_is_nterror(req, &status)) {
2330 tevent_req_received(req);
2331 return status;
2334 /* Steal possbile out parameters to the callers context */
2335 talloc_steal(mem_ctx, state->out_mem_ctx);
2337 /* Return result */
2338 *result = state->orig.out.result;
2340 tevent_req_received(req);
2341 return NT_STATUS_OK;
2344 NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli,
2345 TALLOC_CTX *mem_ctx,
2346 struct policy_handle *handle /* [in] [ref] */,
2347 uint8_t watch_subtree /* [in] */,
2348 uint32_t notify_filter /* [in] */,
2349 uint32_t unknown /* [in] */,
2350 struct winreg_String string1 /* [in] */,
2351 struct winreg_String string2 /* [in] */,
2352 uint32_t unknown2 /* [in] */,
2353 WERROR *werror)
2355 struct winreg_NotifyChangeKeyValue r;
2356 NTSTATUS status;
2358 /* In parameters */
2359 r.in.handle = handle;
2360 r.in.watch_subtree = watch_subtree;
2361 r.in.notify_filter = notify_filter;
2362 r.in.unknown = unknown;
2363 r.in.string1 = string1;
2364 r.in.string2 = string2;
2365 r.in.unknown2 = unknown2;
2367 status = cli->dispatch(cli,
2368 mem_ctx,
2369 &ndr_table_winreg,
2370 NDR_WINREG_NOTIFYCHANGEKEYVALUE,
2371 &r);
2373 if (!NT_STATUS_IS_OK(status)) {
2374 return status;
2377 if (NT_STATUS_IS_ERR(status)) {
2378 return status;
2381 /* Return variables */
2383 /* Return result */
2384 if (werror) {
2385 *werror = r.out.result;
2388 return werror_to_ntstatus(r.out.result);
2391 struct rpccli_winreg_OpenKey_state {
2392 struct winreg_OpenKey orig;
2393 struct winreg_OpenKey tmp;
2394 TALLOC_CTX *out_mem_ctx;
2395 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2398 static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq);
2400 struct tevent_req *rpccli_winreg_OpenKey_send(TALLOC_CTX *mem_ctx,
2401 struct tevent_context *ev,
2402 struct rpc_pipe_client *cli,
2403 struct policy_handle *_parent_handle /* [in] [ref] */,
2404 struct winreg_String _keyname /* [in] */,
2405 uint32_t _unknown /* [in] */,
2406 uint32_t _access_mask /* [in] */,
2407 struct policy_handle *_handle /* [out] [ref] */)
2409 struct tevent_req *req;
2410 struct rpccli_winreg_OpenKey_state *state;
2411 struct tevent_req *subreq;
2413 req = tevent_req_create(mem_ctx, &state,
2414 struct rpccli_winreg_OpenKey_state);
2415 if (req == NULL) {
2416 return NULL;
2418 state->out_mem_ctx = NULL;
2419 state->dispatch_recv = cli->dispatch_recv;
2421 /* In parameters */
2422 state->orig.in.parent_handle = _parent_handle;
2423 state->orig.in.keyname = _keyname;
2424 state->orig.in.unknown = _unknown;
2425 state->orig.in.access_mask = _access_mask;
2427 /* Out parameters */
2428 state->orig.out.handle = _handle;
2430 /* Result */
2431 ZERO_STRUCT(state->orig.out.result);
2433 state->out_mem_ctx = talloc_named_const(state, 0,
2434 "rpccli_winreg_OpenKey_out_memory");
2435 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2436 return tevent_req_post(req, ev);
2439 /* make a temporary copy, that we pass to the dispatch function */
2440 state->tmp = state->orig;
2442 subreq = cli->dispatch_send(state, ev, cli,
2443 &ndr_table_winreg,
2444 NDR_WINREG_OPENKEY,
2445 &state->tmp);
2446 if (tevent_req_nomem(subreq, req)) {
2447 return tevent_req_post(req, ev);
2449 tevent_req_set_callback(subreq, rpccli_winreg_OpenKey_done, req);
2450 return req;
2453 static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq)
2455 struct tevent_req *req = tevent_req_callback_data(
2456 subreq, struct tevent_req);
2457 struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
2458 req, struct rpccli_winreg_OpenKey_state);
2459 NTSTATUS status;
2460 TALLOC_CTX *mem_ctx;
2462 if (state->out_mem_ctx) {
2463 mem_ctx = state->out_mem_ctx;
2464 } else {
2465 mem_ctx = state;
2468 status = state->dispatch_recv(subreq, mem_ctx);
2469 TALLOC_FREE(subreq);
2470 if (!NT_STATUS_IS_OK(status)) {
2471 tevent_req_nterror(req, status);
2472 return;
2475 /* Copy out parameters */
2476 *state->orig.out.handle = *state->tmp.out.handle;
2478 /* Copy result */
2479 state->orig.out.result = state->tmp.out.result;
2481 /* Reset temporary structure */
2482 ZERO_STRUCT(state->tmp);
2484 tevent_req_done(req);
2487 NTSTATUS rpccli_winreg_OpenKey_recv(struct tevent_req *req,
2488 TALLOC_CTX *mem_ctx,
2489 WERROR *result)
2491 struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
2492 req, struct rpccli_winreg_OpenKey_state);
2493 NTSTATUS status;
2495 if (tevent_req_is_nterror(req, &status)) {
2496 tevent_req_received(req);
2497 return status;
2500 /* Steal possbile out parameters to the callers context */
2501 talloc_steal(mem_ctx, state->out_mem_ctx);
2503 /* Return result */
2504 *result = state->orig.out.result;
2506 tevent_req_received(req);
2507 return NT_STATUS_OK;
2510 NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli,
2511 TALLOC_CTX *mem_ctx,
2512 struct policy_handle *parent_handle /* [in] [ref] */,
2513 struct winreg_String keyname /* [in] */,
2514 uint32_t unknown /* [in] */,
2515 uint32_t access_mask /* [in] */,
2516 struct policy_handle *handle /* [out] [ref] */,
2517 WERROR *werror)
2519 struct winreg_OpenKey r;
2520 NTSTATUS status;
2522 /* In parameters */
2523 r.in.parent_handle = parent_handle;
2524 r.in.keyname = keyname;
2525 r.in.unknown = unknown;
2526 r.in.access_mask = access_mask;
2528 status = cli->dispatch(cli,
2529 mem_ctx,
2530 &ndr_table_winreg,
2531 NDR_WINREG_OPENKEY,
2532 &r);
2534 if (!NT_STATUS_IS_OK(status)) {
2535 return status;
2538 if (NT_STATUS_IS_ERR(status)) {
2539 return status;
2542 /* Return variables */
2543 *handle = *r.out.handle;
2545 /* Return result */
2546 if (werror) {
2547 *werror = r.out.result;
2550 return werror_to_ntstatus(r.out.result);
2553 struct rpccli_winreg_QueryInfoKey_state {
2554 struct winreg_QueryInfoKey orig;
2555 struct winreg_QueryInfoKey tmp;
2556 TALLOC_CTX *out_mem_ctx;
2557 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2560 static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq);
2562 struct tevent_req *rpccli_winreg_QueryInfoKey_send(TALLOC_CTX *mem_ctx,
2563 struct tevent_context *ev,
2564 struct rpc_pipe_client *cli,
2565 struct policy_handle *_handle /* [in] [ref] */,
2566 struct winreg_String *_classname /* [in,out] [ref] */,
2567 uint32_t *_num_subkeys /* [out] [ref] */,
2568 uint32_t *_max_subkeylen /* [out] [ref] */,
2569 uint32_t *_max_classlen /* [out] [ref] */,
2570 uint32_t *_num_values /* [out] [ref] */,
2571 uint32_t *_max_valnamelen /* [out] [ref] */,
2572 uint32_t *_max_valbufsize /* [out] [ref] */,
2573 uint32_t *_secdescsize /* [out] [ref] */,
2574 NTTIME *_last_changed_time /* [out] [ref] */)
2576 struct tevent_req *req;
2577 struct rpccli_winreg_QueryInfoKey_state *state;
2578 struct tevent_req *subreq;
2580 req = tevent_req_create(mem_ctx, &state,
2581 struct rpccli_winreg_QueryInfoKey_state);
2582 if (req == NULL) {
2583 return NULL;
2585 state->out_mem_ctx = NULL;
2586 state->dispatch_recv = cli->dispatch_recv;
2588 /* In parameters */
2589 state->orig.in.handle = _handle;
2590 state->orig.in.classname = _classname;
2592 /* Out parameters */
2593 state->orig.out.classname = _classname;
2594 state->orig.out.num_subkeys = _num_subkeys;
2595 state->orig.out.max_subkeylen = _max_subkeylen;
2596 state->orig.out.max_classlen = _max_classlen;
2597 state->orig.out.num_values = _num_values;
2598 state->orig.out.max_valnamelen = _max_valnamelen;
2599 state->orig.out.max_valbufsize = _max_valbufsize;
2600 state->orig.out.secdescsize = _secdescsize;
2601 state->orig.out.last_changed_time = _last_changed_time;
2603 /* Result */
2604 ZERO_STRUCT(state->orig.out.result);
2606 state->out_mem_ctx = talloc_named_const(state, 0,
2607 "rpccli_winreg_QueryInfoKey_out_memory");
2608 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2609 return tevent_req_post(req, ev);
2612 /* make a temporary copy, that we pass to the dispatch function */
2613 state->tmp = state->orig;
2615 subreq = cli->dispatch_send(state, ev, cli,
2616 &ndr_table_winreg,
2617 NDR_WINREG_QUERYINFOKEY,
2618 &state->tmp);
2619 if (tevent_req_nomem(subreq, req)) {
2620 return tevent_req_post(req, ev);
2622 tevent_req_set_callback(subreq, rpccli_winreg_QueryInfoKey_done, req);
2623 return req;
2626 static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq)
2628 struct tevent_req *req = tevent_req_callback_data(
2629 subreq, struct tevent_req);
2630 struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
2631 req, struct rpccli_winreg_QueryInfoKey_state);
2632 NTSTATUS status;
2633 TALLOC_CTX *mem_ctx;
2635 if (state->out_mem_ctx) {
2636 mem_ctx = state->out_mem_ctx;
2637 } else {
2638 mem_ctx = state;
2641 status = state->dispatch_recv(subreq, mem_ctx);
2642 TALLOC_FREE(subreq);
2643 if (!NT_STATUS_IS_OK(status)) {
2644 tevent_req_nterror(req, status);
2645 return;
2648 /* Copy out parameters */
2649 *state->orig.out.classname = *state->tmp.out.classname;
2650 *state->orig.out.num_subkeys = *state->tmp.out.num_subkeys;
2651 *state->orig.out.max_subkeylen = *state->tmp.out.max_subkeylen;
2652 *state->orig.out.max_classlen = *state->tmp.out.max_classlen;
2653 *state->orig.out.num_values = *state->tmp.out.num_values;
2654 *state->orig.out.max_valnamelen = *state->tmp.out.max_valnamelen;
2655 *state->orig.out.max_valbufsize = *state->tmp.out.max_valbufsize;
2656 *state->orig.out.secdescsize = *state->tmp.out.secdescsize;
2657 *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
2659 /* Copy result */
2660 state->orig.out.result = state->tmp.out.result;
2662 /* Reset temporary structure */
2663 ZERO_STRUCT(state->tmp);
2665 tevent_req_done(req);
2668 NTSTATUS rpccli_winreg_QueryInfoKey_recv(struct tevent_req *req,
2669 TALLOC_CTX *mem_ctx,
2670 WERROR *result)
2672 struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
2673 req, struct rpccli_winreg_QueryInfoKey_state);
2674 NTSTATUS status;
2676 if (tevent_req_is_nterror(req, &status)) {
2677 tevent_req_received(req);
2678 return status;
2681 /* Steal possbile out parameters to the callers context */
2682 talloc_steal(mem_ctx, state->out_mem_ctx);
2684 /* Return result */
2685 *result = state->orig.out.result;
2687 tevent_req_received(req);
2688 return NT_STATUS_OK;
2691 NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
2692 TALLOC_CTX *mem_ctx,
2693 struct policy_handle *handle /* [in] [ref] */,
2694 struct winreg_String *classname /* [in,out] [ref] */,
2695 uint32_t *num_subkeys /* [out] [ref] */,
2696 uint32_t *max_subkeylen /* [out] [ref] */,
2697 uint32_t *max_classlen /* [out] [ref] */,
2698 uint32_t *num_values /* [out] [ref] */,
2699 uint32_t *max_valnamelen /* [out] [ref] */,
2700 uint32_t *max_valbufsize /* [out] [ref] */,
2701 uint32_t *secdescsize /* [out] [ref] */,
2702 NTTIME *last_changed_time /* [out] [ref] */,
2703 WERROR *werror)
2705 struct winreg_QueryInfoKey r;
2706 NTSTATUS status;
2708 /* In parameters */
2709 r.in.handle = handle;
2710 r.in.classname = classname;
2712 status = cli->dispatch(cli,
2713 mem_ctx,
2714 &ndr_table_winreg,
2715 NDR_WINREG_QUERYINFOKEY,
2716 &r);
2718 if (!NT_STATUS_IS_OK(status)) {
2719 return status;
2722 if (NT_STATUS_IS_ERR(status)) {
2723 return status;
2726 /* Return variables */
2727 *classname = *r.out.classname;
2728 *num_subkeys = *r.out.num_subkeys;
2729 *max_subkeylen = *r.out.max_subkeylen;
2730 *max_classlen = *r.out.max_classlen;
2731 *num_values = *r.out.num_values;
2732 *max_valnamelen = *r.out.max_valnamelen;
2733 *max_valbufsize = *r.out.max_valbufsize;
2734 *secdescsize = *r.out.secdescsize;
2735 *last_changed_time = *r.out.last_changed_time;
2737 /* Return result */
2738 if (werror) {
2739 *werror = r.out.result;
2742 return werror_to_ntstatus(r.out.result);
2745 struct rpccli_winreg_QueryValue_state {
2746 struct winreg_QueryValue orig;
2747 struct winreg_QueryValue tmp;
2748 TALLOC_CTX *out_mem_ctx;
2749 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2752 static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq);
2754 struct tevent_req *rpccli_winreg_QueryValue_send(TALLOC_CTX *mem_ctx,
2755 struct tevent_context *ev,
2756 struct rpc_pipe_client *cli,
2757 struct policy_handle *_handle /* [in] [ref] */,
2758 struct winreg_String *_value_name /* [in] [ref] */,
2759 enum winreg_Type *_type /* [in,out] [unique] */,
2760 uint8_t *_data /* [in,out] [unique,range(0,0x4000000),length_is(data_length?*data_length:0),size_is(data_size?*data_size:0)] */,
2761 uint32_t *_data_size /* [in,out] [unique] */,
2762 uint32_t *_data_length /* [in,out] [unique] */)
2764 struct tevent_req *req;
2765 struct rpccli_winreg_QueryValue_state *state;
2766 struct tevent_req *subreq;
2768 req = tevent_req_create(mem_ctx, &state,
2769 struct rpccli_winreg_QueryValue_state);
2770 if (req == NULL) {
2771 return NULL;
2773 state->out_mem_ctx = NULL;
2774 state->dispatch_recv = cli->dispatch_recv;
2776 /* In parameters */
2777 state->orig.in.handle = _handle;
2778 state->orig.in.value_name = _value_name;
2779 state->orig.in.type = _type;
2780 state->orig.in.data = _data;
2781 state->orig.in.data_size = _data_size;
2782 state->orig.in.data_length = _data_length;
2784 /* Out parameters */
2785 state->orig.out.type = _type;
2786 state->orig.out.data = _data;
2787 state->orig.out.data_size = _data_size;
2788 state->orig.out.data_length = _data_length;
2790 /* Result */
2791 ZERO_STRUCT(state->orig.out.result);
2793 state->out_mem_ctx = talloc_named_const(state, 0,
2794 "rpccli_winreg_QueryValue_out_memory");
2795 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2796 return tevent_req_post(req, ev);
2799 /* make a temporary copy, that we pass to the dispatch function */
2800 state->tmp = state->orig;
2802 subreq = cli->dispatch_send(state, ev, cli,
2803 &ndr_table_winreg,
2804 NDR_WINREG_QUERYVALUE,
2805 &state->tmp);
2806 if (tevent_req_nomem(subreq, req)) {
2807 return tevent_req_post(req, ev);
2809 tevent_req_set_callback(subreq, rpccli_winreg_QueryValue_done, req);
2810 return req;
2813 static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq)
2815 struct tevent_req *req = tevent_req_callback_data(
2816 subreq, struct tevent_req);
2817 struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
2818 req, struct rpccli_winreg_QueryValue_state);
2819 NTSTATUS status;
2820 TALLOC_CTX *mem_ctx;
2822 if (state->out_mem_ctx) {
2823 mem_ctx = state->out_mem_ctx;
2824 } else {
2825 mem_ctx = state;
2828 status = state->dispatch_recv(subreq, mem_ctx);
2829 TALLOC_FREE(subreq);
2830 if (!NT_STATUS_IS_OK(status)) {
2831 tevent_req_nterror(req, status);
2832 return;
2835 /* Copy out parameters */
2836 if (state->orig.out.type && state->tmp.out.type) {
2837 *state->orig.out.type = *state->tmp.out.type;
2839 if (state->orig.out.data && state->tmp.out.data) {
2840 if ((state->tmp.out.data_size?*state->tmp.out.data_size:0) > (state->tmp.in.data_size?*state->tmp.in.data_size:0)) {
2841 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
2842 return;
2844 if ((state->tmp.out.data_length?*state->tmp.out.data_length:0) > (state->tmp.out.data_size?*state->tmp.out.data_size:0)) {
2845 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
2846 return;
2848 memcpy(state->orig.out.data, state->tmp.out.data, (state->tmp.out.data_length?*state->tmp.out.data_length:0) * sizeof(*state->orig.out.data));
2850 if (state->orig.out.data_size && state->tmp.out.data_size) {
2851 *state->orig.out.data_size = *state->tmp.out.data_size;
2853 if (state->orig.out.data_length && state->tmp.out.data_length) {
2854 *state->orig.out.data_length = *state->tmp.out.data_length;
2857 /* Copy result */
2858 state->orig.out.result = state->tmp.out.result;
2860 /* Reset temporary structure */
2861 ZERO_STRUCT(state->tmp);
2863 tevent_req_done(req);
2866 NTSTATUS rpccli_winreg_QueryValue_recv(struct tevent_req *req,
2867 TALLOC_CTX *mem_ctx,
2868 WERROR *result)
2870 struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
2871 req, struct rpccli_winreg_QueryValue_state);
2872 NTSTATUS status;
2874 if (tevent_req_is_nterror(req, &status)) {
2875 tevent_req_received(req);
2876 return status;
2879 /* Steal possbile out parameters to the callers context */
2880 talloc_steal(mem_ctx, state->out_mem_ctx);
2882 /* Return result */
2883 *result = state->orig.out.result;
2885 tevent_req_received(req);
2886 return NT_STATUS_OK;
2889 NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
2890 TALLOC_CTX *mem_ctx,
2891 struct policy_handle *handle /* [in] [ref] */,
2892 struct winreg_String *value_name /* [in] [ref] */,
2893 enum winreg_Type *type /* [in,out] [unique] */,
2894 uint8_t *data /* [in,out] [unique,range(0,0x4000000),length_is(data_length?*data_length:0),size_is(data_size?*data_size:0)] */,
2895 uint32_t *data_size /* [in,out] [unique] */,
2896 uint32_t *data_length /* [in,out] [unique] */,
2897 WERROR *werror)
2899 struct winreg_QueryValue r;
2900 NTSTATUS status;
2902 /* In parameters */
2903 r.in.handle = handle;
2904 r.in.value_name = value_name;
2905 r.in.type = type;
2906 r.in.data = data;
2907 r.in.data_size = data_size;
2908 r.in.data_length = data_length;
2910 status = cli->dispatch(cli,
2911 mem_ctx,
2912 &ndr_table_winreg,
2913 NDR_WINREG_QUERYVALUE,
2914 &r);
2916 if (!NT_STATUS_IS_OK(status)) {
2917 return status;
2920 if (NT_STATUS_IS_ERR(status)) {
2921 return status;
2924 /* Return variables */
2925 if (type && r.out.type) {
2926 *type = *r.out.type;
2928 if (data && r.out.data) {
2929 if ((r.out.data_size?*r.out.data_size:0) > (r.in.data_size?*r.in.data_size:0)) {
2930 return NT_STATUS_INVALID_NETWORK_RESPONSE;
2932 if ((r.out.data_length?*r.out.data_length:0) > (r.out.data_size?*r.out.data_size:0)) {
2933 return NT_STATUS_INVALID_NETWORK_RESPONSE;
2935 memcpy(data, r.out.data, (r.out.data_length?*r.out.data_length:0) * sizeof(*data));
2937 if (data_size && r.out.data_size) {
2938 *data_size = *r.out.data_size;
2940 if (data_length && r.out.data_length) {
2941 *data_length = *r.out.data_length;
2944 /* Return result */
2945 if (werror) {
2946 *werror = r.out.result;
2949 return werror_to_ntstatus(r.out.result);
2952 struct rpccli_winreg_ReplaceKey_state {
2953 struct winreg_ReplaceKey orig;
2954 struct winreg_ReplaceKey tmp;
2955 TALLOC_CTX *out_mem_ctx;
2956 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2959 static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq);
2961 struct tevent_req *rpccli_winreg_ReplaceKey_send(TALLOC_CTX *mem_ctx,
2962 struct tevent_context *ev,
2963 struct rpc_pipe_client *cli)
2965 struct tevent_req *req;
2966 struct rpccli_winreg_ReplaceKey_state *state;
2967 struct tevent_req *subreq;
2969 req = tevent_req_create(mem_ctx, &state,
2970 struct rpccli_winreg_ReplaceKey_state);
2971 if (req == NULL) {
2972 return NULL;
2974 state->out_mem_ctx = NULL;
2975 state->dispatch_recv = cli->dispatch_recv;
2977 /* In parameters */
2979 /* Out parameters */
2981 /* Result */
2982 ZERO_STRUCT(state->orig.out.result);
2984 /* make a temporary copy, that we pass to the dispatch function */
2985 state->tmp = state->orig;
2987 subreq = cli->dispatch_send(state, ev, cli,
2988 &ndr_table_winreg,
2989 NDR_WINREG_REPLACEKEY,
2990 &state->tmp);
2991 if (tevent_req_nomem(subreq, req)) {
2992 return tevent_req_post(req, ev);
2994 tevent_req_set_callback(subreq, rpccli_winreg_ReplaceKey_done, req);
2995 return req;
2998 static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq)
3000 struct tevent_req *req = tevent_req_callback_data(
3001 subreq, struct tevent_req);
3002 struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
3003 req, struct rpccli_winreg_ReplaceKey_state);
3004 NTSTATUS status;
3005 TALLOC_CTX *mem_ctx;
3007 if (state->out_mem_ctx) {
3008 mem_ctx = state->out_mem_ctx;
3009 } else {
3010 mem_ctx = state;
3013 status = state->dispatch_recv(subreq, mem_ctx);
3014 TALLOC_FREE(subreq);
3015 if (!NT_STATUS_IS_OK(status)) {
3016 tevent_req_nterror(req, status);
3017 return;
3020 /* Copy out parameters */
3022 /* Copy result */
3023 state->orig.out.result = state->tmp.out.result;
3025 /* Reset temporary structure */
3026 ZERO_STRUCT(state->tmp);
3028 tevent_req_done(req);
3031 NTSTATUS rpccli_winreg_ReplaceKey_recv(struct tevent_req *req,
3032 TALLOC_CTX *mem_ctx,
3033 WERROR *result)
3035 struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
3036 req, struct rpccli_winreg_ReplaceKey_state);
3037 NTSTATUS status;
3039 if (tevent_req_is_nterror(req, &status)) {
3040 tevent_req_received(req);
3041 return status;
3044 /* Steal possbile out parameters to the callers context */
3045 talloc_steal(mem_ctx, state->out_mem_ctx);
3047 /* Return result */
3048 *result = state->orig.out.result;
3050 tevent_req_received(req);
3051 return NT_STATUS_OK;
3054 NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli,
3055 TALLOC_CTX *mem_ctx,
3056 WERROR *werror)
3058 struct winreg_ReplaceKey r;
3059 NTSTATUS status;
3061 /* In parameters */
3063 status = cli->dispatch(cli,
3064 mem_ctx,
3065 &ndr_table_winreg,
3066 NDR_WINREG_REPLACEKEY,
3067 &r);
3069 if (!NT_STATUS_IS_OK(status)) {
3070 return status;
3073 if (NT_STATUS_IS_ERR(status)) {
3074 return status;
3077 /* Return variables */
3079 /* Return result */
3080 if (werror) {
3081 *werror = r.out.result;
3084 return werror_to_ntstatus(r.out.result);
3087 struct rpccli_winreg_RestoreKey_state {
3088 struct winreg_RestoreKey orig;
3089 struct winreg_RestoreKey tmp;
3090 TALLOC_CTX *out_mem_ctx;
3091 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3094 static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq);
3096 struct tevent_req *rpccli_winreg_RestoreKey_send(TALLOC_CTX *mem_ctx,
3097 struct tevent_context *ev,
3098 struct rpc_pipe_client *cli,
3099 struct policy_handle *_handle /* [in] [ref] */,
3100 struct winreg_String *_filename /* [in] [ref] */,
3101 uint32_t _flags /* [in] */)
3103 struct tevent_req *req;
3104 struct rpccli_winreg_RestoreKey_state *state;
3105 struct tevent_req *subreq;
3107 req = tevent_req_create(mem_ctx, &state,
3108 struct rpccli_winreg_RestoreKey_state);
3109 if (req == NULL) {
3110 return NULL;
3112 state->out_mem_ctx = NULL;
3113 state->dispatch_recv = cli->dispatch_recv;
3115 /* In parameters */
3116 state->orig.in.handle = _handle;
3117 state->orig.in.filename = _filename;
3118 state->orig.in.flags = _flags;
3120 /* Out parameters */
3122 /* Result */
3123 ZERO_STRUCT(state->orig.out.result);
3125 /* make a temporary copy, that we pass to the dispatch function */
3126 state->tmp = state->orig;
3128 subreq = cli->dispatch_send(state, ev, cli,
3129 &ndr_table_winreg,
3130 NDR_WINREG_RESTOREKEY,
3131 &state->tmp);
3132 if (tevent_req_nomem(subreq, req)) {
3133 return tevent_req_post(req, ev);
3135 tevent_req_set_callback(subreq, rpccli_winreg_RestoreKey_done, req);
3136 return req;
3139 static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq)
3141 struct tevent_req *req = tevent_req_callback_data(
3142 subreq, struct tevent_req);
3143 struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
3144 req, struct rpccli_winreg_RestoreKey_state);
3145 NTSTATUS status;
3146 TALLOC_CTX *mem_ctx;
3148 if (state->out_mem_ctx) {
3149 mem_ctx = state->out_mem_ctx;
3150 } else {
3151 mem_ctx = state;
3154 status = state->dispatch_recv(subreq, mem_ctx);
3155 TALLOC_FREE(subreq);
3156 if (!NT_STATUS_IS_OK(status)) {
3157 tevent_req_nterror(req, status);
3158 return;
3161 /* Copy out parameters */
3163 /* Copy result */
3164 state->orig.out.result = state->tmp.out.result;
3166 /* Reset temporary structure */
3167 ZERO_STRUCT(state->tmp);
3169 tevent_req_done(req);
3172 NTSTATUS rpccli_winreg_RestoreKey_recv(struct tevent_req *req,
3173 TALLOC_CTX *mem_ctx,
3174 WERROR *result)
3176 struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
3177 req, struct rpccli_winreg_RestoreKey_state);
3178 NTSTATUS status;
3180 if (tevent_req_is_nterror(req, &status)) {
3181 tevent_req_received(req);
3182 return status;
3185 /* Steal possbile out parameters to the callers context */
3186 talloc_steal(mem_ctx, state->out_mem_ctx);
3188 /* Return result */
3189 *result = state->orig.out.result;
3191 tevent_req_received(req);
3192 return NT_STATUS_OK;
3195 NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli,
3196 TALLOC_CTX *mem_ctx,
3197 struct policy_handle *handle /* [in] [ref] */,
3198 struct winreg_String *filename /* [in] [ref] */,
3199 uint32_t flags /* [in] */,
3200 WERROR *werror)
3202 struct winreg_RestoreKey r;
3203 NTSTATUS status;
3205 /* In parameters */
3206 r.in.handle = handle;
3207 r.in.filename = filename;
3208 r.in.flags = flags;
3210 status = cli->dispatch(cli,
3211 mem_ctx,
3212 &ndr_table_winreg,
3213 NDR_WINREG_RESTOREKEY,
3214 &r);
3216 if (!NT_STATUS_IS_OK(status)) {
3217 return status;
3220 if (NT_STATUS_IS_ERR(status)) {
3221 return status;
3224 /* Return variables */
3226 /* Return result */
3227 if (werror) {
3228 *werror = r.out.result;
3231 return werror_to_ntstatus(r.out.result);
3234 struct rpccli_winreg_SaveKey_state {
3235 struct winreg_SaveKey orig;
3236 struct winreg_SaveKey tmp;
3237 TALLOC_CTX *out_mem_ctx;
3238 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3241 static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq);
3243 struct tevent_req *rpccli_winreg_SaveKey_send(TALLOC_CTX *mem_ctx,
3244 struct tevent_context *ev,
3245 struct rpc_pipe_client *cli,
3246 struct policy_handle *_handle /* [in] [ref] */,
3247 struct winreg_String *_filename /* [in] [ref] */,
3248 struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */)
3250 struct tevent_req *req;
3251 struct rpccli_winreg_SaveKey_state *state;
3252 struct tevent_req *subreq;
3254 req = tevent_req_create(mem_ctx, &state,
3255 struct rpccli_winreg_SaveKey_state);
3256 if (req == NULL) {
3257 return NULL;
3259 state->out_mem_ctx = NULL;
3260 state->dispatch_recv = cli->dispatch_recv;
3262 /* In parameters */
3263 state->orig.in.handle = _handle;
3264 state->orig.in.filename = _filename;
3265 state->orig.in.sec_attrib = _sec_attrib;
3267 /* Out parameters */
3269 /* Result */
3270 ZERO_STRUCT(state->orig.out.result);
3272 /* make a temporary copy, that we pass to the dispatch function */
3273 state->tmp = state->orig;
3275 subreq = cli->dispatch_send(state, ev, cli,
3276 &ndr_table_winreg,
3277 NDR_WINREG_SAVEKEY,
3278 &state->tmp);
3279 if (tevent_req_nomem(subreq, req)) {
3280 return tevent_req_post(req, ev);
3282 tevent_req_set_callback(subreq, rpccli_winreg_SaveKey_done, req);
3283 return req;
3286 static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq)
3288 struct tevent_req *req = tevent_req_callback_data(
3289 subreq, struct tevent_req);
3290 struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
3291 req, struct rpccli_winreg_SaveKey_state);
3292 NTSTATUS status;
3293 TALLOC_CTX *mem_ctx;
3295 if (state->out_mem_ctx) {
3296 mem_ctx = state->out_mem_ctx;
3297 } else {
3298 mem_ctx = state;
3301 status = state->dispatch_recv(subreq, mem_ctx);
3302 TALLOC_FREE(subreq);
3303 if (!NT_STATUS_IS_OK(status)) {
3304 tevent_req_nterror(req, status);
3305 return;
3308 /* Copy out parameters */
3310 /* Copy result */
3311 state->orig.out.result = state->tmp.out.result;
3313 /* Reset temporary structure */
3314 ZERO_STRUCT(state->tmp);
3316 tevent_req_done(req);
3319 NTSTATUS rpccli_winreg_SaveKey_recv(struct tevent_req *req,
3320 TALLOC_CTX *mem_ctx,
3321 WERROR *result)
3323 struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
3324 req, struct rpccli_winreg_SaveKey_state);
3325 NTSTATUS status;
3327 if (tevent_req_is_nterror(req, &status)) {
3328 tevent_req_received(req);
3329 return status;
3332 /* Steal possbile out parameters to the callers context */
3333 talloc_steal(mem_ctx, state->out_mem_ctx);
3335 /* Return result */
3336 *result = state->orig.out.result;
3338 tevent_req_received(req);
3339 return NT_STATUS_OK;
3342 NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
3343 TALLOC_CTX *mem_ctx,
3344 struct policy_handle *handle /* [in] [ref] */,
3345 struct winreg_String *filename /* [in] [ref] */,
3346 struct KeySecurityAttribute *sec_attrib /* [in] [unique] */,
3347 WERROR *werror)
3349 struct winreg_SaveKey r;
3350 NTSTATUS status;
3352 /* In parameters */
3353 r.in.handle = handle;
3354 r.in.filename = filename;
3355 r.in.sec_attrib = sec_attrib;
3357 status = cli->dispatch(cli,
3358 mem_ctx,
3359 &ndr_table_winreg,
3360 NDR_WINREG_SAVEKEY,
3361 &r);
3363 if (!NT_STATUS_IS_OK(status)) {
3364 return status;
3367 if (NT_STATUS_IS_ERR(status)) {
3368 return status;
3371 /* Return variables */
3373 /* Return result */
3374 if (werror) {
3375 *werror = r.out.result;
3378 return werror_to_ntstatus(r.out.result);
3381 struct rpccli_winreg_SetKeySecurity_state {
3382 struct winreg_SetKeySecurity orig;
3383 struct winreg_SetKeySecurity tmp;
3384 TALLOC_CTX *out_mem_ctx;
3385 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3388 static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq);
3390 struct tevent_req *rpccli_winreg_SetKeySecurity_send(TALLOC_CTX *mem_ctx,
3391 struct tevent_context *ev,
3392 struct rpc_pipe_client *cli,
3393 struct policy_handle *_handle /* [in] [ref] */,
3394 uint32_t _sec_info /* [in] */,
3395 struct KeySecurityData *_sd /* [in] [ref] */)
3397 struct tevent_req *req;
3398 struct rpccli_winreg_SetKeySecurity_state *state;
3399 struct tevent_req *subreq;
3401 req = tevent_req_create(mem_ctx, &state,
3402 struct rpccli_winreg_SetKeySecurity_state);
3403 if (req == NULL) {
3404 return NULL;
3406 state->out_mem_ctx = NULL;
3407 state->dispatch_recv = cli->dispatch_recv;
3409 /* In parameters */
3410 state->orig.in.handle = _handle;
3411 state->orig.in.sec_info = _sec_info;
3412 state->orig.in.sd = _sd;
3414 /* Out parameters */
3416 /* Result */
3417 ZERO_STRUCT(state->orig.out.result);
3419 /* make a temporary copy, that we pass to the dispatch function */
3420 state->tmp = state->orig;
3422 subreq = cli->dispatch_send(state, ev, cli,
3423 &ndr_table_winreg,
3424 NDR_WINREG_SETKEYSECURITY,
3425 &state->tmp);
3426 if (tevent_req_nomem(subreq, req)) {
3427 return tevent_req_post(req, ev);
3429 tevent_req_set_callback(subreq, rpccli_winreg_SetKeySecurity_done, req);
3430 return req;
3433 static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq)
3435 struct tevent_req *req = tevent_req_callback_data(
3436 subreq, struct tevent_req);
3437 struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
3438 req, struct rpccli_winreg_SetKeySecurity_state);
3439 NTSTATUS status;
3440 TALLOC_CTX *mem_ctx;
3442 if (state->out_mem_ctx) {
3443 mem_ctx = state->out_mem_ctx;
3444 } else {
3445 mem_ctx = state;
3448 status = state->dispatch_recv(subreq, mem_ctx);
3449 TALLOC_FREE(subreq);
3450 if (!NT_STATUS_IS_OK(status)) {
3451 tevent_req_nterror(req, status);
3452 return;
3455 /* Copy out parameters */
3457 /* Copy result */
3458 state->orig.out.result = state->tmp.out.result;
3460 /* Reset temporary structure */
3461 ZERO_STRUCT(state->tmp);
3463 tevent_req_done(req);
3466 NTSTATUS rpccli_winreg_SetKeySecurity_recv(struct tevent_req *req,
3467 TALLOC_CTX *mem_ctx,
3468 WERROR *result)
3470 struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
3471 req, struct rpccli_winreg_SetKeySecurity_state);
3472 NTSTATUS status;
3474 if (tevent_req_is_nterror(req, &status)) {
3475 tevent_req_received(req);
3476 return status;
3479 /* Steal possbile out parameters to the callers context */
3480 talloc_steal(mem_ctx, state->out_mem_ctx);
3482 /* Return result */
3483 *result = state->orig.out.result;
3485 tevent_req_received(req);
3486 return NT_STATUS_OK;
3489 NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
3490 TALLOC_CTX *mem_ctx,
3491 struct policy_handle *handle /* [in] [ref] */,
3492 uint32_t sec_info /* [in] */,
3493 struct KeySecurityData *sd /* [in] [ref] */,
3494 WERROR *werror)
3496 struct winreg_SetKeySecurity r;
3497 NTSTATUS status;
3499 /* In parameters */
3500 r.in.handle = handle;
3501 r.in.sec_info = sec_info;
3502 r.in.sd = sd;
3504 status = cli->dispatch(cli,
3505 mem_ctx,
3506 &ndr_table_winreg,
3507 NDR_WINREG_SETKEYSECURITY,
3508 &r);
3510 if (!NT_STATUS_IS_OK(status)) {
3511 return status;
3514 if (NT_STATUS_IS_ERR(status)) {
3515 return status;
3518 /* Return variables */
3520 /* Return result */
3521 if (werror) {
3522 *werror = r.out.result;
3525 return werror_to_ntstatus(r.out.result);
3528 struct rpccli_winreg_SetValue_state {
3529 struct winreg_SetValue orig;
3530 struct winreg_SetValue tmp;
3531 TALLOC_CTX *out_mem_ctx;
3532 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3535 static void rpccli_winreg_SetValue_done(struct tevent_req *subreq);
3537 struct tevent_req *rpccli_winreg_SetValue_send(TALLOC_CTX *mem_ctx,
3538 struct tevent_context *ev,
3539 struct rpc_pipe_client *cli,
3540 struct policy_handle *_handle /* [in] [ref] */,
3541 struct winreg_String _name /* [in] */,
3542 enum winreg_Type _type /* [in] */,
3543 uint8_t *_data /* [in] [ref,size_is(size)] */,
3544 uint32_t _size /* [in] */)
3546 struct tevent_req *req;
3547 struct rpccli_winreg_SetValue_state *state;
3548 struct tevent_req *subreq;
3550 req = tevent_req_create(mem_ctx, &state,
3551 struct rpccli_winreg_SetValue_state);
3552 if (req == NULL) {
3553 return NULL;
3555 state->out_mem_ctx = NULL;
3556 state->dispatch_recv = cli->dispatch_recv;
3558 /* In parameters */
3559 state->orig.in.handle = _handle;
3560 state->orig.in.name = _name;
3561 state->orig.in.type = _type;
3562 state->orig.in.data = _data;
3563 state->orig.in.size = _size;
3565 /* Out parameters */
3567 /* Result */
3568 ZERO_STRUCT(state->orig.out.result);
3570 /* make a temporary copy, that we pass to the dispatch function */
3571 state->tmp = state->orig;
3573 subreq = cli->dispatch_send(state, ev, cli,
3574 &ndr_table_winreg,
3575 NDR_WINREG_SETVALUE,
3576 &state->tmp);
3577 if (tevent_req_nomem(subreq, req)) {
3578 return tevent_req_post(req, ev);
3580 tevent_req_set_callback(subreq, rpccli_winreg_SetValue_done, req);
3581 return req;
3584 static void rpccli_winreg_SetValue_done(struct tevent_req *subreq)
3586 struct tevent_req *req = tevent_req_callback_data(
3587 subreq, struct tevent_req);
3588 struct rpccli_winreg_SetValue_state *state = tevent_req_data(
3589 req, struct rpccli_winreg_SetValue_state);
3590 NTSTATUS status;
3591 TALLOC_CTX *mem_ctx;
3593 if (state->out_mem_ctx) {
3594 mem_ctx = state->out_mem_ctx;
3595 } else {
3596 mem_ctx = state;
3599 status = state->dispatch_recv(subreq, mem_ctx);
3600 TALLOC_FREE(subreq);
3601 if (!NT_STATUS_IS_OK(status)) {
3602 tevent_req_nterror(req, status);
3603 return;
3606 /* Copy out parameters */
3608 /* Copy result */
3609 state->orig.out.result = state->tmp.out.result;
3611 /* Reset temporary structure */
3612 ZERO_STRUCT(state->tmp);
3614 tevent_req_done(req);
3617 NTSTATUS rpccli_winreg_SetValue_recv(struct tevent_req *req,
3618 TALLOC_CTX *mem_ctx,
3619 WERROR *result)
3621 struct rpccli_winreg_SetValue_state *state = tevent_req_data(
3622 req, struct rpccli_winreg_SetValue_state);
3623 NTSTATUS status;
3625 if (tevent_req_is_nterror(req, &status)) {
3626 tevent_req_received(req);
3627 return status;
3630 /* Steal possbile out parameters to the callers context */
3631 talloc_steal(mem_ctx, state->out_mem_ctx);
3633 /* Return result */
3634 *result = state->orig.out.result;
3636 tevent_req_received(req);
3637 return NT_STATUS_OK;
3640 NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli,
3641 TALLOC_CTX *mem_ctx,
3642 struct policy_handle *handle /* [in] [ref] */,
3643 struct winreg_String name /* [in] */,
3644 enum winreg_Type type /* [in] */,
3645 uint8_t *data /* [in] [ref,size_is(size)] */,
3646 uint32_t size /* [in] */,
3647 WERROR *werror)
3649 struct winreg_SetValue r;
3650 NTSTATUS status;
3652 /* In parameters */
3653 r.in.handle = handle;
3654 r.in.name = name;
3655 r.in.type = type;
3656 r.in.data = data;
3657 r.in.size = size;
3659 status = cli->dispatch(cli,
3660 mem_ctx,
3661 &ndr_table_winreg,
3662 NDR_WINREG_SETVALUE,
3663 &r);
3665 if (!NT_STATUS_IS_OK(status)) {
3666 return status;
3669 if (NT_STATUS_IS_ERR(status)) {
3670 return status;
3673 /* Return variables */
3675 /* Return result */
3676 if (werror) {
3677 *werror = r.out.result;
3680 return werror_to_ntstatus(r.out.result);
3683 struct rpccli_winreg_UnLoadKey_state {
3684 struct winreg_UnLoadKey orig;
3685 struct winreg_UnLoadKey tmp;
3686 TALLOC_CTX *out_mem_ctx;
3687 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3690 static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq);
3692 struct tevent_req *rpccli_winreg_UnLoadKey_send(TALLOC_CTX *mem_ctx,
3693 struct tevent_context *ev,
3694 struct rpc_pipe_client *cli)
3696 struct tevent_req *req;
3697 struct rpccli_winreg_UnLoadKey_state *state;
3698 struct tevent_req *subreq;
3700 req = tevent_req_create(mem_ctx, &state,
3701 struct rpccli_winreg_UnLoadKey_state);
3702 if (req == NULL) {
3703 return NULL;
3705 state->out_mem_ctx = NULL;
3706 state->dispatch_recv = cli->dispatch_recv;
3708 /* In parameters */
3710 /* Out parameters */
3712 /* Result */
3713 ZERO_STRUCT(state->orig.out.result);
3715 /* make a temporary copy, that we pass to the dispatch function */
3716 state->tmp = state->orig;
3718 subreq = cli->dispatch_send(state, ev, cli,
3719 &ndr_table_winreg,
3720 NDR_WINREG_UNLOADKEY,
3721 &state->tmp);
3722 if (tevent_req_nomem(subreq, req)) {
3723 return tevent_req_post(req, ev);
3725 tevent_req_set_callback(subreq, rpccli_winreg_UnLoadKey_done, req);
3726 return req;
3729 static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq)
3731 struct tevent_req *req = tevent_req_callback_data(
3732 subreq, struct tevent_req);
3733 struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
3734 req, struct rpccli_winreg_UnLoadKey_state);
3735 NTSTATUS status;
3736 TALLOC_CTX *mem_ctx;
3738 if (state->out_mem_ctx) {
3739 mem_ctx = state->out_mem_ctx;
3740 } else {
3741 mem_ctx = state;
3744 status = state->dispatch_recv(subreq, mem_ctx);
3745 TALLOC_FREE(subreq);
3746 if (!NT_STATUS_IS_OK(status)) {
3747 tevent_req_nterror(req, status);
3748 return;
3751 /* Copy out parameters */
3753 /* Copy result */
3754 state->orig.out.result = state->tmp.out.result;
3756 /* Reset temporary structure */
3757 ZERO_STRUCT(state->tmp);
3759 tevent_req_done(req);
3762 NTSTATUS rpccli_winreg_UnLoadKey_recv(struct tevent_req *req,
3763 TALLOC_CTX *mem_ctx,
3764 WERROR *result)
3766 struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
3767 req, struct rpccli_winreg_UnLoadKey_state);
3768 NTSTATUS status;
3770 if (tevent_req_is_nterror(req, &status)) {
3771 tevent_req_received(req);
3772 return status;
3775 /* Steal possbile out parameters to the callers context */
3776 talloc_steal(mem_ctx, state->out_mem_ctx);
3778 /* Return result */
3779 *result = state->orig.out.result;
3781 tevent_req_received(req);
3782 return NT_STATUS_OK;
3785 NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
3786 TALLOC_CTX *mem_ctx,
3787 WERROR *werror)
3789 struct winreg_UnLoadKey r;
3790 NTSTATUS status;
3792 /* In parameters */
3794 status = cli->dispatch(cli,
3795 mem_ctx,
3796 &ndr_table_winreg,
3797 NDR_WINREG_UNLOADKEY,
3798 &r);
3800 if (!NT_STATUS_IS_OK(status)) {
3801 return status;
3804 if (NT_STATUS_IS_ERR(status)) {
3805 return status;
3808 /* Return variables */
3810 /* Return result */
3811 if (werror) {
3812 *werror = r.out.result;
3815 return werror_to_ntstatus(r.out.result);
3818 struct rpccli_winreg_InitiateSystemShutdown_state {
3819 struct winreg_InitiateSystemShutdown orig;
3820 struct winreg_InitiateSystemShutdown tmp;
3821 TALLOC_CTX *out_mem_ctx;
3822 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3825 static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq);
3827 struct tevent_req *rpccli_winreg_InitiateSystemShutdown_send(TALLOC_CTX *mem_ctx,
3828 struct tevent_context *ev,
3829 struct rpc_pipe_client *cli,
3830 uint16_t *_hostname /* [in] [unique] */,
3831 struct lsa_StringLarge *_message /* [in] [unique] */,
3832 uint32_t _timeout /* [in] */,
3833 uint8_t _force_apps /* [in] */,
3834 uint8_t _do_reboot /* [in] */)
3836 struct tevent_req *req;
3837 struct rpccli_winreg_InitiateSystemShutdown_state *state;
3838 struct tevent_req *subreq;
3840 req = tevent_req_create(mem_ctx, &state,
3841 struct rpccli_winreg_InitiateSystemShutdown_state);
3842 if (req == NULL) {
3843 return NULL;
3845 state->out_mem_ctx = NULL;
3846 state->dispatch_recv = cli->dispatch_recv;
3848 /* In parameters */
3849 state->orig.in.hostname = _hostname;
3850 state->orig.in.message = _message;
3851 state->orig.in.timeout = _timeout;
3852 state->orig.in.force_apps = _force_apps;
3853 state->orig.in.do_reboot = _do_reboot;
3855 /* Out parameters */
3857 /* Result */
3858 ZERO_STRUCT(state->orig.out.result);
3860 /* make a temporary copy, that we pass to the dispatch function */
3861 state->tmp = state->orig;
3863 subreq = cli->dispatch_send(state, ev, cli,
3864 &ndr_table_winreg,
3865 NDR_WINREG_INITIATESYSTEMSHUTDOWN,
3866 &state->tmp);
3867 if (tevent_req_nomem(subreq, req)) {
3868 return tevent_req_post(req, ev);
3870 tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdown_done, req);
3871 return req;
3874 static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq)
3876 struct tevent_req *req = tevent_req_callback_data(
3877 subreq, struct tevent_req);
3878 struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
3879 req, struct rpccli_winreg_InitiateSystemShutdown_state);
3880 NTSTATUS status;
3881 TALLOC_CTX *mem_ctx;
3883 if (state->out_mem_ctx) {
3884 mem_ctx = state->out_mem_ctx;
3885 } else {
3886 mem_ctx = state;
3889 status = state->dispatch_recv(subreq, mem_ctx);
3890 TALLOC_FREE(subreq);
3891 if (!NT_STATUS_IS_OK(status)) {
3892 tevent_req_nterror(req, status);
3893 return;
3896 /* Copy out parameters */
3898 /* Copy result */
3899 state->orig.out.result = state->tmp.out.result;
3901 /* Reset temporary structure */
3902 ZERO_STRUCT(state->tmp);
3904 tevent_req_done(req);
3907 NTSTATUS rpccli_winreg_InitiateSystemShutdown_recv(struct tevent_req *req,
3908 TALLOC_CTX *mem_ctx,
3909 WERROR *result)
3911 struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
3912 req, struct rpccli_winreg_InitiateSystemShutdown_state);
3913 NTSTATUS status;
3915 if (tevent_req_is_nterror(req, &status)) {
3916 tevent_req_received(req);
3917 return status;
3920 /* Steal possbile out parameters to the callers context */
3921 talloc_steal(mem_ctx, state->out_mem_ctx);
3923 /* Return result */
3924 *result = state->orig.out.result;
3926 tevent_req_received(req);
3927 return NT_STATUS_OK;
3930 NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
3931 TALLOC_CTX *mem_ctx,
3932 uint16_t *hostname /* [in] [unique] */,
3933 struct lsa_StringLarge *message /* [in] [unique] */,
3934 uint32_t timeout /* [in] */,
3935 uint8_t force_apps /* [in] */,
3936 uint8_t do_reboot /* [in] */,
3937 WERROR *werror)
3939 struct winreg_InitiateSystemShutdown r;
3940 NTSTATUS status;
3942 /* In parameters */
3943 r.in.hostname = hostname;
3944 r.in.message = message;
3945 r.in.timeout = timeout;
3946 r.in.force_apps = force_apps;
3947 r.in.do_reboot = do_reboot;
3949 status = cli->dispatch(cli,
3950 mem_ctx,
3951 &ndr_table_winreg,
3952 NDR_WINREG_INITIATESYSTEMSHUTDOWN,
3953 &r);
3955 if (!NT_STATUS_IS_OK(status)) {
3956 return status;
3959 if (NT_STATUS_IS_ERR(status)) {
3960 return status;
3963 /* Return variables */
3965 /* Return result */
3966 if (werror) {
3967 *werror = r.out.result;
3970 return werror_to_ntstatus(r.out.result);
3973 struct rpccli_winreg_AbortSystemShutdown_state {
3974 struct winreg_AbortSystemShutdown orig;
3975 struct winreg_AbortSystemShutdown tmp;
3976 TALLOC_CTX *out_mem_ctx;
3977 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3980 static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq);
3982 struct tevent_req *rpccli_winreg_AbortSystemShutdown_send(TALLOC_CTX *mem_ctx,
3983 struct tevent_context *ev,
3984 struct rpc_pipe_client *cli,
3985 uint16_t *_server /* [in] [unique] */)
3987 struct tevent_req *req;
3988 struct rpccli_winreg_AbortSystemShutdown_state *state;
3989 struct tevent_req *subreq;
3991 req = tevent_req_create(mem_ctx, &state,
3992 struct rpccli_winreg_AbortSystemShutdown_state);
3993 if (req == NULL) {
3994 return NULL;
3996 state->out_mem_ctx = NULL;
3997 state->dispatch_recv = cli->dispatch_recv;
3999 /* In parameters */
4000 state->orig.in.server = _server;
4002 /* Out parameters */
4004 /* Result */
4005 ZERO_STRUCT(state->orig.out.result);
4007 /* make a temporary copy, that we pass to the dispatch function */
4008 state->tmp = state->orig;
4010 subreq = cli->dispatch_send(state, ev, cli,
4011 &ndr_table_winreg,
4012 NDR_WINREG_ABORTSYSTEMSHUTDOWN,
4013 &state->tmp);
4014 if (tevent_req_nomem(subreq, req)) {
4015 return tevent_req_post(req, ev);
4017 tevent_req_set_callback(subreq, rpccli_winreg_AbortSystemShutdown_done, req);
4018 return req;
4021 static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq)
4023 struct tevent_req *req = tevent_req_callback_data(
4024 subreq, struct tevent_req);
4025 struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
4026 req, struct rpccli_winreg_AbortSystemShutdown_state);
4027 NTSTATUS status;
4028 TALLOC_CTX *mem_ctx;
4030 if (state->out_mem_ctx) {
4031 mem_ctx = state->out_mem_ctx;
4032 } else {
4033 mem_ctx = state;
4036 status = state->dispatch_recv(subreq, mem_ctx);
4037 TALLOC_FREE(subreq);
4038 if (!NT_STATUS_IS_OK(status)) {
4039 tevent_req_nterror(req, status);
4040 return;
4043 /* Copy out parameters */
4045 /* Copy result */
4046 state->orig.out.result = state->tmp.out.result;
4048 /* Reset temporary structure */
4049 ZERO_STRUCT(state->tmp);
4051 tevent_req_done(req);
4054 NTSTATUS rpccli_winreg_AbortSystemShutdown_recv(struct tevent_req *req,
4055 TALLOC_CTX *mem_ctx,
4056 WERROR *result)
4058 struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
4059 req, struct rpccli_winreg_AbortSystemShutdown_state);
4060 NTSTATUS status;
4062 if (tevent_req_is_nterror(req, &status)) {
4063 tevent_req_received(req);
4064 return status;
4067 /* Steal possbile out parameters to the callers context */
4068 talloc_steal(mem_ctx, state->out_mem_ctx);
4070 /* Return result */
4071 *result = state->orig.out.result;
4073 tevent_req_received(req);
4074 return NT_STATUS_OK;
4077 NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
4078 TALLOC_CTX *mem_ctx,
4079 uint16_t *server /* [in] [unique] */,
4080 WERROR *werror)
4082 struct winreg_AbortSystemShutdown r;
4083 NTSTATUS status;
4085 /* In parameters */
4086 r.in.server = server;
4088 status = cli->dispatch(cli,
4089 mem_ctx,
4090 &ndr_table_winreg,
4091 NDR_WINREG_ABORTSYSTEMSHUTDOWN,
4092 &r);
4094 if (!NT_STATUS_IS_OK(status)) {
4095 return status;
4098 if (NT_STATUS_IS_ERR(status)) {
4099 return status;
4102 /* Return variables */
4104 /* Return result */
4105 if (werror) {
4106 *werror = r.out.result;
4109 return werror_to_ntstatus(r.out.result);
4112 struct rpccli_winreg_GetVersion_state {
4113 struct winreg_GetVersion orig;
4114 struct winreg_GetVersion tmp;
4115 TALLOC_CTX *out_mem_ctx;
4116 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4119 static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq);
4121 struct tevent_req *rpccli_winreg_GetVersion_send(TALLOC_CTX *mem_ctx,
4122 struct tevent_context *ev,
4123 struct rpc_pipe_client *cli,
4124 struct policy_handle *_handle /* [in] [ref] */,
4125 uint32_t *_version /* [out] [ref] */)
4127 struct tevent_req *req;
4128 struct rpccli_winreg_GetVersion_state *state;
4129 struct tevent_req *subreq;
4131 req = tevent_req_create(mem_ctx, &state,
4132 struct rpccli_winreg_GetVersion_state);
4133 if (req == NULL) {
4134 return NULL;
4136 state->out_mem_ctx = NULL;
4137 state->dispatch_recv = cli->dispatch_recv;
4139 /* In parameters */
4140 state->orig.in.handle = _handle;
4142 /* Out parameters */
4143 state->orig.out.version = _version;
4145 /* Result */
4146 ZERO_STRUCT(state->orig.out.result);
4148 state->out_mem_ctx = talloc_named_const(state, 0,
4149 "rpccli_winreg_GetVersion_out_memory");
4150 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4151 return tevent_req_post(req, ev);
4154 /* make a temporary copy, that we pass to the dispatch function */
4155 state->tmp = state->orig;
4157 subreq = cli->dispatch_send(state, ev, cli,
4158 &ndr_table_winreg,
4159 NDR_WINREG_GETVERSION,
4160 &state->tmp);
4161 if (tevent_req_nomem(subreq, req)) {
4162 return tevent_req_post(req, ev);
4164 tevent_req_set_callback(subreq, rpccli_winreg_GetVersion_done, req);
4165 return req;
4168 static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq)
4170 struct tevent_req *req = tevent_req_callback_data(
4171 subreq, struct tevent_req);
4172 struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
4173 req, struct rpccli_winreg_GetVersion_state);
4174 NTSTATUS status;
4175 TALLOC_CTX *mem_ctx;
4177 if (state->out_mem_ctx) {
4178 mem_ctx = state->out_mem_ctx;
4179 } else {
4180 mem_ctx = state;
4183 status = state->dispatch_recv(subreq, mem_ctx);
4184 TALLOC_FREE(subreq);
4185 if (!NT_STATUS_IS_OK(status)) {
4186 tevent_req_nterror(req, status);
4187 return;
4190 /* Copy out parameters */
4191 *state->orig.out.version = *state->tmp.out.version;
4193 /* Copy result */
4194 state->orig.out.result = state->tmp.out.result;
4196 /* Reset temporary structure */
4197 ZERO_STRUCT(state->tmp);
4199 tevent_req_done(req);
4202 NTSTATUS rpccli_winreg_GetVersion_recv(struct tevent_req *req,
4203 TALLOC_CTX *mem_ctx,
4204 WERROR *result)
4206 struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
4207 req, struct rpccli_winreg_GetVersion_state);
4208 NTSTATUS status;
4210 if (tevent_req_is_nterror(req, &status)) {
4211 tevent_req_received(req);
4212 return status;
4215 /* Steal possbile out parameters to the callers context */
4216 talloc_steal(mem_ctx, state->out_mem_ctx);
4218 /* Return result */
4219 *result = state->orig.out.result;
4221 tevent_req_received(req);
4222 return NT_STATUS_OK;
4225 NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli,
4226 TALLOC_CTX *mem_ctx,
4227 struct policy_handle *handle /* [in] [ref] */,
4228 uint32_t *version /* [out] [ref] */,
4229 WERROR *werror)
4231 struct winreg_GetVersion r;
4232 NTSTATUS status;
4234 /* In parameters */
4235 r.in.handle = handle;
4237 status = cli->dispatch(cli,
4238 mem_ctx,
4239 &ndr_table_winreg,
4240 NDR_WINREG_GETVERSION,
4241 &r);
4243 if (!NT_STATUS_IS_OK(status)) {
4244 return status;
4247 if (NT_STATUS_IS_ERR(status)) {
4248 return status;
4251 /* Return variables */
4252 *version = *r.out.version;
4254 /* Return result */
4255 if (werror) {
4256 *werror = r.out.result;
4259 return werror_to_ntstatus(r.out.result);
4262 struct rpccli_winreg_OpenHKCC_state {
4263 struct winreg_OpenHKCC orig;
4264 struct winreg_OpenHKCC tmp;
4265 TALLOC_CTX *out_mem_ctx;
4266 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4269 static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq);
4271 struct tevent_req *rpccli_winreg_OpenHKCC_send(TALLOC_CTX *mem_ctx,
4272 struct tevent_context *ev,
4273 struct rpc_pipe_client *cli,
4274 uint16_t *_system_name /* [in] [unique] */,
4275 uint32_t _access_mask /* [in] */,
4276 struct policy_handle *_handle /* [out] [ref] */)
4278 struct tevent_req *req;
4279 struct rpccli_winreg_OpenHKCC_state *state;
4280 struct tevent_req *subreq;
4282 req = tevent_req_create(mem_ctx, &state,
4283 struct rpccli_winreg_OpenHKCC_state);
4284 if (req == NULL) {
4285 return NULL;
4287 state->out_mem_ctx = NULL;
4288 state->dispatch_recv = cli->dispatch_recv;
4290 /* In parameters */
4291 state->orig.in.system_name = _system_name;
4292 state->orig.in.access_mask = _access_mask;
4294 /* Out parameters */
4295 state->orig.out.handle = _handle;
4297 /* Result */
4298 ZERO_STRUCT(state->orig.out.result);
4300 state->out_mem_ctx = talloc_named_const(state, 0,
4301 "rpccli_winreg_OpenHKCC_out_memory");
4302 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4303 return tevent_req_post(req, ev);
4306 /* make a temporary copy, that we pass to the dispatch function */
4307 state->tmp = state->orig;
4309 subreq = cli->dispatch_send(state, ev, cli,
4310 &ndr_table_winreg,
4311 NDR_WINREG_OPENHKCC,
4312 &state->tmp);
4313 if (tevent_req_nomem(subreq, req)) {
4314 return tevent_req_post(req, ev);
4316 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCC_done, req);
4317 return req;
4320 static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq)
4322 struct tevent_req *req = tevent_req_callback_data(
4323 subreq, struct tevent_req);
4324 struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
4325 req, struct rpccli_winreg_OpenHKCC_state);
4326 NTSTATUS status;
4327 TALLOC_CTX *mem_ctx;
4329 if (state->out_mem_ctx) {
4330 mem_ctx = state->out_mem_ctx;
4331 } else {
4332 mem_ctx = state;
4335 status = state->dispatch_recv(subreq, mem_ctx);
4336 TALLOC_FREE(subreq);
4337 if (!NT_STATUS_IS_OK(status)) {
4338 tevent_req_nterror(req, status);
4339 return;
4342 /* Copy out parameters */
4343 *state->orig.out.handle = *state->tmp.out.handle;
4345 /* Copy result */
4346 state->orig.out.result = state->tmp.out.result;
4348 /* Reset temporary structure */
4349 ZERO_STRUCT(state->tmp);
4351 tevent_req_done(req);
4354 NTSTATUS rpccli_winreg_OpenHKCC_recv(struct tevent_req *req,
4355 TALLOC_CTX *mem_ctx,
4356 WERROR *result)
4358 struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
4359 req, struct rpccli_winreg_OpenHKCC_state);
4360 NTSTATUS status;
4362 if (tevent_req_is_nterror(req, &status)) {
4363 tevent_req_received(req);
4364 return status;
4367 /* Steal possbile out parameters to the callers context */
4368 talloc_steal(mem_ctx, state->out_mem_ctx);
4370 /* Return result */
4371 *result = state->orig.out.result;
4373 tevent_req_received(req);
4374 return NT_STATUS_OK;
4377 NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
4378 TALLOC_CTX *mem_ctx,
4379 uint16_t *system_name /* [in] [unique] */,
4380 uint32_t access_mask /* [in] */,
4381 struct policy_handle *handle /* [out] [ref] */,
4382 WERROR *werror)
4384 struct winreg_OpenHKCC r;
4385 NTSTATUS status;
4387 /* In parameters */
4388 r.in.system_name = system_name;
4389 r.in.access_mask = access_mask;
4391 status = cli->dispatch(cli,
4392 mem_ctx,
4393 &ndr_table_winreg,
4394 NDR_WINREG_OPENHKCC,
4395 &r);
4397 if (!NT_STATUS_IS_OK(status)) {
4398 return status;
4401 if (NT_STATUS_IS_ERR(status)) {
4402 return status;
4405 /* Return variables */
4406 *handle = *r.out.handle;
4408 /* Return result */
4409 if (werror) {
4410 *werror = r.out.result;
4413 return werror_to_ntstatus(r.out.result);
4416 struct rpccli_winreg_OpenHKDD_state {
4417 struct winreg_OpenHKDD orig;
4418 struct winreg_OpenHKDD tmp;
4419 TALLOC_CTX *out_mem_ctx;
4420 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4423 static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq);
4425 struct tevent_req *rpccli_winreg_OpenHKDD_send(TALLOC_CTX *mem_ctx,
4426 struct tevent_context *ev,
4427 struct rpc_pipe_client *cli,
4428 uint16_t *_system_name /* [in] [unique] */,
4429 uint32_t _access_mask /* [in] */,
4430 struct policy_handle *_handle /* [out] [ref] */)
4432 struct tevent_req *req;
4433 struct rpccli_winreg_OpenHKDD_state *state;
4434 struct tevent_req *subreq;
4436 req = tevent_req_create(mem_ctx, &state,
4437 struct rpccli_winreg_OpenHKDD_state);
4438 if (req == NULL) {
4439 return NULL;
4441 state->out_mem_ctx = NULL;
4442 state->dispatch_recv = cli->dispatch_recv;
4444 /* In parameters */
4445 state->orig.in.system_name = _system_name;
4446 state->orig.in.access_mask = _access_mask;
4448 /* Out parameters */
4449 state->orig.out.handle = _handle;
4451 /* Result */
4452 ZERO_STRUCT(state->orig.out.result);
4454 state->out_mem_ctx = talloc_named_const(state, 0,
4455 "rpccli_winreg_OpenHKDD_out_memory");
4456 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4457 return tevent_req_post(req, ev);
4460 /* make a temporary copy, that we pass to the dispatch function */
4461 state->tmp = state->orig;
4463 subreq = cli->dispatch_send(state, ev, cli,
4464 &ndr_table_winreg,
4465 NDR_WINREG_OPENHKDD,
4466 &state->tmp);
4467 if (tevent_req_nomem(subreq, req)) {
4468 return tevent_req_post(req, ev);
4470 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKDD_done, req);
4471 return req;
4474 static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq)
4476 struct tevent_req *req = tevent_req_callback_data(
4477 subreq, struct tevent_req);
4478 struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
4479 req, struct rpccli_winreg_OpenHKDD_state);
4480 NTSTATUS status;
4481 TALLOC_CTX *mem_ctx;
4483 if (state->out_mem_ctx) {
4484 mem_ctx = state->out_mem_ctx;
4485 } else {
4486 mem_ctx = state;
4489 status = state->dispatch_recv(subreq, mem_ctx);
4490 TALLOC_FREE(subreq);
4491 if (!NT_STATUS_IS_OK(status)) {
4492 tevent_req_nterror(req, status);
4493 return;
4496 /* Copy out parameters */
4497 *state->orig.out.handle = *state->tmp.out.handle;
4499 /* Copy result */
4500 state->orig.out.result = state->tmp.out.result;
4502 /* Reset temporary structure */
4503 ZERO_STRUCT(state->tmp);
4505 tevent_req_done(req);
4508 NTSTATUS rpccli_winreg_OpenHKDD_recv(struct tevent_req *req,
4509 TALLOC_CTX *mem_ctx,
4510 WERROR *result)
4512 struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
4513 req, struct rpccli_winreg_OpenHKDD_state);
4514 NTSTATUS status;
4516 if (tevent_req_is_nterror(req, &status)) {
4517 tevent_req_received(req);
4518 return status;
4521 /* Steal possbile out parameters to the callers context */
4522 talloc_steal(mem_ctx, state->out_mem_ctx);
4524 /* Return result */
4525 *result = state->orig.out.result;
4527 tevent_req_received(req);
4528 return NT_STATUS_OK;
4531 NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli,
4532 TALLOC_CTX *mem_ctx,
4533 uint16_t *system_name /* [in] [unique] */,
4534 uint32_t access_mask /* [in] */,
4535 struct policy_handle *handle /* [out] [ref] */,
4536 WERROR *werror)
4538 struct winreg_OpenHKDD r;
4539 NTSTATUS status;
4541 /* In parameters */
4542 r.in.system_name = system_name;
4543 r.in.access_mask = access_mask;
4545 status = cli->dispatch(cli,
4546 mem_ctx,
4547 &ndr_table_winreg,
4548 NDR_WINREG_OPENHKDD,
4549 &r);
4551 if (!NT_STATUS_IS_OK(status)) {
4552 return status;
4555 if (NT_STATUS_IS_ERR(status)) {
4556 return status;
4559 /* Return variables */
4560 *handle = *r.out.handle;
4562 /* Return result */
4563 if (werror) {
4564 *werror = r.out.result;
4567 return werror_to_ntstatus(r.out.result);
4570 struct rpccli_winreg_QueryMultipleValues_state {
4571 struct winreg_QueryMultipleValues orig;
4572 struct winreg_QueryMultipleValues tmp;
4573 TALLOC_CTX *out_mem_ctx;
4574 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4577 static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq);
4579 struct tevent_req *rpccli_winreg_QueryMultipleValues_send(TALLOC_CTX *mem_ctx,
4580 struct tevent_context *ev,
4581 struct rpc_pipe_client *cli,
4582 struct policy_handle *_key_handle /* [in] [ref] */,
4583 struct QueryMultipleValue *_values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
4584 uint32_t _num_values /* [in] */,
4585 uint8_t *_buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
4586 uint32_t *_buffer_size /* [in,out] [ref] */)
4588 struct tevent_req *req;
4589 struct rpccli_winreg_QueryMultipleValues_state *state;
4590 struct tevent_req *subreq;
4592 req = tevent_req_create(mem_ctx, &state,
4593 struct rpccli_winreg_QueryMultipleValues_state);
4594 if (req == NULL) {
4595 return NULL;
4597 state->out_mem_ctx = NULL;
4598 state->dispatch_recv = cli->dispatch_recv;
4600 /* In parameters */
4601 state->orig.in.key_handle = _key_handle;
4602 state->orig.in.values = _values;
4603 state->orig.in.num_values = _num_values;
4604 state->orig.in.buffer = _buffer;
4605 state->orig.in.buffer_size = _buffer_size;
4607 /* Out parameters */
4608 state->orig.out.values = _values;
4609 state->orig.out.buffer = _buffer;
4610 state->orig.out.buffer_size = _buffer_size;
4612 /* Result */
4613 ZERO_STRUCT(state->orig.out.result);
4615 state->out_mem_ctx = talloc_named_const(state, 0,
4616 "rpccli_winreg_QueryMultipleValues_out_memory");
4617 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4618 return tevent_req_post(req, ev);
4621 /* make a temporary copy, that we pass to the dispatch function */
4622 state->tmp = state->orig;
4624 subreq = cli->dispatch_send(state, ev, cli,
4625 &ndr_table_winreg,
4626 NDR_WINREG_QUERYMULTIPLEVALUES,
4627 &state->tmp);
4628 if (tevent_req_nomem(subreq, req)) {
4629 return tevent_req_post(req, ev);
4631 tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues_done, req);
4632 return req;
4635 static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq)
4637 struct tevent_req *req = tevent_req_callback_data(
4638 subreq, struct tevent_req);
4639 struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
4640 req, struct rpccli_winreg_QueryMultipleValues_state);
4641 NTSTATUS status;
4642 TALLOC_CTX *mem_ctx;
4644 if (state->out_mem_ctx) {
4645 mem_ctx = state->out_mem_ctx;
4646 } else {
4647 mem_ctx = state;
4650 status = state->dispatch_recv(subreq, mem_ctx);
4651 TALLOC_FREE(subreq);
4652 if (!NT_STATUS_IS_OK(status)) {
4653 tevent_req_nterror(req, status);
4654 return;
4657 /* Copy out parameters */
4658 memcpy(state->orig.out.values, state->tmp.out.values, (state->tmp.in.num_values) * sizeof(*state->orig.out.values));
4659 if (state->orig.out.buffer && state->tmp.out.buffer) {
4660 if ((*state->tmp.out.buffer_size) > (*state->tmp.in.buffer_size)) {
4661 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
4662 return;
4664 memcpy(state->orig.out.buffer, state->tmp.out.buffer, (*state->tmp.out.buffer_size) * sizeof(*state->orig.out.buffer));
4666 *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
4668 /* Copy result */
4669 state->orig.out.result = state->tmp.out.result;
4671 /* Reset temporary structure */
4672 ZERO_STRUCT(state->tmp);
4674 tevent_req_done(req);
4677 NTSTATUS rpccli_winreg_QueryMultipleValues_recv(struct tevent_req *req,
4678 TALLOC_CTX *mem_ctx,
4679 WERROR *result)
4681 struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
4682 req, struct rpccli_winreg_QueryMultipleValues_state);
4683 NTSTATUS status;
4685 if (tevent_req_is_nterror(req, &status)) {
4686 tevent_req_received(req);
4687 return status;
4690 /* Steal possbile out parameters to the callers context */
4691 talloc_steal(mem_ctx, state->out_mem_ctx);
4693 /* Return result */
4694 *result = state->orig.out.result;
4696 tevent_req_received(req);
4697 return NT_STATUS_OK;
4700 NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
4701 TALLOC_CTX *mem_ctx,
4702 struct policy_handle *key_handle /* [in] [ref] */,
4703 struct QueryMultipleValue *values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
4704 uint32_t num_values /* [in] */,
4705 uint8_t *buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
4706 uint32_t *buffer_size /* [in,out] [ref] */,
4707 WERROR *werror)
4709 struct winreg_QueryMultipleValues r;
4710 NTSTATUS status;
4712 /* In parameters */
4713 r.in.key_handle = key_handle;
4714 r.in.values = values;
4715 r.in.num_values = num_values;
4716 r.in.buffer = buffer;
4717 r.in.buffer_size = buffer_size;
4719 status = cli->dispatch(cli,
4720 mem_ctx,
4721 &ndr_table_winreg,
4722 NDR_WINREG_QUERYMULTIPLEVALUES,
4723 &r);
4725 if (!NT_STATUS_IS_OK(status)) {
4726 return status;
4729 if (NT_STATUS_IS_ERR(status)) {
4730 return status;
4733 /* Return variables */
4734 memcpy(values, r.out.values, (r.in.num_values) * sizeof(*values));
4735 if (buffer && r.out.buffer) {
4736 if ((*r.out.buffer_size) > (*r.in.buffer_size)) {
4737 return NT_STATUS_INVALID_NETWORK_RESPONSE;
4739 memcpy(buffer, r.out.buffer, (*r.out.buffer_size) * sizeof(*buffer));
4741 *buffer_size = *r.out.buffer_size;
4743 /* Return result */
4744 if (werror) {
4745 *werror = r.out.result;
4748 return werror_to_ntstatus(r.out.result);
4751 struct rpccli_winreg_InitiateSystemShutdownEx_state {
4752 struct winreg_InitiateSystemShutdownEx orig;
4753 struct winreg_InitiateSystemShutdownEx tmp;
4754 TALLOC_CTX *out_mem_ctx;
4755 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4758 static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq);
4760 struct tevent_req *rpccli_winreg_InitiateSystemShutdownEx_send(TALLOC_CTX *mem_ctx,
4761 struct tevent_context *ev,
4762 struct rpc_pipe_client *cli,
4763 uint16_t *_hostname /* [in] [unique] */,
4764 struct lsa_StringLarge *_message /* [in] [unique] */,
4765 uint32_t _timeout /* [in] */,
4766 uint8_t _force_apps /* [in] */,
4767 uint8_t _do_reboot /* [in] */,
4768 uint32_t _reason /* [in] */)
4770 struct tevent_req *req;
4771 struct rpccli_winreg_InitiateSystemShutdownEx_state *state;
4772 struct tevent_req *subreq;
4774 req = tevent_req_create(mem_ctx, &state,
4775 struct rpccli_winreg_InitiateSystemShutdownEx_state);
4776 if (req == NULL) {
4777 return NULL;
4779 state->out_mem_ctx = NULL;
4780 state->dispatch_recv = cli->dispatch_recv;
4782 /* In parameters */
4783 state->orig.in.hostname = _hostname;
4784 state->orig.in.message = _message;
4785 state->orig.in.timeout = _timeout;
4786 state->orig.in.force_apps = _force_apps;
4787 state->orig.in.do_reboot = _do_reboot;
4788 state->orig.in.reason = _reason;
4790 /* Out parameters */
4792 /* Result */
4793 ZERO_STRUCT(state->orig.out.result);
4795 /* make a temporary copy, that we pass to the dispatch function */
4796 state->tmp = state->orig;
4798 subreq = cli->dispatch_send(state, ev, cli,
4799 &ndr_table_winreg,
4800 NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
4801 &state->tmp);
4802 if (tevent_req_nomem(subreq, req)) {
4803 return tevent_req_post(req, ev);
4805 tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdownEx_done, req);
4806 return req;
4809 static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq)
4811 struct tevent_req *req = tevent_req_callback_data(
4812 subreq, struct tevent_req);
4813 struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
4814 req, struct rpccli_winreg_InitiateSystemShutdownEx_state);
4815 NTSTATUS status;
4816 TALLOC_CTX *mem_ctx;
4818 if (state->out_mem_ctx) {
4819 mem_ctx = state->out_mem_ctx;
4820 } else {
4821 mem_ctx = state;
4824 status = state->dispatch_recv(subreq, mem_ctx);
4825 TALLOC_FREE(subreq);
4826 if (!NT_STATUS_IS_OK(status)) {
4827 tevent_req_nterror(req, status);
4828 return;
4831 /* Copy out parameters */
4833 /* Copy result */
4834 state->orig.out.result = state->tmp.out.result;
4836 /* Reset temporary structure */
4837 ZERO_STRUCT(state->tmp);
4839 tevent_req_done(req);
4842 NTSTATUS rpccli_winreg_InitiateSystemShutdownEx_recv(struct tevent_req *req,
4843 TALLOC_CTX *mem_ctx,
4844 WERROR *result)
4846 struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
4847 req, struct rpccli_winreg_InitiateSystemShutdownEx_state);
4848 NTSTATUS status;
4850 if (tevent_req_is_nterror(req, &status)) {
4851 tevent_req_received(req);
4852 return status;
4855 /* Steal possbile out parameters to the callers context */
4856 talloc_steal(mem_ctx, state->out_mem_ctx);
4858 /* Return result */
4859 *result = state->orig.out.result;
4861 tevent_req_received(req);
4862 return NT_STATUS_OK;
4865 NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
4866 TALLOC_CTX *mem_ctx,
4867 uint16_t *hostname /* [in] [unique] */,
4868 struct lsa_StringLarge *message /* [in] [unique] */,
4869 uint32_t timeout /* [in] */,
4870 uint8_t force_apps /* [in] */,
4871 uint8_t do_reboot /* [in] */,
4872 uint32_t reason /* [in] */,
4873 WERROR *werror)
4875 struct winreg_InitiateSystemShutdownEx r;
4876 NTSTATUS status;
4878 /* In parameters */
4879 r.in.hostname = hostname;
4880 r.in.message = message;
4881 r.in.timeout = timeout;
4882 r.in.force_apps = force_apps;
4883 r.in.do_reboot = do_reboot;
4884 r.in.reason = reason;
4886 status = cli->dispatch(cli,
4887 mem_ctx,
4888 &ndr_table_winreg,
4889 NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
4890 &r);
4892 if (!NT_STATUS_IS_OK(status)) {
4893 return status;
4896 if (NT_STATUS_IS_ERR(status)) {
4897 return status;
4900 /* Return variables */
4902 /* Return result */
4903 if (werror) {
4904 *werror = r.out.result;
4907 return werror_to_ntstatus(r.out.result);
4910 struct rpccli_winreg_SaveKeyEx_state {
4911 struct winreg_SaveKeyEx orig;
4912 struct winreg_SaveKeyEx tmp;
4913 TALLOC_CTX *out_mem_ctx;
4914 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4917 static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq);
4919 struct tevent_req *rpccli_winreg_SaveKeyEx_send(TALLOC_CTX *mem_ctx,
4920 struct tevent_context *ev,
4921 struct rpc_pipe_client *cli)
4923 struct tevent_req *req;
4924 struct rpccli_winreg_SaveKeyEx_state *state;
4925 struct tevent_req *subreq;
4927 req = tevent_req_create(mem_ctx, &state,
4928 struct rpccli_winreg_SaveKeyEx_state);
4929 if (req == NULL) {
4930 return NULL;
4932 state->out_mem_ctx = NULL;
4933 state->dispatch_recv = cli->dispatch_recv;
4935 /* In parameters */
4937 /* Out parameters */
4939 /* Result */
4940 ZERO_STRUCT(state->orig.out.result);
4942 /* make a temporary copy, that we pass to the dispatch function */
4943 state->tmp = state->orig;
4945 subreq = cli->dispatch_send(state, ev, cli,
4946 &ndr_table_winreg,
4947 NDR_WINREG_SAVEKEYEX,
4948 &state->tmp);
4949 if (tevent_req_nomem(subreq, req)) {
4950 return tevent_req_post(req, ev);
4952 tevent_req_set_callback(subreq, rpccli_winreg_SaveKeyEx_done, req);
4953 return req;
4956 static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq)
4958 struct tevent_req *req = tevent_req_callback_data(
4959 subreq, struct tevent_req);
4960 struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
4961 req, struct rpccli_winreg_SaveKeyEx_state);
4962 NTSTATUS status;
4963 TALLOC_CTX *mem_ctx;
4965 if (state->out_mem_ctx) {
4966 mem_ctx = state->out_mem_ctx;
4967 } else {
4968 mem_ctx = state;
4971 status = state->dispatch_recv(subreq, mem_ctx);
4972 TALLOC_FREE(subreq);
4973 if (!NT_STATUS_IS_OK(status)) {
4974 tevent_req_nterror(req, status);
4975 return;
4978 /* Copy out parameters */
4980 /* Copy result */
4981 state->orig.out.result = state->tmp.out.result;
4983 /* Reset temporary structure */
4984 ZERO_STRUCT(state->tmp);
4986 tevent_req_done(req);
4989 NTSTATUS rpccli_winreg_SaveKeyEx_recv(struct tevent_req *req,
4990 TALLOC_CTX *mem_ctx,
4991 WERROR *result)
4993 struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
4994 req, struct rpccli_winreg_SaveKeyEx_state);
4995 NTSTATUS status;
4997 if (tevent_req_is_nterror(req, &status)) {
4998 tevent_req_received(req);
4999 return status;
5002 /* Steal possbile out parameters to the callers context */
5003 talloc_steal(mem_ctx, state->out_mem_ctx);
5005 /* Return result */
5006 *result = state->orig.out.result;
5008 tevent_req_received(req);
5009 return NT_STATUS_OK;
5012 NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli,
5013 TALLOC_CTX *mem_ctx,
5014 WERROR *werror)
5016 struct winreg_SaveKeyEx r;
5017 NTSTATUS status;
5019 /* In parameters */
5021 status = cli->dispatch(cli,
5022 mem_ctx,
5023 &ndr_table_winreg,
5024 NDR_WINREG_SAVEKEYEX,
5025 &r);
5027 if (!NT_STATUS_IS_OK(status)) {
5028 return status;
5031 if (NT_STATUS_IS_ERR(status)) {
5032 return status;
5035 /* Return variables */
5037 /* Return result */
5038 if (werror) {
5039 *werror = r.out.result;
5042 return werror_to_ntstatus(r.out.result);
5045 struct rpccli_winreg_OpenHKPT_state {
5046 struct winreg_OpenHKPT orig;
5047 struct winreg_OpenHKPT tmp;
5048 TALLOC_CTX *out_mem_ctx;
5049 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5052 static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq);
5054 struct tevent_req *rpccli_winreg_OpenHKPT_send(TALLOC_CTX *mem_ctx,
5055 struct tevent_context *ev,
5056 struct rpc_pipe_client *cli,
5057 uint16_t *_system_name /* [in] [unique] */,
5058 uint32_t _access_mask /* [in] */,
5059 struct policy_handle *_handle /* [out] [ref] */)
5061 struct tevent_req *req;
5062 struct rpccli_winreg_OpenHKPT_state *state;
5063 struct tevent_req *subreq;
5065 req = tevent_req_create(mem_ctx, &state,
5066 struct rpccli_winreg_OpenHKPT_state);
5067 if (req == NULL) {
5068 return NULL;
5070 state->out_mem_ctx = NULL;
5071 state->dispatch_recv = cli->dispatch_recv;
5073 /* In parameters */
5074 state->orig.in.system_name = _system_name;
5075 state->orig.in.access_mask = _access_mask;
5077 /* Out parameters */
5078 state->orig.out.handle = _handle;
5080 /* Result */
5081 ZERO_STRUCT(state->orig.out.result);
5083 state->out_mem_ctx = talloc_named_const(state, 0,
5084 "rpccli_winreg_OpenHKPT_out_memory");
5085 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5086 return tevent_req_post(req, ev);
5089 /* make a temporary copy, that we pass to the dispatch function */
5090 state->tmp = state->orig;
5092 subreq = cli->dispatch_send(state, ev, cli,
5093 &ndr_table_winreg,
5094 NDR_WINREG_OPENHKPT,
5095 &state->tmp);
5096 if (tevent_req_nomem(subreq, req)) {
5097 return tevent_req_post(req, ev);
5099 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPT_done, req);
5100 return req;
5103 static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq)
5105 struct tevent_req *req = tevent_req_callback_data(
5106 subreq, struct tevent_req);
5107 struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
5108 req, struct rpccli_winreg_OpenHKPT_state);
5109 NTSTATUS status;
5110 TALLOC_CTX *mem_ctx;
5112 if (state->out_mem_ctx) {
5113 mem_ctx = state->out_mem_ctx;
5114 } else {
5115 mem_ctx = state;
5118 status = state->dispatch_recv(subreq, mem_ctx);
5119 TALLOC_FREE(subreq);
5120 if (!NT_STATUS_IS_OK(status)) {
5121 tevent_req_nterror(req, status);
5122 return;
5125 /* Copy out parameters */
5126 *state->orig.out.handle = *state->tmp.out.handle;
5128 /* Copy result */
5129 state->orig.out.result = state->tmp.out.result;
5131 /* Reset temporary structure */
5132 ZERO_STRUCT(state->tmp);
5134 tevent_req_done(req);
5137 NTSTATUS rpccli_winreg_OpenHKPT_recv(struct tevent_req *req,
5138 TALLOC_CTX *mem_ctx,
5139 WERROR *result)
5141 struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
5142 req, struct rpccli_winreg_OpenHKPT_state);
5143 NTSTATUS status;
5145 if (tevent_req_is_nterror(req, &status)) {
5146 tevent_req_received(req);
5147 return status;
5150 /* Steal possbile out parameters to the callers context */
5151 talloc_steal(mem_ctx, state->out_mem_ctx);
5153 /* Return result */
5154 *result = state->orig.out.result;
5156 tevent_req_received(req);
5157 return NT_STATUS_OK;
5160 NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli,
5161 TALLOC_CTX *mem_ctx,
5162 uint16_t *system_name /* [in] [unique] */,
5163 uint32_t access_mask /* [in] */,
5164 struct policy_handle *handle /* [out] [ref] */,
5165 WERROR *werror)
5167 struct winreg_OpenHKPT r;
5168 NTSTATUS status;
5170 /* In parameters */
5171 r.in.system_name = system_name;
5172 r.in.access_mask = access_mask;
5174 status = cli->dispatch(cli,
5175 mem_ctx,
5176 &ndr_table_winreg,
5177 NDR_WINREG_OPENHKPT,
5178 &r);
5180 if (!NT_STATUS_IS_OK(status)) {
5181 return status;
5184 if (NT_STATUS_IS_ERR(status)) {
5185 return status;
5188 /* Return variables */
5189 *handle = *r.out.handle;
5191 /* Return result */
5192 if (werror) {
5193 *werror = r.out.result;
5196 return werror_to_ntstatus(r.out.result);
5199 struct rpccli_winreg_OpenHKPN_state {
5200 struct winreg_OpenHKPN orig;
5201 struct winreg_OpenHKPN tmp;
5202 TALLOC_CTX *out_mem_ctx;
5203 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5206 static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq);
5208 struct tevent_req *rpccli_winreg_OpenHKPN_send(TALLOC_CTX *mem_ctx,
5209 struct tevent_context *ev,
5210 struct rpc_pipe_client *cli,
5211 uint16_t *_system_name /* [in] [unique] */,
5212 uint32_t _access_mask /* [in] */,
5213 struct policy_handle *_handle /* [out] [ref] */)
5215 struct tevent_req *req;
5216 struct rpccli_winreg_OpenHKPN_state *state;
5217 struct tevent_req *subreq;
5219 req = tevent_req_create(mem_ctx, &state,
5220 struct rpccli_winreg_OpenHKPN_state);
5221 if (req == NULL) {
5222 return NULL;
5224 state->out_mem_ctx = NULL;
5225 state->dispatch_recv = cli->dispatch_recv;
5227 /* In parameters */
5228 state->orig.in.system_name = _system_name;
5229 state->orig.in.access_mask = _access_mask;
5231 /* Out parameters */
5232 state->orig.out.handle = _handle;
5234 /* Result */
5235 ZERO_STRUCT(state->orig.out.result);
5237 state->out_mem_ctx = talloc_named_const(state, 0,
5238 "rpccli_winreg_OpenHKPN_out_memory");
5239 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5240 return tevent_req_post(req, ev);
5243 /* make a temporary copy, that we pass to the dispatch function */
5244 state->tmp = state->orig;
5246 subreq = cli->dispatch_send(state, ev, cli,
5247 &ndr_table_winreg,
5248 NDR_WINREG_OPENHKPN,
5249 &state->tmp);
5250 if (tevent_req_nomem(subreq, req)) {
5251 return tevent_req_post(req, ev);
5253 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPN_done, req);
5254 return req;
5257 static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq)
5259 struct tevent_req *req = tevent_req_callback_data(
5260 subreq, struct tevent_req);
5261 struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
5262 req, struct rpccli_winreg_OpenHKPN_state);
5263 NTSTATUS status;
5264 TALLOC_CTX *mem_ctx;
5266 if (state->out_mem_ctx) {
5267 mem_ctx = state->out_mem_ctx;
5268 } else {
5269 mem_ctx = state;
5272 status = state->dispatch_recv(subreq, mem_ctx);
5273 TALLOC_FREE(subreq);
5274 if (!NT_STATUS_IS_OK(status)) {
5275 tevent_req_nterror(req, status);
5276 return;
5279 /* Copy out parameters */
5280 *state->orig.out.handle = *state->tmp.out.handle;
5282 /* Copy result */
5283 state->orig.out.result = state->tmp.out.result;
5285 /* Reset temporary structure */
5286 ZERO_STRUCT(state->tmp);
5288 tevent_req_done(req);
5291 NTSTATUS rpccli_winreg_OpenHKPN_recv(struct tevent_req *req,
5292 TALLOC_CTX *mem_ctx,
5293 WERROR *result)
5295 struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
5296 req, struct rpccli_winreg_OpenHKPN_state);
5297 NTSTATUS status;
5299 if (tevent_req_is_nterror(req, &status)) {
5300 tevent_req_received(req);
5301 return status;
5304 /* Steal possbile out parameters to the callers context */
5305 talloc_steal(mem_ctx, state->out_mem_ctx);
5307 /* Return result */
5308 *result = state->orig.out.result;
5310 tevent_req_received(req);
5311 return NT_STATUS_OK;
5314 NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli,
5315 TALLOC_CTX *mem_ctx,
5316 uint16_t *system_name /* [in] [unique] */,
5317 uint32_t access_mask /* [in] */,
5318 struct policy_handle *handle /* [out] [ref] */,
5319 WERROR *werror)
5321 struct winreg_OpenHKPN r;
5322 NTSTATUS status;
5324 /* In parameters */
5325 r.in.system_name = system_name;
5326 r.in.access_mask = access_mask;
5328 status = cli->dispatch(cli,
5329 mem_ctx,
5330 &ndr_table_winreg,
5331 NDR_WINREG_OPENHKPN,
5332 &r);
5334 if (!NT_STATUS_IS_OK(status)) {
5335 return status;
5338 if (NT_STATUS_IS_ERR(status)) {
5339 return status;
5342 /* Return variables */
5343 *handle = *r.out.handle;
5345 /* Return result */
5346 if (werror) {
5347 *werror = r.out.result;
5350 return werror_to_ntstatus(r.out.result);
5353 struct rpccli_winreg_QueryMultipleValues2_state {
5354 struct winreg_QueryMultipleValues2 orig;
5355 struct winreg_QueryMultipleValues2 tmp;
5356 TALLOC_CTX *out_mem_ctx;
5357 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5360 static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq);
5362 struct tevent_req *rpccli_winreg_QueryMultipleValues2_send(TALLOC_CTX *mem_ctx,
5363 struct tevent_context *ev,
5364 struct rpc_pipe_client *cli)
5366 struct tevent_req *req;
5367 struct rpccli_winreg_QueryMultipleValues2_state *state;
5368 struct tevent_req *subreq;
5370 req = tevent_req_create(mem_ctx, &state,
5371 struct rpccli_winreg_QueryMultipleValues2_state);
5372 if (req == NULL) {
5373 return NULL;
5375 state->out_mem_ctx = NULL;
5376 state->dispatch_recv = cli->dispatch_recv;
5378 /* In parameters */
5380 /* Out parameters */
5382 /* Result */
5383 ZERO_STRUCT(state->orig.out.result);
5385 /* make a temporary copy, that we pass to the dispatch function */
5386 state->tmp = state->orig;
5388 subreq = cli->dispatch_send(state, ev, cli,
5389 &ndr_table_winreg,
5390 NDR_WINREG_QUERYMULTIPLEVALUES2,
5391 &state->tmp);
5392 if (tevent_req_nomem(subreq, req)) {
5393 return tevent_req_post(req, ev);
5395 tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues2_done, req);
5396 return req;
5399 static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq)
5401 struct tevent_req *req = tevent_req_callback_data(
5402 subreq, struct tevent_req);
5403 struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
5404 req, struct rpccli_winreg_QueryMultipleValues2_state);
5405 NTSTATUS status;
5406 TALLOC_CTX *mem_ctx;
5408 if (state->out_mem_ctx) {
5409 mem_ctx = state->out_mem_ctx;
5410 } else {
5411 mem_ctx = state;
5414 status = state->dispatch_recv(subreq, mem_ctx);
5415 TALLOC_FREE(subreq);
5416 if (!NT_STATUS_IS_OK(status)) {
5417 tevent_req_nterror(req, status);
5418 return;
5421 /* Copy out parameters */
5423 /* Copy result */
5424 state->orig.out.result = state->tmp.out.result;
5426 /* Reset temporary structure */
5427 ZERO_STRUCT(state->tmp);
5429 tevent_req_done(req);
5432 NTSTATUS rpccli_winreg_QueryMultipleValues2_recv(struct tevent_req *req,
5433 TALLOC_CTX *mem_ctx,
5434 WERROR *result)
5436 struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
5437 req, struct rpccli_winreg_QueryMultipleValues2_state);
5438 NTSTATUS status;
5440 if (tevent_req_is_nterror(req, &status)) {
5441 tevent_req_received(req);
5442 return status;
5445 /* Steal possbile out parameters to the callers context */
5446 talloc_steal(mem_ctx, state->out_mem_ctx);
5448 /* Return result */
5449 *result = state->orig.out.result;
5451 tevent_req_received(req);
5452 return NT_STATUS_OK;
5455 NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli,
5456 TALLOC_CTX *mem_ctx,
5457 WERROR *werror)
5459 struct winreg_QueryMultipleValues2 r;
5460 NTSTATUS status;
5462 /* In parameters */
5464 status = cli->dispatch(cli,
5465 mem_ctx,
5466 &ndr_table_winreg,
5467 NDR_WINREG_QUERYMULTIPLEVALUES2,
5468 &r);
5470 if (!NT_STATUS_IS_OK(status)) {
5471 return status;
5474 if (NT_STATUS_IS_ERR(status)) {
5475 return status;
5478 /* Return variables */
5480 /* Return result */
5481 if (werror) {
5482 *werror = r.out.result;
5485 return werror_to_ntstatus(r.out.result);