Merge branch 'master' of /home/tridge/samba/git/combined
[Samba/aatanasov.git] / librpc / gen_ndr / cli_winreg.c
blobd0936028a4c7b57ea7108b23d31b71a95f382871
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 if (DEBUGLEVEL >= 10) {
48 NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, &state->orig);
51 state->out_mem_ctx = talloc_named_const(state, 0,
52 "rpccli_winreg_OpenHKCR_out_memory");
53 if (tevent_req_nomem(state->out_mem_ctx, req)) {
54 return tevent_req_post(req, ev);
57 /* make a temporary copy, that we pass to the dispatch function */
58 state->tmp = state->orig;
60 subreq = cli->dispatch_send(state, ev, cli,
61 &ndr_table_winreg,
62 NDR_WINREG_OPENHKCR,
63 &state->tmp);
64 if (tevent_req_nomem(subreq, req)) {
65 return tevent_req_post(req, ev);
67 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCR_done, req);
68 return req;
71 static void rpccli_winreg_OpenHKCR_done(struct tevent_req *subreq)
73 struct tevent_req *req = tevent_req_callback_data(
74 subreq, struct tevent_req);
75 struct rpccli_winreg_OpenHKCR_state *state = tevent_req_data(
76 req, struct rpccli_winreg_OpenHKCR_state);
77 NTSTATUS status;
78 TALLOC_CTX *mem_ctx;
80 if (state->out_mem_ctx) {
81 mem_ctx = state->out_mem_ctx;
82 } else {
83 mem_ctx = state;
86 status = state->dispatch_recv(subreq, mem_ctx);
87 TALLOC_FREE(subreq);
88 if (!NT_STATUS_IS_OK(status)) {
89 tevent_req_nterror(req, status);
90 return;
93 /* Copy out parameters */
94 *state->orig.out.handle = *state->tmp.out.handle;
96 /* Copy result */
97 state->orig.out.result = state->tmp.out.result;
99 /* Reset temporary structure */
100 ZERO_STRUCT(state->tmp);
102 if (DEBUGLEVEL >= 10) {
103 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, &state->orig);
106 tevent_req_done(req);
109 NTSTATUS rpccli_winreg_OpenHKCR_recv(struct tevent_req *req,
110 TALLOC_CTX *mem_ctx,
111 WERROR *result)
113 struct rpccli_winreg_OpenHKCR_state *state = tevent_req_data(
114 req, struct rpccli_winreg_OpenHKCR_state);
115 NTSTATUS status;
117 if (tevent_req_is_nterror(req, &status)) {
118 tevent_req_received(req);
119 return status;
122 /* Steal possbile out parameters to the callers context */
123 talloc_steal(mem_ctx, state->out_mem_ctx);
125 /* Return result */
126 *result = state->orig.out.result;
128 tevent_req_received(req);
129 return NT_STATUS_OK;
132 NTSTATUS rpccli_winreg_OpenHKCR(struct rpc_pipe_client *cli,
133 TALLOC_CTX *mem_ctx,
134 uint16_t *system_name /* [in] [unique] */,
135 uint32_t access_mask /* [in] */,
136 struct policy_handle *handle /* [out] [ref] */,
137 WERROR *werror)
139 struct winreg_OpenHKCR r;
140 NTSTATUS status;
142 /* In parameters */
143 r.in.system_name = system_name;
144 r.in.access_mask = access_mask;
146 if (DEBUGLEVEL >= 10) {
147 NDR_PRINT_IN_DEBUG(winreg_OpenHKCR, &r);
150 status = cli->dispatch(cli,
151 mem_ctx,
152 &ndr_table_winreg,
153 NDR_WINREG_OPENHKCR,
154 &r);
156 if (!NT_STATUS_IS_OK(status)) {
157 return status;
160 if (DEBUGLEVEL >= 10) {
161 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCR, &r);
164 if (NT_STATUS_IS_ERR(status)) {
165 return status;
168 /* Return variables */
169 *handle = *r.out.handle;
171 /* Return result */
172 if (werror) {
173 *werror = r.out.result;
176 return werror_to_ntstatus(r.out.result);
179 struct rpccli_winreg_OpenHKCU_state {
180 struct winreg_OpenHKCU orig;
181 struct winreg_OpenHKCU tmp;
182 TALLOC_CTX *out_mem_ctx;
183 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
186 static void rpccli_winreg_OpenHKCU_done(struct tevent_req *subreq);
188 struct tevent_req *rpccli_winreg_OpenHKCU_send(TALLOC_CTX *mem_ctx,
189 struct tevent_context *ev,
190 struct rpc_pipe_client *cli,
191 uint16_t *_system_name /* [in] [unique] */,
192 uint32_t _access_mask /* [in] */,
193 struct policy_handle *_handle /* [out] [ref] */)
195 struct tevent_req *req;
196 struct rpccli_winreg_OpenHKCU_state *state;
197 struct tevent_req *subreq;
199 req = tevent_req_create(mem_ctx, &state,
200 struct rpccli_winreg_OpenHKCU_state);
201 if (req == NULL) {
202 return NULL;
204 state->out_mem_ctx = NULL;
205 state->dispatch_recv = cli->dispatch_recv;
207 /* In parameters */
208 state->orig.in.system_name = _system_name;
209 state->orig.in.access_mask = _access_mask;
211 /* Out parameters */
212 state->orig.out.handle = _handle;
214 /* Result */
215 ZERO_STRUCT(state->orig.out.result);
217 if (DEBUGLEVEL >= 10) {
218 NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, &state->orig);
221 state->out_mem_ctx = talloc_named_const(state, 0,
222 "rpccli_winreg_OpenHKCU_out_memory");
223 if (tevent_req_nomem(state->out_mem_ctx, req)) {
224 return tevent_req_post(req, ev);
227 /* make a temporary copy, that we pass to the dispatch function */
228 state->tmp = state->orig;
230 subreq = cli->dispatch_send(state, ev, cli,
231 &ndr_table_winreg,
232 NDR_WINREG_OPENHKCU,
233 &state->tmp);
234 if (tevent_req_nomem(subreq, req)) {
235 return tevent_req_post(req, ev);
237 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCU_done, req);
238 return req;
241 static void rpccli_winreg_OpenHKCU_done(struct tevent_req *subreq)
243 struct tevent_req *req = tevent_req_callback_data(
244 subreq, struct tevent_req);
245 struct rpccli_winreg_OpenHKCU_state *state = tevent_req_data(
246 req, struct rpccli_winreg_OpenHKCU_state);
247 NTSTATUS status;
248 TALLOC_CTX *mem_ctx;
250 if (state->out_mem_ctx) {
251 mem_ctx = state->out_mem_ctx;
252 } else {
253 mem_ctx = state;
256 status = state->dispatch_recv(subreq, mem_ctx);
257 TALLOC_FREE(subreq);
258 if (!NT_STATUS_IS_OK(status)) {
259 tevent_req_nterror(req, status);
260 return;
263 /* Copy out parameters */
264 *state->orig.out.handle = *state->tmp.out.handle;
266 /* Copy result */
267 state->orig.out.result = state->tmp.out.result;
269 /* Reset temporary structure */
270 ZERO_STRUCT(state->tmp);
272 if (DEBUGLEVEL >= 10) {
273 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, &state->orig);
276 tevent_req_done(req);
279 NTSTATUS rpccli_winreg_OpenHKCU_recv(struct tevent_req *req,
280 TALLOC_CTX *mem_ctx,
281 WERROR *result)
283 struct rpccli_winreg_OpenHKCU_state *state = tevent_req_data(
284 req, struct rpccli_winreg_OpenHKCU_state);
285 NTSTATUS status;
287 if (tevent_req_is_nterror(req, &status)) {
288 tevent_req_received(req);
289 return status;
292 /* Steal possbile out parameters to the callers context */
293 talloc_steal(mem_ctx, state->out_mem_ctx);
295 /* Return result */
296 *result = state->orig.out.result;
298 tevent_req_received(req);
299 return NT_STATUS_OK;
302 NTSTATUS rpccli_winreg_OpenHKCU(struct rpc_pipe_client *cli,
303 TALLOC_CTX *mem_ctx,
304 uint16_t *system_name /* [in] [unique] */,
305 uint32_t access_mask /* [in] */,
306 struct policy_handle *handle /* [out] [ref] */,
307 WERROR *werror)
309 struct winreg_OpenHKCU r;
310 NTSTATUS status;
312 /* In parameters */
313 r.in.system_name = system_name;
314 r.in.access_mask = access_mask;
316 if (DEBUGLEVEL >= 10) {
317 NDR_PRINT_IN_DEBUG(winreg_OpenHKCU, &r);
320 status = cli->dispatch(cli,
321 mem_ctx,
322 &ndr_table_winreg,
323 NDR_WINREG_OPENHKCU,
324 &r);
326 if (!NT_STATUS_IS_OK(status)) {
327 return status;
330 if (DEBUGLEVEL >= 10) {
331 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCU, &r);
334 if (NT_STATUS_IS_ERR(status)) {
335 return status;
338 /* Return variables */
339 *handle = *r.out.handle;
341 /* Return result */
342 if (werror) {
343 *werror = r.out.result;
346 return werror_to_ntstatus(r.out.result);
349 struct rpccli_winreg_OpenHKLM_state {
350 struct winreg_OpenHKLM orig;
351 struct winreg_OpenHKLM tmp;
352 TALLOC_CTX *out_mem_ctx;
353 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
356 static void rpccli_winreg_OpenHKLM_done(struct tevent_req *subreq);
358 struct tevent_req *rpccli_winreg_OpenHKLM_send(TALLOC_CTX *mem_ctx,
359 struct tevent_context *ev,
360 struct rpc_pipe_client *cli,
361 uint16_t *_system_name /* [in] [unique] */,
362 uint32_t _access_mask /* [in] */,
363 struct policy_handle *_handle /* [out] [ref] */)
365 struct tevent_req *req;
366 struct rpccli_winreg_OpenHKLM_state *state;
367 struct tevent_req *subreq;
369 req = tevent_req_create(mem_ctx, &state,
370 struct rpccli_winreg_OpenHKLM_state);
371 if (req == NULL) {
372 return NULL;
374 state->out_mem_ctx = NULL;
375 state->dispatch_recv = cli->dispatch_recv;
377 /* In parameters */
378 state->orig.in.system_name = _system_name;
379 state->orig.in.access_mask = _access_mask;
381 /* Out parameters */
382 state->orig.out.handle = _handle;
384 /* Result */
385 ZERO_STRUCT(state->orig.out.result);
387 if (DEBUGLEVEL >= 10) {
388 NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, &state->orig);
391 state->out_mem_ctx = talloc_named_const(state, 0,
392 "rpccli_winreg_OpenHKLM_out_memory");
393 if (tevent_req_nomem(state->out_mem_ctx, req)) {
394 return tevent_req_post(req, ev);
397 /* make a temporary copy, that we pass to the dispatch function */
398 state->tmp = state->orig;
400 subreq = cli->dispatch_send(state, ev, cli,
401 &ndr_table_winreg,
402 NDR_WINREG_OPENHKLM,
403 &state->tmp);
404 if (tevent_req_nomem(subreq, req)) {
405 return tevent_req_post(req, ev);
407 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKLM_done, req);
408 return req;
411 static void rpccli_winreg_OpenHKLM_done(struct tevent_req *subreq)
413 struct tevent_req *req = tevent_req_callback_data(
414 subreq, struct tevent_req);
415 struct rpccli_winreg_OpenHKLM_state *state = tevent_req_data(
416 req, struct rpccli_winreg_OpenHKLM_state);
417 NTSTATUS status;
418 TALLOC_CTX *mem_ctx;
420 if (state->out_mem_ctx) {
421 mem_ctx = state->out_mem_ctx;
422 } else {
423 mem_ctx = state;
426 status = state->dispatch_recv(subreq, mem_ctx);
427 TALLOC_FREE(subreq);
428 if (!NT_STATUS_IS_OK(status)) {
429 tevent_req_nterror(req, status);
430 return;
433 /* Copy out parameters */
434 *state->orig.out.handle = *state->tmp.out.handle;
436 /* Copy result */
437 state->orig.out.result = state->tmp.out.result;
439 /* Reset temporary structure */
440 ZERO_STRUCT(state->tmp);
442 if (DEBUGLEVEL >= 10) {
443 NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, &state->orig);
446 tevent_req_done(req);
449 NTSTATUS rpccli_winreg_OpenHKLM_recv(struct tevent_req *req,
450 TALLOC_CTX *mem_ctx,
451 WERROR *result)
453 struct rpccli_winreg_OpenHKLM_state *state = tevent_req_data(
454 req, struct rpccli_winreg_OpenHKLM_state);
455 NTSTATUS status;
457 if (tevent_req_is_nterror(req, &status)) {
458 tevent_req_received(req);
459 return status;
462 /* Steal possbile out parameters to the callers context */
463 talloc_steal(mem_ctx, state->out_mem_ctx);
465 /* Return result */
466 *result = state->orig.out.result;
468 tevent_req_received(req);
469 return NT_STATUS_OK;
472 NTSTATUS rpccli_winreg_OpenHKLM(struct rpc_pipe_client *cli,
473 TALLOC_CTX *mem_ctx,
474 uint16_t *system_name /* [in] [unique] */,
475 uint32_t access_mask /* [in] */,
476 struct policy_handle *handle /* [out] [ref] */,
477 WERROR *werror)
479 struct winreg_OpenHKLM r;
480 NTSTATUS status;
482 /* In parameters */
483 r.in.system_name = system_name;
484 r.in.access_mask = access_mask;
486 if (DEBUGLEVEL >= 10) {
487 NDR_PRINT_IN_DEBUG(winreg_OpenHKLM, &r);
490 status = cli->dispatch(cli,
491 mem_ctx,
492 &ndr_table_winreg,
493 NDR_WINREG_OPENHKLM,
494 &r);
496 if (!NT_STATUS_IS_OK(status)) {
497 return status;
500 if (DEBUGLEVEL >= 10) {
501 NDR_PRINT_OUT_DEBUG(winreg_OpenHKLM, &r);
504 if (NT_STATUS_IS_ERR(status)) {
505 return status;
508 /* Return variables */
509 *handle = *r.out.handle;
511 /* Return result */
512 if (werror) {
513 *werror = r.out.result;
516 return werror_to_ntstatus(r.out.result);
519 struct rpccli_winreg_OpenHKPD_state {
520 struct winreg_OpenHKPD orig;
521 struct winreg_OpenHKPD tmp;
522 TALLOC_CTX *out_mem_ctx;
523 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
526 static void rpccli_winreg_OpenHKPD_done(struct tevent_req *subreq);
528 struct tevent_req *rpccli_winreg_OpenHKPD_send(TALLOC_CTX *mem_ctx,
529 struct tevent_context *ev,
530 struct rpc_pipe_client *cli,
531 uint16_t *_system_name /* [in] [unique] */,
532 uint32_t _access_mask /* [in] */,
533 struct policy_handle *_handle /* [out] [ref] */)
535 struct tevent_req *req;
536 struct rpccli_winreg_OpenHKPD_state *state;
537 struct tevent_req *subreq;
539 req = tevent_req_create(mem_ctx, &state,
540 struct rpccli_winreg_OpenHKPD_state);
541 if (req == NULL) {
542 return NULL;
544 state->out_mem_ctx = NULL;
545 state->dispatch_recv = cli->dispatch_recv;
547 /* In parameters */
548 state->orig.in.system_name = _system_name;
549 state->orig.in.access_mask = _access_mask;
551 /* Out parameters */
552 state->orig.out.handle = _handle;
554 /* Result */
555 ZERO_STRUCT(state->orig.out.result);
557 if (DEBUGLEVEL >= 10) {
558 NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, &state->orig);
561 state->out_mem_ctx = talloc_named_const(state, 0,
562 "rpccli_winreg_OpenHKPD_out_memory");
563 if (tevent_req_nomem(state->out_mem_ctx, req)) {
564 return tevent_req_post(req, ev);
567 /* make a temporary copy, that we pass to the dispatch function */
568 state->tmp = state->orig;
570 subreq = cli->dispatch_send(state, ev, cli,
571 &ndr_table_winreg,
572 NDR_WINREG_OPENHKPD,
573 &state->tmp);
574 if (tevent_req_nomem(subreq, req)) {
575 return tevent_req_post(req, ev);
577 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPD_done, req);
578 return req;
581 static void rpccli_winreg_OpenHKPD_done(struct tevent_req *subreq)
583 struct tevent_req *req = tevent_req_callback_data(
584 subreq, struct tevent_req);
585 struct rpccli_winreg_OpenHKPD_state *state = tevent_req_data(
586 req, struct rpccli_winreg_OpenHKPD_state);
587 NTSTATUS status;
588 TALLOC_CTX *mem_ctx;
590 if (state->out_mem_ctx) {
591 mem_ctx = state->out_mem_ctx;
592 } else {
593 mem_ctx = state;
596 status = state->dispatch_recv(subreq, mem_ctx);
597 TALLOC_FREE(subreq);
598 if (!NT_STATUS_IS_OK(status)) {
599 tevent_req_nterror(req, status);
600 return;
603 /* Copy out parameters */
604 *state->orig.out.handle = *state->tmp.out.handle;
606 /* Copy result */
607 state->orig.out.result = state->tmp.out.result;
609 /* Reset temporary structure */
610 ZERO_STRUCT(state->tmp);
612 if (DEBUGLEVEL >= 10) {
613 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, &state->orig);
616 tevent_req_done(req);
619 NTSTATUS rpccli_winreg_OpenHKPD_recv(struct tevent_req *req,
620 TALLOC_CTX *mem_ctx,
621 WERROR *result)
623 struct rpccli_winreg_OpenHKPD_state *state = tevent_req_data(
624 req, struct rpccli_winreg_OpenHKPD_state);
625 NTSTATUS status;
627 if (tevent_req_is_nterror(req, &status)) {
628 tevent_req_received(req);
629 return status;
632 /* Steal possbile out parameters to the callers context */
633 talloc_steal(mem_ctx, state->out_mem_ctx);
635 /* Return result */
636 *result = state->orig.out.result;
638 tevent_req_received(req);
639 return NT_STATUS_OK;
642 NTSTATUS rpccli_winreg_OpenHKPD(struct rpc_pipe_client *cli,
643 TALLOC_CTX *mem_ctx,
644 uint16_t *system_name /* [in] [unique] */,
645 uint32_t access_mask /* [in] */,
646 struct policy_handle *handle /* [out] [ref] */,
647 WERROR *werror)
649 struct winreg_OpenHKPD r;
650 NTSTATUS status;
652 /* In parameters */
653 r.in.system_name = system_name;
654 r.in.access_mask = access_mask;
656 if (DEBUGLEVEL >= 10) {
657 NDR_PRINT_IN_DEBUG(winreg_OpenHKPD, &r);
660 status = cli->dispatch(cli,
661 mem_ctx,
662 &ndr_table_winreg,
663 NDR_WINREG_OPENHKPD,
664 &r);
666 if (!NT_STATUS_IS_OK(status)) {
667 return status;
670 if (DEBUGLEVEL >= 10) {
671 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPD, &r);
674 if (NT_STATUS_IS_ERR(status)) {
675 return status;
678 /* Return variables */
679 *handle = *r.out.handle;
681 /* Return result */
682 if (werror) {
683 *werror = r.out.result;
686 return werror_to_ntstatus(r.out.result);
689 struct rpccli_winreg_OpenHKU_state {
690 struct winreg_OpenHKU orig;
691 struct winreg_OpenHKU tmp;
692 TALLOC_CTX *out_mem_ctx;
693 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
696 static void rpccli_winreg_OpenHKU_done(struct tevent_req *subreq);
698 struct tevent_req *rpccli_winreg_OpenHKU_send(TALLOC_CTX *mem_ctx,
699 struct tevent_context *ev,
700 struct rpc_pipe_client *cli,
701 uint16_t *_system_name /* [in] [unique] */,
702 uint32_t _access_mask /* [in] */,
703 struct policy_handle *_handle /* [out] [ref] */)
705 struct tevent_req *req;
706 struct rpccli_winreg_OpenHKU_state *state;
707 struct tevent_req *subreq;
709 req = tevent_req_create(mem_ctx, &state,
710 struct rpccli_winreg_OpenHKU_state);
711 if (req == NULL) {
712 return NULL;
714 state->out_mem_ctx = NULL;
715 state->dispatch_recv = cli->dispatch_recv;
717 /* In parameters */
718 state->orig.in.system_name = _system_name;
719 state->orig.in.access_mask = _access_mask;
721 /* Out parameters */
722 state->orig.out.handle = _handle;
724 /* Result */
725 ZERO_STRUCT(state->orig.out.result);
727 if (DEBUGLEVEL >= 10) {
728 NDR_PRINT_IN_DEBUG(winreg_OpenHKU, &state->orig);
731 state->out_mem_ctx = talloc_named_const(state, 0,
732 "rpccli_winreg_OpenHKU_out_memory");
733 if (tevent_req_nomem(state->out_mem_ctx, req)) {
734 return tevent_req_post(req, ev);
737 /* make a temporary copy, that we pass to the dispatch function */
738 state->tmp = state->orig;
740 subreq = cli->dispatch_send(state, ev, cli,
741 &ndr_table_winreg,
742 NDR_WINREG_OPENHKU,
743 &state->tmp);
744 if (tevent_req_nomem(subreq, req)) {
745 return tevent_req_post(req, ev);
747 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKU_done, req);
748 return req;
751 static void rpccli_winreg_OpenHKU_done(struct tevent_req *subreq)
753 struct tevent_req *req = tevent_req_callback_data(
754 subreq, struct tevent_req);
755 struct rpccli_winreg_OpenHKU_state *state = tevent_req_data(
756 req, struct rpccli_winreg_OpenHKU_state);
757 NTSTATUS status;
758 TALLOC_CTX *mem_ctx;
760 if (state->out_mem_ctx) {
761 mem_ctx = state->out_mem_ctx;
762 } else {
763 mem_ctx = state;
766 status = state->dispatch_recv(subreq, mem_ctx);
767 TALLOC_FREE(subreq);
768 if (!NT_STATUS_IS_OK(status)) {
769 tevent_req_nterror(req, status);
770 return;
773 /* Copy out parameters */
774 *state->orig.out.handle = *state->tmp.out.handle;
776 /* Copy result */
777 state->orig.out.result = state->tmp.out.result;
779 /* Reset temporary structure */
780 ZERO_STRUCT(state->tmp);
782 if (DEBUGLEVEL >= 10) {
783 NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, &state->orig);
786 tevent_req_done(req);
789 NTSTATUS rpccli_winreg_OpenHKU_recv(struct tevent_req *req,
790 TALLOC_CTX *mem_ctx,
791 WERROR *result)
793 struct rpccli_winreg_OpenHKU_state *state = tevent_req_data(
794 req, struct rpccli_winreg_OpenHKU_state);
795 NTSTATUS status;
797 if (tevent_req_is_nterror(req, &status)) {
798 tevent_req_received(req);
799 return status;
802 /* Steal possbile out parameters to the callers context */
803 talloc_steal(mem_ctx, state->out_mem_ctx);
805 /* Return result */
806 *result = state->orig.out.result;
808 tevent_req_received(req);
809 return NT_STATUS_OK;
812 NTSTATUS rpccli_winreg_OpenHKU(struct rpc_pipe_client *cli,
813 TALLOC_CTX *mem_ctx,
814 uint16_t *system_name /* [in] [unique] */,
815 uint32_t access_mask /* [in] */,
816 struct policy_handle *handle /* [out] [ref] */,
817 WERROR *werror)
819 struct winreg_OpenHKU r;
820 NTSTATUS status;
822 /* In parameters */
823 r.in.system_name = system_name;
824 r.in.access_mask = access_mask;
826 if (DEBUGLEVEL >= 10) {
827 NDR_PRINT_IN_DEBUG(winreg_OpenHKU, &r);
830 status = cli->dispatch(cli,
831 mem_ctx,
832 &ndr_table_winreg,
833 NDR_WINREG_OPENHKU,
834 &r);
836 if (!NT_STATUS_IS_OK(status)) {
837 return status;
840 if (DEBUGLEVEL >= 10) {
841 NDR_PRINT_OUT_DEBUG(winreg_OpenHKU, &r);
844 if (NT_STATUS_IS_ERR(status)) {
845 return status;
848 /* Return variables */
849 *handle = *r.out.handle;
851 /* Return result */
852 if (werror) {
853 *werror = r.out.result;
856 return werror_to_ntstatus(r.out.result);
859 struct rpccli_winreg_CloseKey_state {
860 struct winreg_CloseKey orig;
861 struct winreg_CloseKey tmp;
862 TALLOC_CTX *out_mem_ctx;
863 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
866 static void rpccli_winreg_CloseKey_done(struct tevent_req *subreq);
868 struct tevent_req *rpccli_winreg_CloseKey_send(TALLOC_CTX *mem_ctx,
869 struct tevent_context *ev,
870 struct rpc_pipe_client *cli,
871 struct policy_handle *_handle /* [in,out] [ref] */)
873 struct tevent_req *req;
874 struct rpccli_winreg_CloseKey_state *state;
875 struct tevent_req *subreq;
877 req = tevent_req_create(mem_ctx, &state,
878 struct rpccli_winreg_CloseKey_state);
879 if (req == NULL) {
880 return NULL;
882 state->out_mem_ctx = NULL;
883 state->dispatch_recv = cli->dispatch_recv;
885 /* In parameters */
886 state->orig.in.handle = _handle;
888 /* Out parameters */
889 state->orig.out.handle = _handle;
891 /* Result */
892 ZERO_STRUCT(state->orig.out.result);
894 if (DEBUGLEVEL >= 10) {
895 NDR_PRINT_IN_DEBUG(winreg_CloseKey, &state->orig);
898 state->out_mem_ctx = talloc_named_const(state, 0,
899 "rpccli_winreg_CloseKey_out_memory");
900 if (tevent_req_nomem(state->out_mem_ctx, req)) {
901 return tevent_req_post(req, ev);
904 /* make a temporary copy, that we pass to the dispatch function */
905 state->tmp = state->orig;
907 subreq = cli->dispatch_send(state, ev, cli,
908 &ndr_table_winreg,
909 NDR_WINREG_CLOSEKEY,
910 &state->tmp);
911 if (tevent_req_nomem(subreq, req)) {
912 return tevent_req_post(req, ev);
914 tevent_req_set_callback(subreq, rpccli_winreg_CloseKey_done, req);
915 return req;
918 static void rpccli_winreg_CloseKey_done(struct tevent_req *subreq)
920 struct tevent_req *req = tevent_req_callback_data(
921 subreq, struct tevent_req);
922 struct rpccli_winreg_CloseKey_state *state = tevent_req_data(
923 req, struct rpccli_winreg_CloseKey_state);
924 NTSTATUS status;
925 TALLOC_CTX *mem_ctx;
927 if (state->out_mem_ctx) {
928 mem_ctx = state->out_mem_ctx;
929 } else {
930 mem_ctx = state;
933 status = state->dispatch_recv(subreq, mem_ctx);
934 TALLOC_FREE(subreq);
935 if (!NT_STATUS_IS_OK(status)) {
936 tevent_req_nterror(req, status);
937 return;
940 /* Copy out parameters */
941 *state->orig.out.handle = *state->tmp.out.handle;
943 /* Copy result */
944 state->orig.out.result = state->tmp.out.result;
946 /* Reset temporary structure */
947 ZERO_STRUCT(state->tmp);
949 if (DEBUGLEVEL >= 10) {
950 NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &state->orig);
953 tevent_req_done(req);
956 NTSTATUS rpccli_winreg_CloseKey_recv(struct tevent_req *req,
957 TALLOC_CTX *mem_ctx,
958 WERROR *result)
960 struct rpccli_winreg_CloseKey_state *state = tevent_req_data(
961 req, struct rpccli_winreg_CloseKey_state);
962 NTSTATUS status;
964 if (tevent_req_is_nterror(req, &status)) {
965 tevent_req_received(req);
966 return status;
969 /* Steal possbile out parameters to the callers context */
970 talloc_steal(mem_ctx, state->out_mem_ctx);
972 /* Return result */
973 *result = state->orig.out.result;
975 tevent_req_received(req);
976 return NT_STATUS_OK;
979 NTSTATUS rpccli_winreg_CloseKey(struct rpc_pipe_client *cli,
980 TALLOC_CTX *mem_ctx,
981 struct policy_handle *handle /* [in,out] [ref] */,
982 WERROR *werror)
984 struct winreg_CloseKey r;
985 NTSTATUS status;
987 /* In parameters */
988 r.in.handle = handle;
990 if (DEBUGLEVEL >= 10) {
991 NDR_PRINT_IN_DEBUG(winreg_CloseKey, &r);
994 status = cli->dispatch(cli,
995 mem_ctx,
996 &ndr_table_winreg,
997 NDR_WINREG_CLOSEKEY,
998 &r);
1000 if (!NT_STATUS_IS_OK(status)) {
1001 return status;
1004 if (DEBUGLEVEL >= 10) {
1005 NDR_PRINT_OUT_DEBUG(winreg_CloseKey, &r);
1008 if (NT_STATUS_IS_ERR(status)) {
1009 return status;
1012 /* Return variables */
1013 *handle = *r.out.handle;
1015 /* Return result */
1016 if (werror) {
1017 *werror = r.out.result;
1020 return werror_to_ntstatus(r.out.result);
1023 struct rpccli_winreg_CreateKey_state {
1024 struct winreg_CreateKey orig;
1025 struct winreg_CreateKey tmp;
1026 TALLOC_CTX *out_mem_ctx;
1027 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1030 static void rpccli_winreg_CreateKey_done(struct tevent_req *subreq);
1032 struct tevent_req *rpccli_winreg_CreateKey_send(TALLOC_CTX *mem_ctx,
1033 struct tevent_context *ev,
1034 struct rpc_pipe_client *cli,
1035 struct policy_handle *_handle /* [in] [ref] */,
1036 struct winreg_String _name /* [in] */,
1037 struct winreg_String _keyclass /* [in] */,
1038 uint32_t _options /* [in] */,
1039 uint32_t _access_mask /* [in] */,
1040 struct winreg_SecBuf *_secdesc /* [in] [unique] */,
1041 struct policy_handle *_new_handle /* [out] [ref] */,
1042 enum winreg_CreateAction *_action_taken /* [in,out] [unique] */)
1044 struct tevent_req *req;
1045 struct rpccli_winreg_CreateKey_state *state;
1046 struct tevent_req *subreq;
1048 req = tevent_req_create(mem_ctx, &state,
1049 struct rpccli_winreg_CreateKey_state);
1050 if (req == NULL) {
1051 return NULL;
1053 state->out_mem_ctx = NULL;
1054 state->dispatch_recv = cli->dispatch_recv;
1056 /* In parameters */
1057 state->orig.in.handle = _handle;
1058 state->orig.in.name = _name;
1059 state->orig.in.keyclass = _keyclass;
1060 state->orig.in.options = _options;
1061 state->orig.in.access_mask = _access_mask;
1062 state->orig.in.secdesc = _secdesc;
1063 state->orig.in.action_taken = _action_taken;
1065 /* Out parameters */
1066 state->orig.out.new_handle = _new_handle;
1067 state->orig.out.action_taken = _action_taken;
1069 /* Result */
1070 ZERO_STRUCT(state->orig.out.result);
1072 if (DEBUGLEVEL >= 10) {
1073 NDR_PRINT_IN_DEBUG(winreg_CreateKey, &state->orig);
1076 state->out_mem_ctx = talloc_named_const(state, 0,
1077 "rpccli_winreg_CreateKey_out_memory");
1078 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1079 return tevent_req_post(req, ev);
1082 /* make a temporary copy, that we pass to the dispatch function */
1083 state->tmp = state->orig;
1085 subreq = cli->dispatch_send(state, ev, cli,
1086 &ndr_table_winreg,
1087 NDR_WINREG_CREATEKEY,
1088 &state->tmp);
1089 if (tevent_req_nomem(subreq, req)) {
1090 return tevent_req_post(req, ev);
1092 tevent_req_set_callback(subreq, rpccli_winreg_CreateKey_done, req);
1093 return req;
1096 static void rpccli_winreg_CreateKey_done(struct tevent_req *subreq)
1098 struct tevent_req *req = tevent_req_callback_data(
1099 subreq, struct tevent_req);
1100 struct rpccli_winreg_CreateKey_state *state = tevent_req_data(
1101 req, struct rpccli_winreg_CreateKey_state);
1102 NTSTATUS status;
1103 TALLOC_CTX *mem_ctx;
1105 if (state->out_mem_ctx) {
1106 mem_ctx = state->out_mem_ctx;
1107 } else {
1108 mem_ctx = state;
1111 status = state->dispatch_recv(subreq, mem_ctx);
1112 TALLOC_FREE(subreq);
1113 if (!NT_STATUS_IS_OK(status)) {
1114 tevent_req_nterror(req, status);
1115 return;
1118 /* Copy out parameters */
1119 *state->orig.out.new_handle = *state->tmp.out.new_handle;
1120 if (state->orig.out.action_taken && state->tmp.out.action_taken) {
1121 *state->orig.out.action_taken = *state->tmp.out.action_taken;
1124 /* Copy result */
1125 state->orig.out.result = state->tmp.out.result;
1127 /* Reset temporary structure */
1128 ZERO_STRUCT(state->tmp);
1130 if (DEBUGLEVEL >= 10) {
1131 NDR_PRINT_OUT_DEBUG(winreg_CreateKey, &state->orig);
1134 tevent_req_done(req);
1137 NTSTATUS rpccli_winreg_CreateKey_recv(struct tevent_req *req,
1138 TALLOC_CTX *mem_ctx,
1139 WERROR *result)
1141 struct rpccli_winreg_CreateKey_state *state = tevent_req_data(
1142 req, struct rpccli_winreg_CreateKey_state);
1143 NTSTATUS status;
1145 if (tevent_req_is_nterror(req, &status)) {
1146 tevent_req_received(req);
1147 return status;
1150 /* Steal possbile out parameters to the callers context */
1151 talloc_steal(mem_ctx, state->out_mem_ctx);
1153 /* Return result */
1154 *result = state->orig.out.result;
1156 tevent_req_received(req);
1157 return NT_STATUS_OK;
1160 NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli,
1161 TALLOC_CTX *mem_ctx,
1162 struct policy_handle *handle /* [in] [ref] */,
1163 struct winreg_String name /* [in] */,
1164 struct winreg_String keyclass /* [in] */,
1165 uint32_t options /* [in] */,
1166 uint32_t access_mask /* [in] */,
1167 struct winreg_SecBuf *secdesc /* [in] [unique] */,
1168 struct policy_handle *new_handle /* [out] [ref] */,
1169 enum winreg_CreateAction *action_taken /* [in,out] [unique] */,
1170 WERROR *werror)
1172 struct winreg_CreateKey r;
1173 NTSTATUS status;
1175 /* In parameters */
1176 r.in.handle = handle;
1177 r.in.name = name;
1178 r.in.keyclass = keyclass;
1179 r.in.options = options;
1180 r.in.access_mask = access_mask;
1181 r.in.secdesc = secdesc;
1182 r.in.action_taken = action_taken;
1184 if (DEBUGLEVEL >= 10) {
1185 NDR_PRINT_IN_DEBUG(winreg_CreateKey, &r);
1188 status = cli->dispatch(cli,
1189 mem_ctx,
1190 &ndr_table_winreg,
1191 NDR_WINREG_CREATEKEY,
1192 &r);
1194 if (!NT_STATUS_IS_OK(status)) {
1195 return status;
1198 if (DEBUGLEVEL >= 10) {
1199 NDR_PRINT_OUT_DEBUG(winreg_CreateKey, &r);
1202 if (NT_STATUS_IS_ERR(status)) {
1203 return status;
1206 /* Return variables */
1207 *new_handle = *r.out.new_handle;
1208 if (action_taken && r.out.action_taken) {
1209 *action_taken = *r.out.action_taken;
1212 /* Return result */
1213 if (werror) {
1214 *werror = r.out.result;
1217 return werror_to_ntstatus(r.out.result);
1220 struct rpccli_winreg_DeleteKey_state {
1221 struct winreg_DeleteKey orig;
1222 struct winreg_DeleteKey tmp;
1223 TALLOC_CTX *out_mem_ctx;
1224 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1227 static void rpccli_winreg_DeleteKey_done(struct tevent_req *subreq);
1229 struct tevent_req *rpccli_winreg_DeleteKey_send(TALLOC_CTX *mem_ctx,
1230 struct tevent_context *ev,
1231 struct rpc_pipe_client *cli,
1232 struct policy_handle *_handle /* [in] [ref] */,
1233 struct winreg_String _key /* [in] */)
1235 struct tevent_req *req;
1236 struct rpccli_winreg_DeleteKey_state *state;
1237 struct tevent_req *subreq;
1239 req = tevent_req_create(mem_ctx, &state,
1240 struct rpccli_winreg_DeleteKey_state);
1241 if (req == NULL) {
1242 return NULL;
1244 state->out_mem_ctx = NULL;
1245 state->dispatch_recv = cli->dispatch_recv;
1247 /* In parameters */
1248 state->orig.in.handle = _handle;
1249 state->orig.in.key = _key;
1251 /* Out parameters */
1253 /* Result */
1254 ZERO_STRUCT(state->orig.out.result);
1256 if (DEBUGLEVEL >= 10) {
1257 NDR_PRINT_IN_DEBUG(winreg_DeleteKey, &state->orig);
1260 /* make a temporary copy, that we pass to the dispatch function */
1261 state->tmp = state->orig;
1263 subreq = cli->dispatch_send(state, ev, cli,
1264 &ndr_table_winreg,
1265 NDR_WINREG_DELETEKEY,
1266 &state->tmp);
1267 if (tevent_req_nomem(subreq, req)) {
1268 return tevent_req_post(req, ev);
1270 tevent_req_set_callback(subreq, rpccli_winreg_DeleteKey_done, req);
1271 return req;
1274 static void rpccli_winreg_DeleteKey_done(struct tevent_req *subreq)
1276 struct tevent_req *req = tevent_req_callback_data(
1277 subreq, struct tevent_req);
1278 struct rpccli_winreg_DeleteKey_state *state = tevent_req_data(
1279 req, struct rpccli_winreg_DeleteKey_state);
1280 NTSTATUS status;
1281 TALLOC_CTX *mem_ctx;
1283 if (state->out_mem_ctx) {
1284 mem_ctx = state->out_mem_ctx;
1285 } else {
1286 mem_ctx = state;
1289 status = state->dispatch_recv(subreq, mem_ctx);
1290 TALLOC_FREE(subreq);
1291 if (!NT_STATUS_IS_OK(status)) {
1292 tevent_req_nterror(req, status);
1293 return;
1296 /* Copy out parameters */
1298 /* Copy result */
1299 state->orig.out.result = state->tmp.out.result;
1301 /* Reset temporary structure */
1302 ZERO_STRUCT(state->tmp);
1304 if (DEBUGLEVEL >= 10) {
1305 NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, &state->orig);
1308 tevent_req_done(req);
1311 NTSTATUS rpccli_winreg_DeleteKey_recv(struct tevent_req *req,
1312 TALLOC_CTX *mem_ctx,
1313 WERROR *result)
1315 struct rpccli_winreg_DeleteKey_state *state = tevent_req_data(
1316 req, struct rpccli_winreg_DeleteKey_state);
1317 NTSTATUS status;
1319 if (tevent_req_is_nterror(req, &status)) {
1320 tevent_req_received(req);
1321 return status;
1324 /* Steal possbile out parameters to the callers context */
1325 talloc_steal(mem_ctx, state->out_mem_ctx);
1327 /* Return result */
1328 *result = state->orig.out.result;
1330 tevent_req_received(req);
1331 return NT_STATUS_OK;
1334 NTSTATUS rpccli_winreg_DeleteKey(struct rpc_pipe_client *cli,
1335 TALLOC_CTX *mem_ctx,
1336 struct policy_handle *handle /* [in] [ref] */,
1337 struct winreg_String key /* [in] */,
1338 WERROR *werror)
1340 struct winreg_DeleteKey r;
1341 NTSTATUS status;
1343 /* In parameters */
1344 r.in.handle = handle;
1345 r.in.key = key;
1347 if (DEBUGLEVEL >= 10) {
1348 NDR_PRINT_IN_DEBUG(winreg_DeleteKey, &r);
1351 status = cli->dispatch(cli,
1352 mem_ctx,
1353 &ndr_table_winreg,
1354 NDR_WINREG_DELETEKEY,
1355 &r);
1357 if (!NT_STATUS_IS_OK(status)) {
1358 return status;
1361 if (DEBUGLEVEL >= 10) {
1362 NDR_PRINT_OUT_DEBUG(winreg_DeleteKey, &r);
1365 if (NT_STATUS_IS_ERR(status)) {
1366 return status;
1369 /* Return variables */
1371 /* Return result */
1372 if (werror) {
1373 *werror = r.out.result;
1376 return werror_to_ntstatus(r.out.result);
1379 struct rpccli_winreg_DeleteValue_state {
1380 struct winreg_DeleteValue orig;
1381 struct winreg_DeleteValue tmp;
1382 TALLOC_CTX *out_mem_ctx;
1383 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1386 static void rpccli_winreg_DeleteValue_done(struct tevent_req *subreq);
1388 struct tevent_req *rpccli_winreg_DeleteValue_send(TALLOC_CTX *mem_ctx,
1389 struct tevent_context *ev,
1390 struct rpc_pipe_client *cli,
1391 struct policy_handle *_handle /* [in] [ref] */,
1392 struct winreg_String _value /* [in] */)
1394 struct tevent_req *req;
1395 struct rpccli_winreg_DeleteValue_state *state;
1396 struct tevent_req *subreq;
1398 req = tevent_req_create(mem_ctx, &state,
1399 struct rpccli_winreg_DeleteValue_state);
1400 if (req == NULL) {
1401 return NULL;
1403 state->out_mem_ctx = NULL;
1404 state->dispatch_recv = cli->dispatch_recv;
1406 /* In parameters */
1407 state->orig.in.handle = _handle;
1408 state->orig.in.value = _value;
1410 /* Out parameters */
1412 /* Result */
1413 ZERO_STRUCT(state->orig.out.result);
1415 if (DEBUGLEVEL >= 10) {
1416 NDR_PRINT_IN_DEBUG(winreg_DeleteValue, &state->orig);
1419 /* make a temporary copy, that we pass to the dispatch function */
1420 state->tmp = state->orig;
1422 subreq = cli->dispatch_send(state, ev, cli,
1423 &ndr_table_winreg,
1424 NDR_WINREG_DELETEVALUE,
1425 &state->tmp);
1426 if (tevent_req_nomem(subreq, req)) {
1427 return tevent_req_post(req, ev);
1429 tevent_req_set_callback(subreq, rpccli_winreg_DeleteValue_done, req);
1430 return req;
1433 static void rpccli_winreg_DeleteValue_done(struct tevent_req *subreq)
1435 struct tevent_req *req = tevent_req_callback_data(
1436 subreq, struct tevent_req);
1437 struct rpccli_winreg_DeleteValue_state *state = tevent_req_data(
1438 req, struct rpccli_winreg_DeleteValue_state);
1439 NTSTATUS status;
1440 TALLOC_CTX *mem_ctx;
1442 if (state->out_mem_ctx) {
1443 mem_ctx = state->out_mem_ctx;
1444 } else {
1445 mem_ctx = state;
1448 status = state->dispatch_recv(subreq, mem_ctx);
1449 TALLOC_FREE(subreq);
1450 if (!NT_STATUS_IS_OK(status)) {
1451 tevent_req_nterror(req, status);
1452 return;
1455 /* Copy out parameters */
1457 /* Copy result */
1458 state->orig.out.result = state->tmp.out.result;
1460 /* Reset temporary structure */
1461 ZERO_STRUCT(state->tmp);
1463 if (DEBUGLEVEL >= 10) {
1464 NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, &state->orig);
1467 tevent_req_done(req);
1470 NTSTATUS rpccli_winreg_DeleteValue_recv(struct tevent_req *req,
1471 TALLOC_CTX *mem_ctx,
1472 WERROR *result)
1474 struct rpccli_winreg_DeleteValue_state *state = tevent_req_data(
1475 req, struct rpccli_winreg_DeleteValue_state);
1476 NTSTATUS status;
1478 if (tevent_req_is_nterror(req, &status)) {
1479 tevent_req_received(req);
1480 return status;
1483 /* Steal possbile out parameters to the callers context */
1484 talloc_steal(mem_ctx, state->out_mem_ctx);
1486 /* Return result */
1487 *result = state->orig.out.result;
1489 tevent_req_received(req);
1490 return NT_STATUS_OK;
1493 NTSTATUS rpccli_winreg_DeleteValue(struct rpc_pipe_client *cli,
1494 TALLOC_CTX *mem_ctx,
1495 struct policy_handle *handle /* [in] [ref] */,
1496 struct winreg_String value /* [in] */,
1497 WERROR *werror)
1499 struct winreg_DeleteValue r;
1500 NTSTATUS status;
1502 /* In parameters */
1503 r.in.handle = handle;
1504 r.in.value = value;
1506 if (DEBUGLEVEL >= 10) {
1507 NDR_PRINT_IN_DEBUG(winreg_DeleteValue, &r);
1510 status = cli->dispatch(cli,
1511 mem_ctx,
1512 &ndr_table_winreg,
1513 NDR_WINREG_DELETEVALUE,
1514 &r);
1516 if (!NT_STATUS_IS_OK(status)) {
1517 return status;
1520 if (DEBUGLEVEL >= 10) {
1521 NDR_PRINT_OUT_DEBUG(winreg_DeleteValue, &r);
1524 if (NT_STATUS_IS_ERR(status)) {
1525 return status;
1528 /* Return variables */
1530 /* Return result */
1531 if (werror) {
1532 *werror = r.out.result;
1535 return werror_to_ntstatus(r.out.result);
1538 struct rpccli_winreg_EnumKey_state {
1539 struct winreg_EnumKey orig;
1540 struct winreg_EnumKey tmp;
1541 TALLOC_CTX *out_mem_ctx;
1542 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1545 static void rpccli_winreg_EnumKey_done(struct tevent_req *subreq);
1547 struct tevent_req *rpccli_winreg_EnumKey_send(TALLOC_CTX *mem_ctx,
1548 struct tevent_context *ev,
1549 struct rpc_pipe_client *cli,
1550 struct policy_handle *_handle /* [in] [ref] */,
1551 uint32_t _enum_index /* [in] */,
1552 struct winreg_StringBuf *_name /* [in,out] [ref] */,
1553 struct winreg_StringBuf *_keyclass /* [in,out] [unique] */,
1554 NTTIME *_last_changed_time /* [in,out] [unique] */)
1556 struct tevent_req *req;
1557 struct rpccli_winreg_EnumKey_state *state;
1558 struct tevent_req *subreq;
1560 req = tevent_req_create(mem_ctx, &state,
1561 struct rpccli_winreg_EnumKey_state);
1562 if (req == NULL) {
1563 return NULL;
1565 state->out_mem_ctx = NULL;
1566 state->dispatch_recv = cli->dispatch_recv;
1568 /* In parameters */
1569 state->orig.in.handle = _handle;
1570 state->orig.in.enum_index = _enum_index;
1571 state->orig.in.name = _name;
1572 state->orig.in.keyclass = _keyclass;
1573 state->orig.in.last_changed_time = _last_changed_time;
1575 /* Out parameters */
1576 state->orig.out.name = _name;
1577 state->orig.out.keyclass = _keyclass;
1578 state->orig.out.last_changed_time = _last_changed_time;
1580 /* Result */
1581 ZERO_STRUCT(state->orig.out.result);
1583 if (DEBUGLEVEL >= 10) {
1584 NDR_PRINT_IN_DEBUG(winreg_EnumKey, &state->orig);
1587 state->out_mem_ctx = talloc_named_const(state, 0,
1588 "rpccli_winreg_EnumKey_out_memory");
1589 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1590 return tevent_req_post(req, ev);
1593 /* make a temporary copy, that we pass to the dispatch function */
1594 state->tmp = state->orig;
1596 subreq = cli->dispatch_send(state, ev, cli,
1597 &ndr_table_winreg,
1598 NDR_WINREG_ENUMKEY,
1599 &state->tmp);
1600 if (tevent_req_nomem(subreq, req)) {
1601 return tevent_req_post(req, ev);
1603 tevent_req_set_callback(subreq, rpccli_winreg_EnumKey_done, req);
1604 return req;
1607 static void rpccli_winreg_EnumKey_done(struct tevent_req *subreq)
1609 struct tevent_req *req = tevent_req_callback_data(
1610 subreq, struct tevent_req);
1611 struct rpccli_winreg_EnumKey_state *state = tevent_req_data(
1612 req, struct rpccli_winreg_EnumKey_state);
1613 NTSTATUS status;
1614 TALLOC_CTX *mem_ctx;
1616 if (state->out_mem_ctx) {
1617 mem_ctx = state->out_mem_ctx;
1618 } else {
1619 mem_ctx = state;
1622 status = state->dispatch_recv(subreq, mem_ctx);
1623 TALLOC_FREE(subreq);
1624 if (!NT_STATUS_IS_OK(status)) {
1625 tevent_req_nterror(req, status);
1626 return;
1629 /* Copy out parameters */
1630 *state->orig.out.name = *state->tmp.out.name;
1631 if (state->orig.out.keyclass && state->tmp.out.keyclass) {
1632 *state->orig.out.keyclass = *state->tmp.out.keyclass;
1634 if (state->orig.out.last_changed_time && state->tmp.out.last_changed_time) {
1635 *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
1638 /* Copy result */
1639 state->orig.out.result = state->tmp.out.result;
1641 /* Reset temporary structure */
1642 ZERO_STRUCT(state->tmp);
1644 if (DEBUGLEVEL >= 10) {
1645 NDR_PRINT_OUT_DEBUG(winreg_EnumKey, &state->orig);
1648 tevent_req_done(req);
1651 NTSTATUS rpccli_winreg_EnumKey_recv(struct tevent_req *req,
1652 TALLOC_CTX *mem_ctx,
1653 WERROR *result)
1655 struct rpccli_winreg_EnumKey_state *state = tevent_req_data(
1656 req, struct rpccli_winreg_EnumKey_state);
1657 NTSTATUS status;
1659 if (tevent_req_is_nterror(req, &status)) {
1660 tevent_req_received(req);
1661 return status;
1664 /* Steal possbile out parameters to the callers context */
1665 talloc_steal(mem_ctx, state->out_mem_ctx);
1667 /* Return result */
1668 *result = state->orig.out.result;
1670 tevent_req_received(req);
1671 return NT_STATUS_OK;
1674 NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli,
1675 TALLOC_CTX *mem_ctx,
1676 struct policy_handle *handle /* [in] [ref] */,
1677 uint32_t enum_index /* [in] */,
1678 struct winreg_StringBuf *name /* [in,out] [ref] */,
1679 struct winreg_StringBuf *keyclass /* [in,out] [unique] */,
1680 NTTIME *last_changed_time /* [in,out] [unique] */,
1681 WERROR *werror)
1683 struct winreg_EnumKey r;
1684 NTSTATUS status;
1686 /* In parameters */
1687 r.in.handle = handle;
1688 r.in.enum_index = enum_index;
1689 r.in.name = name;
1690 r.in.keyclass = keyclass;
1691 r.in.last_changed_time = last_changed_time;
1693 if (DEBUGLEVEL >= 10) {
1694 NDR_PRINT_IN_DEBUG(winreg_EnumKey, &r);
1697 status = cli->dispatch(cli,
1698 mem_ctx,
1699 &ndr_table_winreg,
1700 NDR_WINREG_ENUMKEY,
1701 &r);
1703 if (!NT_STATUS_IS_OK(status)) {
1704 return status;
1707 if (DEBUGLEVEL >= 10) {
1708 NDR_PRINT_OUT_DEBUG(winreg_EnumKey, &r);
1711 if (NT_STATUS_IS_ERR(status)) {
1712 return status;
1715 /* Return variables */
1716 *name = *r.out.name;
1717 if (keyclass && r.out.keyclass) {
1718 *keyclass = *r.out.keyclass;
1720 if (last_changed_time && r.out.last_changed_time) {
1721 *last_changed_time = *r.out.last_changed_time;
1724 /* Return result */
1725 if (werror) {
1726 *werror = r.out.result;
1729 return werror_to_ntstatus(r.out.result);
1732 struct rpccli_winreg_EnumValue_state {
1733 struct winreg_EnumValue orig;
1734 struct winreg_EnumValue tmp;
1735 TALLOC_CTX *out_mem_ctx;
1736 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1739 static void rpccli_winreg_EnumValue_done(struct tevent_req *subreq);
1741 struct tevent_req *rpccli_winreg_EnumValue_send(TALLOC_CTX *mem_ctx,
1742 struct tevent_context *ev,
1743 struct rpc_pipe_client *cli,
1744 struct policy_handle *_handle /* [in] [ref] */,
1745 uint32_t _enum_index /* [in] */,
1746 struct winreg_ValNameBuf *_name /* [in,out] [ref] */,
1747 enum winreg_Type *_type /* [in,out] [unique] */,
1748 uint8_t *_value /* [in,out] [unique,length_is(*length),size_is(*size)] */,
1749 uint32_t *_size /* [in,out] [unique] */,
1750 uint32_t *_length /* [in,out] [unique] */)
1752 struct tevent_req *req;
1753 struct rpccli_winreg_EnumValue_state *state;
1754 struct tevent_req *subreq;
1756 req = tevent_req_create(mem_ctx, &state,
1757 struct rpccli_winreg_EnumValue_state);
1758 if (req == NULL) {
1759 return NULL;
1761 state->out_mem_ctx = NULL;
1762 state->dispatch_recv = cli->dispatch_recv;
1764 /* In parameters */
1765 state->orig.in.handle = _handle;
1766 state->orig.in.enum_index = _enum_index;
1767 state->orig.in.name = _name;
1768 state->orig.in.type = _type;
1769 state->orig.in.value = _value;
1770 state->orig.in.size = _size;
1771 state->orig.in.length = _length;
1773 /* Out parameters */
1774 state->orig.out.name = _name;
1775 state->orig.out.type = _type;
1776 state->orig.out.value = _value;
1777 state->orig.out.size = _size;
1778 state->orig.out.length = _length;
1780 /* Result */
1781 ZERO_STRUCT(state->orig.out.result);
1783 if (DEBUGLEVEL >= 10) {
1784 NDR_PRINT_IN_DEBUG(winreg_EnumValue, &state->orig);
1787 state->out_mem_ctx = talloc_named_const(state, 0,
1788 "rpccli_winreg_EnumValue_out_memory");
1789 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1790 return tevent_req_post(req, ev);
1793 /* make a temporary copy, that we pass to the dispatch function */
1794 state->tmp = state->orig;
1796 subreq = cli->dispatch_send(state, ev, cli,
1797 &ndr_table_winreg,
1798 NDR_WINREG_ENUMVALUE,
1799 &state->tmp);
1800 if (tevent_req_nomem(subreq, req)) {
1801 return tevent_req_post(req, ev);
1803 tevent_req_set_callback(subreq, rpccli_winreg_EnumValue_done, req);
1804 return req;
1807 static void rpccli_winreg_EnumValue_done(struct tevent_req *subreq)
1809 struct tevent_req *req = tevent_req_callback_data(
1810 subreq, struct tevent_req);
1811 struct rpccli_winreg_EnumValue_state *state = tevent_req_data(
1812 req, struct rpccli_winreg_EnumValue_state);
1813 NTSTATUS status;
1814 TALLOC_CTX *mem_ctx;
1816 if (state->out_mem_ctx) {
1817 mem_ctx = state->out_mem_ctx;
1818 } else {
1819 mem_ctx = state;
1822 status = state->dispatch_recv(subreq, mem_ctx);
1823 TALLOC_FREE(subreq);
1824 if (!NT_STATUS_IS_OK(status)) {
1825 tevent_req_nterror(req, status);
1826 return;
1829 /* Copy out parameters */
1830 *state->orig.out.name = *state->tmp.out.name;
1831 if (state->orig.out.type && state->tmp.out.type) {
1832 *state->orig.out.type = *state->tmp.out.type;
1834 if (state->orig.out.value && state->tmp.out.value) {
1835 memcpy(state->orig.out.value, state->tmp.out.value, *state->tmp.in.size * sizeof(*state->orig.out.value));
1837 if (state->orig.out.size && state->tmp.out.size) {
1838 *state->orig.out.size = *state->tmp.out.size;
1840 if (state->orig.out.length && state->tmp.out.length) {
1841 *state->orig.out.length = *state->tmp.out.length;
1844 /* Copy result */
1845 state->orig.out.result = state->tmp.out.result;
1847 /* Reset temporary structure */
1848 ZERO_STRUCT(state->tmp);
1850 if (DEBUGLEVEL >= 10) {
1851 NDR_PRINT_OUT_DEBUG(winreg_EnumValue, &state->orig);
1854 tevent_req_done(req);
1857 NTSTATUS rpccli_winreg_EnumValue_recv(struct tevent_req *req,
1858 TALLOC_CTX *mem_ctx,
1859 WERROR *result)
1861 struct rpccli_winreg_EnumValue_state *state = tevent_req_data(
1862 req, struct rpccli_winreg_EnumValue_state);
1863 NTSTATUS status;
1865 if (tevent_req_is_nterror(req, &status)) {
1866 tevent_req_received(req);
1867 return status;
1870 /* Steal possbile out parameters to the callers context */
1871 talloc_steal(mem_ctx, state->out_mem_ctx);
1873 /* Return result */
1874 *result = state->orig.out.result;
1876 tevent_req_received(req);
1877 return NT_STATUS_OK;
1880 NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli,
1881 TALLOC_CTX *mem_ctx,
1882 struct policy_handle *handle /* [in] [ref] */,
1883 uint32_t enum_index /* [in] */,
1884 struct winreg_ValNameBuf *name /* [in,out] [ref] */,
1885 enum winreg_Type *type /* [in,out] [unique] */,
1886 uint8_t *value /* [in,out] [unique,length_is(*length),size_is(*size)] */,
1887 uint32_t *size /* [in,out] [unique] */,
1888 uint32_t *length /* [in,out] [unique] */,
1889 WERROR *werror)
1891 struct winreg_EnumValue r;
1892 NTSTATUS status;
1894 /* In parameters */
1895 r.in.handle = handle;
1896 r.in.enum_index = enum_index;
1897 r.in.name = name;
1898 r.in.type = type;
1899 r.in.value = value;
1900 r.in.size = size;
1901 r.in.length = length;
1903 if (DEBUGLEVEL >= 10) {
1904 NDR_PRINT_IN_DEBUG(winreg_EnumValue, &r);
1907 status = cli->dispatch(cli,
1908 mem_ctx,
1909 &ndr_table_winreg,
1910 NDR_WINREG_ENUMVALUE,
1911 &r);
1913 if (!NT_STATUS_IS_OK(status)) {
1914 return status;
1917 if (DEBUGLEVEL >= 10) {
1918 NDR_PRINT_OUT_DEBUG(winreg_EnumValue, &r);
1921 if (NT_STATUS_IS_ERR(status)) {
1922 return status;
1925 /* Return variables */
1926 *name = *r.out.name;
1927 if (type && r.out.type) {
1928 *type = *r.out.type;
1930 if (value && r.out.value) {
1931 memcpy(value, r.out.value, *r.in.size * sizeof(*value));
1933 if (size && r.out.size) {
1934 *size = *r.out.size;
1936 if (length && r.out.length) {
1937 *length = *r.out.length;
1940 /* Return result */
1941 if (werror) {
1942 *werror = r.out.result;
1945 return werror_to_ntstatus(r.out.result);
1948 struct rpccli_winreg_FlushKey_state {
1949 struct winreg_FlushKey orig;
1950 struct winreg_FlushKey tmp;
1951 TALLOC_CTX *out_mem_ctx;
1952 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1955 static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq);
1957 struct tevent_req *rpccli_winreg_FlushKey_send(TALLOC_CTX *mem_ctx,
1958 struct tevent_context *ev,
1959 struct rpc_pipe_client *cli,
1960 struct policy_handle *_handle /* [in] [ref] */)
1962 struct tevent_req *req;
1963 struct rpccli_winreg_FlushKey_state *state;
1964 struct tevent_req *subreq;
1966 req = tevent_req_create(mem_ctx, &state,
1967 struct rpccli_winreg_FlushKey_state);
1968 if (req == NULL) {
1969 return NULL;
1971 state->out_mem_ctx = NULL;
1972 state->dispatch_recv = cli->dispatch_recv;
1974 /* In parameters */
1975 state->orig.in.handle = _handle;
1977 /* Out parameters */
1979 /* Result */
1980 ZERO_STRUCT(state->orig.out.result);
1982 if (DEBUGLEVEL >= 10) {
1983 NDR_PRINT_IN_DEBUG(winreg_FlushKey, &state->orig);
1986 /* make a temporary copy, that we pass to the dispatch function */
1987 state->tmp = state->orig;
1989 subreq = cli->dispatch_send(state, ev, cli,
1990 &ndr_table_winreg,
1991 NDR_WINREG_FLUSHKEY,
1992 &state->tmp);
1993 if (tevent_req_nomem(subreq, req)) {
1994 return tevent_req_post(req, ev);
1996 tevent_req_set_callback(subreq, rpccli_winreg_FlushKey_done, req);
1997 return req;
2000 static void rpccli_winreg_FlushKey_done(struct tevent_req *subreq)
2002 struct tevent_req *req = tevent_req_callback_data(
2003 subreq, struct tevent_req);
2004 struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
2005 req, struct rpccli_winreg_FlushKey_state);
2006 NTSTATUS status;
2007 TALLOC_CTX *mem_ctx;
2009 if (state->out_mem_ctx) {
2010 mem_ctx = state->out_mem_ctx;
2011 } else {
2012 mem_ctx = state;
2015 status = state->dispatch_recv(subreq, mem_ctx);
2016 TALLOC_FREE(subreq);
2017 if (!NT_STATUS_IS_OK(status)) {
2018 tevent_req_nterror(req, status);
2019 return;
2022 /* Copy out parameters */
2024 /* Copy result */
2025 state->orig.out.result = state->tmp.out.result;
2027 /* Reset temporary structure */
2028 ZERO_STRUCT(state->tmp);
2030 if (DEBUGLEVEL >= 10) {
2031 NDR_PRINT_OUT_DEBUG(winreg_FlushKey, &state->orig);
2034 tevent_req_done(req);
2037 NTSTATUS rpccli_winreg_FlushKey_recv(struct tevent_req *req,
2038 TALLOC_CTX *mem_ctx,
2039 WERROR *result)
2041 struct rpccli_winreg_FlushKey_state *state = tevent_req_data(
2042 req, struct rpccli_winreg_FlushKey_state);
2043 NTSTATUS status;
2045 if (tevent_req_is_nterror(req, &status)) {
2046 tevent_req_received(req);
2047 return status;
2050 /* Steal possbile out parameters to the callers context */
2051 talloc_steal(mem_ctx, state->out_mem_ctx);
2053 /* Return result */
2054 *result = state->orig.out.result;
2056 tevent_req_received(req);
2057 return NT_STATUS_OK;
2060 NTSTATUS rpccli_winreg_FlushKey(struct rpc_pipe_client *cli,
2061 TALLOC_CTX *mem_ctx,
2062 struct policy_handle *handle /* [in] [ref] */,
2063 WERROR *werror)
2065 struct winreg_FlushKey r;
2066 NTSTATUS status;
2068 /* In parameters */
2069 r.in.handle = handle;
2071 if (DEBUGLEVEL >= 10) {
2072 NDR_PRINT_IN_DEBUG(winreg_FlushKey, &r);
2075 status = cli->dispatch(cli,
2076 mem_ctx,
2077 &ndr_table_winreg,
2078 NDR_WINREG_FLUSHKEY,
2079 &r);
2081 if (!NT_STATUS_IS_OK(status)) {
2082 return status;
2085 if (DEBUGLEVEL >= 10) {
2086 NDR_PRINT_OUT_DEBUG(winreg_FlushKey, &r);
2089 if (NT_STATUS_IS_ERR(status)) {
2090 return status;
2093 /* Return variables */
2095 /* Return result */
2096 if (werror) {
2097 *werror = r.out.result;
2100 return werror_to_ntstatus(r.out.result);
2103 struct rpccli_winreg_GetKeySecurity_state {
2104 struct winreg_GetKeySecurity orig;
2105 struct winreg_GetKeySecurity tmp;
2106 TALLOC_CTX *out_mem_ctx;
2107 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2110 static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq);
2112 struct tevent_req *rpccli_winreg_GetKeySecurity_send(TALLOC_CTX *mem_ctx,
2113 struct tevent_context *ev,
2114 struct rpc_pipe_client *cli,
2115 struct policy_handle *_handle /* [in] [ref] */,
2116 uint32_t _sec_info /* [in] */,
2117 struct KeySecurityData *_sd /* [in,out] [ref] */)
2119 struct tevent_req *req;
2120 struct rpccli_winreg_GetKeySecurity_state *state;
2121 struct tevent_req *subreq;
2123 req = tevent_req_create(mem_ctx, &state,
2124 struct rpccli_winreg_GetKeySecurity_state);
2125 if (req == NULL) {
2126 return NULL;
2128 state->out_mem_ctx = NULL;
2129 state->dispatch_recv = cli->dispatch_recv;
2131 /* In parameters */
2132 state->orig.in.handle = _handle;
2133 state->orig.in.sec_info = _sec_info;
2134 state->orig.in.sd = _sd;
2136 /* Out parameters */
2137 state->orig.out.sd = _sd;
2139 /* Result */
2140 ZERO_STRUCT(state->orig.out.result);
2142 if (DEBUGLEVEL >= 10) {
2143 NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, &state->orig);
2146 state->out_mem_ctx = talloc_named_const(state, 0,
2147 "rpccli_winreg_GetKeySecurity_out_memory");
2148 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2149 return tevent_req_post(req, ev);
2152 /* make a temporary copy, that we pass to the dispatch function */
2153 state->tmp = state->orig;
2155 subreq = cli->dispatch_send(state, ev, cli,
2156 &ndr_table_winreg,
2157 NDR_WINREG_GETKEYSECURITY,
2158 &state->tmp);
2159 if (tevent_req_nomem(subreq, req)) {
2160 return tevent_req_post(req, ev);
2162 tevent_req_set_callback(subreq, rpccli_winreg_GetKeySecurity_done, req);
2163 return req;
2166 static void rpccli_winreg_GetKeySecurity_done(struct tevent_req *subreq)
2168 struct tevent_req *req = tevent_req_callback_data(
2169 subreq, struct tevent_req);
2170 struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
2171 req, struct rpccli_winreg_GetKeySecurity_state);
2172 NTSTATUS status;
2173 TALLOC_CTX *mem_ctx;
2175 if (state->out_mem_ctx) {
2176 mem_ctx = state->out_mem_ctx;
2177 } else {
2178 mem_ctx = state;
2181 status = state->dispatch_recv(subreq, mem_ctx);
2182 TALLOC_FREE(subreq);
2183 if (!NT_STATUS_IS_OK(status)) {
2184 tevent_req_nterror(req, status);
2185 return;
2188 /* Copy out parameters */
2189 *state->orig.out.sd = *state->tmp.out.sd;
2191 /* Copy result */
2192 state->orig.out.result = state->tmp.out.result;
2194 /* Reset temporary structure */
2195 ZERO_STRUCT(state->tmp);
2197 if (DEBUGLEVEL >= 10) {
2198 NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, &state->orig);
2201 tevent_req_done(req);
2204 NTSTATUS rpccli_winreg_GetKeySecurity_recv(struct tevent_req *req,
2205 TALLOC_CTX *mem_ctx,
2206 WERROR *result)
2208 struct rpccli_winreg_GetKeySecurity_state *state = tevent_req_data(
2209 req, struct rpccli_winreg_GetKeySecurity_state);
2210 NTSTATUS status;
2212 if (tevent_req_is_nterror(req, &status)) {
2213 tevent_req_received(req);
2214 return status;
2217 /* Steal possbile out parameters to the callers context */
2218 talloc_steal(mem_ctx, state->out_mem_ctx);
2220 /* Return result */
2221 *result = state->orig.out.result;
2223 tevent_req_received(req);
2224 return NT_STATUS_OK;
2227 NTSTATUS rpccli_winreg_GetKeySecurity(struct rpc_pipe_client *cli,
2228 TALLOC_CTX *mem_ctx,
2229 struct policy_handle *handle /* [in] [ref] */,
2230 uint32_t sec_info /* [in] */,
2231 struct KeySecurityData *sd /* [in,out] [ref] */,
2232 WERROR *werror)
2234 struct winreg_GetKeySecurity r;
2235 NTSTATUS status;
2237 /* In parameters */
2238 r.in.handle = handle;
2239 r.in.sec_info = sec_info;
2240 r.in.sd = sd;
2242 if (DEBUGLEVEL >= 10) {
2243 NDR_PRINT_IN_DEBUG(winreg_GetKeySecurity, &r);
2246 status = cli->dispatch(cli,
2247 mem_ctx,
2248 &ndr_table_winreg,
2249 NDR_WINREG_GETKEYSECURITY,
2250 &r);
2252 if (!NT_STATUS_IS_OK(status)) {
2253 return status;
2256 if (DEBUGLEVEL >= 10) {
2257 NDR_PRINT_OUT_DEBUG(winreg_GetKeySecurity, &r);
2260 if (NT_STATUS_IS_ERR(status)) {
2261 return status;
2264 /* Return variables */
2265 *sd = *r.out.sd;
2267 /* Return result */
2268 if (werror) {
2269 *werror = r.out.result;
2272 return werror_to_ntstatus(r.out.result);
2275 struct rpccli_winreg_LoadKey_state {
2276 struct winreg_LoadKey orig;
2277 struct winreg_LoadKey tmp;
2278 TALLOC_CTX *out_mem_ctx;
2279 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2282 static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq);
2284 struct tevent_req *rpccli_winreg_LoadKey_send(TALLOC_CTX *mem_ctx,
2285 struct tevent_context *ev,
2286 struct rpc_pipe_client *cli,
2287 struct policy_handle *_handle /* [in] [ref] */,
2288 struct winreg_String *_keyname /* [in] [unique] */,
2289 struct winreg_String *_filename /* [in] [unique] */)
2291 struct tevent_req *req;
2292 struct rpccli_winreg_LoadKey_state *state;
2293 struct tevent_req *subreq;
2295 req = tevent_req_create(mem_ctx, &state,
2296 struct rpccli_winreg_LoadKey_state);
2297 if (req == NULL) {
2298 return NULL;
2300 state->out_mem_ctx = NULL;
2301 state->dispatch_recv = cli->dispatch_recv;
2303 /* In parameters */
2304 state->orig.in.handle = _handle;
2305 state->orig.in.keyname = _keyname;
2306 state->orig.in.filename = _filename;
2308 /* Out parameters */
2310 /* Result */
2311 ZERO_STRUCT(state->orig.out.result);
2313 if (DEBUGLEVEL >= 10) {
2314 NDR_PRINT_IN_DEBUG(winreg_LoadKey, &state->orig);
2317 /* make a temporary copy, that we pass to the dispatch function */
2318 state->tmp = state->orig;
2320 subreq = cli->dispatch_send(state, ev, cli,
2321 &ndr_table_winreg,
2322 NDR_WINREG_LOADKEY,
2323 &state->tmp);
2324 if (tevent_req_nomem(subreq, req)) {
2325 return tevent_req_post(req, ev);
2327 tevent_req_set_callback(subreq, rpccli_winreg_LoadKey_done, req);
2328 return req;
2331 static void rpccli_winreg_LoadKey_done(struct tevent_req *subreq)
2333 struct tevent_req *req = tevent_req_callback_data(
2334 subreq, struct tevent_req);
2335 struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
2336 req, struct rpccli_winreg_LoadKey_state);
2337 NTSTATUS status;
2338 TALLOC_CTX *mem_ctx;
2340 if (state->out_mem_ctx) {
2341 mem_ctx = state->out_mem_ctx;
2342 } else {
2343 mem_ctx = state;
2346 status = state->dispatch_recv(subreq, mem_ctx);
2347 TALLOC_FREE(subreq);
2348 if (!NT_STATUS_IS_OK(status)) {
2349 tevent_req_nterror(req, status);
2350 return;
2353 /* Copy out parameters */
2355 /* Copy result */
2356 state->orig.out.result = state->tmp.out.result;
2358 /* Reset temporary structure */
2359 ZERO_STRUCT(state->tmp);
2361 if (DEBUGLEVEL >= 10) {
2362 NDR_PRINT_OUT_DEBUG(winreg_LoadKey, &state->orig);
2365 tevent_req_done(req);
2368 NTSTATUS rpccli_winreg_LoadKey_recv(struct tevent_req *req,
2369 TALLOC_CTX *mem_ctx,
2370 WERROR *result)
2372 struct rpccli_winreg_LoadKey_state *state = tevent_req_data(
2373 req, struct rpccli_winreg_LoadKey_state);
2374 NTSTATUS status;
2376 if (tevent_req_is_nterror(req, &status)) {
2377 tevent_req_received(req);
2378 return status;
2381 /* Steal possbile out parameters to the callers context */
2382 talloc_steal(mem_ctx, state->out_mem_ctx);
2384 /* Return result */
2385 *result = state->orig.out.result;
2387 tevent_req_received(req);
2388 return NT_STATUS_OK;
2391 NTSTATUS rpccli_winreg_LoadKey(struct rpc_pipe_client *cli,
2392 TALLOC_CTX *mem_ctx,
2393 struct policy_handle *handle /* [in] [ref] */,
2394 struct winreg_String *keyname /* [in] [unique] */,
2395 struct winreg_String *filename /* [in] [unique] */,
2396 WERROR *werror)
2398 struct winreg_LoadKey r;
2399 NTSTATUS status;
2401 /* In parameters */
2402 r.in.handle = handle;
2403 r.in.keyname = keyname;
2404 r.in.filename = filename;
2406 if (DEBUGLEVEL >= 10) {
2407 NDR_PRINT_IN_DEBUG(winreg_LoadKey, &r);
2410 status = cli->dispatch(cli,
2411 mem_ctx,
2412 &ndr_table_winreg,
2413 NDR_WINREG_LOADKEY,
2414 &r);
2416 if (!NT_STATUS_IS_OK(status)) {
2417 return status;
2420 if (DEBUGLEVEL >= 10) {
2421 NDR_PRINT_OUT_DEBUG(winreg_LoadKey, &r);
2424 if (NT_STATUS_IS_ERR(status)) {
2425 return status;
2428 /* Return variables */
2430 /* Return result */
2431 if (werror) {
2432 *werror = r.out.result;
2435 return werror_to_ntstatus(r.out.result);
2438 struct rpccli_winreg_NotifyChangeKeyValue_state {
2439 struct winreg_NotifyChangeKeyValue orig;
2440 struct winreg_NotifyChangeKeyValue tmp;
2441 TALLOC_CTX *out_mem_ctx;
2442 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2445 static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq);
2447 struct tevent_req *rpccli_winreg_NotifyChangeKeyValue_send(TALLOC_CTX *mem_ctx,
2448 struct tevent_context *ev,
2449 struct rpc_pipe_client *cli,
2450 struct policy_handle *_handle /* [in] [ref] */,
2451 uint8_t _watch_subtree /* [in] */,
2452 uint32_t _notify_filter /* [in] */,
2453 uint32_t _unknown /* [in] */,
2454 struct winreg_String _string1 /* [in] */,
2455 struct winreg_String _string2 /* [in] */,
2456 uint32_t _unknown2 /* [in] */)
2458 struct tevent_req *req;
2459 struct rpccli_winreg_NotifyChangeKeyValue_state *state;
2460 struct tevent_req *subreq;
2462 req = tevent_req_create(mem_ctx, &state,
2463 struct rpccli_winreg_NotifyChangeKeyValue_state);
2464 if (req == NULL) {
2465 return NULL;
2467 state->out_mem_ctx = NULL;
2468 state->dispatch_recv = cli->dispatch_recv;
2470 /* In parameters */
2471 state->orig.in.handle = _handle;
2472 state->orig.in.watch_subtree = _watch_subtree;
2473 state->orig.in.notify_filter = _notify_filter;
2474 state->orig.in.unknown = _unknown;
2475 state->orig.in.string1 = _string1;
2476 state->orig.in.string2 = _string2;
2477 state->orig.in.unknown2 = _unknown2;
2479 /* Out parameters */
2481 /* Result */
2482 ZERO_STRUCT(state->orig.out.result);
2484 if (DEBUGLEVEL >= 10) {
2485 NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, &state->orig);
2488 /* make a temporary copy, that we pass to the dispatch function */
2489 state->tmp = state->orig;
2491 subreq = cli->dispatch_send(state, ev, cli,
2492 &ndr_table_winreg,
2493 NDR_WINREG_NOTIFYCHANGEKEYVALUE,
2494 &state->tmp);
2495 if (tevent_req_nomem(subreq, req)) {
2496 return tevent_req_post(req, ev);
2498 tevent_req_set_callback(subreq, rpccli_winreg_NotifyChangeKeyValue_done, req);
2499 return req;
2502 static void rpccli_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq)
2504 struct tevent_req *req = tevent_req_callback_data(
2505 subreq, struct tevent_req);
2506 struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
2507 req, struct rpccli_winreg_NotifyChangeKeyValue_state);
2508 NTSTATUS status;
2509 TALLOC_CTX *mem_ctx;
2511 if (state->out_mem_ctx) {
2512 mem_ctx = state->out_mem_ctx;
2513 } else {
2514 mem_ctx = state;
2517 status = state->dispatch_recv(subreq, mem_ctx);
2518 TALLOC_FREE(subreq);
2519 if (!NT_STATUS_IS_OK(status)) {
2520 tevent_req_nterror(req, status);
2521 return;
2524 /* Copy out parameters */
2526 /* Copy result */
2527 state->orig.out.result = state->tmp.out.result;
2529 /* Reset temporary structure */
2530 ZERO_STRUCT(state->tmp);
2532 if (DEBUGLEVEL >= 10) {
2533 NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, &state->orig);
2536 tevent_req_done(req);
2539 NTSTATUS rpccli_winreg_NotifyChangeKeyValue_recv(struct tevent_req *req,
2540 TALLOC_CTX *mem_ctx,
2541 WERROR *result)
2543 struct rpccli_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
2544 req, struct rpccli_winreg_NotifyChangeKeyValue_state);
2545 NTSTATUS status;
2547 if (tevent_req_is_nterror(req, &status)) {
2548 tevent_req_received(req);
2549 return status;
2552 /* Steal possbile out parameters to the callers context */
2553 talloc_steal(mem_ctx, state->out_mem_ctx);
2555 /* Return result */
2556 *result = state->orig.out.result;
2558 tevent_req_received(req);
2559 return NT_STATUS_OK;
2562 NTSTATUS rpccli_winreg_NotifyChangeKeyValue(struct rpc_pipe_client *cli,
2563 TALLOC_CTX *mem_ctx,
2564 struct policy_handle *handle /* [in] [ref] */,
2565 uint8_t watch_subtree /* [in] */,
2566 uint32_t notify_filter /* [in] */,
2567 uint32_t unknown /* [in] */,
2568 struct winreg_String string1 /* [in] */,
2569 struct winreg_String string2 /* [in] */,
2570 uint32_t unknown2 /* [in] */,
2571 WERROR *werror)
2573 struct winreg_NotifyChangeKeyValue r;
2574 NTSTATUS status;
2576 /* In parameters */
2577 r.in.handle = handle;
2578 r.in.watch_subtree = watch_subtree;
2579 r.in.notify_filter = notify_filter;
2580 r.in.unknown = unknown;
2581 r.in.string1 = string1;
2582 r.in.string2 = string2;
2583 r.in.unknown2 = unknown2;
2585 if (DEBUGLEVEL >= 10) {
2586 NDR_PRINT_IN_DEBUG(winreg_NotifyChangeKeyValue, &r);
2589 status = cli->dispatch(cli,
2590 mem_ctx,
2591 &ndr_table_winreg,
2592 NDR_WINREG_NOTIFYCHANGEKEYVALUE,
2593 &r);
2595 if (!NT_STATUS_IS_OK(status)) {
2596 return status;
2599 if (DEBUGLEVEL >= 10) {
2600 NDR_PRINT_OUT_DEBUG(winreg_NotifyChangeKeyValue, &r);
2603 if (NT_STATUS_IS_ERR(status)) {
2604 return status;
2607 /* Return variables */
2609 /* Return result */
2610 if (werror) {
2611 *werror = r.out.result;
2614 return werror_to_ntstatus(r.out.result);
2617 struct rpccli_winreg_OpenKey_state {
2618 struct winreg_OpenKey orig;
2619 struct winreg_OpenKey tmp;
2620 TALLOC_CTX *out_mem_ctx;
2621 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2624 static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq);
2626 struct tevent_req *rpccli_winreg_OpenKey_send(TALLOC_CTX *mem_ctx,
2627 struct tevent_context *ev,
2628 struct rpc_pipe_client *cli,
2629 struct policy_handle *_parent_handle /* [in] [ref] */,
2630 struct winreg_String _keyname /* [in] */,
2631 uint32_t _unknown /* [in] */,
2632 uint32_t _access_mask /* [in] */,
2633 struct policy_handle *_handle /* [out] [ref] */)
2635 struct tevent_req *req;
2636 struct rpccli_winreg_OpenKey_state *state;
2637 struct tevent_req *subreq;
2639 req = tevent_req_create(mem_ctx, &state,
2640 struct rpccli_winreg_OpenKey_state);
2641 if (req == NULL) {
2642 return NULL;
2644 state->out_mem_ctx = NULL;
2645 state->dispatch_recv = cli->dispatch_recv;
2647 /* In parameters */
2648 state->orig.in.parent_handle = _parent_handle;
2649 state->orig.in.keyname = _keyname;
2650 state->orig.in.unknown = _unknown;
2651 state->orig.in.access_mask = _access_mask;
2653 /* Out parameters */
2654 state->orig.out.handle = _handle;
2656 /* Result */
2657 ZERO_STRUCT(state->orig.out.result);
2659 if (DEBUGLEVEL >= 10) {
2660 NDR_PRINT_IN_DEBUG(winreg_OpenKey, &state->orig);
2663 state->out_mem_ctx = talloc_named_const(state, 0,
2664 "rpccli_winreg_OpenKey_out_memory");
2665 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2666 return tevent_req_post(req, ev);
2669 /* make a temporary copy, that we pass to the dispatch function */
2670 state->tmp = state->orig;
2672 subreq = cli->dispatch_send(state, ev, cli,
2673 &ndr_table_winreg,
2674 NDR_WINREG_OPENKEY,
2675 &state->tmp);
2676 if (tevent_req_nomem(subreq, req)) {
2677 return tevent_req_post(req, ev);
2679 tevent_req_set_callback(subreq, rpccli_winreg_OpenKey_done, req);
2680 return req;
2683 static void rpccli_winreg_OpenKey_done(struct tevent_req *subreq)
2685 struct tevent_req *req = tevent_req_callback_data(
2686 subreq, struct tevent_req);
2687 struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
2688 req, struct rpccli_winreg_OpenKey_state);
2689 NTSTATUS status;
2690 TALLOC_CTX *mem_ctx;
2692 if (state->out_mem_ctx) {
2693 mem_ctx = state->out_mem_ctx;
2694 } else {
2695 mem_ctx = state;
2698 status = state->dispatch_recv(subreq, mem_ctx);
2699 TALLOC_FREE(subreq);
2700 if (!NT_STATUS_IS_OK(status)) {
2701 tevent_req_nterror(req, status);
2702 return;
2705 /* Copy out parameters */
2706 *state->orig.out.handle = *state->tmp.out.handle;
2708 /* Copy result */
2709 state->orig.out.result = state->tmp.out.result;
2711 /* Reset temporary structure */
2712 ZERO_STRUCT(state->tmp);
2714 if (DEBUGLEVEL >= 10) {
2715 NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &state->orig);
2718 tevent_req_done(req);
2721 NTSTATUS rpccli_winreg_OpenKey_recv(struct tevent_req *req,
2722 TALLOC_CTX *mem_ctx,
2723 WERROR *result)
2725 struct rpccli_winreg_OpenKey_state *state = tevent_req_data(
2726 req, struct rpccli_winreg_OpenKey_state);
2727 NTSTATUS status;
2729 if (tevent_req_is_nterror(req, &status)) {
2730 tevent_req_received(req);
2731 return status;
2734 /* Steal possbile out parameters to the callers context */
2735 talloc_steal(mem_ctx, state->out_mem_ctx);
2737 /* Return result */
2738 *result = state->orig.out.result;
2740 tevent_req_received(req);
2741 return NT_STATUS_OK;
2744 NTSTATUS rpccli_winreg_OpenKey(struct rpc_pipe_client *cli,
2745 TALLOC_CTX *mem_ctx,
2746 struct policy_handle *parent_handle /* [in] [ref] */,
2747 struct winreg_String keyname /* [in] */,
2748 uint32_t unknown /* [in] */,
2749 uint32_t access_mask /* [in] */,
2750 struct policy_handle *handle /* [out] [ref] */,
2751 WERROR *werror)
2753 struct winreg_OpenKey r;
2754 NTSTATUS status;
2756 /* In parameters */
2757 r.in.parent_handle = parent_handle;
2758 r.in.keyname = keyname;
2759 r.in.unknown = unknown;
2760 r.in.access_mask = access_mask;
2762 if (DEBUGLEVEL >= 10) {
2763 NDR_PRINT_IN_DEBUG(winreg_OpenKey, &r);
2766 status = cli->dispatch(cli,
2767 mem_ctx,
2768 &ndr_table_winreg,
2769 NDR_WINREG_OPENKEY,
2770 &r);
2772 if (!NT_STATUS_IS_OK(status)) {
2773 return status;
2776 if (DEBUGLEVEL >= 10) {
2777 NDR_PRINT_OUT_DEBUG(winreg_OpenKey, &r);
2780 if (NT_STATUS_IS_ERR(status)) {
2781 return status;
2784 /* Return variables */
2785 *handle = *r.out.handle;
2787 /* Return result */
2788 if (werror) {
2789 *werror = r.out.result;
2792 return werror_to_ntstatus(r.out.result);
2795 struct rpccli_winreg_QueryInfoKey_state {
2796 struct winreg_QueryInfoKey orig;
2797 struct winreg_QueryInfoKey tmp;
2798 TALLOC_CTX *out_mem_ctx;
2799 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2802 static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq);
2804 struct tevent_req *rpccli_winreg_QueryInfoKey_send(TALLOC_CTX *mem_ctx,
2805 struct tevent_context *ev,
2806 struct rpc_pipe_client *cli,
2807 struct policy_handle *_handle /* [in] [ref] */,
2808 struct winreg_String *_classname /* [in,out] [ref] */,
2809 uint32_t *_num_subkeys /* [out] [ref] */,
2810 uint32_t *_max_subkeylen /* [out] [ref] */,
2811 uint32_t *_max_classlen /* [out] [ref] */,
2812 uint32_t *_num_values /* [out] [ref] */,
2813 uint32_t *_max_valnamelen /* [out] [ref] */,
2814 uint32_t *_max_valbufsize /* [out] [ref] */,
2815 uint32_t *_secdescsize /* [out] [ref] */,
2816 NTTIME *_last_changed_time /* [out] [ref] */)
2818 struct tevent_req *req;
2819 struct rpccli_winreg_QueryInfoKey_state *state;
2820 struct tevent_req *subreq;
2822 req = tevent_req_create(mem_ctx, &state,
2823 struct rpccli_winreg_QueryInfoKey_state);
2824 if (req == NULL) {
2825 return NULL;
2827 state->out_mem_ctx = NULL;
2828 state->dispatch_recv = cli->dispatch_recv;
2830 /* In parameters */
2831 state->orig.in.handle = _handle;
2832 state->orig.in.classname = _classname;
2834 /* Out parameters */
2835 state->orig.out.classname = _classname;
2836 state->orig.out.num_subkeys = _num_subkeys;
2837 state->orig.out.max_subkeylen = _max_subkeylen;
2838 state->orig.out.max_classlen = _max_classlen;
2839 state->orig.out.num_values = _num_values;
2840 state->orig.out.max_valnamelen = _max_valnamelen;
2841 state->orig.out.max_valbufsize = _max_valbufsize;
2842 state->orig.out.secdescsize = _secdescsize;
2843 state->orig.out.last_changed_time = _last_changed_time;
2845 /* Result */
2846 ZERO_STRUCT(state->orig.out.result);
2848 if (DEBUGLEVEL >= 10) {
2849 NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, &state->orig);
2852 state->out_mem_ctx = talloc_named_const(state, 0,
2853 "rpccli_winreg_QueryInfoKey_out_memory");
2854 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2855 return tevent_req_post(req, ev);
2858 /* make a temporary copy, that we pass to the dispatch function */
2859 state->tmp = state->orig;
2861 subreq = cli->dispatch_send(state, ev, cli,
2862 &ndr_table_winreg,
2863 NDR_WINREG_QUERYINFOKEY,
2864 &state->tmp);
2865 if (tevent_req_nomem(subreq, req)) {
2866 return tevent_req_post(req, ev);
2868 tevent_req_set_callback(subreq, rpccli_winreg_QueryInfoKey_done, req);
2869 return req;
2872 static void rpccli_winreg_QueryInfoKey_done(struct tevent_req *subreq)
2874 struct tevent_req *req = tevent_req_callback_data(
2875 subreq, struct tevent_req);
2876 struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
2877 req, struct rpccli_winreg_QueryInfoKey_state);
2878 NTSTATUS status;
2879 TALLOC_CTX *mem_ctx;
2881 if (state->out_mem_ctx) {
2882 mem_ctx = state->out_mem_ctx;
2883 } else {
2884 mem_ctx = state;
2887 status = state->dispatch_recv(subreq, mem_ctx);
2888 TALLOC_FREE(subreq);
2889 if (!NT_STATUS_IS_OK(status)) {
2890 tevent_req_nterror(req, status);
2891 return;
2894 /* Copy out parameters */
2895 *state->orig.out.classname = *state->tmp.out.classname;
2896 *state->orig.out.num_subkeys = *state->tmp.out.num_subkeys;
2897 *state->orig.out.max_subkeylen = *state->tmp.out.max_subkeylen;
2898 *state->orig.out.max_classlen = *state->tmp.out.max_classlen;
2899 *state->orig.out.num_values = *state->tmp.out.num_values;
2900 *state->orig.out.max_valnamelen = *state->tmp.out.max_valnamelen;
2901 *state->orig.out.max_valbufsize = *state->tmp.out.max_valbufsize;
2902 *state->orig.out.secdescsize = *state->tmp.out.secdescsize;
2903 *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
2905 /* Copy result */
2906 state->orig.out.result = state->tmp.out.result;
2908 /* Reset temporary structure */
2909 ZERO_STRUCT(state->tmp);
2911 if (DEBUGLEVEL >= 10) {
2912 NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, &state->orig);
2915 tevent_req_done(req);
2918 NTSTATUS rpccli_winreg_QueryInfoKey_recv(struct tevent_req *req,
2919 TALLOC_CTX *mem_ctx,
2920 WERROR *result)
2922 struct rpccli_winreg_QueryInfoKey_state *state = tevent_req_data(
2923 req, struct rpccli_winreg_QueryInfoKey_state);
2924 NTSTATUS status;
2926 if (tevent_req_is_nterror(req, &status)) {
2927 tevent_req_received(req);
2928 return status;
2931 /* Steal possbile out parameters to the callers context */
2932 talloc_steal(mem_ctx, state->out_mem_ctx);
2934 /* Return result */
2935 *result = state->orig.out.result;
2937 tevent_req_received(req);
2938 return NT_STATUS_OK;
2941 NTSTATUS rpccli_winreg_QueryInfoKey(struct rpc_pipe_client *cli,
2942 TALLOC_CTX *mem_ctx,
2943 struct policy_handle *handle /* [in] [ref] */,
2944 struct winreg_String *classname /* [in,out] [ref] */,
2945 uint32_t *num_subkeys /* [out] [ref] */,
2946 uint32_t *max_subkeylen /* [out] [ref] */,
2947 uint32_t *max_classlen /* [out] [ref] */,
2948 uint32_t *num_values /* [out] [ref] */,
2949 uint32_t *max_valnamelen /* [out] [ref] */,
2950 uint32_t *max_valbufsize /* [out] [ref] */,
2951 uint32_t *secdescsize /* [out] [ref] */,
2952 NTTIME *last_changed_time /* [out] [ref] */,
2953 WERROR *werror)
2955 struct winreg_QueryInfoKey r;
2956 NTSTATUS status;
2958 /* In parameters */
2959 r.in.handle = handle;
2960 r.in.classname = classname;
2962 if (DEBUGLEVEL >= 10) {
2963 NDR_PRINT_IN_DEBUG(winreg_QueryInfoKey, &r);
2966 status = cli->dispatch(cli,
2967 mem_ctx,
2968 &ndr_table_winreg,
2969 NDR_WINREG_QUERYINFOKEY,
2970 &r);
2972 if (!NT_STATUS_IS_OK(status)) {
2973 return status;
2976 if (DEBUGLEVEL >= 10) {
2977 NDR_PRINT_OUT_DEBUG(winreg_QueryInfoKey, &r);
2980 if (NT_STATUS_IS_ERR(status)) {
2981 return status;
2984 /* Return variables */
2985 *classname = *r.out.classname;
2986 *num_subkeys = *r.out.num_subkeys;
2987 *max_subkeylen = *r.out.max_subkeylen;
2988 *max_classlen = *r.out.max_classlen;
2989 *num_values = *r.out.num_values;
2990 *max_valnamelen = *r.out.max_valnamelen;
2991 *max_valbufsize = *r.out.max_valbufsize;
2992 *secdescsize = *r.out.secdescsize;
2993 *last_changed_time = *r.out.last_changed_time;
2995 /* Return result */
2996 if (werror) {
2997 *werror = r.out.result;
3000 return werror_to_ntstatus(r.out.result);
3003 struct rpccli_winreg_QueryValue_state {
3004 struct winreg_QueryValue orig;
3005 struct winreg_QueryValue tmp;
3006 TALLOC_CTX *out_mem_ctx;
3007 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3010 static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq);
3012 struct tevent_req *rpccli_winreg_QueryValue_send(TALLOC_CTX *mem_ctx,
3013 struct tevent_context *ev,
3014 struct rpc_pipe_client *cli,
3015 struct policy_handle *_handle /* [in] [ref] */,
3016 struct winreg_String *_value_name /* [in] [ref] */,
3017 enum winreg_Type *_type /* [in,out] [unique] */,
3018 uint8_t *_data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */,
3019 uint32_t *_data_size /* [in,out] [unique] */,
3020 uint32_t *_data_length /* [in,out] [unique] */)
3022 struct tevent_req *req;
3023 struct rpccli_winreg_QueryValue_state *state;
3024 struct tevent_req *subreq;
3026 req = tevent_req_create(mem_ctx, &state,
3027 struct rpccli_winreg_QueryValue_state);
3028 if (req == NULL) {
3029 return NULL;
3031 state->out_mem_ctx = NULL;
3032 state->dispatch_recv = cli->dispatch_recv;
3034 /* In parameters */
3035 state->orig.in.handle = _handle;
3036 state->orig.in.value_name = _value_name;
3037 state->orig.in.type = _type;
3038 state->orig.in.data = _data;
3039 state->orig.in.data_size = _data_size;
3040 state->orig.in.data_length = _data_length;
3042 /* Out parameters */
3043 state->orig.out.type = _type;
3044 state->orig.out.data = _data;
3045 state->orig.out.data_size = _data_size;
3046 state->orig.out.data_length = _data_length;
3048 /* Result */
3049 ZERO_STRUCT(state->orig.out.result);
3051 if (DEBUGLEVEL >= 10) {
3052 NDR_PRINT_IN_DEBUG(winreg_QueryValue, &state->orig);
3055 state->out_mem_ctx = talloc_named_const(state, 0,
3056 "rpccli_winreg_QueryValue_out_memory");
3057 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3058 return tevent_req_post(req, ev);
3061 /* make a temporary copy, that we pass to the dispatch function */
3062 state->tmp = state->orig;
3064 subreq = cli->dispatch_send(state, ev, cli,
3065 &ndr_table_winreg,
3066 NDR_WINREG_QUERYVALUE,
3067 &state->tmp);
3068 if (tevent_req_nomem(subreq, req)) {
3069 return tevent_req_post(req, ev);
3071 tevent_req_set_callback(subreq, rpccli_winreg_QueryValue_done, req);
3072 return req;
3075 static void rpccli_winreg_QueryValue_done(struct tevent_req *subreq)
3077 struct tevent_req *req = tevent_req_callback_data(
3078 subreq, struct tevent_req);
3079 struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
3080 req, struct rpccli_winreg_QueryValue_state);
3081 NTSTATUS status;
3082 TALLOC_CTX *mem_ctx;
3084 if (state->out_mem_ctx) {
3085 mem_ctx = state->out_mem_ctx;
3086 } else {
3087 mem_ctx = state;
3090 status = state->dispatch_recv(subreq, mem_ctx);
3091 TALLOC_FREE(subreq);
3092 if (!NT_STATUS_IS_OK(status)) {
3093 tevent_req_nterror(req, status);
3094 return;
3097 /* Copy out parameters */
3098 if (state->orig.out.type && state->tmp.out.type) {
3099 *state->orig.out.type = *state->tmp.out.type;
3101 if (state->orig.out.data && state->tmp.out.data) {
3102 memcpy(state->orig.out.data, state->tmp.out.data, *state->tmp.in.data_size * sizeof(*state->orig.out.data));
3104 if (state->orig.out.data_size && state->tmp.out.data_size) {
3105 *state->orig.out.data_size = *state->tmp.out.data_size;
3107 if (state->orig.out.data_length && state->tmp.out.data_length) {
3108 *state->orig.out.data_length = *state->tmp.out.data_length;
3111 /* Copy result */
3112 state->orig.out.result = state->tmp.out.result;
3114 /* Reset temporary structure */
3115 ZERO_STRUCT(state->tmp);
3117 if (DEBUGLEVEL >= 10) {
3118 NDR_PRINT_OUT_DEBUG(winreg_QueryValue, &state->orig);
3121 tevent_req_done(req);
3124 NTSTATUS rpccli_winreg_QueryValue_recv(struct tevent_req *req,
3125 TALLOC_CTX *mem_ctx,
3126 WERROR *result)
3128 struct rpccli_winreg_QueryValue_state *state = tevent_req_data(
3129 req, struct rpccli_winreg_QueryValue_state);
3130 NTSTATUS status;
3132 if (tevent_req_is_nterror(req, &status)) {
3133 tevent_req_received(req);
3134 return status;
3137 /* Steal possbile out parameters to the callers context */
3138 talloc_steal(mem_ctx, state->out_mem_ctx);
3140 /* Return result */
3141 *result = state->orig.out.result;
3143 tevent_req_received(req);
3144 return NT_STATUS_OK;
3147 NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli,
3148 TALLOC_CTX *mem_ctx,
3149 struct policy_handle *handle /* [in] [ref] */,
3150 struct winreg_String *value_name /* [in] [ref] */,
3151 enum winreg_Type *type /* [in,out] [unique] */,
3152 uint8_t *data /* [in,out] [unique,length_is(*data_length),size_is(*data_size)] */,
3153 uint32_t *data_size /* [in,out] [unique] */,
3154 uint32_t *data_length /* [in,out] [unique] */,
3155 WERROR *werror)
3157 struct winreg_QueryValue r;
3158 NTSTATUS status;
3160 /* In parameters */
3161 r.in.handle = handle;
3162 r.in.value_name = value_name;
3163 r.in.type = type;
3164 r.in.data = data;
3165 r.in.data_size = data_size;
3166 r.in.data_length = data_length;
3168 if (DEBUGLEVEL >= 10) {
3169 NDR_PRINT_IN_DEBUG(winreg_QueryValue, &r);
3172 status = cli->dispatch(cli,
3173 mem_ctx,
3174 &ndr_table_winreg,
3175 NDR_WINREG_QUERYVALUE,
3176 &r);
3178 if (!NT_STATUS_IS_OK(status)) {
3179 return status;
3182 if (DEBUGLEVEL >= 10) {
3183 NDR_PRINT_OUT_DEBUG(winreg_QueryValue, &r);
3186 if (NT_STATUS_IS_ERR(status)) {
3187 return status;
3190 /* Return variables */
3191 if (type && r.out.type) {
3192 *type = *r.out.type;
3194 if (data && r.out.data) {
3195 memcpy(data, r.out.data, *r.in.data_size * sizeof(*data));
3197 if (data_size && r.out.data_size) {
3198 *data_size = *r.out.data_size;
3200 if (data_length && r.out.data_length) {
3201 *data_length = *r.out.data_length;
3204 /* Return result */
3205 if (werror) {
3206 *werror = r.out.result;
3209 return werror_to_ntstatus(r.out.result);
3212 struct rpccli_winreg_ReplaceKey_state {
3213 struct winreg_ReplaceKey orig;
3214 struct winreg_ReplaceKey tmp;
3215 TALLOC_CTX *out_mem_ctx;
3216 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3219 static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq);
3221 struct tevent_req *rpccli_winreg_ReplaceKey_send(TALLOC_CTX *mem_ctx,
3222 struct tevent_context *ev,
3223 struct rpc_pipe_client *cli)
3225 struct tevent_req *req;
3226 struct rpccli_winreg_ReplaceKey_state *state;
3227 struct tevent_req *subreq;
3229 req = tevent_req_create(mem_ctx, &state,
3230 struct rpccli_winreg_ReplaceKey_state);
3231 if (req == NULL) {
3232 return NULL;
3234 state->out_mem_ctx = NULL;
3235 state->dispatch_recv = cli->dispatch_recv;
3237 /* In parameters */
3239 /* Out parameters */
3241 /* Result */
3242 ZERO_STRUCT(state->orig.out.result);
3244 if (DEBUGLEVEL >= 10) {
3245 NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, &state->orig);
3248 /* make a temporary copy, that we pass to the dispatch function */
3249 state->tmp = state->orig;
3251 subreq = cli->dispatch_send(state, ev, cli,
3252 &ndr_table_winreg,
3253 NDR_WINREG_REPLACEKEY,
3254 &state->tmp);
3255 if (tevent_req_nomem(subreq, req)) {
3256 return tevent_req_post(req, ev);
3258 tevent_req_set_callback(subreq, rpccli_winreg_ReplaceKey_done, req);
3259 return req;
3262 static void rpccli_winreg_ReplaceKey_done(struct tevent_req *subreq)
3264 struct tevent_req *req = tevent_req_callback_data(
3265 subreq, struct tevent_req);
3266 struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
3267 req, struct rpccli_winreg_ReplaceKey_state);
3268 NTSTATUS status;
3269 TALLOC_CTX *mem_ctx;
3271 if (state->out_mem_ctx) {
3272 mem_ctx = state->out_mem_ctx;
3273 } else {
3274 mem_ctx = state;
3277 status = state->dispatch_recv(subreq, mem_ctx);
3278 TALLOC_FREE(subreq);
3279 if (!NT_STATUS_IS_OK(status)) {
3280 tevent_req_nterror(req, status);
3281 return;
3284 /* Copy out parameters */
3286 /* Copy result */
3287 state->orig.out.result = state->tmp.out.result;
3289 /* Reset temporary structure */
3290 ZERO_STRUCT(state->tmp);
3292 if (DEBUGLEVEL >= 10) {
3293 NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, &state->orig);
3296 tevent_req_done(req);
3299 NTSTATUS rpccli_winreg_ReplaceKey_recv(struct tevent_req *req,
3300 TALLOC_CTX *mem_ctx,
3301 WERROR *result)
3303 struct rpccli_winreg_ReplaceKey_state *state = tevent_req_data(
3304 req, struct rpccli_winreg_ReplaceKey_state);
3305 NTSTATUS status;
3307 if (tevent_req_is_nterror(req, &status)) {
3308 tevent_req_received(req);
3309 return status;
3312 /* Steal possbile out parameters to the callers context */
3313 talloc_steal(mem_ctx, state->out_mem_ctx);
3315 /* Return result */
3316 *result = state->orig.out.result;
3318 tevent_req_received(req);
3319 return NT_STATUS_OK;
3322 NTSTATUS rpccli_winreg_ReplaceKey(struct rpc_pipe_client *cli,
3323 TALLOC_CTX *mem_ctx,
3324 WERROR *werror)
3326 struct winreg_ReplaceKey r;
3327 NTSTATUS status;
3329 /* In parameters */
3331 if (DEBUGLEVEL >= 10) {
3332 NDR_PRINT_IN_DEBUG(winreg_ReplaceKey, &r);
3335 status = cli->dispatch(cli,
3336 mem_ctx,
3337 &ndr_table_winreg,
3338 NDR_WINREG_REPLACEKEY,
3339 &r);
3341 if (!NT_STATUS_IS_OK(status)) {
3342 return status;
3345 if (DEBUGLEVEL >= 10) {
3346 NDR_PRINT_OUT_DEBUG(winreg_ReplaceKey, &r);
3349 if (NT_STATUS_IS_ERR(status)) {
3350 return status;
3353 /* Return variables */
3355 /* Return result */
3356 if (werror) {
3357 *werror = r.out.result;
3360 return werror_to_ntstatus(r.out.result);
3363 struct rpccli_winreg_RestoreKey_state {
3364 struct winreg_RestoreKey orig;
3365 struct winreg_RestoreKey tmp;
3366 TALLOC_CTX *out_mem_ctx;
3367 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3370 static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq);
3372 struct tevent_req *rpccli_winreg_RestoreKey_send(TALLOC_CTX *mem_ctx,
3373 struct tevent_context *ev,
3374 struct rpc_pipe_client *cli,
3375 struct policy_handle *_handle /* [in] [ref] */,
3376 struct winreg_String *_filename /* [in] [ref] */,
3377 uint32_t _flags /* [in] */)
3379 struct tevent_req *req;
3380 struct rpccli_winreg_RestoreKey_state *state;
3381 struct tevent_req *subreq;
3383 req = tevent_req_create(mem_ctx, &state,
3384 struct rpccli_winreg_RestoreKey_state);
3385 if (req == NULL) {
3386 return NULL;
3388 state->out_mem_ctx = NULL;
3389 state->dispatch_recv = cli->dispatch_recv;
3391 /* In parameters */
3392 state->orig.in.handle = _handle;
3393 state->orig.in.filename = _filename;
3394 state->orig.in.flags = _flags;
3396 /* Out parameters */
3398 /* Result */
3399 ZERO_STRUCT(state->orig.out.result);
3401 if (DEBUGLEVEL >= 10) {
3402 NDR_PRINT_IN_DEBUG(winreg_RestoreKey, &state->orig);
3405 /* make a temporary copy, that we pass to the dispatch function */
3406 state->tmp = state->orig;
3408 subreq = cli->dispatch_send(state, ev, cli,
3409 &ndr_table_winreg,
3410 NDR_WINREG_RESTOREKEY,
3411 &state->tmp);
3412 if (tevent_req_nomem(subreq, req)) {
3413 return tevent_req_post(req, ev);
3415 tevent_req_set_callback(subreq, rpccli_winreg_RestoreKey_done, req);
3416 return req;
3419 static void rpccli_winreg_RestoreKey_done(struct tevent_req *subreq)
3421 struct tevent_req *req = tevent_req_callback_data(
3422 subreq, struct tevent_req);
3423 struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
3424 req, struct rpccli_winreg_RestoreKey_state);
3425 NTSTATUS status;
3426 TALLOC_CTX *mem_ctx;
3428 if (state->out_mem_ctx) {
3429 mem_ctx = state->out_mem_ctx;
3430 } else {
3431 mem_ctx = state;
3434 status = state->dispatch_recv(subreq, mem_ctx);
3435 TALLOC_FREE(subreq);
3436 if (!NT_STATUS_IS_OK(status)) {
3437 tevent_req_nterror(req, status);
3438 return;
3441 /* Copy out parameters */
3443 /* Copy result */
3444 state->orig.out.result = state->tmp.out.result;
3446 /* Reset temporary structure */
3447 ZERO_STRUCT(state->tmp);
3449 if (DEBUGLEVEL >= 10) {
3450 NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, &state->orig);
3453 tevent_req_done(req);
3456 NTSTATUS rpccli_winreg_RestoreKey_recv(struct tevent_req *req,
3457 TALLOC_CTX *mem_ctx,
3458 WERROR *result)
3460 struct rpccli_winreg_RestoreKey_state *state = tevent_req_data(
3461 req, struct rpccli_winreg_RestoreKey_state);
3462 NTSTATUS status;
3464 if (tevent_req_is_nterror(req, &status)) {
3465 tevent_req_received(req);
3466 return status;
3469 /* Steal possbile out parameters to the callers context */
3470 talloc_steal(mem_ctx, state->out_mem_ctx);
3472 /* Return result */
3473 *result = state->orig.out.result;
3475 tevent_req_received(req);
3476 return NT_STATUS_OK;
3479 NTSTATUS rpccli_winreg_RestoreKey(struct rpc_pipe_client *cli,
3480 TALLOC_CTX *mem_ctx,
3481 struct policy_handle *handle /* [in] [ref] */,
3482 struct winreg_String *filename /* [in] [ref] */,
3483 uint32_t flags /* [in] */,
3484 WERROR *werror)
3486 struct winreg_RestoreKey r;
3487 NTSTATUS status;
3489 /* In parameters */
3490 r.in.handle = handle;
3491 r.in.filename = filename;
3492 r.in.flags = flags;
3494 if (DEBUGLEVEL >= 10) {
3495 NDR_PRINT_IN_DEBUG(winreg_RestoreKey, &r);
3498 status = cli->dispatch(cli,
3499 mem_ctx,
3500 &ndr_table_winreg,
3501 NDR_WINREG_RESTOREKEY,
3502 &r);
3504 if (!NT_STATUS_IS_OK(status)) {
3505 return status;
3508 if (DEBUGLEVEL >= 10) {
3509 NDR_PRINT_OUT_DEBUG(winreg_RestoreKey, &r);
3512 if (NT_STATUS_IS_ERR(status)) {
3513 return status;
3516 /* Return variables */
3518 /* Return result */
3519 if (werror) {
3520 *werror = r.out.result;
3523 return werror_to_ntstatus(r.out.result);
3526 struct rpccli_winreg_SaveKey_state {
3527 struct winreg_SaveKey orig;
3528 struct winreg_SaveKey tmp;
3529 TALLOC_CTX *out_mem_ctx;
3530 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3533 static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq);
3535 struct tevent_req *rpccli_winreg_SaveKey_send(TALLOC_CTX *mem_ctx,
3536 struct tevent_context *ev,
3537 struct rpc_pipe_client *cli,
3538 struct policy_handle *_handle /* [in] [ref] */,
3539 struct winreg_String *_filename /* [in] [ref] */,
3540 struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */)
3542 struct tevent_req *req;
3543 struct rpccli_winreg_SaveKey_state *state;
3544 struct tevent_req *subreq;
3546 req = tevent_req_create(mem_ctx, &state,
3547 struct rpccli_winreg_SaveKey_state);
3548 if (req == NULL) {
3549 return NULL;
3551 state->out_mem_ctx = NULL;
3552 state->dispatch_recv = cli->dispatch_recv;
3554 /* In parameters */
3555 state->orig.in.handle = _handle;
3556 state->orig.in.filename = _filename;
3557 state->orig.in.sec_attrib = _sec_attrib;
3559 /* Out parameters */
3561 /* Result */
3562 ZERO_STRUCT(state->orig.out.result);
3564 if (DEBUGLEVEL >= 10) {
3565 NDR_PRINT_IN_DEBUG(winreg_SaveKey, &state->orig);
3568 /* make a temporary copy, that we pass to the dispatch function */
3569 state->tmp = state->orig;
3571 subreq = cli->dispatch_send(state, ev, cli,
3572 &ndr_table_winreg,
3573 NDR_WINREG_SAVEKEY,
3574 &state->tmp);
3575 if (tevent_req_nomem(subreq, req)) {
3576 return tevent_req_post(req, ev);
3578 tevent_req_set_callback(subreq, rpccli_winreg_SaveKey_done, req);
3579 return req;
3582 static void rpccli_winreg_SaveKey_done(struct tevent_req *subreq)
3584 struct tevent_req *req = tevent_req_callback_data(
3585 subreq, struct tevent_req);
3586 struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
3587 req, struct rpccli_winreg_SaveKey_state);
3588 NTSTATUS status;
3589 TALLOC_CTX *mem_ctx;
3591 if (state->out_mem_ctx) {
3592 mem_ctx = state->out_mem_ctx;
3593 } else {
3594 mem_ctx = state;
3597 status = state->dispatch_recv(subreq, mem_ctx);
3598 TALLOC_FREE(subreq);
3599 if (!NT_STATUS_IS_OK(status)) {
3600 tevent_req_nterror(req, status);
3601 return;
3604 /* Copy out parameters */
3606 /* Copy result */
3607 state->orig.out.result = state->tmp.out.result;
3609 /* Reset temporary structure */
3610 ZERO_STRUCT(state->tmp);
3612 if (DEBUGLEVEL >= 10) {
3613 NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &state->orig);
3616 tevent_req_done(req);
3619 NTSTATUS rpccli_winreg_SaveKey_recv(struct tevent_req *req,
3620 TALLOC_CTX *mem_ctx,
3621 WERROR *result)
3623 struct rpccli_winreg_SaveKey_state *state = tevent_req_data(
3624 req, struct rpccli_winreg_SaveKey_state);
3625 NTSTATUS status;
3627 if (tevent_req_is_nterror(req, &status)) {
3628 tevent_req_received(req);
3629 return status;
3632 /* Steal possbile out parameters to the callers context */
3633 talloc_steal(mem_ctx, state->out_mem_ctx);
3635 /* Return result */
3636 *result = state->orig.out.result;
3638 tevent_req_received(req);
3639 return NT_STATUS_OK;
3642 NTSTATUS rpccli_winreg_SaveKey(struct rpc_pipe_client *cli,
3643 TALLOC_CTX *mem_ctx,
3644 struct policy_handle *handle /* [in] [ref] */,
3645 struct winreg_String *filename /* [in] [ref] */,
3646 struct KeySecurityAttribute *sec_attrib /* [in] [unique] */,
3647 WERROR *werror)
3649 struct winreg_SaveKey r;
3650 NTSTATUS status;
3652 /* In parameters */
3653 r.in.handle = handle;
3654 r.in.filename = filename;
3655 r.in.sec_attrib = sec_attrib;
3657 if (DEBUGLEVEL >= 10) {
3658 NDR_PRINT_IN_DEBUG(winreg_SaveKey, &r);
3661 status = cli->dispatch(cli,
3662 mem_ctx,
3663 &ndr_table_winreg,
3664 NDR_WINREG_SAVEKEY,
3665 &r);
3667 if (!NT_STATUS_IS_OK(status)) {
3668 return status;
3671 if (DEBUGLEVEL >= 10) {
3672 NDR_PRINT_OUT_DEBUG(winreg_SaveKey, &r);
3675 if (NT_STATUS_IS_ERR(status)) {
3676 return status;
3679 /* Return variables */
3681 /* Return result */
3682 if (werror) {
3683 *werror = r.out.result;
3686 return werror_to_ntstatus(r.out.result);
3689 struct rpccli_winreg_SetKeySecurity_state {
3690 struct winreg_SetKeySecurity orig;
3691 struct winreg_SetKeySecurity tmp;
3692 TALLOC_CTX *out_mem_ctx;
3693 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3696 static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq);
3698 struct tevent_req *rpccli_winreg_SetKeySecurity_send(TALLOC_CTX *mem_ctx,
3699 struct tevent_context *ev,
3700 struct rpc_pipe_client *cli,
3701 struct policy_handle *_handle /* [in] [ref] */,
3702 uint32_t _sec_info /* [in] */,
3703 struct KeySecurityData *_sd /* [in] [ref] */)
3705 struct tevent_req *req;
3706 struct rpccli_winreg_SetKeySecurity_state *state;
3707 struct tevent_req *subreq;
3709 req = tevent_req_create(mem_ctx, &state,
3710 struct rpccli_winreg_SetKeySecurity_state);
3711 if (req == NULL) {
3712 return NULL;
3714 state->out_mem_ctx = NULL;
3715 state->dispatch_recv = cli->dispatch_recv;
3717 /* In parameters */
3718 state->orig.in.handle = _handle;
3719 state->orig.in.sec_info = _sec_info;
3720 state->orig.in.sd = _sd;
3722 /* Out parameters */
3724 /* Result */
3725 ZERO_STRUCT(state->orig.out.result);
3727 if (DEBUGLEVEL >= 10) {
3728 NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &state->orig);
3731 /* make a temporary copy, that we pass to the dispatch function */
3732 state->tmp = state->orig;
3734 subreq = cli->dispatch_send(state, ev, cli,
3735 &ndr_table_winreg,
3736 NDR_WINREG_SETKEYSECURITY,
3737 &state->tmp);
3738 if (tevent_req_nomem(subreq, req)) {
3739 return tevent_req_post(req, ev);
3741 tevent_req_set_callback(subreq, rpccli_winreg_SetKeySecurity_done, req);
3742 return req;
3745 static void rpccli_winreg_SetKeySecurity_done(struct tevent_req *subreq)
3747 struct tevent_req *req = tevent_req_callback_data(
3748 subreq, struct tevent_req);
3749 struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
3750 req, struct rpccli_winreg_SetKeySecurity_state);
3751 NTSTATUS status;
3752 TALLOC_CTX *mem_ctx;
3754 if (state->out_mem_ctx) {
3755 mem_ctx = state->out_mem_ctx;
3756 } else {
3757 mem_ctx = state;
3760 status = state->dispatch_recv(subreq, mem_ctx);
3761 TALLOC_FREE(subreq);
3762 if (!NT_STATUS_IS_OK(status)) {
3763 tevent_req_nterror(req, status);
3764 return;
3767 /* Copy out parameters */
3769 /* Copy result */
3770 state->orig.out.result = state->tmp.out.result;
3772 /* Reset temporary structure */
3773 ZERO_STRUCT(state->tmp);
3775 if (DEBUGLEVEL >= 10) {
3776 NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &state->orig);
3779 tevent_req_done(req);
3782 NTSTATUS rpccli_winreg_SetKeySecurity_recv(struct tevent_req *req,
3783 TALLOC_CTX *mem_ctx,
3784 WERROR *result)
3786 struct rpccli_winreg_SetKeySecurity_state *state = tevent_req_data(
3787 req, struct rpccli_winreg_SetKeySecurity_state);
3788 NTSTATUS status;
3790 if (tevent_req_is_nterror(req, &status)) {
3791 tevent_req_received(req);
3792 return status;
3795 /* Steal possbile out parameters to the callers context */
3796 talloc_steal(mem_ctx, state->out_mem_ctx);
3798 /* Return result */
3799 *result = state->orig.out.result;
3801 tevent_req_received(req);
3802 return NT_STATUS_OK;
3805 NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli,
3806 TALLOC_CTX *mem_ctx,
3807 struct policy_handle *handle /* [in] [ref] */,
3808 uint32_t sec_info /* [in] */,
3809 struct KeySecurityData *sd /* [in] [ref] */,
3810 WERROR *werror)
3812 struct winreg_SetKeySecurity r;
3813 NTSTATUS status;
3815 /* In parameters */
3816 r.in.handle = handle;
3817 r.in.sec_info = sec_info;
3818 r.in.sd = sd;
3820 if (DEBUGLEVEL >= 10) {
3821 NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &r);
3824 status = cli->dispatch(cli,
3825 mem_ctx,
3826 &ndr_table_winreg,
3827 NDR_WINREG_SETKEYSECURITY,
3828 &r);
3830 if (!NT_STATUS_IS_OK(status)) {
3831 return status;
3834 if (DEBUGLEVEL >= 10) {
3835 NDR_PRINT_OUT_DEBUG(winreg_SetKeySecurity, &r);
3838 if (NT_STATUS_IS_ERR(status)) {
3839 return status;
3842 /* Return variables */
3844 /* Return result */
3845 if (werror) {
3846 *werror = r.out.result;
3849 return werror_to_ntstatus(r.out.result);
3852 struct rpccli_winreg_SetValue_state {
3853 struct winreg_SetValue orig;
3854 struct winreg_SetValue tmp;
3855 TALLOC_CTX *out_mem_ctx;
3856 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3859 static void rpccli_winreg_SetValue_done(struct tevent_req *subreq);
3861 struct tevent_req *rpccli_winreg_SetValue_send(TALLOC_CTX *mem_ctx,
3862 struct tevent_context *ev,
3863 struct rpc_pipe_client *cli,
3864 struct policy_handle *_handle /* [in] [ref] */,
3865 struct winreg_String _name /* [in] */,
3866 enum winreg_Type _type /* [in] */,
3867 uint8_t *_data /* [in] [ref,size_is(size)] */,
3868 uint32_t _size /* [in] */)
3870 struct tevent_req *req;
3871 struct rpccli_winreg_SetValue_state *state;
3872 struct tevent_req *subreq;
3874 req = tevent_req_create(mem_ctx, &state,
3875 struct rpccli_winreg_SetValue_state);
3876 if (req == NULL) {
3877 return NULL;
3879 state->out_mem_ctx = NULL;
3880 state->dispatch_recv = cli->dispatch_recv;
3882 /* In parameters */
3883 state->orig.in.handle = _handle;
3884 state->orig.in.name = _name;
3885 state->orig.in.type = _type;
3886 state->orig.in.data = _data;
3887 state->orig.in.size = _size;
3889 /* Out parameters */
3891 /* Result */
3892 ZERO_STRUCT(state->orig.out.result);
3894 if (DEBUGLEVEL >= 10) {
3895 NDR_PRINT_IN_DEBUG(winreg_SetValue, &state->orig);
3898 /* make a temporary copy, that we pass to the dispatch function */
3899 state->tmp = state->orig;
3901 subreq = cli->dispatch_send(state, ev, cli,
3902 &ndr_table_winreg,
3903 NDR_WINREG_SETVALUE,
3904 &state->tmp);
3905 if (tevent_req_nomem(subreq, req)) {
3906 return tevent_req_post(req, ev);
3908 tevent_req_set_callback(subreq, rpccli_winreg_SetValue_done, req);
3909 return req;
3912 static void rpccli_winreg_SetValue_done(struct tevent_req *subreq)
3914 struct tevent_req *req = tevent_req_callback_data(
3915 subreq, struct tevent_req);
3916 struct rpccli_winreg_SetValue_state *state = tevent_req_data(
3917 req, struct rpccli_winreg_SetValue_state);
3918 NTSTATUS status;
3919 TALLOC_CTX *mem_ctx;
3921 if (state->out_mem_ctx) {
3922 mem_ctx = state->out_mem_ctx;
3923 } else {
3924 mem_ctx = state;
3927 status = state->dispatch_recv(subreq, mem_ctx);
3928 TALLOC_FREE(subreq);
3929 if (!NT_STATUS_IS_OK(status)) {
3930 tevent_req_nterror(req, status);
3931 return;
3934 /* Copy out parameters */
3936 /* Copy result */
3937 state->orig.out.result = state->tmp.out.result;
3939 /* Reset temporary structure */
3940 ZERO_STRUCT(state->tmp);
3942 if (DEBUGLEVEL >= 10) {
3943 NDR_PRINT_OUT_DEBUG(winreg_SetValue, &state->orig);
3946 tevent_req_done(req);
3949 NTSTATUS rpccli_winreg_SetValue_recv(struct tevent_req *req,
3950 TALLOC_CTX *mem_ctx,
3951 WERROR *result)
3953 struct rpccli_winreg_SetValue_state *state = tevent_req_data(
3954 req, struct rpccli_winreg_SetValue_state);
3955 NTSTATUS status;
3957 if (tevent_req_is_nterror(req, &status)) {
3958 tevent_req_received(req);
3959 return status;
3962 /* Steal possbile out parameters to the callers context */
3963 talloc_steal(mem_ctx, state->out_mem_ctx);
3965 /* Return result */
3966 *result = state->orig.out.result;
3968 tevent_req_received(req);
3969 return NT_STATUS_OK;
3972 NTSTATUS rpccli_winreg_SetValue(struct rpc_pipe_client *cli,
3973 TALLOC_CTX *mem_ctx,
3974 struct policy_handle *handle /* [in] [ref] */,
3975 struct winreg_String name /* [in] */,
3976 enum winreg_Type type /* [in] */,
3977 uint8_t *data /* [in] [ref,size_is(size)] */,
3978 uint32_t size /* [in] */,
3979 WERROR *werror)
3981 struct winreg_SetValue r;
3982 NTSTATUS status;
3984 /* In parameters */
3985 r.in.handle = handle;
3986 r.in.name = name;
3987 r.in.type = type;
3988 r.in.data = data;
3989 r.in.size = size;
3991 if (DEBUGLEVEL >= 10) {
3992 NDR_PRINT_IN_DEBUG(winreg_SetValue, &r);
3995 status = cli->dispatch(cli,
3996 mem_ctx,
3997 &ndr_table_winreg,
3998 NDR_WINREG_SETVALUE,
3999 &r);
4001 if (!NT_STATUS_IS_OK(status)) {
4002 return status;
4005 if (DEBUGLEVEL >= 10) {
4006 NDR_PRINT_OUT_DEBUG(winreg_SetValue, &r);
4009 if (NT_STATUS_IS_ERR(status)) {
4010 return status;
4013 /* Return variables */
4015 /* Return result */
4016 if (werror) {
4017 *werror = r.out.result;
4020 return werror_to_ntstatus(r.out.result);
4023 struct rpccli_winreg_UnLoadKey_state {
4024 struct winreg_UnLoadKey orig;
4025 struct winreg_UnLoadKey tmp;
4026 TALLOC_CTX *out_mem_ctx;
4027 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4030 static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq);
4032 struct tevent_req *rpccli_winreg_UnLoadKey_send(TALLOC_CTX *mem_ctx,
4033 struct tevent_context *ev,
4034 struct rpc_pipe_client *cli)
4036 struct tevent_req *req;
4037 struct rpccli_winreg_UnLoadKey_state *state;
4038 struct tevent_req *subreq;
4040 req = tevent_req_create(mem_ctx, &state,
4041 struct rpccli_winreg_UnLoadKey_state);
4042 if (req == NULL) {
4043 return NULL;
4045 state->out_mem_ctx = NULL;
4046 state->dispatch_recv = cli->dispatch_recv;
4048 /* In parameters */
4050 /* Out parameters */
4052 /* Result */
4053 ZERO_STRUCT(state->orig.out.result);
4055 if (DEBUGLEVEL >= 10) {
4056 NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, &state->orig);
4059 /* make a temporary copy, that we pass to the dispatch function */
4060 state->tmp = state->orig;
4062 subreq = cli->dispatch_send(state, ev, cli,
4063 &ndr_table_winreg,
4064 NDR_WINREG_UNLOADKEY,
4065 &state->tmp);
4066 if (tevent_req_nomem(subreq, req)) {
4067 return tevent_req_post(req, ev);
4069 tevent_req_set_callback(subreq, rpccli_winreg_UnLoadKey_done, req);
4070 return req;
4073 static void rpccli_winreg_UnLoadKey_done(struct tevent_req *subreq)
4075 struct tevent_req *req = tevent_req_callback_data(
4076 subreq, struct tevent_req);
4077 struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
4078 req, struct rpccli_winreg_UnLoadKey_state);
4079 NTSTATUS status;
4080 TALLOC_CTX *mem_ctx;
4082 if (state->out_mem_ctx) {
4083 mem_ctx = state->out_mem_ctx;
4084 } else {
4085 mem_ctx = state;
4088 status = state->dispatch_recv(subreq, mem_ctx);
4089 TALLOC_FREE(subreq);
4090 if (!NT_STATUS_IS_OK(status)) {
4091 tevent_req_nterror(req, status);
4092 return;
4095 /* Copy out parameters */
4097 /* Copy result */
4098 state->orig.out.result = state->tmp.out.result;
4100 /* Reset temporary structure */
4101 ZERO_STRUCT(state->tmp);
4103 if (DEBUGLEVEL >= 10) {
4104 NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &state->orig);
4107 tevent_req_done(req);
4110 NTSTATUS rpccli_winreg_UnLoadKey_recv(struct tevent_req *req,
4111 TALLOC_CTX *mem_ctx,
4112 WERROR *result)
4114 struct rpccli_winreg_UnLoadKey_state *state = tevent_req_data(
4115 req, struct rpccli_winreg_UnLoadKey_state);
4116 NTSTATUS status;
4118 if (tevent_req_is_nterror(req, &status)) {
4119 tevent_req_received(req);
4120 return status;
4123 /* Steal possbile out parameters to the callers context */
4124 talloc_steal(mem_ctx, state->out_mem_ctx);
4126 /* Return result */
4127 *result = state->orig.out.result;
4129 tevent_req_received(req);
4130 return NT_STATUS_OK;
4133 NTSTATUS rpccli_winreg_UnLoadKey(struct rpc_pipe_client *cli,
4134 TALLOC_CTX *mem_ctx,
4135 WERROR *werror)
4137 struct winreg_UnLoadKey r;
4138 NTSTATUS status;
4140 /* In parameters */
4142 if (DEBUGLEVEL >= 10) {
4143 NDR_PRINT_IN_DEBUG(winreg_UnLoadKey, &r);
4146 status = cli->dispatch(cli,
4147 mem_ctx,
4148 &ndr_table_winreg,
4149 NDR_WINREG_UNLOADKEY,
4150 &r);
4152 if (!NT_STATUS_IS_OK(status)) {
4153 return status;
4156 if (DEBUGLEVEL >= 10) {
4157 NDR_PRINT_OUT_DEBUG(winreg_UnLoadKey, &r);
4160 if (NT_STATUS_IS_ERR(status)) {
4161 return status;
4164 /* Return variables */
4166 /* Return result */
4167 if (werror) {
4168 *werror = r.out.result;
4171 return werror_to_ntstatus(r.out.result);
4174 struct rpccli_winreg_InitiateSystemShutdown_state {
4175 struct winreg_InitiateSystemShutdown orig;
4176 struct winreg_InitiateSystemShutdown tmp;
4177 TALLOC_CTX *out_mem_ctx;
4178 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4181 static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq);
4183 struct tevent_req *rpccli_winreg_InitiateSystemShutdown_send(TALLOC_CTX *mem_ctx,
4184 struct tevent_context *ev,
4185 struct rpc_pipe_client *cli,
4186 uint16_t *_hostname /* [in] [unique] */,
4187 struct lsa_StringLarge *_message /* [in] [unique] */,
4188 uint32_t _timeout /* [in] */,
4189 uint8_t _force_apps /* [in] */,
4190 uint8_t _do_reboot /* [in] */)
4192 struct tevent_req *req;
4193 struct rpccli_winreg_InitiateSystemShutdown_state *state;
4194 struct tevent_req *subreq;
4196 req = tevent_req_create(mem_ctx, &state,
4197 struct rpccli_winreg_InitiateSystemShutdown_state);
4198 if (req == NULL) {
4199 return NULL;
4201 state->out_mem_ctx = NULL;
4202 state->dispatch_recv = cli->dispatch_recv;
4204 /* In parameters */
4205 state->orig.in.hostname = _hostname;
4206 state->orig.in.message = _message;
4207 state->orig.in.timeout = _timeout;
4208 state->orig.in.force_apps = _force_apps;
4209 state->orig.in.do_reboot = _do_reboot;
4211 /* Out parameters */
4213 /* Result */
4214 ZERO_STRUCT(state->orig.out.result);
4216 if (DEBUGLEVEL >= 10) {
4217 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, &state->orig);
4220 /* make a temporary copy, that we pass to the dispatch function */
4221 state->tmp = state->orig;
4223 subreq = cli->dispatch_send(state, ev, cli,
4224 &ndr_table_winreg,
4225 NDR_WINREG_INITIATESYSTEMSHUTDOWN,
4226 &state->tmp);
4227 if (tevent_req_nomem(subreq, req)) {
4228 return tevent_req_post(req, ev);
4230 tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdown_done, req);
4231 return req;
4234 static void rpccli_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq)
4236 struct tevent_req *req = tevent_req_callback_data(
4237 subreq, struct tevent_req);
4238 struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
4239 req, struct rpccli_winreg_InitiateSystemShutdown_state);
4240 NTSTATUS status;
4241 TALLOC_CTX *mem_ctx;
4243 if (state->out_mem_ctx) {
4244 mem_ctx = state->out_mem_ctx;
4245 } else {
4246 mem_ctx = state;
4249 status = state->dispatch_recv(subreq, mem_ctx);
4250 TALLOC_FREE(subreq);
4251 if (!NT_STATUS_IS_OK(status)) {
4252 tevent_req_nterror(req, status);
4253 return;
4256 /* Copy out parameters */
4258 /* Copy result */
4259 state->orig.out.result = state->tmp.out.result;
4261 /* Reset temporary structure */
4262 ZERO_STRUCT(state->tmp);
4264 if (DEBUGLEVEL >= 10) {
4265 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &state->orig);
4268 tevent_req_done(req);
4271 NTSTATUS rpccli_winreg_InitiateSystemShutdown_recv(struct tevent_req *req,
4272 TALLOC_CTX *mem_ctx,
4273 WERROR *result)
4275 struct rpccli_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
4276 req, struct rpccli_winreg_InitiateSystemShutdown_state);
4277 NTSTATUS status;
4279 if (tevent_req_is_nterror(req, &status)) {
4280 tevent_req_received(req);
4281 return status;
4284 /* Steal possbile out parameters to the callers context */
4285 talloc_steal(mem_ctx, state->out_mem_ctx);
4287 /* Return result */
4288 *result = state->orig.out.result;
4290 tevent_req_received(req);
4291 return NT_STATUS_OK;
4294 NTSTATUS rpccli_winreg_InitiateSystemShutdown(struct rpc_pipe_client *cli,
4295 TALLOC_CTX *mem_ctx,
4296 uint16_t *hostname /* [in] [unique] */,
4297 struct lsa_StringLarge *message /* [in] [unique] */,
4298 uint32_t timeout /* [in] */,
4299 uint8_t force_apps /* [in] */,
4300 uint8_t do_reboot /* [in] */,
4301 WERROR *werror)
4303 struct winreg_InitiateSystemShutdown r;
4304 NTSTATUS status;
4306 /* In parameters */
4307 r.in.hostname = hostname;
4308 r.in.message = message;
4309 r.in.timeout = timeout;
4310 r.in.force_apps = force_apps;
4311 r.in.do_reboot = do_reboot;
4313 if (DEBUGLEVEL >= 10) {
4314 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdown, &r);
4317 status = cli->dispatch(cli,
4318 mem_ctx,
4319 &ndr_table_winreg,
4320 NDR_WINREG_INITIATESYSTEMSHUTDOWN,
4321 &r);
4323 if (!NT_STATUS_IS_OK(status)) {
4324 return status;
4327 if (DEBUGLEVEL >= 10) {
4328 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdown, &r);
4331 if (NT_STATUS_IS_ERR(status)) {
4332 return status;
4335 /* Return variables */
4337 /* Return result */
4338 if (werror) {
4339 *werror = r.out.result;
4342 return werror_to_ntstatus(r.out.result);
4345 struct rpccli_winreg_AbortSystemShutdown_state {
4346 struct winreg_AbortSystemShutdown orig;
4347 struct winreg_AbortSystemShutdown tmp;
4348 TALLOC_CTX *out_mem_ctx;
4349 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4352 static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq);
4354 struct tevent_req *rpccli_winreg_AbortSystemShutdown_send(TALLOC_CTX *mem_ctx,
4355 struct tevent_context *ev,
4356 struct rpc_pipe_client *cli,
4357 uint16_t *_server /* [in] [unique] */)
4359 struct tevent_req *req;
4360 struct rpccli_winreg_AbortSystemShutdown_state *state;
4361 struct tevent_req *subreq;
4363 req = tevent_req_create(mem_ctx, &state,
4364 struct rpccli_winreg_AbortSystemShutdown_state);
4365 if (req == NULL) {
4366 return NULL;
4368 state->out_mem_ctx = NULL;
4369 state->dispatch_recv = cli->dispatch_recv;
4371 /* In parameters */
4372 state->orig.in.server = _server;
4374 /* Out parameters */
4376 /* Result */
4377 ZERO_STRUCT(state->orig.out.result);
4379 if (DEBUGLEVEL >= 10) {
4380 NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, &state->orig);
4383 /* make a temporary copy, that we pass to the dispatch function */
4384 state->tmp = state->orig;
4386 subreq = cli->dispatch_send(state, ev, cli,
4387 &ndr_table_winreg,
4388 NDR_WINREG_ABORTSYSTEMSHUTDOWN,
4389 &state->tmp);
4390 if (tevent_req_nomem(subreq, req)) {
4391 return tevent_req_post(req, ev);
4393 tevent_req_set_callback(subreq, rpccli_winreg_AbortSystemShutdown_done, req);
4394 return req;
4397 static void rpccli_winreg_AbortSystemShutdown_done(struct tevent_req *subreq)
4399 struct tevent_req *req = tevent_req_callback_data(
4400 subreq, struct tevent_req);
4401 struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
4402 req, struct rpccli_winreg_AbortSystemShutdown_state);
4403 NTSTATUS status;
4404 TALLOC_CTX *mem_ctx;
4406 if (state->out_mem_ctx) {
4407 mem_ctx = state->out_mem_ctx;
4408 } else {
4409 mem_ctx = state;
4412 status = state->dispatch_recv(subreq, mem_ctx);
4413 TALLOC_FREE(subreq);
4414 if (!NT_STATUS_IS_OK(status)) {
4415 tevent_req_nterror(req, status);
4416 return;
4419 /* Copy out parameters */
4421 /* Copy result */
4422 state->orig.out.result = state->tmp.out.result;
4424 /* Reset temporary structure */
4425 ZERO_STRUCT(state->tmp);
4427 if (DEBUGLEVEL >= 10) {
4428 NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &state->orig);
4431 tevent_req_done(req);
4434 NTSTATUS rpccli_winreg_AbortSystemShutdown_recv(struct tevent_req *req,
4435 TALLOC_CTX *mem_ctx,
4436 WERROR *result)
4438 struct rpccli_winreg_AbortSystemShutdown_state *state = tevent_req_data(
4439 req, struct rpccli_winreg_AbortSystemShutdown_state);
4440 NTSTATUS status;
4442 if (tevent_req_is_nterror(req, &status)) {
4443 tevent_req_received(req);
4444 return status;
4447 /* Steal possbile out parameters to the callers context */
4448 talloc_steal(mem_ctx, state->out_mem_ctx);
4450 /* Return result */
4451 *result = state->orig.out.result;
4453 tevent_req_received(req);
4454 return NT_STATUS_OK;
4457 NTSTATUS rpccli_winreg_AbortSystemShutdown(struct rpc_pipe_client *cli,
4458 TALLOC_CTX *mem_ctx,
4459 uint16_t *server /* [in] [unique] */,
4460 WERROR *werror)
4462 struct winreg_AbortSystemShutdown r;
4463 NTSTATUS status;
4465 /* In parameters */
4466 r.in.server = server;
4468 if (DEBUGLEVEL >= 10) {
4469 NDR_PRINT_IN_DEBUG(winreg_AbortSystemShutdown, &r);
4472 status = cli->dispatch(cli,
4473 mem_ctx,
4474 &ndr_table_winreg,
4475 NDR_WINREG_ABORTSYSTEMSHUTDOWN,
4476 &r);
4478 if (!NT_STATUS_IS_OK(status)) {
4479 return status;
4482 if (DEBUGLEVEL >= 10) {
4483 NDR_PRINT_OUT_DEBUG(winreg_AbortSystemShutdown, &r);
4486 if (NT_STATUS_IS_ERR(status)) {
4487 return status;
4490 /* Return variables */
4492 /* Return result */
4493 if (werror) {
4494 *werror = r.out.result;
4497 return werror_to_ntstatus(r.out.result);
4500 struct rpccli_winreg_GetVersion_state {
4501 struct winreg_GetVersion orig;
4502 struct winreg_GetVersion tmp;
4503 TALLOC_CTX *out_mem_ctx;
4504 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4507 static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq);
4509 struct tevent_req *rpccli_winreg_GetVersion_send(TALLOC_CTX *mem_ctx,
4510 struct tevent_context *ev,
4511 struct rpc_pipe_client *cli,
4512 struct policy_handle *_handle /* [in] [ref] */,
4513 uint32_t *_version /* [out] [ref] */)
4515 struct tevent_req *req;
4516 struct rpccli_winreg_GetVersion_state *state;
4517 struct tevent_req *subreq;
4519 req = tevent_req_create(mem_ctx, &state,
4520 struct rpccli_winreg_GetVersion_state);
4521 if (req == NULL) {
4522 return NULL;
4524 state->out_mem_ctx = NULL;
4525 state->dispatch_recv = cli->dispatch_recv;
4527 /* In parameters */
4528 state->orig.in.handle = _handle;
4530 /* Out parameters */
4531 state->orig.out.version = _version;
4533 /* Result */
4534 ZERO_STRUCT(state->orig.out.result);
4536 if (DEBUGLEVEL >= 10) {
4537 NDR_PRINT_IN_DEBUG(winreg_GetVersion, &state->orig);
4540 state->out_mem_ctx = talloc_named_const(state, 0,
4541 "rpccli_winreg_GetVersion_out_memory");
4542 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4543 return tevent_req_post(req, ev);
4546 /* make a temporary copy, that we pass to the dispatch function */
4547 state->tmp = state->orig;
4549 subreq = cli->dispatch_send(state, ev, cli,
4550 &ndr_table_winreg,
4551 NDR_WINREG_GETVERSION,
4552 &state->tmp);
4553 if (tevent_req_nomem(subreq, req)) {
4554 return tevent_req_post(req, ev);
4556 tevent_req_set_callback(subreq, rpccli_winreg_GetVersion_done, req);
4557 return req;
4560 static void rpccli_winreg_GetVersion_done(struct tevent_req *subreq)
4562 struct tevent_req *req = tevent_req_callback_data(
4563 subreq, struct tevent_req);
4564 struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
4565 req, struct rpccli_winreg_GetVersion_state);
4566 NTSTATUS status;
4567 TALLOC_CTX *mem_ctx;
4569 if (state->out_mem_ctx) {
4570 mem_ctx = state->out_mem_ctx;
4571 } else {
4572 mem_ctx = state;
4575 status = state->dispatch_recv(subreq, mem_ctx);
4576 TALLOC_FREE(subreq);
4577 if (!NT_STATUS_IS_OK(status)) {
4578 tevent_req_nterror(req, status);
4579 return;
4582 /* Copy out parameters */
4583 *state->orig.out.version = *state->tmp.out.version;
4585 /* Copy result */
4586 state->orig.out.result = state->tmp.out.result;
4588 /* Reset temporary structure */
4589 ZERO_STRUCT(state->tmp);
4591 if (DEBUGLEVEL >= 10) {
4592 NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &state->orig);
4595 tevent_req_done(req);
4598 NTSTATUS rpccli_winreg_GetVersion_recv(struct tevent_req *req,
4599 TALLOC_CTX *mem_ctx,
4600 WERROR *result)
4602 struct rpccli_winreg_GetVersion_state *state = tevent_req_data(
4603 req, struct rpccli_winreg_GetVersion_state);
4604 NTSTATUS status;
4606 if (tevent_req_is_nterror(req, &status)) {
4607 tevent_req_received(req);
4608 return status;
4611 /* Steal possbile out parameters to the callers context */
4612 talloc_steal(mem_ctx, state->out_mem_ctx);
4614 /* Return result */
4615 *result = state->orig.out.result;
4617 tevent_req_received(req);
4618 return NT_STATUS_OK;
4621 NTSTATUS rpccli_winreg_GetVersion(struct rpc_pipe_client *cli,
4622 TALLOC_CTX *mem_ctx,
4623 struct policy_handle *handle /* [in] [ref] */,
4624 uint32_t *version /* [out] [ref] */,
4625 WERROR *werror)
4627 struct winreg_GetVersion r;
4628 NTSTATUS status;
4630 /* In parameters */
4631 r.in.handle = handle;
4633 if (DEBUGLEVEL >= 10) {
4634 NDR_PRINT_IN_DEBUG(winreg_GetVersion, &r);
4637 status = cli->dispatch(cli,
4638 mem_ctx,
4639 &ndr_table_winreg,
4640 NDR_WINREG_GETVERSION,
4641 &r);
4643 if (!NT_STATUS_IS_OK(status)) {
4644 return status;
4647 if (DEBUGLEVEL >= 10) {
4648 NDR_PRINT_OUT_DEBUG(winreg_GetVersion, &r);
4651 if (NT_STATUS_IS_ERR(status)) {
4652 return status;
4655 /* Return variables */
4656 *version = *r.out.version;
4658 /* Return result */
4659 if (werror) {
4660 *werror = r.out.result;
4663 return werror_to_ntstatus(r.out.result);
4666 struct rpccli_winreg_OpenHKCC_state {
4667 struct winreg_OpenHKCC orig;
4668 struct winreg_OpenHKCC tmp;
4669 TALLOC_CTX *out_mem_ctx;
4670 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4673 static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq);
4675 struct tevent_req *rpccli_winreg_OpenHKCC_send(TALLOC_CTX *mem_ctx,
4676 struct tevent_context *ev,
4677 struct rpc_pipe_client *cli,
4678 uint16_t *_system_name /* [in] [unique] */,
4679 uint32_t _access_mask /* [in] */,
4680 struct policy_handle *_handle /* [out] [ref] */)
4682 struct tevent_req *req;
4683 struct rpccli_winreg_OpenHKCC_state *state;
4684 struct tevent_req *subreq;
4686 req = tevent_req_create(mem_ctx, &state,
4687 struct rpccli_winreg_OpenHKCC_state);
4688 if (req == NULL) {
4689 return NULL;
4691 state->out_mem_ctx = NULL;
4692 state->dispatch_recv = cli->dispatch_recv;
4694 /* In parameters */
4695 state->orig.in.system_name = _system_name;
4696 state->orig.in.access_mask = _access_mask;
4698 /* Out parameters */
4699 state->orig.out.handle = _handle;
4701 /* Result */
4702 ZERO_STRUCT(state->orig.out.result);
4704 if (DEBUGLEVEL >= 10) {
4705 NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, &state->orig);
4708 state->out_mem_ctx = talloc_named_const(state, 0,
4709 "rpccli_winreg_OpenHKCC_out_memory");
4710 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4711 return tevent_req_post(req, ev);
4714 /* make a temporary copy, that we pass to the dispatch function */
4715 state->tmp = state->orig;
4717 subreq = cli->dispatch_send(state, ev, cli,
4718 &ndr_table_winreg,
4719 NDR_WINREG_OPENHKCC,
4720 &state->tmp);
4721 if (tevent_req_nomem(subreq, req)) {
4722 return tevent_req_post(req, ev);
4724 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKCC_done, req);
4725 return req;
4728 static void rpccli_winreg_OpenHKCC_done(struct tevent_req *subreq)
4730 struct tevent_req *req = tevent_req_callback_data(
4731 subreq, struct tevent_req);
4732 struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
4733 req, struct rpccli_winreg_OpenHKCC_state);
4734 NTSTATUS status;
4735 TALLOC_CTX *mem_ctx;
4737 if (state->out_mem_ctx) {
4738 mem_ctx = state->out_mem_ctx;
4739 } else {
4740 mem_ctx = state;
4743 status = state->dispatch_recv(subreq, mem_ctx);
4744 TALLOC_FREE(subreq);
4745 if (!NT_STATUS_IS_OK(status)) {
4746 tevent_req_nterror(req, status);
4747 return;
4750 /* Copy out parameters */
4751 *state->orig.out.handle = *state->tmp.out.handle;
4753 /* Copy result */
4754 state->orig.out.result = state->tmp.out.result;
4756 /* Reset temporary structure */
4757 ZERO_STRUCT(state->tmp);
4759 if (DEBUGLEVEL >= 10) {
4760 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &state->orig);
4763 tevent_req_done(req);
4766 NTSTATUS rpccli_winreg_OpenHKCC_recv(struct tevent_req *req,
4767 TALLOC_CTX *mem_ctx,
4768 WERROR *result)
4770 struct rpccli_winreg_OpenHKCC_state *state = tevent_req_data(
4771 req, struct rpccli_winreg_OpenHKCC_state);
4772 NTSTATUS status;
4774 if (tevent_req_is_nterror(req, &status)) {
4775 tevent_req_received(req);
4776 return status;
4779 /* Steal possbile out parameters to the callers context */
4780 talloc_steal(mem_ctx, state->out_mem_ctx);
4782 /* Return result */
4783 *result = state->orig.out.result;
4785 tevent_req_received(req);
4786 return NT_STATUS_OK;
4789 NTSTATUS rpccli_winreg_OpenHKCC(struct rpc_pipe_client *cli,
4790 TALLOC_CTX *mem_ctx,
4791 uint16_t *system_name /* [in] [unique] */,
4792 uint32_t access_mask /* [in] */,
4793 struct policy_handle *handle /* [out] [ref] */,
4794 WERROR *werror)
4796 struct winreg_OpenHKCC r;
4797 NTSTATUS status;
4799 /* In parameters */
4800 r.in.system_name = system_name;
4801 r.in.access_mask = access_mask;
4803 if (DEBUGLEVEL >= 10) {
4804 NDR_PRINT_IN_DEBUG(winreg_OpenHKCC, &r);
4807 status = cli->dispatch(cli,
4808 mem_ctx,
4809 &ndr_table_winreg,
4810 NDR_WINREG_OPENHKCC,
4811 &r);
4813 if (!NT_STATUS_IS_OK(status)) {
4814 return status;
4817 if (DEBUGLEVEL >= 10) {
4818 NDR_PRINT_OUT_DEBUG(winreg_OpenHKCC, &r);
4821 if (NT_STATUS_IS_ERR(status)) {
4822 return status;
4825 /* Return variables */
4826 *handle = *r.out.handle;
4828 /* Return result */
4829 if (werror) {
4830 *werror = r.out.result;
4833 return werror_to_ntstatus(r.out.result);
4836 struct rpccli_winreg_OpenHKDD_state {
4837 struct winreg_OpenHKDD orig;
4838 struct winreg_OpenHKDD tmp;
4839 TALLOC_CTX *out_mem_ctx;
4840 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4843 static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq);
4845 struct tevent_req *rpccli_winreg_OpenHKDD_send(TALLOC_CTX *mem_ctx,
4846 struct tevent_context *ev,
4847 struct rpc_pipe_client *cli,
4848 uint16_t *_system_name /* [in] [unique] */,
4849 uint32_t _access_mask /* [in] */,
4850 struct policy_handle *_handle /* [out] [ref] */)
4852 struct tevent_req *req;
4853 struct rpccli_winreg_OpenHKDD_state *state;
4854 struct tevent_req *subreq;
4856 req = tevent_req_create(mem_ctx, &state,
4857 struct rpccli_winreg_OpenHKDD_state);
4858 if (req == NULL) {
4859 return NULL;
4861 state->out_mem_ctx = NULL;
4862 state->dispatch_recv = cli->dispatch_recv;
4864 /* In parameters */
4865 state->orig.in.system_name = _system_name;
4866 state->orig.in.access_mask = _access_mask;
4868 /* Out parameters */
4869 state->orig.out.handle = _handle;
4871 /* Result */
4872 ZERO_STRUCT(state->orig.out.result);
4874 if (DEBUGLEVEL >= 10) {
4875 NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, &state->orig);
4878 state->out_mem_ctx = talloc_named_const(state, 0,
4879 "rpccli_winreg_OpenHKDD_out_memory");
4880 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4881 return tevent_req_post(req, ev);
4884 /* make a temporary copy, that we pass to the dispatch function */
4885 state->tmp = state->orig;
4887 subreq = cli->dispatch_send(state, ev, cli,
4888 &ndr_table_winreg,
4889 NDR_WINREG_OPENHKDD,
4890 &state->tmp);
4891 if (tevent_req_nomem(subreq, req)) {
4892 return tevent_req_post(req, ev);
4894 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKDD_done, req);
4895 return req;
4898 static void rpccli_winreg_OpenHKDD_done(struct tevent_req *subreq)
4900 struct tevent_req *req = tevent_req_callback_data(
4901 subreq, struct tevent_req);
4902 struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
4903 req, struct rpccli_winreg_OpenHKDD_state);
4904 NTSTATUS status;
4905 TALLOC_CTX *mem_ctx;
4907 if (state->out_mem_ctx) {
4908 mem_ctx = state->out_mem_ctx;
4909 } else {
4910 mem_ctx = state;
4913 status = state->dispatch_recv(subreq, mem_ctx);
4914 TALLOC_FREE(subreq);
4915 if (!NT_STATUS_IS_OK(status)) {
4916 tevent_req_nterror(req, status);
4917 return;
4920 /* Copy out parameters */
4921 *state->orig.out.handle = *state->tmp.out.handle;
4923 /* Copy result */
4924 state->orig.out.result = state->tmp.out.result;
4926 /* Reset temporary structure */
4927 ZERO_STRUCT(state->tmp);
4929 if (DEBUGLEVEL >= 10) {
4930 NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &state->orig);
4933 tevent_req_done(req);
4936 NTSTATUS rpccli_winreg_OpenHKDD_recv(struct tevent_req *req,
4937 TALLOC_CTX *mem_ctx,
4938 WERROR *result)
4940 struct rpccli_winreg_OpenHKDD_state *state = tevent_req_data(
4941 req, struct rpccli_winreg_OpenHKDD_state);
4942 NTSTATUS status;
4944 if (tevent_req_is_nterror(req, &status)) {
4945 tevent_req_received(req);
4946 return status;
4949 /* Steal possbile out parameters to the callers context */
4950 talloc_steal(mem_ctx, state->out_mem_ctx);
4952 /* Return result */
4953 *result = state->orig.out.result;
4955 tevent_req_received(req);
4956 return NT_STATUS_OK;
4959 NTSTATUS rpccli_winreg_OpenHKDD(struct rpc_pipe_client *cli,
4960 TALLOC_CTX *mem_ctx,
4961 uint16_t *system_name /* [in] [unique] */,
4962 uint32_t access_mask /* [in] */,
4963 struct policy_handle *handle /* [out] [ref] */,
4964 WERROR *werror)
4966 struct winreg_OpenHKDD r;
4967 NTSTATUS status;
4969 /* In parameters */
4970 r.in.system_name = system_name;
4971 r.in.access_mask = access_mask;
4973 if (DEBUGLEVEL >= 10) {
4974 NDR_PRINT_IN_DEBUG(winreg_OpenHKDD, &r);
4977 status = cli->dispatch(cli,
4978 mem_ctx,
4979 &ndr_table_winreg,
4980 NDR_WINREG_OPENHKDD,
4981 &r);
4983 if (!NT_STATUS_IS_OK(status)) {
4984 return status;
4987 if (DEBUGLEVEL >= 10) {
4988 NDR_PRINT_OUT_DEBUG(winreg_OpenHKDD, &r);
4991 if (NT_STATUS_IS_ERR(status)) {
4992 return status;
4995 /* Return variables */
4996 *handle = *r.out.handle;
4998 /* Return result */
4999 if (werror) {
5000 *werror = r.out.result;
5003 return werror_to_ntstatus(r.out.result);
5006 struct rpccli_winreg_QueryMultipleValues_state {
5007 struct winreg_QueryMultipleValues orig;
5008 struct winreg_QueryMultipleValues tmp;
5009 TALLOC_CTX *out_mem_ctx;
5010 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5013 static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq);
5015 struct tevent_req *rpccli_winreg_QueryMultipleValues_send(TALLOC_CTX *mem_ctx,
5016 struct tevent_context *ev,
5017 struct rpc_pipe_client *cli,
5018 struct policy_handle *_key_handle /* [in] [ref] */,
5019 struct QueryMultipleValue *_values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
5020 uint32_t _num_values /* [in] */,
5021 uint8_t *_buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
5022 uint32_t *_buffer_size /* [in,out] [ref] */)
5024 struct tevent_req *req;
5025 struct rpccli_winreg_QueryMultipleValues_state *state;
5026 struct tevent_req *subreq;
5028 req = tevent_req_create(mem_ctx, &state,
5029 struct rpccli_winreg_QueryMultipleValues_state);
5030 if (req == NULL) {
5031 return NULL;
5033 state->out_mem_ctx = NULL;
5034 state->dispatch_recv = cli->dispatch_recv;
5036 /* In parameters */
5037 state->orig.in.key_handle = _key_handle;
5038 state->orig.in.values = _values;
5039 state->orig.in.num_values = _num_values;
5040 state->orig.in.buffer = _buffer;
5041 state->orig.in.buffer_size = _buffer_size;
5043 /* Out parameters */
5044 state->orig.out.values = _values;
5045 state->orig.out.buffer = _buffer;
5046 state->orig.out.buffer_size = _buffer_size;
5048 /* Result */
5049 ZERO_STRUCT(state->orig.out.result);
5051 if (DEBUGLEVEL >= 10) {
5052 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, &state->orig);
5055 state->out_mem_ctx = talloc_named_const(state, 0,
5056 "rpccli_winreg_QueryMultipleValues_out_memory");
5057 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5058 return tevent_req_post(req, ev);
5061 /* make a temporary copy, that we pass to the dispatch function */
5062 state->tmp = state->orig;
5064 subreq = cli->dispatch_send(state, ev, cli,
5065 &ndr_table_winreg,
5066 NDR_WINREG_QUERYMULTIPLEVALUES,
5067 &state->tmp);
5068 if (tevent_req_nomem(subreq, req)) {
5069 return tevent_req_post(req, ev);
5071 tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues_done, req);
5072 return req;
5075 static void rpccli_winreg_QueryMultipleValues_done(struct tevent_req *subreq)
5077 struct tevent_req *req = tevent_req_callback_data(
5078 subreq, struct tevent_req);
5079 struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
5080 req, struct rpccli_winreg_QueryMultipleValues_state);
5081 NTSTATUS status;
5082 TALLOC_CTX *mem_ctx;
5084 if (state->out_mem_ctx) {
5085 mem_ctx = state->out_mem_ctx;
5086 } else {
5087 mem_ctx = state;
5090 status = state->dispatch_recv(subreq, mem_ctx);
5091 TALLOC_FREE(subreq);
5092 if (!NT_STATUS_IS_OK(status)) {
5093 tevent_req_nterror(req, status);
5094 return;
5097 /* Copy out parameters */
5098 memcpy(state->orig.out.values, state->tmp.out.values, state->tmp.in.num_values * sizeof(*state->orig.out.values));
5099 if (state->orig.out.buffer && state->tmp.out.buffer) {
5100 memcpy(state->orig.out.buffer, state->tmp.out.buffer, *state->tmp.in.buffer_size * sizeof(*state->orig.out.buffer));
5102 *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
5104 /* Copy result */
5105 state->orig.out.result = state->tmp.out.result;
5107 /* Reset temporary structure */
5108 ZERO_STRUCT(state->tmp);
5110 if (DEBUGLEVEL >= 10) {
5111 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, &state->orig);
5114 tevent_req_done(req);
5117 NTSTATUS rpccli_winreg_QueryMultipleValues_recv(struct tevent_req *req,
5118 TALLOC_CTX *mem_ctx,
5119 WERROR *result)
5121 struct rpccli_winreg_QueryMultipleValues_state *state = tevent_req_data(
5122 req, struct rpccli_winreg_QueryMultipleValues_state);
5123 NTSTATUS status;
5125 if (tevent_req_is_nterror(req, &status)) {
5126 tevent_req_received(req);
5127 return status;
5130 /* Steal possbile out parameters to the callers context */
5131 talloc_steal(mem_ctx, state->out_mem_ctx);
5133 /* Return result */
5134 *result = state->orig.out.result;
5136 tevent_req_received(req);
5137 return NT_STATUS_OK;
5140 NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli,
5141 TALLOC_CTX *mem_ctx,
5142 struct policy_handle *key_handle /* [in] [ref] */,
5143 struct QueryMultipleValue *values /* [in,out] [ref,length_is(num_values),size_is(num_values)] */,
5144 uint32_t num_values /* [in] */,
5145 uint8_t *buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
5146 uint32_t *buffer_size /* [in,out] [ref] */,
5147 WERROR *werror)
5149 struct winreg_QueryMultipleValues r;
5150 NTSTATUS status;
5152 /* In parameters */
5153 r.in.key_handle = key_handle;
5154 r.in.values = values;
5155 r.in.num_values = num_values;
5156 r.in.buffer = buffer;
5157 r.in.buffer_size = buffer_size;
5159 if (DEBUGLEVEL >= 10) {
5160 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues, &r);
5163 status = cli->dispatch(cli,
5164 mem_ctx,
5165 &ndr_table_winreg,
5166 NDR_WINREG_QUERYMULTIPLEVALUES,
5167 &r);
5169 if (!NT_STATUS_IS_OK(status)) {
5170 return status;
5173 if (DEBUGLEVEL >= 10) {
5174 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues, &r);
5177 if (NT_STATUS_IS_ERR(status)) {
5178 return status;
5181 /* Return variables */
5182 memcpy(values, r.out.values, r.in.num_values * sizeof(*values));
5183 if (buffer && r.out.buffer) {
5184 memcpy(buffer, r.out.buffer, *r.in.buffer_size * sizeof(*buffer));
5186 *buffer_size = *r.out.buffer_size;
5188 /* Return result */
5189 if (werror) {
5190 *werror = r.out.result;
5193 return werror_to_ntstatus(r.out.result);
5196 struct rpccli_winreg_InitiateSystemShutdownEx_state {
5197 struct winreg_InitiateSystemShutdownEx orig;
5198 struct winreg_InitiateSystemShutdownEx tmp;
5199 TALLOC_CTX *out_mem_ctx;
5200 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5203 static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq);
5205 struct tevent_req *rpccli_winreg_InitiateSystemShutdownEx_send(TALLOC_CTX *mem_ctx,
5206 struct tevent_context *ev,
5207 struct rpc_pipe_client *cli,
5208 uint16_t *_hostname /* [in] [unique] */,
5209 struct lsa_StringLarge *_message /* [in] [unique] */,
5210 uint32_t _timeout /* [in] */,
5211 uint8_t _force_apps /* [in] */,
5212 uint8_t _do_reboot /* [in] */,
5213 uint32_t _reason /* [in] */)
5215 struct tevent_req *req;
5216 struct rpccli_winreg_InitiateSystemShutdownEx_state *state;
5217 struct tevent_req *subreq;
5219 req = tevent_req_create(mem_ctx, &state,
5220 struct rpccli_winreg_InitiateSystemShutdownEx_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.hostname = _hostname;
5229 state->orig.in.message = _message;
5230 state->orig.in.timeout = _timeout;
5231 state->orig.in.force_apps = _force_apps;
5232 state->orig.in.do_reboot = _do_reboot;
5233 state->orig.in.reason = _reason;
5235 /* Out parameters */
5237 /* Result */
5238 ZERO_STRUCT(state->orig.out.result);
5240 if (DEBUGLEVEL >= 10) {
5241 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, &state->orig);
5244 /* make a temporary copy, that we pass to the dispatch function */
5245 state->tmp = state->orig;
5247 subreq = cli->dispatch_send(state, ev, cli,
5248 &ndr_table_winreg,
5249 NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
5250 &state->tmp);
5251 if (tevent_req_nomem(subreq, req)) {
5252 return tevent_req_post(req, ev);
5254 tevent_req_set_callback(subreq, rpccli_winreg_InitiateSystemShutdownEx_done, req);
5255 return req;
5258 static void rpccli_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq)
5260 struct tevent_req *req = tevent_req_callback_data(
5261 subreq, struct tevent_req);
5262 struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
5263 req, struct rpccli_winreg_InitiateSystemShutdownEx_state);
5264 NTSTATUS status;
5265 TALLOC_CTX *mem_ctx;
5267 if (state->out_mem_ctx) {
5268 mem_ctx = state->out_mem_ctx;
5269 } else {
5270 mem_ctx = state;
5273 status = state->dispatch_recv(subreq, mem_ctx);
5274 TALLOC_FREE(subreq);
5275 if (!NT_STATUS_IS_OK(status)) {
5276 tevent_req_nterror(req, status);
5277 return;
5280 /* Copy out parameters */
5282 /* Copy result */
5283 state->orig.out.result = state->tmp.out.result;
5285 /* Reset temporary structure */
5286 ZERO_STRUCT(state->tmp);
5288 if (DEBUGLEVEL >= 10) {
5289 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, &state->orig);
5292 tevent_req_done(req);
5295 NTSTATUS rpccli_winreg_InitiateSystemShutdownEx_recv(struct tevent_req *req,
5296 TALLOC_CTX *mem_ctx,
5297 WERROR *result)
5299 struct rpccli_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
5300 req, struct rpccli_winreg_InitiateSystemShutdownEx_state);
5301 NTSTATUS status;
5303 if (tevent_req_is_nterror(req, &status)) {
5304 tevent_req_received(req);
5305 return status;
5308 /* Steal possbile out parameters to the callers context */
5309 talloc_steal(mem_ctx, state->out_mem_ctx);
5311 /* Return result */
5312 *result = state->orig.out.result;
5314 tevent_req_received(req);
5315 return NT_STATUS_OK;
5318 NTSTATUS rpccli_winreg_InitiateSystemShutdownEx(struct rpc_pipe_client *cli,
5319 TALLOC_CTX *mem_ctx,
5320 uint16_t *hostname /* [in] [unique] */,
5321 struct lsa_StringLarge *message /* [in] [unique] */,
5322 uint32_t timeout /* [in] */,
5323 uint8_t force_apps /* [in] */,
5324 uint8_t do_reboot /* [in] */,
5325 uint32_t reason /* [in] */,
5326 WERROR *werror)
5328 struct winreg_InitiateSystemShutdownEx r;
5329 NTSTATUS status;
5331 /* In parameters */
5332 r.in.hostname = hostname;
5333 r.in.message = message;
5334 r.in.timeout = timeout;
5335 r.in.force_apps = force_apps;
5336 r.in.do_reboot = do_reboot;
5337 r.in.reason = reason;
5339 if (DEBUGLEVEL >= 10) {
5340 NDR_PRINT_IN_DEBUG(winreg_InitiateSystemShutdownEx, &r);
5343 status = cli->dispatch(cli,
5344 mem_ctx,
5345 &ndr_table_winreg,
5346 NDR_WINREG_INITIATESYSTEMSHUTDOWNEX,
5347 &r);
5349 if (!NT_STATUS_IS_OK(status)) {
5350 return status;
5353 if (DEBUGLEVEL >= 10) {
5354 NDR_PRINT_OUT_DEBUG(winreg_InitiateSystemShutdownEx, &r);
5357 if (NT_STATUS_IS_ERR(status)) {
5358 return status;
5361 /* Return variables */
5363 /* Return result */
5364 if (werror) {
5365 *werror = r.out.result;
5368 return werror_to_ntstatus(r.out.result);
5371 struct rpccli_winreg_SaveKeyEx_state {
5372 struct winreg_SaveKeyEx orig;
5373 struct winreg_SaveKeyEx tmp;
5374 TALLOC_CTX *out_mem_ctx;
5375 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5378 static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq);
5380 struct tevent_req *rpccli_winreg_SaveKeyEx_send(TALLOC_CTX *mem_ctx,
5381 struct tevent_context *ev,
5382 struct rpc_pipe_client *cli)
5384 struct tevent_req *req;
5385 struct rpccli_winreg_SaveKeyEx_state *state;
5386 struct tevent_req *subreq;
5388 req = tevent_req_create(mem_ctx, &state,
5389 struct rpccli_winreg_SaveKeyEx_state);
5390 if (req == NULL) {
5391 return NULL;
5393 state->out_mem_ctx = NULL;
5394 state->dispatch_recv = cli->dispatch_recv;
5396 /* In parameters */
5398 /* Out parameters */
5400 /* Result */
5401 ZERO_STRUCT(state->orig.out.result);
5403 if (DEBUGLEVEL >= 10) {
5404 NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, &state->orig);
5407 /* make a temporary copy, that we pass to the dispatch function */
5408 state->tmp = state->orig;
5410 subreq = cli->dispatch_send(state, ev, cli,
5411 &ndr_table_winreg,
5412 NDR_WINREG_SAVEKEYEX,
5413 &state->tmp);
5414 if (tevent_req_nomem(subreq, req)) {
5415 return tevent_req_post(req, ev);
5417 tevent_req_set_callback(subreq, rpccli_winreg_SaveKeyEx_done, req);
5418 return req;
5421 static void rpccli_winreg_SaveKeyEx_done(struct tevent_req *subreq)
5423 struct tevent_req *req = tevent_req_callback_data(
5424 subreq, struct tevent_req);
5425 struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
5426 req, struct rpccli_winreg_SaveKeyEx_state);
5427 NTSTATUS status;
5428 TALLOC_CTX *mem_ctx;
5430 if (state->out_mem_ctx) {
5431 mem_ctx = state->out_mem_ctx;
5432 } else {
5433 mem_ctx = state;
5436 status = state->dispatch_recv(subreq, mem_ctx);
5437 TALLOC_FREE(subreq);
5438 if (!NT_STATUS_IS_OK(status)) {
5439 tevent_req_nterror(req, status);
5440 return;
5443 /* Copy out parameters */
5445 /* Copy result */
5446 state->orig.out.result = state->tmp.out.result;
5448 /* Reset temporary structure */
5449 ZERO_STRUCT(state->tmp);
5451 if (DEBUGLEVEL >= 10) {
5452 NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, &state->orig);
5455 tevent_req_done(req);
5458 NTSTATUS rpccli_winreg_SaveKeyEx_recv(struct tevent_req *req,
5459 TALLOC_CTX *mem_ctx,
5460 WERROR *result)
5462 struct rpccli_winreg_SaveKeyEx_state *state = tevent_req_data(
5463 req, struct rpccli_winreg_SaveKeyEx_state);
5464 NTSTATUS status;
5466 if (tevent_req_is_nterror(req, &status)) {
5467 tevent_req_received(req);
5468 return status;
5471 /* Steal possbile out parameters to the callers context */
5472 talloc_steal(mem_ctx, state->out_mem_ctx);
5474 /* Return result */
5475 *result = state->orig.out.result;
5477 tevent_req_received(req);
5478 return NT_STATUS_OK;
5481 NTSTATUS rpccli_winreg_SaveKeyEx(struct rpc_pipe_client *cli,
5482 TALLOC_CTX *mem_ctx,
5483 WERROR *werror)
5485 struct winreg_SaveKeyEx r;
5486 NTSTATUS status;
5488 /* In parameters */
5490 if (DEBUGLEVEL >= 10) {
5491 NDR_PRINT_IN_DEBUG(winreg_SaveKeyEx, &r);
5494 status = cli->dispatch(cli,
5495 mem_ctx,
5496 &ndr_table_winreg,
5497 NDR_WINREG_SAVEKEYEX,
5498 &r);
5500 if (!NT_STATUS_IS_OK(status)) {
5501 return status;
5504 if (DEBUGLEVEL >= 10) {
5505 NDR_PRINT_OUT_DEBUG(winreg_SaveKeyEx, &r);
5508 if (NT_STATUS_IS_ERR(status)) {
5509 return status;
5512 /* Return variables */
5514 /* Return result */
5515 if (werror) {
5516 *werror = r.out.result;
5519 return werror_to_ntstatus(r.out.result);
5522 struct rpccli_winreg_OpenHKPT_state {
5523 struct winreg_OpenHKPT orig;
5524 struct winreg_OpenHKPT tmp;
5525 TALLOC_CTX *out_mem_ctx;
5526 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5529 static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq);
5531 struct tevent_req *rpccli_winreg_OpenHKPT_send(TALLOC_CTX *mem_ctx,
5532 struct tevent_context *ev,
5533 struct rpc_pipe_client *cli,
5534 uint16_t *_system_name /* [in] [unique] */,
5535 uint32_t _access_mask /* [in] */,
5536 struct policy_handle *_handle /* [out] [ref] */)
5538 struct tevent_req *req;
5539 struct rpccli_winreg_OpenHKPT_state *state;
5540 struct tevent_req *subreq;
5542 req = tevent_req_create(mem_ctx, &state,
5543 struct rpccli_winreg_OpenHKPT_state);
5544 if (req == NULL) {
5545 return NULL;
5547 state->out_mem_ctx = NULL;
5548 state->dispatch_recv = cli->dispatch_recv;
5550 /* In parameters */
5551 state->orig.in.system_name = _system_name;
5552 state->orig.in.access_mask = _access_mask;
5554 /* Out parameters */
5555 state->orig.out.handle = _handle;
5557 /* Result */
5558 ZERO_STRUCT(state->orig.out.result);
5560 if (DEBUGLEVEL >= 10) {
5561 NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, &state->orig);
5564 state->out_mem_ctx = talloc_named_const(state, 0,
5565 "rpccli_winreg_OpenHKPT_out_memory");
5566 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5567 return tevent_req_post(req, ev);
5570 /* make a temporary copy, that we pass to the dispatch function */
5571 state->tmp = state->orig;
5573 subreq = cli->dispatch_send(state, ev, cli,
5574 &ndr_table_winreg,
5575 NDR_WINREG_OPENHKPT,
5576 &state->tmp);
5577 if (tevent_req_nomem(subreq, req)) {
5578 return tevent_req_post(req, ev);
5580 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPT_done, req);
5581 return req;
5584 static void rpccli_winreg_OpenHKPT_done(struct tevent_req *subreq)
5586 struct tevent_req *req = tevent_req_callback_data(
5587 subreq, struct tevent_req);
5588 struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
5589 req, struct rpccli_winreg_OpenHKPT_state);
5590 NTSTATUS status;
5591 TALLOC_CTX *mem_ctx;
5593 if (state->out_mem_ctx) {
5594 mem_ctx = state->out_mem_ctx;
5595 } else {
5596 mem_ctx = state;
5599 status = state->dispatch_recv(subreq, mem_ctx);
5600 TALLOC_FREE(subreq);
5601 if (!NT_STATUS_IS_OK(status)) {
5602 tevent_req_nterror(req, status);
5603 return;
5606 /* Copy out parameters */
5607 *state->orig.out.handle = *state->tmp.out.handle;
5609 /* Copy result */
5610 state->orig.out.result = state->tmp.out.result;
5612 /* Reset temporary structure */
5613 ZERO_STRUCT(state->tmp);
5615 if (DEBUGLEVEL >= 10) {
5616 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, &state->orig);
5619 tevent_req_done(req);
5622 NTSTATUS rpccli_winreg_OpenHKPT_recv(struct tevent_req *req,
5623 TALLOC_CTX *mem_ctx,
5624 WERROR *result)
5626 struct rpccli_winreg_OpenHKPT_state *state = tevent_req_data(
5627 req, struct rpccli_winreg_OpenHKPT_state);
5628 NTSTATUS status;
5630 if (tevent_req_is_nterror(req, &status)) {
5631 tevent_req_received(req);
5632 return status;
5635 /* Steal possbile out parameters to the callers context */
5636 talloc_steal(mem_ctx, state->out_mem_ctx);
5638 /* Return result */
5639 *result = state->orig.out.result;
5641 tevent_req_received(req);
5642 return NT_STATUS_OK;
5645 NTSTATUS rpccli_winreg_OpenHKPT(struct rpc_pipe_client *cli,
5646 TALLOC_CTX *mem_ctx,
5647 uint16_t *system_name /* [in] [unique] */,
5648 uint32_t access_mask /* [in] */,
5649 struct policy_handle *handle /* [out] [ref] */,
5650 WERROR *werror)
5652 struct winreg_OpenHKPT r;
5653 NTSTATUS status;
5655 /* In parameters */
5656 r.in.system_name = system_name;
5657 r.in.access_mask = access_mask;
5659 if (DEBUGLEVEL >= 10) {
5660 NDR_PRINT_IN_DEBUG(winreg_OpenHKPT, &r);
5663 status = cli->dispatch(cli,
5664 mem_ctx,
5665 &ndr_table_winreg,
5666 NDR_WINREG_OPENHKPT,
5667 &r);
5669 if (!NT_STATUS_IS_OK(status)) {
5670 return status;
5673 if (DEBUGLEVEL >= 10) {
5674 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPT, &r);
5677 if (NT_STATUS_IS_ERR(status)) {
5678 return status;
5681 /* Return variables */
5682 *handle = *r.out.handle;
5684 /* Return result */
5685 if (werror) {
5686 *werror = r.out.result;
5689 return werror_to_ntstatus(r.out.result);
5692 struct rpccli_winreg_OpenHKPN_state {
5693 struct winreg_OpenHKPN orig;
5694 struct winreg_OpenHKPN tmp;
5695 TALLOC_CTX *out_mem_ctx;
5696 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5699 static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq);
5701 struct tevent_req *rpccli_winreg_OpenHKPN_send(TALLOC_CTX *mem_ctx,
5702 struct tevent_context *ev,
5703 struct rpc_pipe_client *cli,
5704 uint16_t *_system_name /* [in] [unique] */,
5705 uint32_t _access_mask /* [in] */,
5706 struct policy_handle *_handle /* [out] [ref] */)
5708 struct tevent_req *req;
5709 struct rpccli_winreg_OpenHKPN_state *state;
5710 struct tevent_req *subreq;
5712 req = tevent_req_create(mem_ctx, &state,
5713 struct rpccli_winreg_OpenHKPN_state);
5714 if (req == NULL) {
5715 return NULL;
5717 state->out_mem_ctx = NULL;
5718 state->dispatch_recv = cli->dispatch_recv;
5720 /* In parameters */
5721 state->orig.in.system_name = _system_name;
5722 state->orig.in.access_mask = _access_mask;
5724 /* Out parameters */
5725 state->orig.out.handle = _handle;
5727 /* Result */
5728 ZERO_STRUCT(state->orig.out.result);
5730 if (DEBUGLEVEL >= 10) {
5731 NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, &state->orig);
5734 state->out_mem_ctx = talloc_named_const(state, 0,
5735 "rpccli_winreg_OpenHKPN_out_memory");
5736 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5737 return tevent_req_post(req, ev);
5740 /* make a temporary copy, that we pass to the dispatch function */
5741 state->tmp = state->orig;
5743 subreq = cli->dispatch_send(state, ev, cli,
5744 &ndr_table_winreg,
5745 NDR_WINREG_OPENHKPN,
5746 &state->tmp);
5747 if (tevent_req_nomem(subreq, req)) {
5748 return tevent_req_post(req, ev);
5750 tevent_req_set_callback(subreq, rpccli_winreg_OpenHKPN_done, req);
5751 return req;
5754 static void rpccli_winreg_OpenHKPN_done(struct tevent_req *subreq)
5756 struct tevent_req *req = tevent_req_callback_data(
5757 subreq, struct tevent_req);
5758 struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
5759 req, struct rpccli_winreg_OpenHKPN_state);
5760 NTSTATUS status;
5761 TALLOC_CTX *mem_ctx;
5763 if (state->out_mem_ctx) {
5764 mem_ctx = state->out_mem_ctx;
5765 } else {
5766 mem_ctx = state;
5769 status = state->dispatch_recv(subreq, mem_ctx);
5770 TALLOC_FREE(subreq);
5771 if (!NT_STATUS_IS_OK(status)) {
5772 tevent_req_nterror(req, status);
5773 return;
5776 /* Copy out parameters */
5777 *state->orig.out.handle = *state->tmp.out.handle;
5779 /* Copy result */
5780 state->orig.out.result = state->tmp.out.result;
5782 /* Reset temporary structure */
5783 ZERO_STRUCT(state->tmp);
5785 if (DEBUGLEVEL >= 10) {
5786 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, &state->orig);
5789 tevent_req_done(req);
5792 NTSTATUS rpccli_winreg_OpenHKPN_recv(struct tevent_req *req,
5793 TALLOC_CTX *mem_ctx,
5794 WERROR *result)
5796 struct rpccli_winreg_OpenHKPN_state *state = tevent_req_data(
5797 req, struct rpccli_winreg_OpenHKPN_state);
5798 NTSTATUS status;
5800 if (tevent_req_is_nterror(req, &status)) {
5801 tevent_req_received(req);
5802 return status;
5805 /* Steal possbile out parameters to the callers context */
5806 talloc_steal(mem_ctx, state->out_mem_ctx);
5808 /* Return result */
5809 *result = state->orig.out.result;
5811 tevent_req_received(req);
5812 return NT_STATUS_OK;
5815 NTSTATUS rpccli_winreg_OpenHKPN(struct rpc_pipe_client *cli,
5816 TALLOC_CTX *mem_ctx,
5817 uint16_t *system_name /* [in] [unique] */,
5818 uint32_t access_mask /* [in] */,
5819 struct policy_handle *handle /* [out] [ref] */,
5820 WERROR *werror)
5822 struct winreg_OpenHKPN r;
5823 NTSTATUS status;
5825 /* In parameters */
5826 r.in.system_name = system_name;
5827 r.in.access_mask = access_mask;
5829 if (DEBUGLEVEL >= 10) {
5830 NDR_PRINT_IN_DEBUG(winreg_OpenHKPN, &r);
5833 status = cli->dispatch(cli,
5834 mem_ctx,
5835 &ndr_table_winreg,
5836 NDR_WINREG_OPENHKPN,
5837 &r);
5839 if (!NT_STATUS_IS_OK(status)) {
5840 return status;
5843 if (DEBUGLEVEL >= 10) {
5844 NDR_PRINT_OUT_DEBUG(winreg_OpenHKPN, &r);
5847 if (NT_STATUS_IS_ERR(status)) {
5848 return status;
5851 /* Return variables */
5852 *handle = *r.out.handle;
5854 /* Return result */
5855 if (werror) {
5856 *werror = r.out.result;
5859 return werror_to_ntstatus(r.out.result);
5862 struct rpccli_winreg_QueryMultipleValues2_state {
5863 struct winreg_QueryMultipleValues2 orig;
5864 struct winreg_QueryMultipleValues2 tmp;
5865 TALLOC_CTX *out_mem_ctx;
5866 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5869 static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq);
5871 struct tevent_req *rpccli_winreg_QueryMultipleValues2_send(TALLOC_CTX *mem_ctx,
5872 struct tevent_context *ev,
5873 struct rpc_pipe_client *cli)
5875 struct tevent_req *req;
5876 struct rpccli_winreg_QueryMultipleValues2_state *state;
5877 struct tevent_req *subreq;
5879 req = tevent_req_create(mem_ctx, &state,
5880 struct rpccli_winreg_QueryMultipleValues2_state);
5881 if (req == NULL) {
5882 return NULL;
5884 state->out_mem_ctx = NULL;
5885 state->dispatch_recv = cli->dispatch_recv;
5887 /* In parameters */
5889 /* Out parameters */
5891 /* Result */
5892 ZERO_STRUCT(state->orig.out.result);
5894 if (DEBUGLEVEL >= 10) {
5895 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, &state->orig);
5898 /* make a temporary copy, that we pass to the dispatch function */
5899 state->tmp = state->orig;
5901 subreq = cli->dispatch_send(state, ev, cli,
5902 &ndr_table_winreg,
5903 NDR_WINREG_QUERYMULTIPLEVALUES2,
5904 &state->tmp);
5905 if (tevent_req_nomem(subreq, req)) {
5906 return tevent_req_post(req, ev);
5908 tevent_req_set_callback(subreq, rpccli_winreg_QueryMultipleValues2_done, req);
5909 return req;
5912 static void rpccli_winreg_QueryMultipleValues2_done(struct tevent_req *subreq)
5914 struct tevent_req *req = tevent_req_callback_data(
5915 subreq, struct tevent_req);
5916 struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
5917 req, struct rpccli_winreg_QueryMultipleValues2_state);
5918 NTSTATUS status;
5919 TALLOC_CTX *mem_ctx;
5921 if (state->out_mem_ctx) {
5922 mem_ctx = state->out_mem_ctx;
5923 } else {
5924 mem_ctx = state;
5927 status = state->dispatch_recv(subreq, mem_ctx);
5928 TALLOC_FREE(subreq);
5929 if (!NT_STATUS_IS_OK(status)) {
5930 tevent_req_nterror(req, status);
5931 return;
5934 /* Copy out parameters */
5936 /* Copy result */
5937 state->orig.out.result = state->tmp.out.result;
5939 /* Reset temporary structure */
5940 ZERO_STRUCT(state->tmp);
5942 if (DEBUGLEVEL >= 10) {
5943 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, &state->orig);
5946 tevent_req_done(req);
5949 NTSTATUS rpccli_winreg_QueryMultipleValues2_recv(struct tevent_req *req,
5950 TALLOC_CTX *mem_ctx,
5951 WERROR *result)
5953 struct rpccli_winreg_QueryMultipleValues2_state *state = tevent_req_data(
5954 req, struct rpccli_winreg_QueryMultipleValues2_state);
5955 NTSTATUS status;
5957 if (tevent_req_is_nterror(req, &status)) {
5958 tevent_req_received(req);
5959 return status;
5962 /* Steal possbile out parameters to the callers context */
5963 talloc_steal(mem_ctx, state->out_mem_ctx);
5965 /* Return result */
5966 *result = state->orig.out.result;
5968 tevent_req_received(req);
5969 return NT_STATUS_OK;
5972 NTSTATUS rpccli_winreg_QueryMultipleValues2(struct rpc_pipe_client *cli,
5973 TALLOC_CTX *mem_ctx,
5974 WERROR *werror)
5976 struct winreg_QueryMultipleValues2 r;
5977 NTSTATUS status;
5979 /* In parameters */
5981 if (DEBUGLEVEL >= 10) {
5982 NDR_PRINT_IN_DEBUG(winreg_QueryMultipleValues2, &r);
5985 status = cli->dispatch(cli,
5986 mem_ctx,
5987 &ndr_table_winreg,
5988 NDR_WINREG_QUERYMULTIPLEVALUES2,
5989 &r);
5991 if (!NT_STATUS_IS_OK(status)) {
5992 return status;
5995 if (DEBUGLEVEL >= 10) {
5996 NDR_PRINT_OUT_DEBUG(winreg_QueryMultipleValues2, &r);
5999 if (NT_STATUS_IS_ERR(status)) {
6000 return status;
6003 /* Return variables */
6005 /* Return result */
6006 if (werror) {
6007 *werror = r.out.result;
6010 return werror_to_ntstatus(r.out.result);