1 /* client functions auto-generated by pidl */
5 #include "lib/util/tevent_ntstatus.h"
6 #include "librpc/gen_ndr/ndr_winreg.h"
7 #include "librpc/gen_ndr/ndr_winreg_c.h"
9 /* winreg - client functions generated by pidl */
11 struct dcerpc_winreg_OpenHKCR_r_state {
12 TALLOC_CTX *out_mem_ctx;
15 static void dcerpc_winreg_OpenHKCR_r_done(struct tevent_req *subreq);
17 struct tevent_req *dcerpc_winreg_OpenHKCR_r_send(TALLOC_CTX *mem_ctx,
18 struct tevent_context *ev,
19 struct dcerpc_binding_handle *h,
20 struct winreg_OpenHKCR *r)
22 struct tevent_req *req;
23 struct dcerpc_winreg_OpenHKCR_r_state *state;
24 struct tevent_req *subreq;
26 req = tevent_req_create(mem_ctx, &state,
27 struct dcerpc_winreg_OpenHKCR_r_state);
32 state->out_mem_ctx = talloc_new(state);
33 if (tevent_req_nomem(state->out_mem_ctx, req)) {
34 return tevent_req_post(req, ev);
37 subreq = dcerpc_binding_handle_call_send(state, ev, h,
38 NULL, &ndr_table_winreg,
39 NDR_WINREG_OPENHKCR, state->out_mem_ctx, r);
40 if (tevent_req_nomem(subreq, req)) {
41 return tevent_req_post(req, ev);
43 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCR_r_done, req);
48 static void dcerpc_winreg_OpenHKCR_r_done(struct tevent_req *subreq)
50 struct tevent_req *req =
51 tevent_req_callback_data(subreq,
55 status = dcerpc_binding_handle_call_recv(subreq);
56 if (!NT_STATUS_IS_OK(status)) {
57 tevent_req_nterror(req, status);
64 NTSTATUS dcerpc_winreg_OpenHKCR_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
66 struct dcerpc_winreg_OpenHKCR_r_state *state =
68 struct dcerpc_winreg_OpenHKCR_r_state);
71 if (tevent_req_is_nterror(req, &status)) {
72 tevent_req_received(req);
76 talloc_steal(mem_ctx, state->out_mem_ctx);
78 tevent_req_received(req);
82 NTSTATUS dcerpc_winreg_OpenHKCR_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKCR *r)
86 status = dcerpc_binding_handle_call(h,
87 NULL, &ndr_table_winreg,
88 NDR_WINREG_OPENHKCR, mem_ctx, r);
93 NTSTATUS dcerpc_winreg_OpenHKCR_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenHKCR *r)
97 status = dcerpc_winreg_OpenHKCR_r(p->binding_handle, mem_ctx, r);
99 if (NT_STATUS_IS_RPC(status)) {
100 status = NT_STATUS_NET_WRITE_FAULT;
106 struct dcerpc_winreg_OpenHKCR_state {
107 struct winreg_OpenHKCR orig;
108 struct winreg_OpenHKCR tmp;
109 TALLOC_CTX *out_mem_ctx;
112 static void dcerpc_winreg_OpenHKCR_done(struct tevent_req *subreq);
114 struct tevent_req *dcerpc_winreg_OpenHKCR_send(TALLOC_CTX *mem_ctx,
115 struct tevent_context *ev,
116 struct dcerpc_binding_handle *h,
117 uint16_t *_system_name /* [in] [unique] */,
118 uint32_t _access_mask /* [in] */,
119 struct policy_handle *_handle /* [out] [ref] */)
121 struct tevent_req *req;
122 struct dcerpc_winreg_OpenHKCR_state *state;
123 struct tevent_req *subreq;
125 req = tevent_req_create(mem_ctx, &state,
126 struct dcerpc_winreg_OpenHKCR_state);
130 state->out_mem_ctx = NULL;
133 state->orig.in.system_name = _system_name;
134 state->orig.in.access_mask = _access_mask;
137 state->orig.out.handle = _handle;
140 ZERO_STRUCT(state->orig.out.result);
142 state->out_mem_ctx = talloc_named_const(state, 0,
143 "dcerpc_winreg_OpenHKCR_out_memory");
144 if (tevent_req_nomem(state->out_mem_ctx, req)) {
145 return tevent_req_post(req, ev);
148 /* make a temporary copy, that we pass to the dispatch function */
149 state->tmp = state->orig;
151 subreq = dcerpc_winreg_OpenHKCR_r_send(state, ev, h, &state->tmp);
152 if (tevent_req_nomem(subreq, req)) {
153 return tevent_req_post(req, ev);
155 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCR_done, req);
159 static void dcerpc_winreg_OpenHKCR_done(struct tevent_req *subreq)
161 struct tevent_req *req = tevent_req_callback_data(
162 subreq, struct tevent_req);
163 struct dcerpc_winreg_OpenHKCR_state *state = tevent_req_data(
164 req, struct dcerpc_winreg_OpenHKCR_state);
168 if (state->out_mem_ctx) {
169 mem_ctx = state->out_mem_ctx;
174 status = dcerpc_winreg_OpenHKCR_r_recv(subreq, mem_ctx);
176 if (!NT_STATUS_IS_OK(status)) {
177 tevent_req_nterror(req, status);
181 /* Copy out parameters */
182 *state->orig.out.handle = *state->tmp.out.handle;
185 state->orig.out.result = state->tmp.out.result;
187 /* Reset temporary structure */
188 ZERO_STRUCT(state->tmp);
190 tevent_req_done(req);
193 NTSTATUS dcerpc_winreg_OpenHKCR_recv(struct tevent_req *req,
197 struct dcerpc_winreg_OpenHKCR_state *state = tevent_req_data(
198 req, struct dcerpc_winreg_OpenHKCR_state);
201 if (tevent_req_is_nterror(req, &status)) {
202 tevent_req_received(req);
206 /* Steal possible out parameters to the callers context */
207 talloc_steal(mem_ctx, state->out_mem_ctx);
210 *result = state->orig.out.result;
212 tevent_req_received(req);
216 NTSTATUS dcerpc_winreg_OpenHKCR(struct dcerpc_binding_handle *h,
218 uint16_t *_system_name /* [in] [unique] */,
219 uint32_t _access_mask /* [in] */,
220 struct policy_handle *_handle /* [out] [ref] */,
223 struct winreg_OpenHKCR r;
227 r.in.system_name = _system_name;
228 r.in.access_mask = _access_mask;
230 status = dcerpc_winreg_OpenHKCR_r(h, mem_ctx, &r);
231 if (!NT_STATUS_IS_OK(status)) {
235 /* Return variables */
236 *_handle = *r.out.handle;
239 *result = r.out.result;
244 struct dcerpc_winreg_OpenHKCU_r_state {
245 TALLOC_CTX *out_mem_ctx;
248 static void dcerpc_winreg_OpenHKCU_r_done(struct tevent_req *subreq);
250 struct tevent_req *dcerpc_winreg_OpenHKCU_r_send(TALLOC_CTX *mem_ctx,
251 struct tevent_context *ev,
252 struct dcerpc_binding_handle *h,
253 struct winreg_OpenHKCU *r)
255 struct tevent_req *req;
256 struct dcerpc_winreg_OpenHKCU_r_state *state;
257 struct tevent_req *subreq;
259 req = tevent_req_create(mem_ctx, &state,
260 struct dcerpc_winreg_OpenHKCU_r_state);
265 state->out_mem_ctx = talloc_new(state);
266 if (tevent_req_nomem(state->out_mem_ctx, req)) {
267 return tevent_req_post(req, ev);
270 subreq = dcerpc_binding_handle_call_send(state, ev, h,
271 NULL, &ndr_table_winreg,
272 NDR_WINREG_OPENHKCU, state->out_mem_ctx, r);
273 if (tevent_req_nomem(subreq, req)) {
274 return tevent_req_post(req, ev);
276 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCU_r_done, req);
281 static void dcerpc_winreg_OpenHKCU_r_done(struct tevent_req *subreq)
283 struct tevent_req *req =
284 tevent_req_callback_data(subreq,
288 status = dcerpc_binding_handle_call_recv(subreq);
289 if (!NT_STATUS_IS_OK(status)) {
290 tevent_req_nterror(req, status);
294 tevent_req_done(req);
297 NTSTATUS dcerpc_winreg_OpenHKCU_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
299 struct dcerpc_winreg_OpenHKCU_r_state *state =
301 struct dcerpc_winreg_OpenHKCU_r_state);
304 if (tevent_req_is_nterror(req, &status)) {
305 tevent_req_received(req);
309 talloc_steal(mem_ctx, state->out_mem_ctx);
311 tevent_req_received(req);
315 NTSTATUS dcerpc_winreg_OpenHKCU_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKCU *r)
319 status = dcerpc_binding_handle_call(h,
320 NULL, &ndr_table_winreg,
321 NDR_WINREG_OPENHKCU, mem_ctx, r);
326 NTSTATUS dcerpc_winreg_OpenHKCU_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenHKCU *r)
330 status = dcerpc_winreg_OpenHKCU_r(p->binding_handle, mem_ctx, r);
332 if (NT_STATUS_IS_RPC(status)) {
333 status = NT_STATUS_NET_WRITE_FAULT;
339 struct dcerpc_winreg_OpenHKCU_state {
340 struct winreg_OpenHKCU orig;
341 struct winreg_OpenHKCU tmp;
342 TALLOC_CTX *out_mem_ctx;
345 static void dcerpc_winreg_OpenHKCU_done(struct tevent_req *subreq);
347 struct tevent_req *dcerpc_winreg_OpenHKCU_send(TALLOC_CTX *mem_ctx,
348 struct tevent_context *ev,
349 struct dcerpc_binding_handle *h,
350 uint16_t *_system_name /* [in] [unique] */,
351 uint32_t _access_mask /* [in] */,
352 struct policy_handle *_handle /* [out] [ref] */)
354 struct tevent_req *req;
355 struct dcerpc_winreg_OpenHKCU_state *state;
356 struct tevent_req *subreq;
358 req = tevent_req_create(mem_ctx, &state,
359 struct dcerpc_winreg_OpenHKCU_state);
363 state->out_mem_ctx = NULL;
366 state->orig.in.system_name = _system_name;
367 state->orig.in.access_mask = _access_mask;
370 state->orig.out.handle = _handle;
373 ZERO_STRUCT(state->orig.out.result);
375 state->out_mem_ctx = talloc_named_const(state, 0,
376 "dcerpc_winreg_OpenHKCU_out_memory");
377 if (tevent_req_nomem(state->out_mem_ctx, req)) {
378 return tevent_req_post(req, ev);
381 /* make a temporary copy, that we pass to the dispatch function */
382 state->tmp = state->orig;
384 subreq = dcerpc_winreg_OpenHKCU_r_send(state, ev, h, &state->tmp);
385 if (tevent_req_nomem(subreq, req)) {
386 return tevent_req_post(req, ev);
388 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCU_done, req);
392 static void dcerpc_winreg_OpenHKCU_done(struct tevent_req *subreq)
394 struct tevent_req *req = tevent_req_callback_data(
395 subreq, struct tevent_req);
396 struct dcerpc_winreg_OpenHKCU_state *state = tevent_req_data(
397 req, struct dcerpc_winreg_OpenHKCU_state);
401 if (state->out_mem_ctx) {
402 mem_ctx = state->out_mem_ctx;
407 status = dcerpc_winreg_OpenHKCU_r_recv(subreq, mem_ctx);
409 if (!NT_STATUS_IS_OK(status)) {
410 tevent_req_nterror(req, status);
414 /* Copy out parameters */
415 *state->orig.out.handle = *state->tmp.out.handle;
418 state->orig.out.result = state->tmp.out.result;
420 /* Reset temporary structure */
421 ZERO_STRUCT(state->tmp);
423 tevent_req_done(req);
426 NTSTATUS dcerpc_winreg_OpenHKCU_recv(struct tevent_req *req,
430 struct dcerpc_winreg_OpenHKCU_state *state = tevent_req_data(
431 req, struct dcerpc_winreg_OpenHKCU_state);
434 if (tevent_req_is_nterror(req, &status)) {
435 tevent_req_received(req);
439 /* Steal possible out parameters to the callers context */
440 talloc_steal(mem_ctx, state->out_mem_ctx);
443 *result = state->orig.out.result;
445 tevent_req_received(req);
449 NTSTATUS dcerpc_winreg_OpenHKCU(struct dcerpc_binding_handle *h,
451 uint16_t *_system_name /* [in] [unique] */,
452 uint32_t _access_mask /* [in] */,
453 struct policy_handle *_handle /* [out] [ref] */,
456 struct winreg_OpenHKCU r;
460 r.in.system_name = _system_name;
461 r.in.access_mask = _access_mask;
463 status = dcerpc_winreg_OpenHKCU_r(h, mem_ctx, &r);
464 if (!NT_STATUS_IS_OK(status)) {
468 /* Return variables */
469 *_handle = *r.out.handle;
472 *result = r.out.result;
477 struct dcerpc_winreg_OpenHKLM_r_state {
478 TALLOC_CTX *out_mem_ctx;
481 static void dcerpc_winreg_OpenHKLM_r_done(struct tevent_req *subreq);
483 struct tevent_req *dcerpc_winreg_OpenHKLM_r_send(TALLOC_CTX *mem_ctx,
484 struct tevent_context *ev,
485 struct dcerpc_binding_handle *h,
486 struct winreg_OpenHKLM *r)
488 struct tevent_req *req;
489 struct dcerpc_winreg_OpenHKLM_r_state *state;
490 struct tevent_req *subreq;
492 req = tevent_req_create(mem_ctx, &state,
493 struct dcerpc_winreg_OpenHKLM_r_state);
498 state->out_mem_ctx = talloc_new(state);
499 if (tevent_req_nomem(state->out_mem_ctx, req)) {
500 return tevent_req_post(req, ev);
503 subreq = dcerpc_binding_handle_call_send(state, ev, h,
504 NULL, &ndr_table_winreg,
505 NDR_WINREG_OPENHKLM, state->out_mem_ctx, r);
506 if (tevent_req_nomem(subreq, req)) {
507 return tevent_req_post(req, ev);
509 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKLM_r_done, req);
514 static void dcerpc_winreg_OpenHKLM_r_done(struct tevent_req *subreq)
516 struct tevent_req *req =
517 tevent_req_callback_data(subreq,
521 status = dcerpc_binding_handle_call_recv(subreq);
522 if (!NT_STATUS_IS_OK(status)) {
523 tevent_req_nterror(req, status);
527 tevent_req_done(req);
530 NTSTATUS dcerpc_winreg_OpenHKLM_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
532 struct dcerpc_winreg_OpenHKLM_r_state *state =
534 struct dcerpc_winreg_OpenHKLM_r_state);
537 if (tevent_req_is_nterror(req, &status)) {
538 tevent_req_received(req);
542 talloc_steal(mem_ctx, state->out_mem_ctx);
544 tevent_req_received(req);
548 NTSTATUS dcerpc_winreg_OpenHKLM_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKLM *r)
552 status = dcerpc_binding_handle_call(h,
553 NULL, &ndr_table_winreg,
554 NDR_WINREG_OPENHKLM, mem_ctx, r);
559 NTSTATUS dcerpc_winreg_OpenHKLM_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenHKLM *r)
563 status = dcerpc_winreg_OpenHKLM_r(p->binding_handle, mem_ctx, r);
565 if (NT_STATUS_IS_RPC(status)) {
566 status = NT_STATUS_NET_WRITE_FAULT;
572 struct dcerpc_winreg_OpenHKLM_state {
573 struct winreg_OpenHKLM orig;
574 struct winreg_OpenHKLM tmp;
575 TALLOC_CTX *out_mem_ctx;
578 static void dcerpc_winreg_OpenHKLM_done(struct tevent_req *subreq);
580 struct tevent_req *dcerpc_winreg_OpenHKLM_send(TALLOC_CTX *mem_ctx,
581 struct tevent_context *ev,
582 struct dcerpc_binding_handle *h,
583 uint16_t *_system_name /* [in] [unique] */,
584 uint32_t _access_mask /* [in] */,
585 struct policy_handle *_handle /* [out] [ref] */)
587 struct tevent_req *req;
588 struct dcerpc_winreg_OpenHKLM_state *state;
589 struct tevent_req *subreq;
591 req = tevent_req_create(mem_ctx, &state,
592 struct dcerpc_winreg_OpenHKLM_state);
596 state->out_mem_ctx = NULL;
599 state->orig.in.system_name = _system_name;
600 state->orig.in.access_mask = _access_mask;
603 state->orig.out.handle = _handle;
606 ZERO_STRUCT(state->orig.out.result);
608 state->out_mem_ctx = talloc_named_const(state, 0,
609 "dcerpc_winreg_OpenHKLM_out_memory");
610 if (tevent_req_nomem(state->out_mem_ctx, req)) {
611 return tevent_req_post(req, ev);
614 /* make a temporary copy, that we pass to the dispatch function */
615 state->tmp = state->orig;
617 subreq = dcerpc_winreg_OpenHKLM_r_send(state, ev, h, &state->tmp);
618 if (tevent_req_nomem(subreq, req)) {
619 return tevent_req_post(req, ev);
621 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKLM_done, req);
625 static void dcerpc_winreg_OpenHKLM_done(struct tevent_req *subreq)
627 struct tevent_req *req = tevent_req_callback_data(
628 subreq, struct tevent_req);
629 struct dcerpc_winreg_OpenHKLM_state *state = tevent_req_data(
630 req, struct dcerpc_winreg_OpenHKLM_state);
634 if (state->out_mem_ctx) {
635 mem_ctx = state->out_mem_ctx;
640 status = dcerpc_winreg_OpenHKLM_r_recv(subreq, mem_ctx);
642 if (!NT_STATUS_IS_OK(status)) {
643 tevent_req_nterror(req, status);
647 /* Copy out parameters */
648 *state->orig.out.handle = *state->tmp.out.handle;
651 state->orig.out.result = state->tmp.out.result;
653 /* Reset temporary structure */
654 ZERO_STRUCT(state->tmp);
656 tevent_req_done(req);
659 NTSTATUS dcerpc_winreg_OpenHKLM_recv(struct tevent_req *req,
663 struct dcerpc_winreg_OpenHKLM_state *state = tevent_req_data(
664 req, struct dcerpc_winreg_OpenHKLM_state);
667 if (tevent_req_is_nterror(req, &status)) {
668 tevent_req_received(req);
672 /* Steal possible out parameters to the callers context */
673 talloc_steal(mem_ctx, state->out_mem_ctx);
676 *result = state->orig.out.result;
678 tevent_req_received(req);
682 NTSTATUS dcerpc_winreg_OpenHKLM(struct dcerpc_binding_handle *h,
684 uint16_t *_system_name /* [in] [unique] */,
685 uint32_t _access_mask /* [in] */,
686 struct policy_handle *_handle /* [out] [ref] */,
689 struct winreg_OpenHKLM r;
693 r.in.system_name = _system_name;
694 r.in.access_mask = _access_mask;
696 status = dcerpc_winreg_OpenHKLM_r(h, mem_ctx, &r);
697 if (!NT_STATUS_IS_OK(status)) {
701 /* Return variables */
702 *_handle = *r.out.handle;
705 *result = r.out.result;
710 struct dcerpc_winreg_OpenHKPD_r_state {
711 TALLOC_CTX *out_mem_ctx;
714 static void dcerpc_winreg_OpenHKPD_r_done(struct tevent_req *subreq);
716 struct tevent_req *dcerpc_winreg_OpenHKPD_r_send(TALLOC_CTX *mem_ctx,
717 struct tevent_context *ev,
718 struct dcerpc_binding_handle *h,
719 struct winreg_OpenHKPD *r)
721 struct tevent_req *req;
722 struct dcerpc_winreg_OpenHKPD_r_state *state;
723 struct tevent_req *subreq;
725 req = tevent_req_create(mem_ctx, &state,
726 struct dcerpc_winreg_OpenHKPD_r_state);
731 state->out_mem_ctx = talloc_new(state);
732 if (tevent_req_nomem(state->out_mem_ctx, req)) {
733 return tevent_req_post(req, ev);
736 subreq = dcerpc_binding_handle_call_send(state, ev, h,
737 NULL, &ndr_table_winreg,
738 NDR_WINREG_OPENHKPD, state->out_mem_ctx, r);
739 if (tevent_req_nomem(subreq, req)) {
740 return tevent_req_post(req, ev);
742 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPD_r_done, req);
747 static void dcerpc_winreg_OpenHKPD_r_done(struct tevent_req *subreq)
749 struct tevent_req *req =
750 tevent_req_callback_data(subreq,
754 status = dcerpc_binding_handle_call_recv(subreq);
755 if (!NT_STATUS_IS_OK(status)) {
756 tevent_req_nterror(req, status);
760 tevent_req_done(req);
763 NTSTATUS dcerpc_winreg_OpenHKPD_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
765 struct dcerpc_winreg_OpenHKPD_r_state *state =
767 struct dcerpc_winreg_OpenHKPD_r_state);
770 if (tevent_req_is_nterror(req, &status)) {
771 tevent_req_received(req);
775 talloc_steal(mem_ctx, state->out_mem_ctx);
777 tevent_req_received(req);
781 NTSTATUS dcerpc_winreg_OpenHKPD_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKPD *r)
785 status = dcerpc_binding_handle_call(h,
786 NULL, &ndr_table_winreg,
787 NDR_WINREG_OPENHKPD, mem_ctx, r);
792 NTSTATUS dcerpc_winreg_OpenHKPD_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenHKPD *r)
796 status = dcerpc_winreg_OpenHKPD_r(p->binding_handle, mem_ctx, r);
798 if (NT_STATUS_IS_RPC(status)) {
799 status = NT_STATUS_NET_WRITE_FAULT;
805 struct dcerpc_winreg_OpenHKPD_state {
806 struct winreg_OpenHKPD orig;
807 struct winreg_OpenHKPD tmp;
808 TALLOC_CTX *out_mem_ctx;
811 static void dcerpc_winreg_OpenHKPD_done(struct tevent_req *subreq);
813 struct tevent_req *dcerpc_winreg_OpenHKPD_send(TALLOC_CTX *mem_ctx,
814 struct tevent_context *ev,
815 struct dcerpc_binding_handle *h,
816 uint16_t *_system_name /* [in] [unique] */,
817 uint32_t _access_mask /* [in] */,
818 struct policy_handle *_handle /* [out] [ref] */)
820 struct tevent_req *req;
821 struct dcerpc_winreg_OpenHKPD_state *state;
822 struct tevent_req *subreq;
824 req = tevent_req_create(mem_ctx, &state,
825 struct dcerpc_winreg_OpenHKPD_state);
829 state->out_mem_ctx = NULL;
832 state->orig.in.system_name = _system_name;
833 state->orig.in.access_mask = _access_mask;
836 state->orig.out.handle = _handle;
839 ZERO_STRUCT(state->orig.out.result);
841 state->out_mem_ctx = talloc_named_const(state, 0,
842 "dcerpc_winreg_OpenHKPD_out_memory");
843 if (tevent_req_nomem(state->out_mem_ctx, req)) {
844 return tevent_req_post(req, ev);
847 /* make a temporary copy, that we pass to the dispatch function */
848 state->tmp = state->orig;
850 subreq = dcerpc_winreg_OpenHKPD_r_send(state, ev, h, &state->tmp);
851 if (tevent_req_nomem(subreq, req)) {
852 return tevent_req_post(req, ev);
854 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPD_done, req);
858 static void dcerpc_winreg_OpenHKPD_done(struct tevent_req *subreq)
860 struct tevent_req *req = tevent_req_callback_data(
861 subreq, struct tevent_req);
862 struct dcerpc_winreg_OpenHKPD_state *state = tevent_req_data(
863 req, struct dcerpc_winreg_OpenHKPD_state);
867 if (state->out_mem_ctx) {
868 mem_ctx = state->out_mem_ctx;
873 status = dcerpc_winreg_OpenHKPD_r_recv(subreq, mem_ctx);
875 if (!NT_STATUS_IS_OK(status)) {
876 tevent_req_nterror(req, status);
880 /* Copy out parameters */
881 *state->orig.out.handle = *state->tmp.out.handle;
884 state->orig.out.result = state->tmp.out.result;
886 /* Reset temporary structure */
887 ZERO_STRUCT(state->tmp);
889 tevent_req_done(req);
892 NTSTATUS dcerpc_winreg_OpenHKPD_recv(struct tevent_req *req,
896 struct dcerpc_winreg_OpenHKPD_state *state = tevent_req_data(
897 req, struct dcerpc_winreg_OpenHKPD_state);
900 if (tevent_req_is_nterror(req, &status)) {
901 tevent_req_received(req);
905 /* Steal possible out parameters to the callers context */
906 talloc_steal(mem_ctx, state->out_mem_ctx);
909 *result = state->orig.out.result;
911 tevent_req_received(req);
915 NTSTATUS dcerpc_winreg_OpenHKPD(struct dcerpc_binding_handle *h,
917 uint16_t *_system_name /* [in] [unique] */,
918 uint32_t _access_mask /* [in] */,
919 struct policy_handle *_handle /* [out] [ref] */,
922 struct winreg_OpenHKPD r;
926 r.in.system_name = _system_name;
927 r.in.access_mask = _access_mask;
929 status = dcerpc_winreg_OpenHKPD_r(h, mem_ctx, &r);
930 if (!NT_STATUS_IS_OK(status)) {
934 /* Return variables */
935 *_handle = *r.out.handle;
938 *result = r.out.result;
943 struct dcerpc_winreg_OpenHKU_r_state {
944 TALLOC_CTX *out_mem_ctx;
947 static void dcerpc_winreg_OpenHKU_r_done(struct tevent_req *subreq);
949 struct tevent_req *dcerpc_winreg_OpenHKU_r_send(TALLOC_CTX *mem_ctx,
950 struct tevent_context *ev,
951 struct dcerpc_binding_handle *h,
952 struct winreg_OpenHKU *r)
954 struct tevent_req *req;
955 struct dcerpc_winreg_OpenHKU_r_state *state;
956 struct tevent_req *subreq;
958 req = tevent_req_create(mem_ctx, &state,
959 struct dcerpc_winreg_OpenHKU_r_state);
964 state->out_mem_ctx = talloc_new(state);
965 if (tevent_req_nomem(state->out_mem_ctx, req)) {
966 return tevent_req_post(req, ev);
969 subreq = dcerpc_binding_handle_call_send(state, ev, h,
970 NULL, &ndr_table_winreg,
971 NDR_WINREG_OPENHKU, state->out_mem_ctx, r);
972 if (tevent_req_nomem(subreq, req)) {
973 return tevent_req_post(req, ev);
975 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKU_r_done, req);
980 static void dcerpc_winreg_OpenHKU_r_done(struct tevent_req *subreq)
982 struct tevent_req *req =
983 tevent_req_callback_data(subreq,
987 status = dcerpc_binding_handle_call_recv(subreq);
988 if (!NT_STATUS_IS_OK(status)) {
989 tevent_req_nterror(req, status);
993 tevent_req_done(req);
996 NTSTATUS dcerpc_winreg_OpenHKU_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
998 struct dcerpc_winreg_OpenHKU_r_state *state =
1000 struct dcerpc_winreg_OpenHKU_r_state);
1003 if (tevent_req_is_nterror(req, &status)) {
1004 tevent_req_received(req);
1008 talloc_steal(mem_ctx, state->out_mem_ctx);
1010 tevent_req_received(req);
1011 return NT_STATUS_OK;
1014 NTSTATUS dcerpc_winreg_OpenHKU_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKU *r)
1018 status = dcerpc_binding_handle_call(h,
1019 NULL, &ndr_table_winreg,
1020 NDR_WINREG_OPENHKU, mem_ctx, r);
1025 NTSTATUS dcerpc_winreg_OpenHKU_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenHKU *r)
1029 status = dcerpc_winreg_OpenHKU_r(p->binding_handle, mem_ctx, r);
1031 if (NT_STATUS_IS_RPC(status)) {
1032 status = NT_STATUS_NET_WRITE_FAULT;
1038 struct dcerpc_winreg_OpenHKU_state {
1039 struct winreg_OpenHKU orig;
1040 struct winreg_OpenHKU tmp;
1041 TALLOC_CTX *out_mem_ctx;
1044 static void dcerpc_winreg_OpenHKU_done(struct tevent_req *subreq);
1046 struct tevent_req *dcerpc_winreg_OpenHKU_send(TALLOC_CTX *mem_ctx,
1047 struct tevent_context *ev,
1048 struct dcerpc_binding_handle *h,
1049 uint16_t *_system_name /* [in] [unique] */,
1050 uint32_t _access_mask /* [in] */,
1051 struct policy_handle *_handle /* [out] [ref] */)
1053 struct tevent_req *req;
1054 struct dcerpc_winreg_OpenHKU_state *state;
1055 struct tevent_req *subreq;
1057 req = tevent_req_create(mem_ctx, &state,
1058 struct dcerpc_winreg_OpenHKU_state);
1062 state->out_mem_ctx = NULL;
1065 state->orig.in.system_name = _system_name;
1066 state->orig.in.access_mask = _access_mask;
1068 /* Out parameters */
1069 state->orig.out.handle = _handle;
1072 ZERO_STRUCT(state->orig.out.result);
1074 state->out_mem_ctx = talloc_named_const(state, 0,
1075 "dcerpc_winreg_OpenHKU_out_memory");
1076 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1077 return tevent_req_post(req, ev);
1080 /* make a temporary copy, that we pass to the dispatch function */
1081 state->tmp = state->orig;
1083 subreq = dcerpc_winreg_OpenHKU_r_send(state, ev, h, &state->tmp);
1084 if (tevent_req_nomem(subreq, req)) {
1085 return tevent_req_post(req, ev);
1087 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKU_done, req);
1091 static void dcerpc_winreg_OpenHKU_done(struct tevent_req *subreq)
1093 struct tevent_req *req = tevent_req_callback_data(
1094 subreq, struct tevent_req);
1095 struct dcerpc_winreg_OpenHKU_state *state = tevent_req_data(
1096 req, struct dcerpc_winreg_OpenHKU_state);
1098 TALLOC_CTX *mem_ctx;
1100 if (state->out_mem_ctx) {
1101 mem_ctx = state->out_mem_ctx;
1106 status = dcerpc_winreg_OpenHKU_r_recv(subreq, mem_ctx);
1107 TALLOC_FREE(subreq);
1108 if (!NT_STATUS_IS_OK(status)) {
1109 tevent_req_nterror(req, status);
1113 /* Copy out parameters */
1114 *state->orig.out.handle = *state->tmp.out.handle;
1117 state->orig.out.result = state->tmp.out.result;
1119 /* Reset temporary structure */
1120 ZERO_STRUCT(state->tmp);
1122 tevent_req_done(req);
1125 NTSTATUS dcerpc_winreg_OpenHKU_recv(struct tevent_req *req,
1126 TALLOC_CTX *mem_ctx,
1129 struct dcerpc_winreg_OpenHKU_state *state = tevent_req_data(
1130 req, struct dcerpc_winreg_OpenHKU_state);
1133 if (tevent_req_is_nterror(req, &status)) {
1134 tevent_req_received(req);
1138 /* Steal possible out parameters to the callers context */
1139 talloc_steal(mem_ctx, state->out_mem_ctx);
1142 *result = state->orig.out.result;
1144 tevent_req_received(req);
1145 return NT_STATUS_OK;
1148 NTSTATUS dcerpc_winreg_OpenHKU(struct dcerpc_binding_handle *h,
1149 TALLOC_CTX *mem_ctx,
1150 uint16_t *_system_name /* [in] [unique] */,
1151 uint32_t _access_mask /* [in] */,
1152 struct policy_handle *_handle /* [out] [ref] */,
1155 struct winreg_OpenHKU r;
1159 r.in.system_name = _system_name;
1160 r.in.access_mask = _access_mask;
1162 status = dcerpc_winreg_OpenHKU_r(h, mem_ctx, &r);
1163 if (!NT_STATUS_IS_OK(status)) {
1167 /* Return variables */
1168 *_handle = *r.out.handle;
1171 *result = r.out.result;
1173 return NT_STATUS_OK;
1176 struct dcerpc_winreg_CloseKey_r_state {
1177 TALLOC_CTX *out_mem_ctx;
1180 static void dcerpc_winreg_CloseKey_r_done(struct tevent_req *subreq);
1182 struct tevent_req *dcerpc_winreg_CloseKey_r_send(TALLOC_CTX *mem_ctx,
1183 struct tevent_context *ev,
1184 struct dcerpc_binding_handle *h,
1185 struct winreg_CloseKey *r)
1187 struct tevent_req *req;
1188 struct dcerpc_winreg_CloseKey_r_state *state;
1189 struct tevent_req *subreq;
1191 req = tevent_req_create(mem_ctx, &state,
1192 struct dcerpc_winreg_CloseKey_r_state);
1197 state->out_mem_ctx = talloc_new(state);
1198 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1199 return tevent_req_post(req, ev);
1202 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1203 NULL, &ndr_table_winreg,
1204 NDR_WINREG_CLOSEKEY, state->out_mem_ctx, r);
1205 if (tevent_req_nomem(subreq, req)) {
1206 return tevent_req_post(req, ev);
1208 tevent_req_set_callback(subreq, dcerpc_winreg_CloseKey_r_done, req);
1213 static void dcerpc_winreg_CloseKey_r_done(struct tevent_req *subreq)
1215 struct tevent_req *req =
1216 tevent_req_callback_data(subreq,
1220 status = dcerpc_binding_handle_call_recv(subreq);
1221 if (!NT_STATUS_IS_OK(status)) {
1222 tevent_req_nterror(req, status);
1226 tevent_req_done(req);
1229 NTSTATUS dcerpc_winreg_CloseKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1231 struct dcerpc_winreg_CloseKey_r_state *state =
1232 tevent_req_data(req,
1233 struct dcerpc_winreg_CloseKey_r_state);
1236 if (tevent_req_is_nterror(req, &status)) {
1237 tevent_req_received(req);
1241 talloc_steal(mem_ctx, state->out_mem_ctx);
1243 tevent_req_received(req);
1244 return NT_STATUS_OK;
1247 NTSTATUS dcerpc_winreg_CloseKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_CloseKey *r)
1251 status = dcerpc_binding_handle_call(h,
1252 NULL, &ndr_table_winreg,
1253 NDR_WINREG_CLOSEKEY, mem_ctx, r);
1258 NTSTATUS dcerpc_winreg_CloseKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_CloseKey *r)
1262 status = dcerpc_winreg_CloseKey_r(p->binding_handle, mem_ctx, r);
1264 if (NT_STATUS_IS_RPC(status)) {
1265 status = NT_STATUS_NET_WRITE_FAULT;
1271 struct dcerpc_winreg_CloseKey_state {
1272 struct winreg_CloseKey orig;
1273 struct winreg_CloseKey tmp;
1274 TALLOC_CTX *out_mem_ctx;
1277 static void dcerpc_winreg_CloseKey_done(struct tevent_req *subreq);
1279 struct tevent_req *dcerpc_winreg_CloseKey_send(TALLOC_CTX *mem_ctx,
1280 struct tevent_context *ev,
1281 struct dcerpc_binding_handle *h,
1282 struct policy_handle *_handle /* [in,out] [ref] */)
1284 struct tevent_req *req;
1285 struct dcerpc_winreg_CloseKey_state *state;
1286 struct tevent_req *subreq;
1288 req = tevent_req_create(mem_ctx, &state,
1289 struct dcerpc_winreg_CloseKey_state);
1293 state->out_mem_ctx = NULL;
1296 state->orig.in.handle = _handle;
1298 /* Out parameters */
1299 state->orig.out.handle = _handle;
1302 ZERO_STRUCT(state->orig.out.result);
1304 state->out_mem_ctx = talloc_named_const(state, 0,
1305 "dcerpc_winreg_CloseKey_out_memory");
1306 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1307 return tevent_req_post(req, ev);
1310 /* make a temporary copy, that we pass to the dispatch function */
1311 state->tmp = state->orig;
1313 subreq = dcerpc_winreg_CloseKey_r_send(state, ev, h, &state->tmp);
1314 if (tevent_req_nomem(subreq, req)) {
1315 return tevent_req_post(req, ev);
1317 tevent_req_set_callback(subreq, dcerpc_winreg_CloseKey_done, req);
1321 static void dcerpc_winreg_CloseKey_done(struct tevent_req *subreq)
1323 struct tevent_req *req = tevent_req_callback_data(
1324 subreq, struct tevent_req);
1325 struct dcerpc_winreg_CloseKey_state *state = tevent_req_data(
1326 req, struct dcerpc_winreg_CloseKey_state);
1328 TALLOC_CTX *mem_ctx;
1330 if (state->out_mem_ctx) {
1331 mem_ctx = state->out_mem_ctx;
1336 status = dcerpc_winreg_CloseKey_r_recv(subreq, mem_ctx);
1337 TALLOC_FREE(subreq);
1338 if (!NT_STATUS_IS_OK(status)) {
1339 tevent_req_nterror(req, status);
1343 /* Copy out parameters */
1344 *state->orig.out.handle = *state->tmp.out.handle;
1347 state->orig.out.result = state->tmp.out.result;
1349 /* Reset temporary structure */
1350 ZERO_STRUCT(state->tmp);
1352 tevent_req_done(req);
1355 NTSTATUS dcerpc_winreg_CloseKey_recv(struct tevent_req *req,
1356 TALLOC_CTX *mem_ctx,
1359 struct dcerpc_winreg_CloseKey_state *state = tevent_req_data(
1360 req, struct dcerpc_winreg_CloseKey_state);
1363 if (tevent_req_is_nterror(req, &status)) {
1364 tevent_req_received(req);
1368 /* Steal possible out parameters to the callers context */
1369 talloc_steal(mem_ctx, state->out_mem_ctx);
1372 *result = state->orig.out.result;
1374 tevent_req_received(req);
1375 return NT_STATUS_OK;
1378 NTSTATUS dcerpc_winreg_CloseKey(struct dcerpc_binding_handle *h,
1379 TALLOC_CTX *mem_ctx,
1380 struct policy_handle *_handle /* [in,out] [ref] */,
1383 struct winreg_CloseKey r;
1387 r.in.handle = _handle;
1389 status = dcerpc_winreg_CloseKey_r(h, mem_ctx, &r);
1390 if (!NT_STATUS_IS_OK(status)) {
1394 /* Return variables */
1395 *_handle = *r.out.handle;
1398 *result = r.out.result;
1400 return NT_STATUS_OK;
1403 struct dcerpc_winreg_CreateKey_r_state {
1404 TALLOC_CTX *out_mem_ctx;
1407 static void dcerpc_winreg_CreateKey_r_done(struct tevent_req *subreq);
1409 struct tevent_req *dcerpc_winreg_CreateKey_r_send(TALLOC_CTX *mem_ctx,
1410 struct tevent_context *ev,
1411 struct dcerpc_binding_handle *h,
1412 struct winreg_CreateKey *r)
1414 struct tevent_req *req;
1415 struct dcerpc_winreg_CreateKey_r_state *state;
1416 struct tevent_req *subreq;
1418 req = tevent_req_create(mem_ctx, &state,
1419 struct dcerpc_winreg_CreateKey_r_state);
1424 state->out_mem_ctx = talloc_new(state);
1425 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1426 return tevent_req_post(req, ev);
1429 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1430 NULL, &ndr_table_winreg,
1431 NDR_WINREG_CREATEKEY, state->out_mem_ctx, r);
1432 if (tevent_req_nomem(subreq, req)) {
1433 return tevent_req_post(req, ev);
1435 tevent_req_set_callback(subreq, dcerpc_winreg_CreateKey_r_done, req);
1440 static void dcerpc_winreg_CreateKey_r_done(struct tevent_req *subreq)
1442 struct tevent_req *req =
1443 tevent_req_callback_data(subreq,
1447 status = dcerpc_binding_handle_call_recv(subreq);
1448 if (!NT_STATUS_IS_OK(status)) {
1449 tevent_req_nterror(req, status);
1453 tevent_req_done(req);
1456 NTSTATUS dcerpc_winreg_CreateKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1458 struct dcerpc_winreg_CreateKey_r_state *state =
1459 tevent_req_data(req,
1460 struct dcerpc_winreg_CreateKey_r_state);
1463 if (tevent_req_is_nterror(req, &status)) {
1464 tevent_req_received(req);
1468 talloc_steal(mem_ctx, state->out_mem_ctx);
1470 tevent_req_received(req);
1471 return NT_STATUS_OK;
1474 NTSTATUS dcerpc_winreg_CreateKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_CreateKey *r)
1478 status = dcerpc_binding_handle_call(h,
1479 NULL, &ndr_table_winreg,
1480 NDR_WINREG_CREATEKEY, mem_ctx, r);
1485 NTSTATUS dcerpc_winreg_CreateKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_CreateKey *r)
1489 status = dcerpc_winreg_CreateKey_r(p->binding_handle, mem_ctx, r);
1491 if (NT_STATUS_IS_RPC(status)) {
1492 status = NT_STATUS_NET_WRITE_FAULT;
1498 struct dcerpc_winreg_CreateKey_state {
1499 struct winreg_CreateKey orig;
1500 struct winreg_CreateKey tmp;
1501 TALLOC_CTX *out_mem_ctx;
1504 static void dcerpc_winreg_CreateKey_done(struct tevent_req *subreq);
1506 struct tevent_req *dcerpc_winreg_CreateKey_send(TALLOC_CTX *mem_ctx,
1507 struct tevent_context *ev,
1508 struct dcerpc_binding_handle *h,
1509 struct policy_handle *_handle /* [in] [ref] */,
1510 struct winreg_String _name /* [in] */,
1511 struct winreg_String _keyclass /* [in] */,
1512 uint32_t _options /* [in] */,
1513 uint32_t _access_mask /* [in] */,
1514 struct winreg_SecBuf *_secdesc /* [in] [unique] */,
1515 struct policy_handle *_new_handle /* [out] [ref] */,
1516 enum winreg_CreateAction *_action_taken /* [in,out] [unique] */)
1518 struct tevent_req *req;
1519 struct dcerpc_winreg_CreateKey_state *state;
1520 struct tevent_req *subreq;
1522 req = tevent_req_create(mem_ctx, &state,
1523 struct dcerpc_winreg_CreateKey_state);
1527 state->out_mem_ctx = NULL;
1530 state->orig.in.handle = _handle;
1531 state->orig.in.name = _name;
1532 state->orig.in.keyclass = _keyclass;
1533 state->orig.in.options = _options;
1534 state->orig.in.access_mask = _access_mask;
1535 state->orig.in.secdesc = _secdesc;
1536 state->orig.in.action_taken = _action_taken;
1538 /* Out parameters */
1539 state->orig.out.new_handle = _new_handle;
1540 state->orig.out.action_taken = _action_taken;
1543 ZERO_STRUCT(state->orig.out.result);
1545 state->out_mem_ctx = talloc_named_const(state, 0,
1546 "dcerpc_winreg_CreateKey_out_memory");
1547 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1548 return tevent_req_post(req, ev);
1551 /* make a temporary copy, that we pass to the dispatch function */
1552 state->tmp = state->orig;
1554 subreq = dcerpc_winreg_CreateKey_r_send(state, ev, h, &state->tmp);
1555 if (tevent_req_nomem(subreq, req)) {
1556 return tevent_req_post(req, ev);
1558 tevent_req_set_callback(subreq, dcerpc_winreg_CreateKey_done, req);
1562 static void dcerpc_winreg_CreateKey_done(struct tevent_req *subreq)
1564 struct tevent_req *req = tevent_req_callback_data(
1565 subreq, struct tevent_req);
1566 struct dcerpc_winreg_CreateKey_state *state = tevent_req_data(
1567 req, struct dcerpc_winreg_CreateKey_state);
1569 TALLOC_CTX *mem_ctx;
1571 if (state->out_mem_ctx) {
1572 mem_ctx = state->out_mem_ctx;
1577 status = dcerpc_winreg_CreateKey_r_recv(subreq, mem_ctx);
1578 TALLOC_FREE(subreq);
1579 if (!NT_STATUS_IS_OK(status)) {
1580 tevent_req_nterror(req, status);
1584 /* Copy out parameters */
1585 *state->orig.out.new_handle = *state->tmp.out.new_handle;
1586 if (state->orig.out.action_taken && state->tmp.out.action_taken) {
1587 *state->orig.out.action_taken = *state->tmp.out.action_taken;
1591 state->orig.out.result = state->tmp.out.result;
1593 /* Reset temporary structure */
1594 ZERO_STRUCT(state->tmp);
1596 tevent_req_done(req);
1599 NTSTATUS dcerpc_winreg_CreateKey_recv(struct tevent_req *req,
1600 TALLOC_CTX *mem_ctx,
1603 struct dcerpc_winreg_CreateKey_state *state = tevent_req_data(
1604 req, struct dcerpc_winreg_CreateKey_state);
1607 if (tevent_req_is_nterror(req, &status)) {
1608 tevent_req_received(req);
1612 /* Steal possible out parameters to the callers context */
1613 talloc_steal(mem_ctx, state->out_mem_ctx);
1616 *result = state->orig.out.result;
1618 tevent_req_received(req);
1619 return NT_STATUS_OK;
1622 NTSTATUS dcerpc_winreg_CreateKey(struct dcerpc_binding_handle *h,
1623 TALLOC_CTX *mem_ctx,
1624 struct policy_handle *_handle /* [in] [ref] */,
1625 struct winreg_String _name /* [in] */,
1626 struct winreg_String _keyclass /* [in] */,
1627 uint32_t _options /* [in] */,
1628 uint32_t _access_mask /* [in] */,
1629 struct winreg_SecBuf *_secdesc /* [in] [unique] */,
1630 struct policy_handle *_new_handle /* [out] [ref] */,
1631 enum winreg_CreateAction *_action_taken /* [in,out] [unique] */,
1634 struct winreg_CreateKey r;
1638 r.in.handle = _handle;
1640 r.in.keyclass = _keyclass;
1641 r.in.options = _options;
1642 r.in.access_mask = _access_mask;
1643 r.in.secdesc = _secdesc;
1644 r.in.action_taken = _action_taken;
1646 status = dcerpc_winreg_CreateKey_r(h, mem_ctx, &r);
1647 if (!NT_STATUS_IS_OK(status)) {
1651 /* Return variables */
1652 *_new_handle = *r.out.new_handle;
1653 if (_action_taken && r.out.action_taken) {
1654 *_action_taken = *r.out.action_taken;
1658 *result = r.out.result;
1660 return NT_STATUS_OK;
1663 struct dcerpc_winreg_DeleteKey_r_state {
1664 TALLOC_CTX *out_mem_ctx;
1667 static void dcerpc_winreg_DeleteKey_r_done(struct tevent_req *subreq);
1669 struct tevent_req *dcerpc_winreg_DeleteKey_r_send(TALLOC_CTX *mem_ctx,
1670 struct tevent_context *ev,
1671 struct dcerpc_binding_handle *h,
1672 struct winreg_DeleteKey *r)
1674 struct tevent_req *req;
1675 struct dcerpc_winreg_DeleteKey_r_state *state;
1676 struct tevent_req *subreq;
1678 req = tevent_req_create(mem_ctx, &state,
1679 struct dcerpc_winreg_DeleteKey_r_state);
1684 state->out_mem_ctx = NULL;
1685 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1686 NULL, &ndr_table_winreg,
1687 NDR_WINREG_DELETEKEY, state, r);
1688 if (tevent_req_nomem(subreq, req)) {
1689 return tevent_req_post(req, ev);
1691 tevent_req_set_callback(subreq, dcerpc_winreg_DeleteKey_r_done, req);
1696 static void dcerpc_winreg_DeleteKey_r_done(struct tevent_req *subreq)
1698 struct tevent_req *req =
1699 tevent_req_callback_data(subreq,
1703 status = dcerpc_binding_handle_call_recv(subreq);
1704 if (!NT_STATUS_IS_OK(status)) {
1705 tevent_req_nterror(req, status);
1709 tevent_req_done(req);
1712 NTSTATUS dcerpc_winreg_DeleteKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1714 struct dcerpc_winreg_DeleteKey_r_state *state =
1715 tevent_req_data(req,
1716 struct dcerpc_winreg_DeleteKey_r_state);
1719 if (tevent_req_is_nterror(req, &status)) {
1720 tevent_req_received(req);
1724 talloc_steal(mem_ctx, state->out_mem_ctx);
1726 tevent_req_received(req);
1727 return NT_STATUS_OK;
1730 NTSTATUS dcerpc_winreg_DeleteKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_DeleteKey *r)
1734 status = dcerpc_binding_handle_call(h,
1735 NULL, &ndr_table_winreg,
1736 NDR_WINREG_DELETEKEY, mem_ctx, r);
1741 NTSTATUS dcerpc_winreg_DeleteKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_DeleteKey *r)
1745 status = dcerpc_winreg_DeleteKey_r(p->binding_handle, mem_ctx, r);
1747 if (NT_STATUS_IS_RPC(status)) {
1748 status = NT_STATUS_NET_WRITE_FAULT;
1754 struct dcerpc_winreg_DeleteKey_state {
1755 struct winreg_DeleteKey orig;
1756 struct winreg_DeleteKey tmp;
1757 TALLOC_CTX *out_mem_ctx;
1760 static void dcerpc_winreg_DeleteKey_done(struct tevent_req *subreq);
1762 struct tevent_req *dcerpc_winreg_DeleteKey_send(TALLOC_CTX *mem_ctx,
1763 struct tevent_context *ev,
1764 struct dcerpc_binding_handle *h,
1765 struct policy_handle *_handle /* [in] [ref] */,
1766 struct winreg_String _key /* [in] */)
1768 struct tevent_req *req;
1769 struct dcerpc_winreg_DeleteKey_state *state;
1770 struct tevent_req *subreq;
1772 req = tevent_req_create(mem_ctx, &state,
1773 struct dcerpc_winreg_DeleteKey_state);
1777 state->out_mem_ctx = NULL;
1780 state->orig.in.handle = _handle;
1781 state->orig.in.key = _key;
1783 /* Out parameters */
1786 ZERO_STRUCT(state->orig.out.result);
1788 /* make a temporary copy, that we pass to the dispatch function */
1789 state->tmp = state->orig;
1791 subreq = dcerpc_winreg_DeleteKey_r_send(state, ev, h, &state->tmp);
1792 if (tevent_req_nomem(subreq, req)) {
1793 return tevent_req_post(req, ev);
1795 tevent_req_set_callback(subreq, dcerpc_winreg_DeleteKey_done, req);
1799 static void dcerpc_winreg_DeleteKey_done(struct tevent_req *subreq)
1801 struct tevent_req *req = tevent_req_callback_data(
1802 subreq, struct tevent_req);
1803 struct dcerpc_winreg_DeleteKey_state *state = tevent_req_data(
1804 req, struct dcerpc_winreg_DeleteKey_state);
1806 TALLOC_CTX *mem_ctx;
1808 if (state->out_mem_ctx) {
1809 mem_ctx = state->out_mem_ctx;
1814 status = dcerpc_winreg_DeleteKey_r_recv(subreq, mem_ctx);
1815 TALLOC_FREE(subreq);
1816 if (!NT_STATUS_IS_OK(status)) {
1817 tevent_req_nterror(req, status);
1821 /* Copy out parameters */
1824 state->orig.out.result = state->tmp.out.result;
1826 /* Reset temporary structure */
1827 ZERO_STRUCT(state->tmp);
1829 tevent_req_done(req);
1832 NTSTATUS dcerpc_winreg_DeleteKey_recv(struct tevent_req *req,
1833 TALLOC_CTX *mem_ctx,
1836 struct dcerpc_winreg_DeleteKey_state *state = tevent_req_data(
1837 req, struct dcerpc_winreg_DeleteKey_state);
1840 if (tevent_req_is_nterror(req, &status)) {
1841 tevent_req_received(req);
1845 /* Steal possible out parameters to the callers context */
1846 talloc_steal(mem_ctx, state->out_mem_ctx);
1849 *result = state->orig.out.result;
1851 tevent_req_received(req);
1852 return NT_STATUS_OK;
1855 NTSTATUS dcerpc_winreg_DeleteKey(struct dcerpc_binding_handle *h,
1856 TALLOC_CTX *mem_ctx,
1857 struct policy_handle *_handle /* [in] [ref] */,
1858 struct winreg_String _key /* [in] */,
1861 struct winreg_DeleteKey r;
1865 r.in.handle = _handle;
1868 status = dcerpc_winreg_DeleteKey_r(h, mem_ctx, &r);
1869 if (!NT_STATUS_IS_OK(status)) {
1873 /* Return variables */
1876 *result = r.out.result;
1878 return NT_STATUS_OK;
1881 struct dcerpc_winreg_DeleteValue_r_state {
1882 TALLOC_CTX *out_mem_ctx;
1885 static void dcerpc_winreg_DeleteValue_r_done(struct tevent_req *subreq);
1887 struct tevent_req *dcerpc_winreg_DeleteValue_r_send(TALLOC_CTX *mem_ctx,
1888 struct tevent_context *ev,
1889 struct dcerpc_binding_handle *h,
1890 struct winreg_DeleteValue *r)
1892 struct tevent_req *req;
1893 struct dcerpc_winreg_DeleteValue_r_state *state;
1894 struct tevent_req *subreq;
1896 req = tevent_req_create(mem_ctx, &state,
1897 struct dcerpc_winreg_DeleteValue_r_state);
1902 state->out_mem_ctx = NULL;
1903 subreq = dcerpc_binding_handle_call_send(state, ev, h,
1904 NULL, &ndr_table_winreg,
1905 NDR_WINREG_DELETEVALUE, state, r);
1906 if (tevent_req_nomem(subreq, req)) {
1907 return tevent_req_post(req, ev);
1909 tevent_req_set_callback(subreq, dcerpc_winreg_DeleteValue_r_done, req);
1914 static void dcerpc_winreg_DeleteValue_r_done(struct tevent_req *subreq)
1916 struct tevent_req *req =
1917 tevent_req_callback_data(subreq,
1921 status = dcerpc_binding_handle_call_recv(subreq);
1922 if (!NT_STATUS_IS_OK(status)) {
1923 tevent_req_nterror(req, status);
1927 tevent_req_done(req);
1930 NTSTATUS dcerpc_winreg_DeleteValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1932 struct dcerpc_winreg_DeleteValue_r_state *state =
1933 tevent_req_data(req,
1934 struct dcerpc_winreg_DeleteValue_r_state);
1937 if (tevent_req_is_nterror(req, &status)) {
1938 tevent_req_received(req);
1942 talloc_steal(mem_ctx, state->out_mem_ctx);
1944 tevent_req_received(req);
1945 return NT_STATUS_OK;
1948 NTSTATUS dcerpc_winreg_DeleteValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_DeleteValue *r)
1952 status = dcerpc_binding_handle_call(h,
1953 NULL, &ndr_table_winreg,
1954 NDR_WINREG_DELETEVALUE, mem_ctx, r);
1959 NTSTATUS dcerpc_winreg_DeleteValue_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_DeleteValue *r)
1963 status = dcerpc_winreg_DeleteValue_r(p->binding_handle, mem_ctx, r);
1965 if (NT_STATUS_IS_RPC(status)) {
1966 status = NT_STATUS_NET_WRITE_FAULT;
1972 struct dcerpc_winreg_DeleteValue_state {
1973 struct winreg_DeleteValue orig;
1974 struct winreg_DeleteValue tmp;
1975 TALLOC_CTX *out_mem_ctx;
1978 static void dcerpc_winreg_DeleteValue_done(struct tevent_req *subreq);
1980 struct tevent_req *dcerpc_winreg_DeleteValue_send(TALLOC_CTX *mem_ctx,
1981 struct tevent_context *ev,
1982 struct dcerpc_binding_handle *h,
1983 struct policy_handle *_handle /* [in] [ref] */,
1984 struct winreg_String _value /* [in] */)
1986 struct tevent_req *req;
1987 struct dcerpc_winreg_DeleteValue_state *state;
1988 struct tevent_req *subreq;
1990 req = tevent_req_create(mem_ctx, &state,
1991 struct dcerpc_winreg_DeleteValue_state);
1995 state->out_mem_ctx = NULL;
1998 state->orig.in.handle = _handle;
1999 state->orig.in.value = _value;
2001 /* Out parameters */
2004 ZERO_STRUCT(state->orig.out.result);
2006 /* make a temporary copy, that we pass to the dispatch function */
2007 state->tmp = state->orig;
2009 subreq = dcerpc_winreg_DeleteValue_r_send(state, ev, h, &state->tmp);
2010 if (tevent_req_nomem(subreq, req)) {
2011 return tevent_req_post(req, ev);
2013 tevent_req_set_callback(subreq, dcerpc_winreg_DeleteValue_done, req);
2017 static void dcerpc_winreg_DeleteValue_done(struct tevent_req *subreq)
2019 struct tevent_req *req = tevent_req_callback_data(
2020 subreq, struct tevent_req);
2021 struct dcerpc_winreg_DeleteValue_state *state = tevent_req_data(
2022 req, struct dcerpc_winreg_DeleteValue_state);
2024 TALLOC_CTX *mem_ctx;
2026 if (state->out_mem_ctx) {
2027 mem_ctx = state->out_mem_ctx;
2032 status = dcerpc_winreg_DeleteValue_r_recv(subreq, mem_ctx);
2033 TALLOC_FREE(subreq);
2034 if (!NT_STATUS_IS_OK(status)) {
2035 tevent_req_nterror(req, status);
2039 /* Copy out parameters */
2042 state->orig.out.result = state->tmp.out.result;
2044 /* Reset temporary structure */
2045 ZERO_STRUCT(state->tmp);
2047 tevent_req_done(req);
2050 NTSTATUS dcerpc_winreg_DeleteValue_recv(struct tevent_req *req,
2051 TALLOC_CTX *mem_ctx,
2054 struct dcerpc_winreg_DeleteValue_state *state = tevent_req_data(
2055 req, struct dcerpc_winreg_DeleteValue_state);
2058 if (tevent_req_is_nterror(req, &status)) {
2059 tevent_req_received(req);
2063 /* Steal possible out parameters to the callers context */
2064 talloc_steal(mem_ctx, state->out_mem_ctx);
2067 *result = state->orig.out.result;
2069 tevent_req_received(req);
2070 return NT_STATUS_OK;
2073 NTSTATUS dcerpc_winreg_DeleteValue(struct dcerpc_binding_handle *h,
2074 TALLOC_CTX *mem_ctx,
2075 struct policy_handle *_handle /* [in] [ref] */,
2076 struct winreg_String _value /* [in] */,
2079 struct winreg_DeleteValue r;
2083 r.in.handle = _handle;
2084 r.in.value = _value;
2086 status = dcerpc_winreg_DeleteValue_r(h, mem_ctx, &r);
2087 if (!NT_STATUS_IS_OK(status)) {
2091 /* Return variables */
2094 *result = r.out.result;
2096 return NT_STATUS_OK;
2099 struct dcerpc_winreg_EnumKey_r_state {
2100 TALLOC_CTX *out_mem_ctx;
2103 static void dcerpc_winreg_EnumKey_r_done(struct tevent_req *subreq);
2105 struct tevent_req *dcerpc_winreg_EnumKey_r_send(TALLOC_CTX *mem_ctx,
2106 struct tevent_context *ev,
2107 struct dcerpc_binding_handle *h,
2108 struct winreg_EnumKey *r)
2110 struct tevent_req *req;
2111 struct dcerpc_winreg_EnumKey_r_state *state;
2112 struct tevent_req *subreq;
2114 req = tevent_req_create(mem_ctx, &state,
2115 struct dcerpc_winreg_EnumKey_r_state);
2120 state->out_mem_ctx = talloc_new(state);
2121 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2122 return tevent_req_post(req, ev);
2125 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2126 NULL, &ndr_table_winreg,
2127 NDR_WINREG_ENUMKEY, state->out_mem_ctx, r);
2128 if (tevent_req_nomem(subreq, req)) {
2129 return tevent_req_post(req, ev);
2131 tevent_req_set_callback(subreq, dcerpc_winreg_EnumKey_r_done, req);
2136 static void dcerpc_winreg_EnumKey_r_done(struct tevent_req *subreq)
2138 struct tevent_req *req =
2139 tevent_req_callback_data(subreq,
2143 status = dcerpc_binding_handle_call_recv(subreq);
2144 if (!NT_STATUS_IS_OK(status)) {
2145 tevent_req_nterror(req, status);
2149 tevent_req_done(req);
2152 NTSTATUS dcerpc_winreg_EnumKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2154 struct dcerpc_winreg_EnumKey_r_state *state =
2155 tevent_req_data(req,
2156 struct dcerpc_winreg_EnumKey_r_state);
2159 if (tevent_req_is_nterror(req, &status)) {
2160 tevent_req_received(req);
2164 talloc_steal(mem_ctx, state->out_mem_ctx);
2166 tevent_req_received(req);
2167 return NT_STATUS_OK;
2170 NTSTATUS dcerpc_winreg_EnumKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_EnumKey *r)
2174 status = dcerpc_binding_handle_call(h,
2175 NULL, &ndr_table_winreg,
2176 NDR_WINREG_ENUMKEY, mem_ctx, r);
2181 NTSTATUS dcerpc_winreg_EnumKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_EnumKey *r)
2185 status = dcerpc_winreg_EnumKey_r(p->binding_handle, mem_ctx, r);
2187 if (NT_STATUS_IS_RPC(status)) {
2188 status = NT_STATUS_NET_WRITE_FAULT;
2194 struct dcerpc_winreg_EnumKey_state {
2195 struct winreg_EnumKey orig;
2196 struct winreg_EnumKey tmp;
2197 TALLOC_CTX *out_mem_ctx;
2200 static void dcerpc_winreg_EnumKey_done(struct tevent_req *subreq);
2202 struct tevent_req *dcerpc_winreg_EnumKey_send(TALLOC_CTX *mem_ctx,
2203 struct tevent_context *ev,
2204 struct dcerpc_binding_handle *h,
2205 struct policy_handle *_handle /* [in] [ref] */,
2206 uint32_t _enum_index /* [in] */,
2207 struct winreg_StringBuf *_name /* [in,out] [ref] */,
2208 struct winreg_StringBuf *_keyclass /* [in,out] [unique] */,
2209 NTTIME *_last_changed_time /* [in,out] [unique] */)
2211 struct tevent_req *req;
2212 struct dcerpc_winreg_EnumKey_state *state;
2213 struct tevent_req *subreq;
2215 req = tevent_req_create(mem_ctx, &state,
2216 struct dcerpc_winreg_EnumKey_state);
2220 state->out_mem_ctx = NULL;
2223 state->orig.in.handle = _handle;
2224 state->orig.in.enum_index = _enum_index;
2225 state->orig.in.name = _name;
2226 state->orig.in.keyclass = _keyclass;
2227 state->orig.in.last_changed_time = _last_changed_time;
2229 /* Out parameters */
2230 state->orig.out.name = _name;
2231 state->orig.out.keyclass = _keyclass;
2232 state->orig.out.last_changed_time = _last_changed_time;
2235 ZERO_STRUCT(state->orig.out.result);
2237 state->out_mem_ctx = talloc_named_const(state, 0,
2238 "dcerpc_winreg_EnumKey_out_memory");
2239 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2240 return tevent_req_post(req, ev);
2243 /* make a temporary copy, that we pass to the dispatch function */
2244 state->tmp = state->orig;
2246 subreq = dcerpc_winreg_EnumKey_r_send(state, ev, h, &state->tmp);
2247 if (tevent_req_nomem(subreq, req)) {
2248 return tevent_req_post(req, ev);
2250 tevent_req_set_callback(subreq, dcerpc_winreg_EnumKey_done, req);
2254 static void dcerpc_winreg_EnumKey_done(struct tevent_req *subreq)
2256 struct tevent_req *req = tevent_req_callback_data(
2257 subreq, struct tevent_req);
2258 struct dcerpc_winreg_EnumKey_state *state = tevent_req_data(
2259 req, struct dcerpc_winreg_EnumKey_state);
2261 TALLOC_CTX *mem_ctx;
2263 if (state->out_mem_ctx) {
2264 mem_ctx = state->out_mem_ctx;
2269 status = dcerpc_winreg_EnumKey_r_recv(subreq, mem_ctx);
2270 TALLOC_FREE(subreq);
2271 if (!NT_STATUS_IS_OK(status)) {
2272 tevent_req_nterror(req, status);
2276 /* Copy out parameters */
2277 *state->orig.out.name = *state->tmp.out.name;
2278 if (state->orig.out.keyclass && state->tmp.out.keyclass) {
2279 *state->orig.out.keyclass = *state->tmp.out.keyclass;
2281 if (state->orig.out.last_changed_time && state->tmp.out.last_changed_time) {
2282 *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
2286 state->orig.out.result = state->tmp.out.result;
2288 /* Reset temporary structure */
2289 ZERO_STRUCT(state->tmp);
2291 tevent_req_done(req);
2294 NTSTATUS dcerpc_winreg_EnumKey_recv(struct tevent_req *req,
2295 TALLOC_CTX *mem_ctx,
2298 struct dcerpc_winreg_EnumKey_state *state = tevent_req_data(
2299 req, struct dcerpc_winreg_EnumKey_state);
2302 if (tevent_req_is_nterror(req, &status)) {
2303 tevent_req_received(req);
2307 /* Steal possible out parameters to the callers context */
2308 talloc_steal(mem_ctx, state->out_mem_ctx);
2311 *result = state->orig.out.result;
2313 tevent_req_received(req);
2314 return NT_STATUS_OK;
2317 NTSTATUS dcerpc_winreg_EnumKey(struct dcerpc_binding_handle *h,
2318 TALLOC_CTX *mem_ctx,
2319 struct policy_handle *_handle /* [in] [ref] */,
2320 uint32_t _enum_index /* [in] */,
2321 struct winreg_StringBuf *_name /* [in,out] [ref] */,
2322 struct winreg_StringBuf *_keyclass /* [in,out] [unique] */,
2323 NTTIME *_last_changed_time /* [in,out] [unique] */,
2326 struct winreg_EnumKey r;
2330 r.in.handle = _handle;
2331 r.in.enum_index = _enum_index;
2333 r.in.keyclass = _keyclass;
2334 r.in.last_changed_time = _last_changed_time;
2336 status = dcerpc_winreg_EnumKey_r(h, mem_ctx, &r);
2337 if (!NT_STATUS_IS_OK(status)) {
2341 /* Return variables */
2342 *_name = *r.out.name;
2343 if (_keyclass && r.out.keyclass) {
2344 *_keyclass = *r.out.keyclass;
2346 if (_last_changed_time && r.out.last_changed_time) {
2347 *_last_changed_time = *r.out.last_changed_time;
2351 *result = r.out.result;
2353 return NT_STATUS_OK;
2356 struct dcerpc_winreg_EnumValue_r_state {
2357 TALLOC_CTX *out_mem_ctx;
2360 static void dcerpc_winreg_EnumValue_r_done(struct tevent_req *subreq);
2362 struct tevent_req *dcerpc_winreg_EnumValue_r_send(TALLOC_CTX *mem_ctx,
2363 struct tevent_context *ev,
2364 struct dcerpc_binding_handle *h,
2365 struct winreg_EnumValue *r)
2367 struct tevent_req *req;
2368 struct dcerpc_winreg_EnumValue_r_state *state;
2369 struct tevent_req *subreq;
2371 req = tevent_req_create(mem_ctx, &state,
2372 struct dcerpc_winreg_EnumValue_r_state);
2377 state->out_mem_ctx = talloc_new(state);
2378 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2379 return tevent_req_post(req, ev);
2382 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2383 NULL, &ndr_table_winreg,
2384 NDR_WINREG_ENUMVALUE, state->out_mem_ctx, r);
2385 if (tevent_req_nomem(subreq, req)) {
2386 return tevent_req_post(req, ev);
2388 tevent_req_set_callback(subreq, dcerpc_winreg_EnumValue_r_done, req);
2393 static void dcerpc_winreg_EnumValue_r_done(struct tevent_req *subreq)
2395 struct tevent_req *req =
2396 tevent_req_callback_data(subreq,
2400 status = dcerpc_binding_handle_call_recv(subreq);
2401 if (!NT_STATUS_IS_OK(status)) {
2402 tevent_req_nterror(req, status);
2406 tevent_req_done(req);
2409 NTSTATUS dcerpc_winreg_EnumValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2411 struct dcerpc_winreg_EnumValue_r_state *state =
2412 tevent_req_data(req,
2413 struct dcerpc_winreg_EnumValue_r_state);
2416 if (tevent_req_is_nterror(req, &status)) {
2417 tevent_req_received(req);
2421 talloc_steal(mem_ctx, state->out_mem_ctx);
2423 tevent_req_received(req);
2424 return NT_STATUS_OK;
2427 NTSTATUS dcerpc_winreg_EnumValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_EnumValue *r)
2431 status = dcerpc_binding_handle_call(h,
2432 NULL, &ndr_table_winreg,
2433 NDR_WINREG_ENUMVALUE, mem_ctx, r);
2438 NTSTATUS dcerpc_winreg_EnumValue_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_EnumValue *r)
2442 status = dcerpc_winreg_EnumValue_r(p->binding_handle, mem_ctx, r);
2444 if (NT_STATUS_IS_RPC(status)) {
2445 status = NT_STATUS_NET_WRITE_FAULT;
2451 struct dcerpc_winreg_EnumValue_state {
2452 struct winreg_EnumValue orig;
2453 struct winreg_EnumValue tmp;
2454 TALLOC_CTX *out_mem_ctx;
2457 static void dcerpc_winreg_EnumValue_done(struct tevent_req *subreq);
2459 struct tevent_req *dcerpc_winreg_EnumValue_send(TALLOC_CTX *mem_ctx,
2460 struct tevent_context *ev,
2461 struct dcerpc_binding_handle *h,
2462 struct policy_handle *_handle /* [in] [ref] */,
2463 uint32_t _enum_index /* [in] */,
2464 struct winreg_ValNameBuf *_name /* [in,out] [ref] */,
2465 enum winreg_Type *_type /* [in,out] [unique] */,
2466 uint8_t *_value /* [in,out] [unique,range(0,0x4000000),length_is(length?*length:0),size_is(size?*size:0)] */,
2467 uint32_t *_size /* [in,out] [unique] */,
2468 uint32_t *_length /* [in,out] [unique] */)
2470 struct tevent_req *req;
2471 struct dcerpc_winreg_EnumValue_state *state;
2472 struct tevent_req *subreq;
2474 req = tevent_req_create(mem_ctx, &state,
2475 struct dcerpc_winreg_EnumValue_state);
2479 state->out_mem_ctx = NULL;
2482 state->orig.in.handle = _handle;
2483 state->orig.in.enum_index = _enum_index;
2484 state->orig.in.name = _name;
2485 state->orig.in.type = _type;
2486 state->orig.in.value = _value;
2487 state->orig.in.size = _size;
2488 state->orig.in.length = _length;
2490 /* Out parameters */
2491 state->orig.out.name = _name;
2492 state->orig.out.type = _type;
2493 state->orig.out.value = _value;
2494 state->orig.out.size = _size;
2495 state->orig.out.length = _length;
2498 ZERO_STRUCT(state->orig.out.result);
2500 state->out_mem_ctx = talloc_named_const(state, 0,
2501 "dcerpc_winreg_EnumValue_out_memory");
2502 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2503 return tevent_req_post(req, ev);
2506 /* make a temporary copy, that we pass to the dispatch function */
2507 state->tmp = state->orig;
2509 subreq = dcerpc_winreg_EnumValue_r_send(state, ev, h, &state->tmp);
2510 if (tevent_req_nomem(subreq, req)) {
2511 return tevent_req_post(req, ev);
2513 tevent_req_set_callback(subreq, dcerpc_winreg_EnumValue_done, req);
2517 static void dcerpc_winreg_EnumValue_done(struct tevent_req *subreq)
2519 struct tevent_req *req = tevent_req_callback_data(
2520 subreq, struct tevent_req);
2521 struct dcerpc_winreg_EnumValue_state *state = tevent_req_data(
2522 req, struct dcerpc_winreg_EnumValue_state);
2524 TALLOC_CTX *mem_ctx;
2526 if (state->out_mem_ctx) {
2527 mem_ctx = state->out_mem_ctx;
2532 status = dcerpc_winreg_EnumValue_r_recv(subreq, mem_ctx);
2533 TALLOC_FREE(subreq);
2534 if (!NT_STATUS_IS_OK(status)) {
2535 tevent_req_nterror(req, status);
2539 /* Copy out parameters */
2540 *state->orig.out.name = *state->tmp.out.name;
2541 if (state->orig.out.type && state->tmp.out.type) {
2542 *state->orig.out.type = *state->tmp.out.type;
2544 if (state->orig.out.value && state->tmp.out.value) {
2546 size_t _copy_len_value;
2547 if ((state->tmp.out.size?*state->tmp.out.size:0) > (state->tmp.in.size?*state->tmp.in.size:0)) {
2548 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
2551 if ((state->tmp.out.length?*state->tmp.out.length:0) > (state->tmp.out.size?*state->tmp.out.size:0)) {
2552 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
2555 _copy_len_value = state->tmp.out.length?*state->tmp.out.length:0;
2556 memcpy(state->orig.out.value, state->tmp.out.value, _copy_len_value * sizeof(*state->orig.out.value));
2559 if (state->orig.out.size && state->tmp.out.size) {
2560 *state->orig.out.size = *state->tmp.out.size;
2562 if (state->orig.out.length && state->tmp.out.length) {
2563 *state->orig.out.length = *state->tmp.out.length;
2567 state->orig.out.result = state->tmp.out.result;
2569 /* Reset temporary structure */
2570 ZERO_STRUCT(state->tmp);
2572 tevent_req_done(req);
2575 NTSTATUS dcerpc_winreg_EnumValue_recv(struct tevent_req *req,
2576 TALLOC_CTX *mem_ctx,
2579 struct dcerpc_winreg_EnumValue_state *state = tevent_req_data(
2580 req, struct dcerpc_winreg_EnumValue_state);
2583 if (tevent_req_is_nterror(req, &status)) {
2584 tevent_req_received(req);
2588 /* Steal possible out parameters to the callers context */
2589 talloc_steal(mem_ctx, state->out_mem_ctx);
2592 *result = state->orig.out.result;
2594 tevent_req_received(req);
2595 return NT_STATUS_OK;
2598 NTSTATUS dcerpc_winreg_EnumValue(struct dcerpc_binding_handle *h,
2599 TALLOC_CTX *mem_ctx,
2600 struct policy_handle *_handle /* [in] [ref] */,
2601 uint32_t _enum_index /* [in] */,
2602 struct winreg_ValNameBuf *_name /* [in,out] [ref] */,
2603 enum winreg_Type *_type /* [in,out] [unique] */,
2604 uint8_t *_value /* [in,out] [unique,range(0,0x4000000),length_is(length?*length:0),size_is(size?*size:0)] */,
2605 uint32_t *_size /* [in,out] [unique] */,
2606 uint32_t *_length /* [in,out] [unique] */,
2609 struct winreg_EnumValue r;
2613 r.in.handle = _handle;
2614 r.in.enum_index = _enum_index;
2617 r.in.value = _value;
2619 r.in.length = _length;
2621 status = dcerpc_winreg_EnumValue_r(h, mem_ctx, &r);
2622 if (!NT_STATUS_IS_OK(status)) {
2626 /* Return variables */
2627 *_name = *r.out.name;
2628 if (_type && r.out.type) {
2629 *_type = *r.out.type;
2631 if (_value && r.out.value) {
2633 size_t _copy_len_value;
2634 if ((r.out.size?*r.out.size:0) > (r.in.size?*r.in.size:0)) {
2635 return NT_STATUS_INVALID_NETWORK_RESPONSE;
2637 if ((r.out.length?*r.out.length:0) > (r.out.size?*r.out.size:0)) {
2638 return NT_STATUS_INVALID_NETWORK_RESPONSE;
2640 _copy_len_value = r.out.length?*r.out.length:0;
2641 memcpy(_value, r.out.value, _copy_len_value * sizeof(*_value));
2644 if (_size && r.out.size) {
2645 *_size = *r.out.size;
2647 if (_length && r.out.length) {
2648 *_length = *r.out.length;
2652 *result = r.out.result;
2654 return NT_STATUS_OK;
2657 struct dcerpc_winreg_FlushKey_r_state {
2658 TALLOC_CTX *out_mem_ctx;
2661 static void dcerpc_winreg_FlushKey_r_done(struct tevent_req *subreq);
2663 struct tevent_req *dcerpc_winreg_FlushKey_r_send(TALLOC_CTX *mem_ctx,
2664 struct tevent_context *ev,
2665 struct dcerpc_binding_handle *h,
2666 struct winreg_FlushKey *r)
2668 struct tevent_req *req;
2669 struct dcerpc_winreg_FlushKey_r_state *state;
2670 struct tevent_req *subreq;
2672 req = tevent_req_create(mem_ctx, &state,
2673 struct dcerpc_winreg_FlushKey_r_state);
2678 state->out_mem_ctx = NULL;
2679 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2680 NULL, &ndr_table_winreg,
2681 NDR_WINREG_FLUSHKEY, state, r);
2682 if (tevent_req_nomem(subreq, req)) {
2683 return tevent_req_post(req, ev);
2685 tevent_req_set_callback(subreq, dcerpc_winreg_FlushKey_r_done, req);
2690 static void dcerpc_winreg_FlushKey_r_done(struct tevent_req *subreq)
2692 struct tevent_req *req =
2693 tevent_req_callback_data(subreq,
2697 status = dcerpc_binding_handle_call_recv(subreq);
2698 if (!NT_STATUS_IS_OK(status)) {
2699 tevent_req_nterror(req, status);
2703 tevent_req_done(req);
2706 NTSTATUS dcerpc_winreg_FlushKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2708 struct dcerpc_winreg_FlushKey_r_state *state =
2709 tevent_req_data(req,
2710 struct dcerpc_winreg_FlushKey_r_state);
2713 if (tevent_req_is_nterror(req, &status)) {
2714 tevent_req_received(req);
2718 talloc_steal(mem_ctx, state->out_mem_ctx);
2720 tevent_req_received(req);
2721 return NT_STATUS_OK;
2724 NTSTATUS dcerpc_winreg_FlushKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_FlushKey *r)
2728 status = dcerpc_binding_handle_call(h,
2729 NULL, &ndr_table_winreg,
2730 NDR_WINREG_FLUSHKEY, mem_ctx, r);
2735 NTSTATUS dcerpc_winreg_FlushKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_FlushKey *r)
2739 status = dcerpc_winreg_FlushKey_r(p->binding_handle, mem_ctx, r);
2741 if (NT_STATUS_IS_RPC(status)) {
2742 status = NT_STATUS_NET_WRITE_FAULT;
2748 struct dcerpc_winreg_FlushKey_state {
2749 struct winreg_FlushKey orig;
2750 struct winreg_FlushKey tmp;
2751 TALLOC_CTX *out_mem_ctx;
2754 static void dcerpc_winreg_FlushKey_done(struct tevent_req *subreq);
2756 struct tevent_req *dcerpc_winreg_FlushKey_send(TALLOC_CTX *mem_ctx,
2757 struct tevent_context *ev,
2758 struct dcerpc_binding_handle *h,
2759 struct policy_handle *_handle /* [in] [ref] */)
2761 struct tevent_req *req;
2762 struct dcerpc_winreg_FlushKey_state *state;
2763 struct tevent_req *subreq;
2765 req = tevent_req_create(mem_ctx, &state,
2766 struct dcerpc_winreg_FlushKey_state);
2770 state->out_mem_ctx = NULL;
2773 state->orig.in.handle = _handle;
2775 /* Out parameters */
2778 ZERO_STRUCT(state->orig.out.result);
2780 /* make a temporary copy, that we pass to the dispatch function */
2781 state->tmp = state->orig;
2783 subreq = dcerpc_winreg_FlushKey_r_send(state, ev, h, &state->tmp);
2784 if (tevent_req_nomem(subreq, req)) {
2785 return tevent_req_post(req, ev);
2787 tevent_req_set_callback(subreq, dcerpc_winreg_FlushKey_done, req);
2791 static void dcerpc_winreg_FlushKey_done(struct tevent_req *subreq)
2793 struct tevent_req *req = tevent_req_callback_data(
2794 subreq, struct tevent_req);
2795 struct dcerpc_winreg_FlushKey_state *state = tevent_req_data(
2796 req, struct dcerpc_winreg_FlushKey_state);
2798 TALLOC_CTX *mem_ctx;
2800 if (state->out_mem_ctx) {
2801 mem_ctx = state->out_mem_ctx;
2806 status = dcerpc_winreg_FlushKey_r_recv(subreq, mem_ctx);
2807 TALLOC_FREE(subreq);
2808 if (!NT_STATUS_IS_OK(status)) {
2809 tevent_req_nterror(req, status);
2813 /* Copy out parameters */
2816 state->orig.out.result = state->tmp.out.result;
2818 /* Reset temporary structure */
2819 ZERO_STRUCT(state->tmp);
2821 tevent_req_done(req);
2824 NTSTATUS dcerpc_winreg_FlushKey_recv(struct tevent_req *req,
2825 TALLOC_CTX *mem_ctx,
2828 struct dcerpc_winreg_FlushKey_state *state = tevent_req_data(
2829 req, struct dcerpc_winreg_FlushKey_state);
2832 if (tevent_req_is_nterror(req, &status)) {
2833 tevent_req_received(req);
2837 /* Steal possible out parameters to the callers context */
2838 talloc_steal(mem_ctx, state->out_mem_ctx);
2841 *result = state->orig.out.result;
2843 tevent_req_received(req);
2844 return NT_STATUS_OK;
2847 NTSTATUS dcerpc_winreg_FlushKey(struct dcerpc_binding_handle *h,
2848 TALLOC_CTX *mem_ctx,
2849 struct policy_handle *_handle /* [in] [ref] */,
2852 struct winreg_FlushKey r;
2856 r.in.handle = _handle;
2858 status = dcerpc_winreg_FlushKey_r(h, mem_ctx, &r);
2859 if (!NT_STATUS_IS_OK(status)) {
2863 /* Return variables */
2866 *result = r.out.result;
2868 return NT_STATUS_OK;
2871 struct dcerpc_winreg_GetKeySecurity_r_state {
2872 TALLOC_CTX *out_mem_ctx;
2875 static void dcerpc_winreg_GetKeySecurity_r_done(struct tevent_req *subreq);
2877 struct tevent_req *dcerpc_winreg_GetKeySecurity_r_send(TALLOC_CTX *mem_ctx,
2878 struct tevent_context *ev,
2879 struct dcerpc_binding_handle *h,
2880 struct winreg_GetKeySecurity *r)
2882 struct tevent_req *req;
2883 struct dcerpc_winreg_GetKeySecurity_r_state *state;
2884 struct tevent_req *subreq;
2886 req = tevent_req_create(mem_ctx, &state,
2887 struct dcerpc_winreg_GetKeySecurity_r_state);
2892 state->out_mem_ctx = talloc_new(state);
2893 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2894 return tevent_req_post(req, ev);
2897 subreq = dcerpc_binding_handle_call_send(state, ev, h,
2898 NULL, &ndr_table_winreg,
2899 NDR_WINREG_GETKEYSECURITY, state->out_mem_ctx, r);
2900 if (tevent_req_nomem(subreq, req)) {
2901 return tevent_req_post(req, ev);
2903 tevent_req_set_callback(subreq, dcerpc_winreg_GetKeySecurity_r_done, req);
2908 static void dcerpc_winreg_GetKeySecurity_r_done(struct tevent_req *subreq)
2910 struct tevent_req *req =
2911 tevent_req_callback_data(subreq,
2915 status = dcerpc_binding_handle_call_recv(subreq);
2916 if (!NT_STATUS_IS_OK(status)) {
2917 tevent_req_nterror(req, status);
2921 tevent_req_done(req);
2924 NTSTATUS dcerpc_winreg_GetKeySecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2926 struct dcerpc_winreg_GetKeySecurity_r_state *state =
2927 tevent_req_data(req,
2928 struct dcerpc_winreg_GetKeySecurity_r_state);
2931 if (tevent_req_is_nterror(req, &status)) {
2932 tevent_req_received(req);
2936 talloc_steal(mem_ctx, state->out_mem_ctx);
2938 tevent_req_received(req);
2939 return NT_STATUS_OK;
2942 NTSTATUS dcerpc_winreg_GetKeySecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_GetKeySecurity *r)
2946 status = dcerpc_binding_handle_call(h,
2947 NULL, &ndr_table_winreg,
2948 NDR_WINREG_GETKEYSECURITY, mem_ctx, r);
2953 NTSTATUS dcerpc_winreg_GetKeySecurity_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_GetKeySecurity *r)
2957 status = dcerpc_winreg_GetKeySecurity_r(p->binding_handle, mem_ctx, r);
2959 if (NT_STATUS_IS_RPC(status)) {
2960 status = NT_STATUS_NET_WRITE_FAULT;
2966 struct dcerpc_winreg_GetKeySecurity_state {
2967 struct winreg_GetKeySecurity orig;
2968 struct winreg_GetKeySecurity tmp;
2969 TALLOC_CTX *out_mem_ctx;
2972 static void dcerpc_winreg_GetKeySecurity_done(struct tevent_req *subreq);
2974 struct tevent_req *dcerpc_winreg_GetKeySecurity_send(TALLOC_CTX *mem_ctx,
2975 struct tevent_context *ev,
2976 struct dcerpc_binding_handle *h,
2977 struct policy_handle *_handle /* [in] [ref] */,
2978 uint32_t _sec_info /* [in] */,
2979 struct KeySecurityData *_sd /* [in,out] [ref] */)
2981 struct tevent_req *req;
2982 struct dcerpc_winreg_GetKeySecurity_state *state;
2983 struct tevent_req *subreq;
2985 req = tevent_req_create(mem_ctx, &state,
2986 struct dcerpc_winreg_GetKeySecurity_state);
2990 state->out_mem_ctx = NULL;
2993 state->orig.in.handle = _handle;
2994 state->orig.in.sec_info = _sec_info;
2995 state->orig.in.sd = _sd;
2997 /* Out parameters */
2998 state->orig.out.sd = _sd;
3001 ZERO_STRUCT(state->orig.out.result);
3003 state->out_mem_ctx = talloc_named_const(state, 0,
3004 "dcerpc_winreg_GetKeySecurity_out_memory");
3005 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3006 return tevent_req_post(req, ev);
3009 /* make a temporary copy, that we pass to the dispatch function */
3010 state->tmp = state->orig;
3012 subreq = dcerpc_winreg_GetKeySecurity_r_send(state, ev, h, &state->tmp);
3013 if (tevent_req_nomem(subreq, req)) {
3014 return tevent_req_post(req, ev);
3016 tevent_req_set_callback(subreq, dcerpc_winreg_GetKeySecurity_done, req);
3020 static void dcerpc_winreg_GetKeySecurity_done(struct tevent_req *subreq)
3022 struct tevent_req *req = tevent_req_callback_data(
3023 subreq, struct tevent_req);
3024 struct dcerpc_winreg_GetKeySecurity_state *state = tevent_req_data(
3025 req, struct dcerpc_winreg_GetKeySecurity_state);
3027 TALLOC_CTX *mem_ctx;
3029 if (state->out_mem_ctx) {
3030 mem_ctx = state->out_mem_ctx;
3035 status = dcerpc_winreg_GetKeySecurity_r_recv(subreq, mem_ctx);
3036 TALLOC_FREE(subreq);
3037 if (!NT_STATUS_IS_OK(status)) {
3038 tevent_req_nterror(req, status);
3042 /* Copy out parameters */
3043 *state->orig.out.sd = *state->tmp.out.sd;
3046 state->orig.out.result = state->tmp.out.result;
3048 /* Reset temporary structure */
3049 ZERO_STRUCT(state->tmp);
3051 tevent_req_done(req);
3054 NTSTATUS dcerpc_winreg_GetKeySecurity_recv(struct tevent_req *req,
3055 TALLOC_CTX *mem_ctx,
3058 struct dcerpc_winreg_GetKeySecurity_state *state = tevent_req_data(
3059 req, struct dcerpc_winreg_GetKeySecurity_state);
3062 if (tevent_req_is_nterror(req, &status)) {
3063 tevent_req_received(req);
3067 /* Steal possible out parameters to the callers context */
3068 talloc_steal(mem_ctx, state->out_mem_ctx);
3071 *result = state->orig.out.result;
3073 tevent_req_received(req);
3074 return NT_STATUS_OK;
3077 NTSTATUS dcerpc_winreg_GetKeySecurity(struct dcerpc_binding_handle *h,
3078 TALLOC_CTX *mem_ctx,
3079 struct policy_handle *_handle /* [in] [ref] */,
3080 uint32_t _sec_info /* [in] */,
3081 struct KeySecurityData *_sd /* [in,out] [ref] */,
3084 struct winreg_GetKeySecurity r;
3088 r.in.handle = _handle;
3089 r.in.sec_info = _sec_info;
3092 status = dcerpc_winreg_GetKeySecurity_r(h, mem_ctx, &r);
3093 if (!NT_STATUS_IS_OK(status)) {
3097 /* Return variables */
3101 *result = r.out.result;
3103 return NT_STATUS_OK;
3106 struct dcerpc_winreg_LoadKey_r_state {
3107 TALLOC_CTX *out_mem_ctx;
3110 static void dcerpc_winreg_LoadKey_r_done(struct tevent_req *subreq);
3112 struct tevent_req *dcerpc_winreg_LoadKey_r_send(TALLOC_CTX *mem_ctx,
3113 struct tevent_context *ev,
3114 struct dcerpc_binding_handle *h,
3115 struct winreg_LoadKey *r)
3117 struct tevent_req *req;
3118 struct dcerpc_winreg_LoadKey_r_state *state;
3119 struct tevent_req *subreq;
3121 req = tevent_req_create(mem_ctx, &state,
3122 struct dcerpc_winreg_LoadKey_r_state);
3127 state->out_mem_ctx = NULL;
3128 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3129 NULL, &ndr_table_winreg,
3130 NDR_WINREG_LOADKEY, state, r);
3131 if (tevent_req_nomem(subreq, req)) {
3132 return tevent_req_post(req, ev);
3134 tevent_req_set_callback(subreq, dcerpc_winreg_LoadKey_r_done, req);
3139 static void dcerpc_winreg_LoadKey_r_done(struct tevent_req *subreq)
3141 struct tevent_req *req =
3142 tevent_req_callback_data(subreq,
3146 status = dcerpc_binding_handle_call_recv(subreq);
3147 if (!NT_STATUS_IS_OK(status)) {
3148 tevent_req_nterror(req, status);
3152 tevent_req_done(req);
3155 NTSTATUS dcerpc_winreg_LoadKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3157 struct dcerpc_winreg_LoadKey_r_state *state =
3158 tevent_req_data(req,
3159 struct dcerpc_winreg_LoadKey_r_state);
3162 if (tevent_req_is_nterror(req, &status)) {
3163 tevent_req_received(req);
3167 talloc_steal(mem_ctx, state->out_mem_ctx);
3169 tevent_req_received(req);
3170 return NT_STATUS_OK;
3173 NTSTATUS dcerpc_winreg_LoadKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_LoadKey *r)
3177 status = dcerpc_binding_handle_call(h,
3178 NULL, &ndr_table_winreg,
3179 NDR_WINREG_LOADKEY, mem_ctx, r);
3184 NTSTATUS dcerpc_winreg_LoadKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_LoadKey *r)
3188 status = dcerpc_winreg_LoadKey_r(p->binding_handle, mem_ctx, r);
3190 if (NT_STATUS_IS_RPC(status)) {
3191 status = NT_STATUS_NET_WRITE_FAULT;
3197 struct dcerpc_winreg_LoadKey_state {
3198 struct winreg_LoadKey orig;
3199 struct winreg_LoadKey tmp;
3200 TALLOC_CTX *out_mem_ctx;
3203 static void dcerpc_winreg_LoadKey_done(struct tevent_req *subreq);
3205 struct tevent_req *dcerpc_winreg_LoadKey_send(TALLOC_CTX *mem_ctx,
3206 struct tevent_context *ev,
3207 struct dcerpc_binding_handle *h,
3208 struct policy_handle *_handle /* [in] [ref] */,
3209 struct winreg_String *_keyname /* [in] [unique] */,
3210 struct winreg_String *_filename /* [in] [unique] */)
3212 struct tevent_req *req;
3213 struct dcerpc_winreg_LoadKey_state *state;
3214 struct tevent_req *subreq;
3216 req = tevent_req_create(mem_ctx, &state,
3217 struct dcerpc_winreg_LoadKey_state);
3221 state->out_mem_ctx = NULL;
3224 state->orig.in.handle = _handle;
3225 state->orig.in.keyname = _keyname;
3226 state->orig.in.filename = _filename;
3228 /* Out parameters */
3231 ZERO_STRUCT(state->orig.out.result);
3233 /* make a temporary copy, that we pass to the dispatch function */
3234 state->tmp = state->orig;
3236 subreq = dcerpc_winreg_LoadKey_r_send(state, ev, h, &state->tmp);
3237 if (tevent_req_nomem(subreq, req)) {
3238 return tevent_req_post(req, ev);
3240 tevent_req_set_callback(subreq, dcerpc_winreg_LoadKey_done, req);
3244 static void dcerpc_winreg_LoadKey_done(struct tevent_req *subreq)
3246 struct tevent_req *req = tevent_req_callback_data(
3247 subreq, struct tevent_req);
3248 struct dcerpc_winreg_LoadKey_state *state = tevent_req_data(
3249 req, struct dcerpc_winreg_LoadKey_state);
3251 TALLOC_CTX *mem_ctx;
3253 if (state->out_mem_ctx) {
3254 mem_ctx = state->out_mem_ctx;
3259 status = dcerpc_winreg_LoadKey_r_recv(subreq, mem_ctx);
3260 TALLOC_FREE(subreq);
3261 if (!NT_STATUS_IS_OK(status)) {
3262 tevent_req_nterror(req, status);
3266 /* Copy out parameters */
3269 state->orig.out.result = state->tmp.out.result;
3271 /* Reset temporary structure */
3272 ZERO_STRUCT(state->tmp);
3274 tevent_req_done(req);
3277 NTSTATUS dcerpc_winreg_LoadKey_recv(struct tevent_req *req,
3278 TALLOC_CTX *mem_ctx,
3281 struct dcerpc_winreg_LoadKey_state *state = tevent_req_data(
3282 req, struct dcerpc_winreg_LoadKey_state);
3285 if (tevent_req_is_nterror(req, &status)) {
3286 tevent_req_received(req);
3290 /* Steal possible out parameters to the callers context */
3291 talloc_steal(mem_ctx, state->out_mem_ctx);
3294 *result = state->orig.out.result;
3296 tevent_req_received(req);
3297 return NT_STATUS_OK;
3300 NTSTATUS dcerpc_winreg_LoadKey(struct dcerpc_binding_handle *h,
3301 TALLOC_CTX *mem_ctx,
3302 struct policy_handle *_handle /* [in] [ref] */,
3303 struct winreg_String *_keyname /* [in] [unique] */,
3304 struct winreg_String *_filename /* [in] [unique] */,
3307 struct winreg_LoadKey r;
3311 r.in.handle = _handle;
3312 r.in.keyname = _keyname;
3313 r.in.filename = _filename;
3315 status = dcerpc_winreg_LoadKey_r(h, mem_ctx, &r);
3316 if (!NT_STATUS_IS_OK(status)) {
3320 /* Return variables */
3323 *result = r.out.result;
3325 return NT_STATUS_OK;
3328 struct dcerpc_winreg_NotifyChangeKeyValue_r_state {
3329 TALLOC_CTX *out_mem_ctx;
3332 static void dcerpc_winreg_NotifyChangeKeyValue_r_done(struct tevent_req *subreq);
3334 struct tevent_req *dcerpc_winreg_NotifyChangeKeyValue_r_send(TALLOC_CTX *mem_ctx,
3335 struct tevent_context *ev,
3336 struct dcerpc_binding_handle *h,
3337 struct winreg_NotifyChangeKeyValue *r)
3339 struct tevent_req *req;
3340 struct dcerpc_winreg_NotifyChangeKeyValue_r_state *state;
3341 struct tevent_req *subreq;
3343 req = tevent_req_create(mem_ctx, &state,
3344 struct dcerpc_winreg_NotifyChangeKeyValue_r_state);
3349 state->out_mem_ctx = NULL;
3350 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3351 NULL, &ndr_table_winreg,
3352 NDR_WINREG_NOTIFYCHANGEKEYVALUE, state, r);
3353 if (tevent_req_nomem(subreq, req)) {
3354 return tevent_req_post(req, ev);
3356 tevent_req_set_callback(subreq, dcerpc_winreg_NotifyChangeKeyValue_r_done, req);
3361 static void dcerpc_winreg_NotifyChangeKeyValue_r_done(struct tevent_req *subreq)
3363 struct tevent_req *req =
3364 tevent_req_callback_data(subreq,
3368 status = dcerpc_binding_handle_call_recv(subreq);
3369 if (!NT_STATUS_IS_OK(status)) {
3370 tevent_req_nterror(req, status);
3374 tevent_req_done(req);
3377 NTSTATUS dcerpc_winreg_NotifyChangeKeyValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3379 struct dcerpc_winreg_NotifyChangeKeyValue_r_state *state =
3380 tevent_req_data(req,
3381 struct dcerpc_winreg_NotifyChangeKeyValue_r_state);
3384 if (tevent_req_is_nterror(req, &status)) {
3385 tevent_req_received(req);
3389 talloc_steal(mem_ctx, state->out_mem_ctx);
3391 tevent_req_received(req);
3392 return NT_STATUS_OK;
3395 NTSTATUS dcerpc_winreg_NotifyChangeKeyValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_NotifyChangeKeyValue *r)
3399 status = dcerpc_binding_handle_call(h,
3400 NULL, &ndr_table_winreg,
3401 NDR_WINREG_NOTIFYCHANGEKEYVALUE, mem_ctx, r);
3406 NTSTATUS dcerpc_winreg_NotifyChangeKeyValue_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_NotifyChangeKeyValue *r)
3410 status = dcerpc_winreg_NotifyChangeKeyValue_r(p->binding_handle, mem_ctx, r);
3412 if (NT_STATUS_IS_RPC(status)) {
3413 status = NT_STATUS_NET_WRITE_FAULT;
3419 struct dcerpc_winreg_NotifyChangeKeyValue_state {
3420 struct winreg_NotifyChangeKeyValue orig;
3421 struct winreg_NotifyChangeKeyValue tmp;
3422 TALLOC_CTX *out_mem_ctx;
3425 static void dcerpc_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq);
3427 struct tevent_req *dcerpc_winreg_NotifyChangeKeyValue_send(TALLOC_CTX *mem_ctx,
3428 struct tevent_context *ev,
3429 struct dcerpc_binding_handle *h,
3430 struct policy_handle *_handle /* [in] [ref] */,
3431 uint8_t _watch_subtree /* [in] */,
3432 uint32_t _notify_filter /* [in] */,
3433 uint32_t _unknown /* [in] */,
3434 struct winreg_String _string1 /* [in] */,
3435 struct winreg_String _string2 /* [in] */,
3436 uint32_t _unknown2 /* [in] */)
3438 struct tevent_req *req;
3439 struct dcerpc_winreg_NotifyChangeKeyValue_state *state;
3440 struct tevent_req *subreq;
3442 req = tevent_req_create(mem_ctx, &state,
3443 struct dcerpc_winreg_NotifyChangeKeyValue_state);
3447 state->out_mem_ctx = NULL;
3450 state->orig.in.handle = _handle;
3451 state->orig.in.watch_subtree = _watch_subtree;
3452 state->orig.in.notify_filter = _notify_filter;
3453 state->orig.in.unknown = _unknown;
3454 state->orig.in.string1 = _string1;
3455 state->orig.in.string2 = _string2;
3456 state->orig.in.unknown2 = _unknown2;
3458 /* Out parameters */
3461 ZERO_STRUCT(state->orig.out.result);
3463 /* make a temporary copy, that we pass to the dispatch function */
3464 state->tmp = state->orig;
3466 subreq = dcerpc_winreg_NotifyChangeKeyValue_r_send(state, ev, h, &state->tmp);
3467 if (tevent_req_nomem(subreq, req)) {
3468 return tevent_req_post(req, ev);
3470 tevent_req_set_callback(subreq, dcerpc_winreg_NotifyChangeKeyValue_done, req);
3474 static void dcerpc_winreg_NotifyChangeKeyValue_done(struct tevent_req *subreq)
3476 struct tevent_req *req = tevent_req_callback_data(
3477 subreq, struct tevent_req);
3478 struct dcerpc_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
3479 req, struct dcerpc_winreg_NotifyChangeKeyValue_state);
3481 TALLOC_CTX *mem_ctx;
3483 if (state->out_mem_ctx) {
3484 mem_ctx = state->out_mem_ctx;
3489 status = dcerpc_winreg_NotifyChangeKeyValue_r_recv(subreq, mem_ctx);
3490 TALLOC_FREE(subreq);
3491 if (!NT_STATUS_IS_OK(status)) {
3492 tevent_req_nterror(req, status);
3496 /* Copy out parameters */
3499 state->orig.out.result = state->tmp.out.result;
3501 /* Reset temporary structure */
3502 ZERO_STRUCT(state->tmp);
3504 tevent_req_done(req);
3507 NTSTATUS dcerpc_winreg_NotifyChangeKeyValue_recv(struct tevent_req *req,
3508 TALLOC_CTX *mem_ctx,
3511 struct dcerpc_winreg_NotifyChangeKeyValue_state *state = tevent_req_data(
3512 req, struct dcerpc_winreg_NotifyChangeKeyValue_state);
3515 if (tevent_req_is_nterror(req, &status)) {
3516 tevent_req_received(req);
3520 /* Steal possible out parameters to the callers context */
3521 talloc_steal(mem_ctx, state->out_mem_ctx);
3524 *result = state->orig.out.result;
3526 tevent_req_received(req);
3527 return NT_STATUS_OK;
3530 NTSTATUS dcerpc_winreg_NotifyChangeKeyValue(struct dcerpc_binding_handle *h,
3531 TALLOC_CTX *mem_ctx,
3532 struct policy_handle *_handle /* [in] [ref] */,
3533 uint8_t _watch_subtree /* [in] */,
3534 uint32_t _notify_filter /* [in] */,
3535 uint32_t _unknown /* [in] */,
3536 struct winreg_String _string1 /* [in] */,
3537 struct winreg_String _string2 /* [in] */,
3538 uint32_t _unknown2 /* [in] */,
3541 struct winreg_NotifyChangeKeyValue r;
3545 r.in.handle = _handle;
3546 r.in.watch_subtree = _watch_subtree;
3547 r.in.notify_filter = _notify_filter;
3548 r.in.unknown = _unknown;
3549 r.in.string1 = _string1;
3550 r.in.string2 = _string2;
3551 r.in.unknown2 = _unknown2;
3553 status = dcerpc_winreg_NotifyChangeKeyValue_r(h, mem_ctx, &r);
3554 if (!NT_STATUS_IS_OK(status)) {
3558 /* Return variables */
3561 *result = r.out.result;
3563 return NT_STATUS_OK;
3566 struct dcerpc_winreg_OpenKey_r_state {
3567 TALLOC_CTX *out_mem_ctx;
3570 static void dcerpc_winreg_OpenKey_r_done(struct tevent_req *subreq);
3572 struct tevent_req *dcerpc_winreg_OpenKey_r_send(TALLOC_CTX *mem_ctx,
3573 struct tevent_context *ev,
3574 struct dcerpc_binding_handle *h,
3575 struct winreg_OpenKey *r)
3577 struct tevent_req *req;
3578 struct dcerpc_winreg_OpenKey_r_state *state;
3579 struct tevent_req *subreq;
3581 req = tevent_req_create(mem_ctx, &state,
3582 struct dcerpc_winreg_OpenKey_r_state);
3587 state->out_mem_ctx = talloc_new(state);
3588 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3589 return tevent_req_post(req, ev);
3592 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3593 NULL, &ndr_table_winreg,
3594 NDR_WINREG_OPENKEY, state->out_mem_ctx, r);
3595 if (tevent_req_nomem(subreq, req)) {
3596 return tevent_req_post(req, ev);
3598 tevent_req_set_callback(subreq, dcerpc_winreg_OpenKey_r_done, req);
3603 static void dcerpc_winreg_OpenKey_r_done(struct tevent_req *subreq)
3605 struct tevent_req *req =
3606 tevent_req_callback_data(subreq,
3610 status = dcerpc_binding_handle_call_recv(subreq);
3611 if (!NT_STATUS_IS_OK(status)) {
3612 tevent_req_nterror(req, status);
3616 tevent_req_done(req);
3619 NTSTATUS dcerpc_winreg_OpenKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3621 struct dcerpc_winreg_OpenKey_r_state *state =
3622 tevent_req_data(req,
3623 struct dcerpc_winreg_OpenKey_r_state);
3626 if (tevent_req_is_nterror(req, &status)) {
3627 tevent_req_received(req);
3631 talloc_steal(mem_ctx, state->out_mem_ctx);
3633 tevent_req_received(req);
3634 return NT_STATUS_OK;
3637 NTSTATUS dcerpc_winreg_OpenKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenKey *r)
3641 status = dcerpc_binding_handle_call(h,
3642 NULL, &ndr_table_winreg,
3643 NDR_WINREG_OPENKEY, mem_ctx, r);
3648 NTSTATUS dcerpc_winreg_OpenKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenKey *r)
3652 status = dcerpc_winreg_OpenKey_r(p->binding_handle, mem_ctx, r);
3654 if (NT_STATUS_IS_RPC(status)) {
3655 status = NT_STATUS_NET_WRITE_FAULT;
3661 struct dcerpc_winreg_OpenKey_state {
3662 struct winreg_OpenKey orig;
3663 struct winreg_OpenKey tmp;
3664 TALLOC_CTX *out_mem_ctx;
3667 static void dcerpc_winreg_OpenKey_done(struct tevent_req *subreq);
3669 struct tevent_req *dcerpc_winreg_OpenKey_send(TALLOC_CTX *mem_ctx,
3670 struct tevent_context *ev,
3671 struct dcerpc_binding_handle *h,
3672 struct policy_handle *_parent_handle /* [in] [ref] */,
3673 struct winreg_String _keyname /* [in] */,
3674 uint32_t _options /* [in] */,
3675 uint32_t _access_mask /* [in] */,
3676 struct policy_handle *_handle /* [out] [ref] */)
3678 struct tevent_req *req;
3679 struct dcerpc_winreg_OpenKey_state *state;
3680 struct tevent_req *subreq;
3682 req = tevent_req_create(mem_ctx, &state,
3683 struct dcerpc_winreg_OpenKey_state);
3687 state->out_mem_ctx = NULL;
3690 state->orig.in.parent_handle = _parent_handle;
3691 state->orig.in.keyname = _keyname;
3692 state->orig.in.options = _options;
3693 state->orig.in.access_mask = _access_mask;
3695 /* Out parameters */
3696 state->orig.out.handle = _handle;
3699 ZERO_STRUCT(state->orig.out.result);
3701 state->out_mem_ctx = talloc_named_const(state, 0,
3702 "dcerpc_winreg_OpenKey_out_memory");
3703 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3704 return tevent_req_post(req, ev);
3707 /* make a temporary copy, that we pass to the dispatch function */
3708 state->tmp = state->orig;
3710 subreq = dcerpc_winreg_OpenKey_r_send(state, ev, h, &state->tmp);
3711 if (tevent_req_nomem(subreq, req)) {
3712 return tevent_req_post(req, ev);
3714 tevent_req_set_callback(subreq, dcerpc_winreg_OpenKey_done, req);
3718 static void dcerpc_winreg_OpenKey_done(struct tevent_req *subreq)
3720 struct tevent_req *req = tevent_req_callback_data(
3721 subreq, struct tevent_req);
3722 struct dcerpc_winreg_OpenKey_state *state = tevent_req_data(
3723 req, struct dcerpc_winreg_OpenKey_state);
3725 TALLOC_CTX *mem_ctx;
3727 if (state->out_mem_ctx) {
3728 mem_ctx = state->out_mem_ctx;
3733 status = dcerpc_winreg_OpenKey_r_recv(subreq, mem_ctx);
3734 TALLOC_FREE(subreq);
3735 if (!NT_STATUS_IS_OK(status)) {
3736 tevent_req_nterror(req, status);
3740 /* Copy out parameters */
3741 *state->orig.out.handle = *state->tmp.out.handle;
3744 state->orig.out.result = state->tmp.out.result;
3746 /* Reset temporary structure */
3747 ZERO_STRUCT(state->tmp);
3749 tevent_req_done(req);
3752 NTSTATUS dcerpc_winreg_OpenKey_recv(struct tevent_req *req,
3753 TALLOC_CTX *mem_ctx,
3756 struct dcerpc_winreg_OpenKey_state *state = tevent_req_data(
3757 req, struct dcerpc_winreg_OpenKey_state);
3760 if (tevent_req_is_nterror(req, &status)) {
3761 tevent_req_received(req);
3765 /* Steal possible out parameters to the callers context */
3766 talloc_steal(mem_ctx, state->out_mem_ctx);
3769 *result = state->orig.out.result;
3771 tevent_req_received(req);
3772 return NT_STATUS_OK;
3775 NTSTATUS dcerpc_winreg_OpenKey(struct dcerpc_binding_handle *h,
3776 TALLOC_CTX *mem_ctx,
3777 struct policy_handle *_parent_handle /* [in] [ref] */,
3778 struct winreg_String _keyname /* [in] */,
3779 uint32_t _options /* [in] */,
3780 uint32_t _access_mask /* [in] */,
3781 struct policy_handle *_handle /* [out] [ref] */,
3784 struct winreg_OpenKey r;
3788 r.in.parent_handle = _parent_handle;
3789 r.in.keyname = _keyname;
3790 r.in.options = _options;
3791 r.in.access_mask = _access_mask;
3793 status = dcerpc_winreg_OpenKey_r(h, mem_ctx, &r);
3794 if (!NT_STATUS_IS_OK(status)) {
3798 /* Return variables */
3799 *_handle = *r.out.handle;
3802 *result = r.out.result;
3804 return NT_STATUS_OK;
3807 struct dcerpc_winreg_QueryInfoKey_r_state {
3808 TALLOC_CTX *out_mem_ctx;
3811 static void dcerpc_winreg_QueryInfoKey_r_done(struct tevent_req *subreq);
3813 struct tevent_req *dcerpc_winreg_QueryInfoKey_r_send(TALLOC_CTX *mem_ctx,
3814 struct tevent_context *ev,
3815 struct dcerpc_binding_handle *h,
3816 struct winreg_QueryInfoKey *r)
3818 struct tevent_req *req;
3819 struct dcerpc_winreg_QueryInfoKey_r_state *state;
3820 struct tevent_req *subreq;
3822 req = tevent_req_create(mem_ctx, &state,
3823 struct dcerpc_winreg_QueryInfoKey_r_state);
3828 state->out_mem_ctx = talloc_new(state);
3829 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3830 return tevent_req_post(req, ev);
3833 subreq = dcerpc_binding_handle_call_send(state, ev, h,
3834 NULL, &ndr_table_winreg,
3835 NDR_WINREG_QUERYINFOKEY, state->out_mem_ctx, r);
3836 if (tevent_req_nomem(subreq, req)) {
3837 return tevent_req_post(req, ev);
3839 tevent_req_set_callback(subreq, dcerpc_winreg_QueryInfoKey_r_done, req);
3844 static void dcerpc_winreg_QueryInfoKey_r_done(struct tevent_req *subreq)
3846 struct tevent_req *req =
3847 tevent_req_callback_data(subreq,
3851 status = dcerpc_binding_handle_call_recv(subreq);
3852 if (!NT_STATUS_IS_OK(status)) {
3853 tevent_req_nterror(req, status);
3857 tevent_req_done(req);
3860 NTSTATUS dcerpc_winreg_QueryInfoKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3862 struct dcerpc_winreg_QueryInfoKey_r_state *state =
3863 tevent_req_data(req,
3864 struct dcerpc_winreg_QueryInfoKey_r_state);
3867 if (tevent_req_is_nterror(req, &status)) {
3868 tevent_req_received(req);
3872 talloc_steal(mem_ctx, state->out_mem_ctx);
3874 tevent_req_received(req);
3875 return NT_STATUS_OK;
3878 NTSTATUS dcerpc_winreg_QueryInfoKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_QueryInfoKey *r)
3882 status = dcerpc_binding_handle_call(h,
3883 NULL, &ndr_table_winreg,
3884 NDR_WINREG_QUERYINFOKEY, mem_ctx, r);
3889 NTSTATUS dcerpc_winreg_QueryInfoKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_QueryInfoKey *r)
3893 status = dcerpc_winreg_QueryInfoKey_r(p->binding_handle, mem_ctx, r);
3895 if (NT_STATUS_IS_RPC(status)) {
3896 status = NT_STATUS_NET_WRITE_FAULT;
3902 struct dcerpc_winreg_QueryInfoKey_state {
3903 struct winreg_QueryInfoKey orig;
3904 struct winreg_QueryInfoKey tmp;
3905 TALLOC_CTX *out_mem_ctx;
3908 static void dcerpc_winreg_QueryInfoKey_done(struct tevent_req *subreq);
3910 struct tevent_req *dcerpc_winreg_QueryInfoKey_send(TALLOC_CTX *mem_ctx,
3911 struct tevent_context *ev,
3912 struct dcerpc_binding_handle *h,
3913 struct policy_handle *_handle /* [in] [ref] */,
3914 struct winreg_String *_classname /* [in,out] [ref] */,
3915 uint32_t *_num_subkeys /* [out] [ref] */,
3916 uint32_t *_max_subkeylen /* [out] [ref] */,
3917 uint32_t *_max_classlen /* [out] [ref] */,
3918 uint32_t *_num_values /* [out] [ref] */,
3919 uint32_t *_max_valnamelen /* [out] [ref] */,
3920 uint32_t *_max_valbufsize /* [out] [ref] */,
3921 uint32_t *_secdescsize /* [out] [ref] */,
3922 NTTIME *_last_changed_time /* [out] [ref] */)
3924 struct tevent_req *req;
3925 struct dcerpc_winreg_QueryInfoKey_state *state;
3926 struct tevent_req *subreq;
3928 req = tevent_req_create(mem_ctx, &state,
3929 struct dcerpc_winreg_QueryInfoKey_state);
3933 state->out_mem_ctx = NULL;
3936 state->orig.in.handle = _handle;
3937 state->orig.in.classname = _classname;
3939 /* Out parameters */
3940 state->orig.out.classname = _classname;
3941 state->orig.out.num_subkeys = _num_subkeys;
3942 state->orig.out.max_subkeylen = _max_subkeylen;
3943 state->orig.out.max_classlen = _max_classlen;
3944 state->orig.out.num_values = _num_values;
3945 state->orig.out.max_valnamelen = _max_valnamelen;
3946 state->orig.out.max_valbufsize = _max_valbufsize;
3947 state->orig.out.secdescsize = _secdescsize;
3948 state->orig.out.last_changed_time = _last_changed_time;
3951 ZERO_STRUCT(state->orig.out.result);
3953 state->out_mem_ctx = talloc_named_const(state, 0,
3954 "dcerpc_winreg_QueryInfoKey_out_memory");
3955 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3956 return tevent_req_post(req, ev);
3959 /* make a temporary copy, that we pass to the dispatch function */
3960 state->tmp = state->orig;
3962 subreq = dcerpc_winreg_QueryInfoKey_r_send(state, ev, h, &state->tmp);
3963 if (tevent_req_nomem(subreq, req)) {
3964 return tevent_req_post(req, ev);
3966 tevent_req_set_callback(subreq, dcerpc_winreg_QueryInfoKey_done, req);
3970 static void dcerpc_winreg_QueryInfoKey_done(struct tevent_req *subreq)
3972 struct tevent_req *req = tevent_req_callback_data(
3973 subreq, struct tevent_req);
3974 struct dcerpc_winreg_QueryInfoKey_state *state = tevent_req_data(
3975 req, struct dcerpc_winreg_QueryInfoKey_state);
3977 TALLOC_CTX *mem_ctx;
3979 if (state->out_mem_ctx) {
3980 mem_ctx = state->out_mem_ctx;
3985 status = dcerpc_winreg_QueryInfoKey_r_recv(subreq, mem_ctx);
3986 TALLOC_FREE(subreq);
3987 if (!NT_STATUS_IS_OK(status)) {
3988 tevent_req_nterror(req, status);
3992 /* Copy out parameters */
3993 *state->orig.out.classname = *state->tmp.out.classname;
3994 *state->orig.out.num_subkeys = *state->tmp.out.num_subkeys;
3995 *state->orig.out.max_subkeylen = *state->tmp.out.max_subkeylen;
3996 *state->orig.out.max_classlen = *state->tmp.out.max_classlen;
3997 *state->orig.out.num_values = *state->tmp.out.num_values;
3998 *state->orig.out.max_valnamelen = *state->tmp.out.max_valnamelen;
3999 *state->orig.out.max_valbufsize = *state->tmp.out.max_valbufsize;
4000 *state->orig.out.secdescsize = *state->tmp.out.secdescsize;
4001 *state->orig.out.last_changed_time = *state->tmp.out.last_changed_time;
4004 state->orig.out.result = state->tmp.out.result;
4006 /* Reset temporary structure */
4007 ZERO_STRUCT(state->tmp);
4009 tevent_req_done(req);
4012 NTSTATUS dcerpc_winreg_QueryInfoKey_recv(struct tevent_req *req,
4013 TALLOC_CTX *mem_ctx,
4016 struct dcerpc_winreg_QueryInfoKey_state *state = tevent_req_data(
4017 req, struct dcerpc_winreg_QueryInfoKey_state);
4020 if (tevent_req_is_nterror(req, &status)) {
4021 tevent_req_received(req);
4025 /* Steal possible out parameters to the callers context */
4026 talloc_steal(mem_ctx, state->out_mem_ctx);
4029 *result = state->orig.out.result;
4031 tevent_req_received(req);
4032 return NT_STATUS_OK;
4035 NTSTATUS dcerpc_winreg_QueryInfoKey(struct dcerpc_binding_handle *h,
4036 TALLOC_CTX *mem_ctx,
4037 struct policy_handle *_handle /* [in] [ref] */,
4038 struct winreg_String *_classname /* [in,out] [ref] */,
4039 uint32_t *_num_subkeys /* [out] [ref] */,
4040 uint32_t *_max_subkeylen /* [out] [ref] */,
4041 uint32_t *_max_classlen /* [out] [ref] */,
4042 uint32_t *_num_values /* [out] [ref] */,
4043 uint32_t *_max_valnamelen /* [out] [ref] */,
4044 uint32_t *_max_valbufsize /* [out] [ref] */,
4045 uint32_t *_secdescsize /* [out] [ref] */,
4046 NTTIME *_last_changed_time /* [out] [ref] */,
4049 struct winreg_QueryInfoKey r;
4053 r.in.handle = _handle;
4054 r.in.classname = _classname;
4056 status = dcerpc_winreg_QueryInfoKey_r(h, mem_ctx, &r);
4057 if (!NT_STATUS_IS_OK(status)) {
4061 /* Return variables */
4062 *_classname = *r.out.classname;
4063 *_num_subkeys = *r.out.num_subkeys;
4064 *_max_subkeylen = *r.out.max_subkeylen;
4065 *_max_classlen = *r.out.max_classlen;
4066 *_num_values = *r.out.num_values;
4067 *_max_valnamelen = *r.out.max_valnamelen;
4068 *_max_valbufsize = *r.out.max_valbufsize;
4069 *_secdescsize = *r.out.secdescsize;
4070 *_last_changed_time = *r.out.last_changed_time;
4073 *result = r.out.result;
4075 return NT_STATUS_OK;
4078 struct dcerpc_winreg_QueryValue_r_state {
4079 TALLOC_CTX *out_mem_ctx;
4082 static void dcerpc_winreg_QueryValue_r_done(struct tevent_req *subreq);
4084 struct tevent_req *dcerpc_winreg_QueryValue_r_send(TALLOC_CTX *mem_ctx,
4085 struct tevent_context *ev,
4086 struct dcerpc_binding_handle *h,
4087 struct winreg_QueryValue *r)
4089 struct tevent_req *req;
4090 struct dcerpc_winreg_QueryValue_r_state *state;
4091 struct tevent_req *subreq;
4093 req = tevent_req_create(mem_ctx, &state,
4094 struct dcerpc_winreg_QueryValue_r_state);
4099 state->out_mem_ctx = talloc_new(state);
4100 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4101 return tevent_req_post(req, ev);
4104 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4105 NULL, &ndr_table_winreg,
4106 NDR_WINREG_QUERYVALUE, state->out_mem_ctx, r);
4107 if (tevent_req_nomem(subreq, req)) {
4108 return tevent_req_post(req, ev);
4110 tevent_req_set_callback(subreq, dcerpc_winreg_QueryValue_r_done, req);
4115 static void dcerpc_winreg_QueryValue_r_done(struct tevent_req *subreq)
4117 struct tevent_req *req =
4118 tevent_req_callback_data(subreq,
4122 status = dcerpc_binding_handle_call_recv(subreq);
4123 if (!NT_STATUS_IS_OK(status)) {
4124 tevent_req_nterror(req, status);
4128 tevent_req_done(req);
4131 NTSTATUS dcerpc_winreg_QueryValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4133 struct dcerpc_winreg_QueryValue_r_state *state =
4134 tevent_req_data(req,
4135 struct dcerpc_winreg_QueryValue_r_state);
4138 if (tevent_req_is_nterror(req, &status)) {
4139 tevent_req_received(req);
4143 talloc_steal(mem_ctx, state->out_mem_ctx);
4145 tevent_req_received(req);
4146 return NT_STATUS_OK;
4149 NTSTATUS dcerpc_winreg_QueryValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_QueryValue *r)
4153 status = dcerpc_binding_handle_call(h,
4154 NULL, &ndr_table_winreg,
4155 NDR_WINREG_QUERYVALUE, mem_ctx, r);
4160 NTSTATUS dcerpc_winreg_QueryValue_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_QueryValue *r)
4164 status = dcerpc_winreg_QueryValue_r(p->binding_handle, mem_ctx, r);
4166 if (NT_STATUS_IS_RPC(status)) {
4167 status = NT_STATUS_NET_WRITE_FAULT;
4173 struct dcerpc_winreg_QueryValue_state {
4174 struct winreg_QueryValue orig;
4175 struct winreg_QueryValue tmp;
4176 TALLOC_CTX *out_mem_ctx;
4179 static void dcerpc_winreg_QueryValue_done(struct tevent_req *subreq);
4181 struct tevent_req *dcerpc_winreg_QueryValue_send(TALLOC_CTX *mem_ctx,
4182 struct tevent_context *ev,
4183 struct dcerpc_binding_handle *h,
4184 struct policy_handle *_handle /* [in] [ref] */,
4185 struct winreg_String *_value_name /* [in] [ref] */,
4186 enum winreg_Type *_type /* [in,out] [unique] */,
4187 uint8_t *_data /* [in,out] [unique,range(0,0x4000000),length_is(data_length?*data_length:0),size_is(data_size?*data_size:0)] */,
4188 uint32_t *_data_size /* [in,out] [unique] */,
4189 uint32_t *_data_length /* [in,out] [unique] */)
4191 struct tevent_req *req;
4192 struct dcerpc_winreg_QueryValue_state *state;
4193 struct tevent_req *subreq;
4195 req = tevent_req_create(mem_ctx, &state,
4196 struct dcerpc_winreg_QueryValue_state);
4200 state->out_mem_ctx = NULL;
4203 state->orig.in.handle = _handle;
4204 state->orig.in.value_name = _value_name;
4205 state->orig.in.type = _type;
4206 state->orig.in.data = _data;
4207 state->orig.in.data_size = _data_size;
4208 state->orig.in.data_length = _data_length;
4210 /* Out parameters */
4211 state->orig.out.type = _type;
4212 state->orig.out.data = _data;
4213 state->orig.out.data_size = _data_size;
4214 state->orig.out.data_length = _data_length;
4217 ZERO_STRUCT(state->orig.out.result);
4219 state->out_mem_ctx = talloc_named_const(state, 0,
4220 "dcerpc_winreg_QueryValue_out_memory");
4221 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4222 return tevent_req_post(req, ev);
4225 /* make a temporary copy, that we pass to the dispatch function */
4226 state->tmp = state->orig;
4228 subreq = dcerpc_winreg_QueryValue_r_send(state, ev, h, &state->tmp);
4229 if (tevent_req_nomem(subreq, req)) {
4230 return tevent_req_post(req, ev);
4232 tevent_req_set_callback(subreq, dcerpc_winreg_QueryValue_done, req);
4236 static void dcerpc_winreg_QueryValue_done(struct tevent_req *subreq)
4238 struct tevent_req *req = tevent_req_callback_data(
4239 subreq, struct tevent_req);
4240 struct dcerpc_winreg_QueryValue_state *state = tevent_req_data(
4241 req, struct dcerpc_winreg_QueryValue_state);
4243 TALLOC_CTX *mem_ctx;
4245 if (state->out_mem_ctx) {
4246 mem_ctx = state->out_mem_ctx;
4251 status = dcerpc_winreg_QueryValue_r_recv(subreq, mem_ctx);
4252 TALLOC_FREE(subreq);
4253 if (!NT_STATUS_IS_OK(status)) {
4254 tevent_req_nterror(req, status);
4258 /* Copy out parameters */
4259 if (state->orig.out.type && state->tmp.out.type) {
4260 *state->orig.out.type = *state->tmp.out.type;
4262 if (state->orig.out.data && state->tmp.out.data) {
4264 size_t _copy_len_data;
4265 if ((state->tmp.out.data_size?*state->tmp.out.data_size:0) > (state->tmp.in.data_size?*state->tmp.in.data_size:0)) {
4266 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
4269 if ((state->tmp.out.data_length?*state->tmp.out.data_length:0) > (state->tmp.out.data_size?*state->tmp.out.data_size:0)) {
4270 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
4273 _copy_len_data = state->tmp.out.data_length?*state->tmp.out.data_length:0;
4274 memcpy(state->orig.out.data, state->tmp.out.data, _copy_len_data * sizeof(*state->orig.out.data));
4277 if (state->orig.out.data_size && state->tmp.out.data_size) {
4278 *state->orig.out.data_size = *state->tmp.out.data_size;
4280 if (state->orig.out.data_length && state->tmp.out.data_length) {
4281 *state->orig.out.data_length = *state->tmp.out.data_length;
4285 state->orig.out.result = state->tmp.out.result;
4287 /* Reset temporary structure */
4288 ZERO_STRUCT(state->tmp);
4290 tevent_req_done(req);
4293 NTSTATUS dcerpc_winreg_QueryValue_recv(struct tevent_req *req,
4294 TALLOC_CTX *mem_ctx,
4297 struct dcerpc_winreg_QueryValue_state *state = tevent_req_data(
4298 req, struct dcerpc_winreg_QueryValue_state);
4301 if (tevent_req_is_nterror(req, &status)) {
4302 tevent_req_received(req);
4306 /* Steal possible out parameters to the callers context */
4307 talloc_steal(mem_ctx, state->out_mem_ctx);
4310 *result = state->orig.out.result;
4312 tevent_req_received(req);
4313 return NT_STATUS_OK;
4316 NTSTATUS dcerpc_winreg_QueryValue(struct dcerpc_binding_handle *h,
4317 TALLOC_CTX *mem_ctx,
4318 struct policy_handle *_handle /* [in] [ref] */,
4319 struct winreg_String *_value_name /* [in] [ref] */,
4320 enum winreg_Type *_type /* [in,out] [unique] */,
4321 uint8_t *_data /* [in,out] [unique,range(0,0x4000000),length_is(data_length?*data_length:0),size_is(data_size?*data_size:0)] */,
4322 uint32_t *_data_size /* [in,out] [unique] */,
4323 uint32_t *_data_length /* [in,out] [unique] */,
4326 struct winreg_QueryValue r;
4330 r.in.handle = _handle;
4331 r.in.value_name = _value_name;
4334 r.in.data_size = _data_size;
4335 r.in.data_length = _data_length;
4337 status = dcerpc_winreg_QueryValue_r(h, mem_ctx, &r);
4338 if (!NT_STATUS_IS_OK(status)) {
4342 /* Return variables */
4343 if (_type && r.out.type) {
4344 *_type = *r.out.type;
4346 if (_data && r.out.data) {
4348 size_t _copy_len_data;
4349 if ((r.out.data_size?*r.out.data_size:0) > (r.in.data_size?*r.in.data_size:0)) {
4350 return NT_STATUS_INVALID_NETWORK_RESPONSE;
4352 if ((r.out.data_length?*r.out.data_length:0) > (r.out.data_size?*r.out.data_size:0)) {
4353 return NT_STATUS_INVALID_NETWORK_RESPONSE;
4355 _copy_len_data = r.out.data_length?*r.out.data_length:0;
4356 memcpy(_data, r.out.data, _copy_len_data * sizeof(*_data));
4359 if (_data_size && r.out.data_size) {
4360 *_data_size = *r.out.data_size;
4362 if (_data_length && r.out.data_length) {
4363 *_data_length = *r.out.data_length;
4367 *result = r.out.result;
4369 return NT_STATUS_OK;
4372 struct dcerpc_winreg_ReplaceKey_r_state {
4373 TALLOC_CTX *out_mem_ctx;
4376 static void dcerpc_winreg_ReplaceKey_r_done(struct tevent_req *subreq);
4378 struct tevent_req *dcerpc_winreg_ReplaceKey_r_send(TALLOC_CTX *mem_ctx,
4379 struct tevent_context *ev,
4380 struct dcerpc_binding_handle *h,
4381 struct winreg_ReplaceKey *r)
4383 struct tevent_req *req;
4384 struct dcerpc_winreg_ReplaceKey_r_state *state;
4385 struct tevent_req *subreq;
4387 req = tevent_req_create(mem_ctx, &state,
4388 struct dcerpc_winreg_ReplaceKey_r_state);
4393 state->out_mem_ctx = NULL;
4394 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4395 NULL, &ndr_table_winreg,
4396 NDR_WINREG_REPLACEKEY, state, r);
4397 if (tevent_req_nomem(subreq, req)) {
4398 return tevent_req_post(req, ev);
4400 tevent_req_set_callback(subreq, dcerpc_winreg_ReplaceKey_r_done, req);
4405 static void dcerpc_winreg_ReplaceKey_r_done(struct tevent_req *subreq)
4407 struct tevent_req *req =
4408 tevent_req_callback_data(subreq,
4412 status = dcerpc_binding_handle_call_recv(subreq);
4413 if (!NT_STATUS_IS_OK(status)) {
4414 tevent_req_nterror(req, status);
4418 tevent_req_done(req);
4421 NTSTATUS dcerpc_winreg_ReplaceKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4423 struct dcerpc_winreg_ReplaceKey_r_state *state =
4424 tevent_req_data(req,
4425 struct dcerpc_winreg_ReplaceKey_r_state);
4428 if (tevent_req_is_nterror(req, &status)) {
4429 tevent_req_received(req);
4433 talloc_steal(mem_ctx, state->out_mem_ctx);
4435 tevent_req_received(req);
4436 return NT_STATUS_OK;
4439 NTSTATUS dcerpc_winreg_ReplaceKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_ReplaceKey *r)
4443 status = dcerpc_binding_handle_call(h,
4444 NULL, &ndr_table_winreg,
4445 NDR_WINREG_REPLACEKEY, mem_ctx, r);
4450 NTSTATUS dcerpc_winreg_ReplaceKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_ReplaceKey *r)
4454 status = dcerpc_winreg_ReplaceKey_r(p->binding_handle, mem_ctx, r);
4456 if (NT_STATUS_IS_RPC(status)) {
4457 status = NT_STATUS_NET_WRITE_FAULT;
4463 struct dcerpc_winreg_ReplaceKey_state {
4464 struct winreg_ReplaceKey orig;
4465 struct winreg_ReplaceKey tmp;
4466 TALLOC_CTX *out_mem_ctx;
4469 static void dcerpc_winreg_ReplaceKey_done(struct tevent_req *subreq);
4471 struct tevent_req *dcerpc_winreg_ReplaceKey_send(TALLOC_CTX *mem_ctx,
4472 struct tevent_context *ev,
4473 struct dcerpc_binding_handle *h,
4474 struct policy_handle *_handle /* [in] [ref] */,
4475 struct winreg_String *_subkey /* [in] [ref] */,
4476 struct winreg_String *_new_file /* [in] [ref] */,
4477 struct winreg_String *_old_file /* [in] [ref] */)
4479 struct tevent_req *req;
4480 struct dcerpc_winreg_ReplaceKey_state *state;
4481 struct tevent_req *subreq;
4483 req = tevent_req_create(mem_ctx, &state,
4484 struct dcerpc_winreg_ReplaceKey_state);
4488 state->out_mem_ctx = NULL;
4491 state->orig.in.handle = _handle;
4492 state->orig.in.subkey = _subkey;
4493 state->orig.in.new_file = _new_file;
4494 state->orig.in.old_file = _old_file;
4496 /* Out parameters */
4499 ZERO_STRUCT(state->orig.out.result);
4501 /* make a temporary copy, that we pass to the dispatch function */
4502 state->tmp = state->orig;
4504 subreq = dcerpc_winreg_ReplaceKey_r_send(state, ev, h, &state->tmp);
4505 if (tevent_req_nomem(subreq, req)) {
4506 return tevent_req_post(req, ev);
4508 tevent_req_set_callback(subreq, dcerpc_winreg_ReplaceKey_done, req);
4512 static void dcerpc_winreg_ReplaceKey_done(struct tevent_req *subreq)
4514 struct tevent_req *req = tevent_req_callback_data(
4515 subreq, struct tevent_req);
4516 struct dcerpc_winreg_ReplaceKey_state *state = tevent_req_data(
4517 req, struct dcerpc_winreg_ReplaceKey_state);
4519 TALLOC_CTX *mem_ctx;
4521 if (state->out_mem_ctx) {
4522 mem_ctx = state->out_mem_ctx;
4527 status = dcerpc_winreg_ReplaceKey_r_recv(subreq, mem_ctx);
4528 TALLOC_FREE(subreq);
4529 if (!NT_STATUS_IS_OK(status)) {
4530 tevent_req_nterror(req, status);
4534 /* Copy out parameters */
4537 state->orig.out.result = state->tmp.out.result;
4539 /* Reset temporary structure */
4540 ZERO_STRUCT(state->tmp);
4542 tevent_req_done(req);
4545 NTSTATUS dcerpc_winreg_ReplaceKey_recv(struct tevent_req *req,
4546 TALLOC_CTX *mem_ctx,
4549 struct dcerpc_winreg_ReplaceKey_state *state = tevent_req_data(
4550 req, struct dcerpc_winreg_ReplaceKey_state);
4553 if (tevent_req_is_nterror(req, &status)) {
4554 tevent_req_received(req);
4558 /* Steal possible out parameters to the callers context */
4559 talloc_steal(mem_ctx, state->out_mem_ctx);
4562 *result = state->orig.out.result;
4564 tevent_req_received(req);
4565 return NT_STATUS_OK;
4568 NTSTATUS dcerpc_winreg_ReplaceKey(struct dcerpc_binding_handle *h,
4569 TALLOC_CTX *mem_ctx,
4570 struct policy_handle *_handle /* [in] [ref] */,
4571 struct winreg_String *_subkey /* [in] [ref] */,
4572 struct winreg_String *_new_file /* [in] [ref] */,
4573 struct winreg_String *_old_file /* [in] [ref] */,
4576 struct winreg_ReplaceKey r;
4580 r.in.handle = _handle;
4581 r.in.subkey = _subkey;
4582 r.in.new_file = _new_file;
4583 r.in.old_file = _old_file;
4585 status = dcerpc_winreg_ReplaceKey_r(h, mem_ctx, &r);
4586 if (!NT_STATUS_IS_OK(status)) {
4590 /* Return variables */
4593 *result = r.out.result;
4595 return NT_STATUS_OK;
4598 struct dcerpc_winreg_RestoreKey_r_state {
4599 TALLOC_CTX *out_mem_ctx;
4602 static void dcerpc_winreg_RestoreKey_r_done(struct tevent_req *subreq);
4604 struct tevent_req *dcerpc_winreg_RestoreKey_r_send(TALLOC_CTX *mem_ctx,
4605 struct tevent_context *ev,
4606 struct dcerpc_binding_handle *h,
4607 struct winreg_RestoreKey *r)
4609 struct tevent_req *req;
4610 struct dcerpc_winreg_RestoreKey_r_state *state;
4611 struct tevent_req *subreq;
4613 req = tevent_req_create(mem_ctx, &state,
4614 struct dcerpc_winreg_RestoreKey_r_state);
4619 state->out_mem_ctx = NULL;
4620 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4621 NULL, &ndr_table_winreg,
4622 NDR_WINREG_RESTOREKEY, state, r);
4623 if (tevent_req_nomem(subreq, req)) {
4624 return tevent_req_post(req, ev);
4626 tevent_req_set_callback(subreq, dcerpc_winreg_RestoreKey_r_done, req);
4631 static void dcerpc_winreg_RestoreKey_r_done(struct tevent_req *subreq)
4633 struct tevent_req *req =
4634 tevent_req_callback_data(subreq,
4638 status = dcerpc_binding_handle_call_recv(subreq);
4639 if (!NT_STATUS_IS_OK(status)) {
4640 tevent_req_nterror(req, status);
4644 tevent_req_done(req);
4647 NTSTATUS dcerpc_winreg_RestoreKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4649 struct dcerpc_winreg_RestoreKey_r_state *state =
4650 tevent_req_data(req,
4651 struct dcerpc_winreg_RestoreKey_r_state);
4654 if (tevent_req_is_nterror(req, &status)) {
4655 tevent_req_received(req);
4659 talloc_steal(mem_ctx, state->out_mem_ctx);
4661 tevent_req_received(req);
4662 return NT_STATUS_OK;
4665 NTSTATUS dcerpc_winreg_RestoreKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_RestoreKey *r)
4669 status = dcerpc_binding_handle_call(h,
4670 NULL, &ndr_table_winreg,
4671 NDR_WINREG_RESTOREKEY, mem_ctx, r);
4676 NTSTATUS dcerpc_winreg_RestoreKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_RestoreKey *r)
4680 status = dcerpc_winreg_RestoreKey_r(p->binding_handle, mem_ctx, r);
4682 if (NT_STATUS_IS_RPC(status)) {
4683 status = NT_STATUS_NET_WRITE_FAULT;
4689 struct dcerpc_winreg_RestoreKey_state {
4690 struct winreg_RestoreKey orig;
4691 struct winreg_RestoreKey tmp;
4692 TALLOC_CTX *out_mem_ctx;
4695 static void dcerpc_winreg_RestoreKey_done(struct tevent_req *subreq);
4697 struct tevent_req *dcerpc_winreg_RestoreKey_send(TALLOC_CTX *mem_ctx,
4698 struct tevent_context *ev,
4699 struct dcerpc_binding_handle *h,
4700 struct policy_handle *_handle /* [in] [ref] */,
4701 struct winreg_String *_filename /* [in] [ref] */,
4702 uint32_t _flags /* [in] */)
4704 struct tevent_req *req;
4705 struct dcerpc_winreg_RestoreKey_state *state;
4706 struct tevent_req *subreq;
4708 req = tevent_req_create(mem_ctx, &state,
4709 struct dcerpc_winreg_RestoreKey_state);
4713 state->out_mem_ctx = NULL;
4716 state->orig.in.handle = _handle;
4717 state->orig.in.filename = _filename;
4718 state->orig.in.flags = _flags;
4720 /* Out parameters */
4723 ZERO_STRUCT(state->orig.out.result);
4725 /* make a temporary copy, that we pass to the dispatch function */
4726 state->tmp = state->orig;
4728 subreq = dcerpc_winreg_RestoreKey_r_send(state, ev, h, &state->tmp);
4729 if (tevent_req_nomem(subreq, req)) {
4730 return tevent_req_post(req, ev);
4732 tevent_req_set_callback(subreq, dcerpc_winreg_RestoreKey_done, req);
4736 static void dcerpc_winreg_RestoreKey_done(struct tevent_req *subreq)
4738 struct tevent_req *req = tevent_req_callback_data(
4739 subreq, struct tevent_req);
4740 struct dcerpc_winreg_RestoreKey_state *state = tevent_req_data(
4741 req, struct dcerpc_winreg_RestoreKey_state);
4743 TALLOC_CTX *mem_ctx;
4745 if (state->out_mem_ctx) {
4746 mem_ctx = state->out_mem_ctx;
4751 status = dcerpc_winreg_RestoreKey_r_recv(subreq, mem_ctx);
4752 TALLOC_FREE(subreq);
4753 if (!NT_STATUS_IS_OK(status)) {
4754 tevent_req_nterror(req, status);
4758 /* Copy out parameters */
4761 state->orig.out.result = state->tmp.out.result;
4763 /* Reset temporary structure */
4764 ZERO_STRUCT(state->tmp);
4766 tevent_req_done(req);
4769 NTSTATUS dcerpc_winreg_RestoreKey_recv(struct tevent_req *req,
4770 TALLOC_CTX *mem_ctx,
4773 struct dcerpc_winreg_RestoreKey_state *state = tevent_req_data(
4774 req, struct dcerpc_winreg_RestoreKey_state);
4777 if (tevent_req_is_nterror(req, &status)) {
4778 tevent_req_received(req);
4782 /* Steal possible out parameters to the callers context */
4783 talloc_steal(mem_ctx, state->out_mem_ctx);
4786 *result = state->orig.out.result;
4788 tevent_req_received(req);
4789 return NT_STATUS_OK;
4792 NTSTATUS dcerpc_winreg_RestoreKey(struct dcerpc_binding_handle *h,
4793 TALLOC_CTX *mem_ctx,
4794 struct policy_handle *_handle /* [in] [ref] */,
4795 struct winreg_String *_filename /* [in] [ref] */,
4796 uint32_t _flags /* [in] */,
4799 struct winreg_RestoreKey r;
4803 r.in.handle = _handle;
4804 r.in.filename = _filename;
4805 r.in.flags = _flags;
4807 status = dcerpc_winreg_RestoreKey_r(h, mem_ctx, &r);
4808 if (!NT_STATUS_IS_OK(status)) {
4812 /* Return variables */
4815 *result = r.out.result;
4817 return NT_STATUS_OK;
4820 struct dcerpc_winreg_SaveKey_r_state {
4821 TALLOC_CTX *out_mem_ctx;
4824 static void dcerpc_winreg_SaveKey_r_done(struct tevent_req *subreq);
4826 struct tevent_req *dcerpc_winreg_SaveKey_r_send(TALLOC_CTX *mem_ctx,
4827 struct tevent_context *ev,
4828 struct dcerpc_binding_handle *h,
4829 struct winreg_SaveKey *r)
4831 struct tevent_req *req;
4832 struct dcerpc_winreg_SaveKey_r_state *state;
4833 struct tevent_req *subreq;
4835 req = tevent_req_create(mem_ctx, &state,
4836 struct dcerpc_winreg_SaveKey_r_state);
4841 state->out_mem_ctx = NULL;
4842 subreq = dcerpc_binding_handle_call_send(state, ev, h,
4843 NULL, &ndr_table_winreg,
4844 NDR_WINREG_SAVEKEY, state, r);
4845 if (tevent_req_nomem(subreq, req)) {
4846 return tevent_req_post(req, ev);
4848 tevent_req_set_callback(subreq, dcerpc_winreg_SaveKey_r_done, req);
4853 static void dcerpc_winreg_SaveKey_r_done(struct tevent_req *subreq)
4855 struct tevent_req *req =
4856 tevent_req_callback_data(subreq,
4860 status = dcerpc_binding_handle_call_recv(subreq);
4861 if (!NT_STATUS_IS_OK(status)) {
4862 tevent_req_nterror(req, status);
4866 tevent_req_done(req);
4869 NTSTATUS dcerpc_winreg_SaveKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4871 struct dcerpc_winreg_SaveKey_r_state *state =
4872 tevent_req_data(req,
4873 struct dcerpc_winreg_SaveKey_r_state);
4876 if (tevent_req_is_nterror(req, &status)) {
4877 tevent_req_received(req);
4881 talloc_steal(mem_ctx, state->out_mem_ctx);
4883 tevent_req_received(req);
4884 return NT_STATUS_OK;
4887 NTSTATUS dcerpc_winreg_SaveKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_SaveKey *r)
4891 status = dcerpc_binding_handle_call(h,
4892 NULL, &ndr_table_winreg,
4893 NDR_WINREG_SAVEKEY, mem_ctx, r);
4898 NTSTATUS dcerpc_winreg_SaveKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_SaveKey *r)
4902 status = dcerpc_winreg_SaveKey_r(p->binding_handle, mem_ctx, r);
4904 if (NT_STATUS_IS_RPC(status)) {
4905 status = NT_STATUS_NET_WRITE_FAULT;
4911 struct dcerpc_winreg_SaveKey_state {
4912 struct winreg_SaveKey orig;
4913 struct winreg_SaveKey tmp;
4914 TALLOC_CTX *out_mem_ctx;
4917 static void dcerpc_winreg_SaveKey_done(struct tevent_req *subreq);
4919 struct tevent_req *dcerpc_winreg_SaveKey_send(TALLOC_CTX *mem_ctx,
4920 struct tevent_context *ev,
4921 struct dcerpc_binding_handle *h,
4922 struct policy_handle *_handle /* [in] [ref] */,
4923 struct winreg_String *_filename /* [in] [ref] */,
4924 struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */)
4926 struct tevent_req *req;
4927 struct dcerpc_winreg_SaveKey_state *state;
4928 struct tevent_req *subreq;
4930 req = tevent_req_create(mem_ctx, &state,
4931 struct dcerpc_winreg_SaveKey_state);
4935 state->out_mem_ctx = NULL;
4938 state->orig.in.handle = _handle;
4939 state->orig.in.filename = _filename;
4940 state->orig.in.sec_attrib = _sec_attrib;
4942 /* Out parameters */
4945 ZERO_STRUCT(state->orig.out.result);
4947 /* make a temporary copy, that we pass to the dispatch function */
4948 state->tmp = state->orig;
4950 subreq = dcerpc_winreg_SaveKey_r_send(state, ev, h, &state->tmp);
4951 if (tevent_req_nomem(subreq, req)) {
4952 return tevent_req_post(req, ev);
4954 tevent_req_set_callback(subreq, dcerpc_winreg_SaveKey_done, req);
4958 static void dcerpc_winreg_SaveKey_done(struct tevent_req *subreq)
4960 struct tevent_req *req = tevent_req_callback_data(
4961 subreq, struct tevent_req);
4962 struct dcerpc_winreg_SaveKey_state *state = tevent_req_data(
4963 req, struct dcerpc_winreg_SaveKey_state);
4965 TALLOC_CTX *mem_ctx;
4967 if (state->out_mem_ctx) {
4968 mem_ctx = state->out_mem_ctx;
4973 status = dcerpc_winreg_SaveKey_r_recv(subreq, mem_ctx);
4974 TALLOC_FREE(subreq);
4975 if (!NT_STATUS_IS_OK(status)) {
4976 tevent_req_nterror(req, status);
4980 /* Copy out parameters */
4983 state->orig.out.result = state->tmp.out.result;
4985 /* Reset temporary structure */
4986 ZERO_STRUCT(state->tmp);
4988 tevent_req_done(req);
4991 NTSTATUS dcerpc_winreg_SaveKey_recv(struct tevent_req *req,
4992 TALLOC_CTX *mem_ctx,
4995 struct dcerpc_winreg_SaveKey_state *state = tevent_req_data(
4996 req, struct dcerpc_winreg_SaveKey_state);
4999 if (tevent_req_is_nterror(req, &status)) {
5000 tevent_req_received(req);
5004 /* Steal possible out parameters to the callers context */
5005 talloc_steal(mem_ctx, state->out_mem_ctx);
5008 *result = state->orig.out.result;
5010 tevent_req_received(req);
5011 return NT_STATUS_OK;
5014 NTSTATUS dcerpc_winreg_SaveKey(struct dcerpc_binding_handle *h,
5015 TALLOC_CTX *mem_ctx,
5016 struct policy_handle *_handle /* [in] [ref] */,
5017 struct winreg_String *_filename /* [in] [ref] */,
5018 struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */,
5021 struct winreg_SaveKey r;
5025 r.in.handle = _handle;
5026 r.in.filename = _filename;
5027 r.in.sec_attrib = _sec_attrib;
5029 status = dcerpc_winreg_SaveKey_r(h, mem_ctx, &r);
5030 if (!NT_STATUS_IS_OK(status)) {
5034 /* Return variables */
5037 *result = r.out.result;
5039 return NT_STATUS_OK;
5042 struct dcerpc_winreg_SetKeySecurity_r_state {
5043 TALLOC_CTX *out_mem_ctx;
5046 static void dcerpc_winreg_SetKeySecurity_r_done(struct tevent_req *subreq);
5048 struct tevent_req *dcerpc_winreg_SetKeySecurity_r_send(TALLOC_CTX *mem_ctx,
5049 struct tevent_context *ev,
5050 struct dcerpc_binding_handle *h,
5051 struct winreg_SetKeySecurity *r)
5053 struct tevent_req *req;
5054 struct dcerpc_winreg_SetKeySecurity_r_state *state;
5055 struct tevent_req *subreq;
5057 req = tevent_req_create(mem_ctx, &state,
5058 struct dcerpc_winreg_SetKeySecurity_r_state);
5063 state->out_mem_ctx = NULL;
5064 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5065 NULL, &ndr_table_winreg,
5066 NDR_WINREG_SETKEYSECURITY, state, r);
5067 if (tevent_req_nomem(subreq, req)) {
5068 return tevent_req_post(req, ev);
5070 tevent_req_set_callback(subreq, dcerpc_winreg_SetKeySecurity_r_done, req);
5075 static void dcerpc_winreg_SetKeySecurity_r_done(struct tevent_req *subreq)
5077 struct tevent_req *req =
5078 tevent_req_callback_data(subreq,
5082 status = dcerpc_binding_handle_call_recv(subreq);
5083 if (!NT_STATUS_IS_OK(status)) {
5084 tevent_req_nterror(req, status);
5088 tevent_req_done(req);
5091 NTSTATUS dcerpc_winreg_SetKeySecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5093 struct dcerpc_winreg_SetKeySecurity_r_state *state =
5094 tevent_req_data(req,
5095 struct dcerpc_winreg_SetKeySecurity_r_state);
5098 if (tevent_req_is_nterror(req, &status)) {
5099 tevent_req_received(req);
5103 talloc_steal(mem_ctx, state->out_mem_ctx);
5105 tevent_req_received(req);
5106 return NT_STATUS_OK;
5109 NTSTATUS dcerpc_winreg_SetKeySecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_SetKeySecurity *r)
5113 status = dcerpc_binding_handle_call(h,
5114 NULL, &ndr_table_winreg,
5115 NDR_WINREG_SETKEYSECURITY, mem_ctx, r);
5120 NTSTATUS dcerpc_winreg_SetKeySecurity_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_SetKeySecurity *r)
5124 status = dcerpc_winreg_SetKeySecurity_r(p->binding_handle, mem_ctx, r);
5126 if (NT_STATUS_IS_RPC(status)) {
5127 status = NT_STATUS_NET_WRITE_FAULT;
5133 struct dcerpc_winreg_SetKeySecurity_state {
5134 struct winreg_SetKeySecurity orig;
5135 struct winreg_SetKeySecurity tmp;
5136 TALLOC_CTX *out_mem_ctx;
5139 static void dcerpc_winreg_SetKeySecurity_done(struct tevent_req *subreq);
5141 struct tevent_req *dcerpc_winreg_SetKeySecurity_send(TALLOC_CTX *mem_ctx,
5142 struct tevent_context *ev,
5143 struct dcerpc_binding_handle *h,
5144 struct policy_handle *_handle /* [in] [ref] */,
5145 uint32_t _sec_info /* [in] */,
5146 struct KeySecurityData *_sd /* [in] [ref] */)
5148 struct tevent_req *req;
5149 struct dcerpc_winreg_SetKeySecurity_state *state;
5150 struct tevent_req *subreq;
5152 req = tevent_req_create(mem_ctx, &state,
5153 struct dcerpc_winreg_SetKeySecurity_state);
5157 state->out_mem_ctx = NULL;
5160 state->orig.in.handle = _handle;
5161 state->orig.in.sec_info = _sec_info;
5162 state->orig.in.sd = _sd;
5164 /* Out parameters */
5167 ZERO_STRUCT(state->orig.out.result);
5169 /* make a temporary copy, that we pass to the dispatch function */
5170 state->tmp = state->orig;
5172 subreq = dcerpc_winreg_SetKeySecurity_r_send(state, ev, h, &state->tmp);
5173 if (tevent_req_nomem(subreq, req)) {
5174 return tevent_req_post(req, ev);
5176 tevent_req_set_callback(subreq, dcerpc_winreg_SetKeySecurity_done, req);
5180 static void dcerpc_winreg_SetKeySecurity_done(struct tevent_req *subreq)
5182 struct tevent_req *req = tevent_req_callback_data(
5183 subreq, struct tevent_req);
5184 struct dcerpc_winreg_SetKeySecurity_state *state = tevent_req_data(
5185 req, struct dcerpc_winreg_SetKeySecurity_state);
5187 TALLOC_CTX *mem_ctx;
5189 if (state->out_mem_ctx) {
5190 mem_ctx = state->out_mem_ctx;
5195 status = dcerpc_winreg_SetKeySecurity_r_recv(subreq, mem_ctx);
5196 TALLOC_FREE(subreq);
5197 if (!NT_STATUS_IS_OK(status)) {
5198 tevent_req_nterror(req, status);
5202 /* Copy out parameters */
5205 state->orig.out.result = state->tmp.out.result;
5207 /* Reset temporary structure */
5208 ZERO_STRUCT(state->tmp);
5210 tevent_req_done(req);
5213 NTSTATUS dcerpc_winreg_SetKeySecurity_recv(struct tevent_req *req,
5214 TALLOC_CTX *mem_ctx,
5217 struct dcerpc_winreg_SetKeySecurity_state *state = tevent_req_data(
5218 req, struct dcerpc_winreg_SetKeySecurity_state);
5221 if (tevent_req_is_nterror(req, &status)) {
5222 tevent_req_received(req);
5226 /* Steal possible out parameters to the callers context */
5227 talloc_steal(mem_ctx, state->out_mem_ctx);
5230 *result = state->orig.out.result;
5232 tevent_req_received(req);
5233 return NT_STATUS_OK;
5236 NTSTATUS dcerpc_winreg_SetKeySecurity(struct dcerpc_binding_handle *h,
5237 TALLOC_CTX *mem_ctx,
5238 struct policy_handle *_handle /* [in] [ref] */,
5239 uint32_t _sec_info /* [in] */,
5240 struct KeySecurityData *_sd /* [in] [ref] */,
5243 struct winreg_SetKeySecurity r;
5247 r.in.handle = _handle;
5248 r.in.sec_info = _sec_info;
5251 status = dcerpc_winreg_SetKeySecurity_r(h, mem_ctx, &r);
5252 if (!NT_STATUS_IS_OK(status)) {
5256 /* Return variables */
5259 *result = r.out.result;
5261 return NT_STATUS_OK;
5264 struct dcerpc_winreg_SetValue_r_state {
5265 TALLOC_CTX *out_mem_ctx;
5268 static void dcerpc_winreg_SetValue_r_done(struct tevent_req *subreq);
5270 struct tevent_req *dcerpc_winreg_SetValue_r_send(TALLOC_CTX *mem_ctx,
5271 struct tevent_context *ev,
5272 struct dcerpc_binding_handle *h,
5273 struct winreg_SetValue *r)
5275 struct tevent_req *req;
5276 struct dcerpc_winreg_SetValue_r_state *state;
5277 struct tevent_req *subreq;
5279 req = tevent_req_create(mem_ctx, &state,
5280 struct dcerpc_winreg_SetValue_r_state);
5285 state->out_mem_ctx = NULL;
5286 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5287 NULL, &ndr_table_winreg,
5288 NDR_WINREG_SETVALUE, state, r);
5289 if (tevent_req_nomem(subreq, req)) {
5290 return tevent_req_post(req, ev);
5292 tevent_req_set_callback(subreq, dcerpc_winreg_SetValue_r_done, req);
5297 static void dcerpc_winreg_SetValue_r_done(struct tevent_req *subreq)
5299 struct tevent_req *req =
5300 tevent_req_callback_data(subreq,
5304 status = dcerpc_binding_handle_call_recv(subreq);
5305 if (!NT_STATUS_IS_OK(status)) {
5306 tevent_req_nterror(req, status);
5310 tevent_req_done(req);
5313 NTSTATUS dcerpc_winreg_SetValue_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5315 struct dcerpc_winreg_SetValue_r_state *state =
5316 tevent_req_data(req,
5317 struct dcerpc_winreg_SetValue_r_state);
5320 if (tevent_req_is_nterror(req, &status)) {
5321 tevent_req_received(req);
5325 talloc_steal(mem_ctx, state->out_mem_ctx);
5327 tevent_req_received(req);
5328 return NT_STATUS_OK;
5331 NTSTATUS dcerpc_winreg_SetValue_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_SetValue *r)
5335 status = dcerpc_binding_handle_call(h,
5336 NULL, &ndr_table_winreg,
5337 NDR_WINREG_SETVALUE, mem_ctx, r);
5342 NTSTATUS dcerpc_winreg_SetValue_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_SetValue *r)
5346 status = dcerpc_winreg_SetValue_r(p->binding_handle, mem_ctx, r);
5348 if (NT_STATUS_IS_RPC(status)) {
5349 status = NT_STATUS_NET_WRITE_FAULT;
5355 struct dcerpc_winreg_SetValue_state {
5356 struct winreg_SetValue orig;
5357 struct winreg_SetValue tmp;
5358 TALLOC_CTX *out_mem_ctx;
5361 static void dcerpc_winreg_SetValue_done(struct tevent_req *subreq);
5363 struct tevent_req *dcerpc_winreg_SetValue_send(TALLOC_CTX *mem_ctx,
5364 struct tevent_context *ev,
5365 struct dcerpc_binding_handle *h,
5366 struct policy_handle *_handle /* [in] [ref] */,
5367 struct winreg_String _name /* [in] */,
5368 enum winreg_Type _type /* [in] */,
5369 uint8_t *_data /* [in] [ref,size_is(size)] */,
5370 uint32_t _size /* [in] */)
5372 struct tevent_req *req;
5373 struct dcerpc_winreg_SetValue_state *state;
5374 struct tevent_req *subreq;
5376 req = tevent_req_create(mem_ctx, &state,
5377 struct dcerpc_winreg_SetValue_state);
5381 state->out_mem_ctx = NULL;
5384 state->orig.in.handle = _handle;
5385 state->orig.in.name = _name;
5386 state->orig.in.type = _type;
5387 state->orig.in.data = _data;
5388 state->orig.in.size = _size;
5390 /* Out parameters */
5393 ZERO_STRUCT(state->orig.out.result);
5395 /* make a temporary copy, that we pass to the dispatch function */
5396 state->tmp = state->orig;
5398 subreq = dcerpc_winreg_SetValue_r_send(state, ev, h, &state->tmp);
5399 if (tevent_req_nomem(subreq, req)) {
5400 return tevent_req_post(req, ev);
5402 tevent_req_set_callback(subreq, dcerpc_winreg_SetValue_done, req);
5406 static void dcerpc_winreg_SetValue_done(struct tevent_req *subreq)
5408 struct tevent_req *req = tevent_req_callback_data(
5409 subreq, struct tevent_req);
5410 struct dcerpc_winreg_SetValue_state *state = tevent_req_data(
5411 req, struct dcerpc_winreg_SetValue_state);
5413 TALLOC_CTX *mem_ctx;
5415 if (state->out_mem_ctx) {
5416 mem_ctx = state->out_mem_ctx;
5421 status = dcerpc_winreg_SetValue_r_recv(subreq, mem_ctx);
5422 TALLOC_FREE(subreq);
5423 if (!NT_STATUS_IS_OK(status)) {
5424 tevent_req_nterror(req, status);
5428 /* Copy out parameters */
5431 state->orig.out.result = state->tmp.out.result;
5433 /* Reset temporary structure */
5434 ZERO_STRUCT(state->tmp);
5436 tevent_req_done(req);
5439 NTSTATUS dcerpc_winreg_SetValue_recv(struct tevent_req *req,
5440 TALLOC_CTX *mem_ctx,
5443 struct dcerpc_winreg_SetValue_state *state = tevent_req_data(
5444 req, struct dcerpc_winreg_SetValue_state);
5447 if (tevent_req_is_nterror(req, &status)) {
5448 tevent_req_received(req);
5452 /* Steal possible out parameters to the callers context */
5453 talloc_steal(mem_ctx, state->out_mem_ctx);
5456 *result = state->orig.out.result;
5458 tevent_req_received(req);
5459 return NT_STATUS_OK;
5462 NTSTATUS dcerpc_winreg_SetValue(struct dcerpc_binding_handle *h,
5463 TALLOC_CTX *mem_ctx,
5464 struct policy_handle *_handle /* [in] [ref] */,
5465 struct winreg_String _name /* [in] */,
5466 enum winreg_Type _type /* [in] */,
5467 uint8_t *_data /* [in] [ref,size_is(size)] */,
5468 uint32_t _size /* [in] */,
5471 struct winreg_SetValue r;
5475 r.in.handle = _handle;
5481 status = dcerpc_winreg_SetValue_r(h, mem_ctx, &r);
5482 if (!NT_STATUS_IS_OK(status)) {
5486 /* Return variables */
5489 *result = r.out.result;
5491 return NT_STATUS_OK;
5494 struct dcerpc_winreg_UnLoadKey_r_state {
5495 TALLOC_CTX *out_mem_ctx;
5498 static void dcerpc_winreg_UnLoadKey_r_done(struct tevent_req *subreq);
5500 struct tevent_req *dcerpc_winreg_UnLoadKey_r_send(TALLOC_CTX *mem_ctx,
5501 struct tevent_context *ev,
5502 struct dcerpc_binding_handle *h,
5503 struct winreg_UnLoadKey *r)
5505 struct tevent_req *req;
5506 struct dcerpc_winreg_UnLoadKey_r_state *state;
5507 struct tevent_req *subreq;
5509 req = tevent_req_create(mem_ctx, &state,
5510 struct dcerpc_winreg_UnLoadKey_r_state);
5515 state->out_mem_ctx = NULL;
5516 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5517 NULL, &ndr_table_winreg,
5518 NDR_WINREG_UNLOADKEY, state, r);
5519 if (tevent_req_nomem(subreq, req)) {
5520 return tevent_req_post(req, ev);
5522 tevent_req_set_callback(subreq, dcerpc_winreg_UnLoadKey_r_done, req);
5527 static void dcerpc_winreg_UnLoadKey_r_done(struct tevent_req *subreq)
5529 struct tevent_req *req =
5530 tevent_req_callback_data(subreq,
5534 status = dcerpc_binding_handle_call_recv(subreq);
5535 if (!NT_STATUS_IS_OK(status)) {
5536 tevent_req_nterror(req, status);
5540 tevent_req_done(req);
5543 NTSTATUS dcerpc_winreg_UnLoadKey_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5545 struct dcerpc_winreg_UnLoadKey_r_state *state =
5546 tevent_req_data(req,
5547 struct dcerpc_winreg_UnLoadKey_r_state);
5550 if (tevent_req_is_nterror(req, &status)) {
5551 tevent_req_received(req);
5555 talloc_steal(mem_ctx, state->out_mem_ctx);
5557 tevent_req_received(req);
5558 return NT_STATUS_OK;
5561 NTSTATUS dcerpc_winreg_UnLoadKey_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_UnLoadKey *r)
5565 status = dcerpc_binding_handle_call(h,
5566 NULL, &ndr_table_winreg,
5567 NDR_WINREG_UNLOADKEY, mem_ctx, r);
5572 NTSTATUS dcerpc_winreg_UnLoadKey_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_UnLoadKey *r)
5576 status = dcerpc_winreg_UnLoadKey_r(p->binding_handle, mem_ctx, r);
5578 if (NT_STATUS_IS_RPC(status)) {
5579 status = NT_STATUS_NET_WRITE_FAULT;
5585 struct dcerpc_winreg_UnLoadKey_state {
5586 struct winreg_UnLoadKey orig;
5587 struct winreg_UnLoadKey tmp;
5588 TALLOC_CTX *out_mem_ctx;
5591 static void dcerpc_winreg_UnLoadKey_done(struct tevent_req *subreq);
5593 struct tevent_req *dcerpc_winreg_UnLoadKey_send(TALLOC_CTX *mem_ctx,
5594 struct tevent_context *ev,
5595 struct dcerpc_binding_handle *h,
5596 struct policy_handle *_handle /* [in] [ref] */,
5597 struct winreg_String *_subkey /* [in] [ref] */)
5599 struct tevent_req *req;
5600 struct dcerpc_winreg_UnLoadKey_state *state;
5601 struct tevent_req *subreq;
5603 req = tevent_req_create(mem_ctx, &state,
5604 struct dcerpc_winreg_UnLoadKey_state);
5608 state->out_mem_ctx = NULL;
5611 state->orig.in.handle = _handle;
5612 state->orig.in.subkey = _subkey;
5614 /* Out parameters */
5617 ZERO_STRUCT(state->orig.out.result);
5619 /* make a temporary copy, that we pass to the dispatch function */
5620 state->tmp = state->orig;
5622 subreq = dcerpc_winreg_UnLoadKey_r_send(state, ev, h, &state->tmp);
5623 if (tevent_req_nomem(subreq, req)) {
5624 return tevent_req_post(req, ev);
5626 tevent_req_set_callback(subreq, dcerpc_winreg_UnLoadKey_done, req);
5630 static void dcerpc_winreg_UnLoadKey_done(struct tevent_req *subreq)
5632 struct tevent_req *req = tevent_req_callback_data(
5633 subreq, struct tevent_req);
5634 struct dcerpc_winreg_UnLoadKey_state *state = tevent_req_data(
5635 req, struct dcerpc_winreg_UnLoadKey_state);
5637 TALLOC_CTX *mem_ctx;
5639 if (state->out_mem_ctx) {
5640 mem_ctx = state->out_mem_ctx;
5645 status = dcerpc_winreg_UnLoadKey_r_recv(subreq, mem_ctx);
5646 TALLOC_FREE(subreq);
5647 if (!NT_STATUS_IS_OK(status)) {
5648 tevent_req_nterror(req, status);
5652 /* Copy out parameters */
5655 state->orig.out.result = state->tmp.out.result;
5657 /* Reset temporary structure */
5658 ZERO_STRUCT(state->tmp);
5660 tevent_req_done(req);
5663 NTSTATUS dcerpc_winreg_UnLoadKey_recv(struct tevent_req *req,
5664 TALLOC_CTX *mem_ctx,
5667 struct dcerpc_winreg_UnLoadKey_state *state = tevent_req_data(
5668 req, struct dcerpc_winreg_UnLoadKey_state);
5671 if (tevent_req_is_nterror(req, &status)) {
5672 tevent_req_received(req);
5676 /* Steal possible out parameters to the callers context */
5677 talloc_steal(mem_ctx, state->out_mem_ctx);
5680 *result = state->orig.out.result;
5682 tevent_req_received(req);
5683 return NT_STATUS_OK;
5686 NTSTATUS dcerpc_winreg_UnLoadKey(struct dcerpc_binding_handle *h,
5687 TALLOC_CTX *mem_ctx,
5688 struct policy_handle *_handle /* [in] [ref] */,
5689 struct winreg_String *_subkey /* [in] [ref] */,
5692 struct winreg_UnLoadKey r;
5696 r.in.handle = _handle;
5697 r.in.subkey = _subkey;
5699 status = dcerpc_winreg_UnLoadKey_r(h, mem_ctx, &r);
5700 if (!NT_STATUS_IS_OK(status)) {
5704 /* Return variables */
5707 *result = r.out.result;
5709 return NT_STATUS_OK;
5712 struct dcerpc_winreg_InitiateSystemShutdown_r_state {
5713 TALLOC_CTX *out_mem_ctx;
5716 static void dcerpc_winreg_InitiateSystemShutdown_r_done(struct tevent_req *subreq);
5718 struct tevent_req *dcerpc_winreg_InitiateSystemShutdown_r_send(TALLOC_CTX *mem_ctx,
5719 struct tevent_context *ev,
5720 struct dcerpc_binding_handle *h,
5721 struct winreg_InitiateSystemShutdown *r)
5723 struct tevent_req *req;
5724 struct dcerpc_winreg_InitiateSystemShutdown_r_state *state;
5725 struct tevent_req *subreq;
5727 req = tevent_req_create(mem_ctx, &state,
5728 struct dcerpc_winreg_InitiateSystemShutdown_r_state);
5733 state->out_mem_ctx = NULL;
5734 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5735 NULL, &ndr_table_winreg,
5736 NDR_WINREG_INITIATESYSTEMSHUTDOWN, state, r);
5737 if (tevent_req_nomem(subreq, req)) {
5738 return tevent_req_post(req, ev);
5740 tevent_req_set_callback(subreq, dcerpc_winreg_InitiateSystemShutdown_r_done, req);
5745 static void dcerpc_winreg_InitiateSystemShutdown_r_done(struct tevent_req *subreq)
5747 struct tevent_req *req =
5748 tevent_req_callback_data(subreq,
5752 status = dcerpc_binding_handle_call_recv(subreq);
5753 if (!NT_STATUS_IS_OK(status)) {
5754 tevent_req_nterror(req, status);
5758 tevent_req_done(req);
5761 NTSTATUS dcerpc_winreg_InitiateSystemShutdown_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5763 struct dcerpc_winreg_InitiateSystemShutdown_r_state *state =
5764 tevent_req_data(req,
5765 struct dcerpc_winreg_InitiateSystemShutdown_r_state);
5768 if (tevent_req_is_nterror(req, &status)) {
5769 tevent_req_received(req);
5773 talloc_steal(mem_ctx, state->out_mem_ctx);
5775 tevent_req_received(req);
5776 return NT_STATUS_OK;
5779 NTSTATUS dcerpc_winreg_InitiateSystemShutdown_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_InitiateSystemShutdown *r)
5783 status = dcerpc_binding_handle_call(h,
5784 NULL, &ndr_table_winreg,
5785 NDR_WINREG_INITIATESYSTEMSHUTDOWN, mem_ctx, r);
5790 NTSTATUS dcerpc_winreg_InitiateSystemShutdown_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_InitiateSystemShutdown *r)
5794 status = dcerpc_winreg_InitiateSystemShutdown_r(p->binding_handle, mem_ctx, r);
5796 if (NT_STATUS_IS_RPC(status)) {
5797 status = NT_STATUS_NET_WRITE_FAULT;
5803 struct dcerpc_winreg_InitiateSystemShutdown_state {
5804 struct winreg_InitiateSystemShutdown orig;
5805 struct winreg_InitiateSystemShutdown tmp;
5806 TALLOC_CTX *out_mem_ctx;
5809 static void dcerpc_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq);
5811 struct tevent_req *dcerpc_winreg_InitiateSystemShutdown_send(TALLOC_CTX *mem_ctx,
5812 struct tevent_context *ev,
5813 struct dcerpc_binding_handle *h,
5814 uint16_t *_hostname /* [in] [unique] */,
5815 struct lsa_StringLarge *_message /* [in] [unique] */,
5816 uint32_t _timeout /* [in] */,
5817 uint8_t _force_apps /* [in] */,
5818 uint8_t _do_reboot /* [in] */)
5820 struct tevent_req *req;
5821 struct dcerpc_winreg_InitiateSystemShutdown_state *state;
5822 struct tevent_req *subreq;
5824 req = tevent_req_create(mem_ctx, &state,
5825 struct dcerpc_winreg_InitiateSystemShutdown_state);
5829 state->out_mem_ctx = NULL;
5832 state->orig.in.hostname = _hostname;
5833 state->orig.in.message = _message;
5834 state->orig.in.timeout = _timeout;
5835 state->orig.in.force_apps = _force_apps;
5836 state->orig.in.do_reboot = _do_reboot;
5838 /* Out parameters */
5841 ZERO_STRUCT(state->orig.out.result);
5843 /* make a temporary copy, that we pass to the dispatch function */
5844 state->tmp = state->orig;
5846 subreq = dcerpc_winreg_InitiateSystemShutdown_r_send(state, ev, h, &state->tmp);
5847 if (tevent_req_nomem(subreq, req)) {
5848 return tevent_req_post(req, ev);
5850 tevent_req_set_callback(subreq, dcerpc_winreg_InitiateSystemShutdown_done, req);
5854 static void dcerpc_winreg_InitiateSystemShutdown_done(struct tevent_req *subreq)
5856 struct tevent_req *req = tevent_req_callback_data(
5857 subreq, struct tevent_req);
5858 struct dcerpc_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
5859 req, struct dcerpc_winreg_InitiateSystemShutdown_state);
5861 TALLOC_CTX *mem_ctx;
5863 if (state->out_mem_ctx) {
5864 mem_ctx = state->out_mem_ctx;
5869 status = dcerpc_winreg_InitiateSystemShutdown_r_recv(subreq, mem_ctx);
5870 TALLOC_FREE(subreq);
5871 if (!NT_STATUS_IS_OK(status)) {
5872 tevent_req_nterror(req, status);
5876 /* Copy out parameters */
5879 state->orig.out.result = state->tmp.out.result;
5881 /* Reset temporary structure */
5882 ZERO_STRUCT(state->tmp);
5884 tevent_req_done(req);
5887 NTSTATUS dcerpc_winreg_InitiateSystemShutdown_recv(struct tevent_req *req,
5888 TALLOC_CTX *mem_ctx,
5891 struct dcerpc_winreg_InitiateSystemShutdown_state *state = tevent_req_data(
5892 req, struct dcerpc_winreg_InitiateSystemShutdown_state);
5895 if (tevent_req_is_nterror(req, &status)) {
5896 tevent_req_received(req);
5900 /* Steal possible out parameters to the callers context */
5901 talloc_steal(mem_ctx, state->out_mem_ctx);
5904 *result = state->orig.out.result;
5906 tevent_req_received(req);
5907 return NT_STATUS_OK;
5910 NTSTATUS dcerpc_winreg_InitiateSystemShutdown(struct dcerpc_binding_handle *h,
5911 TALLOC_CTX *mem_ctx,
5912 uint16_t *_hostname /* [in] [unique] */,
5913 struct lsa_StringLarge *_message /* [in] [unique] */,
5914 uint32_t _timeout /* [in] */,
5915 uint8_t _force_apps /* [in] */,
5916 uint8_t _do_reboot /* [in] */,
5919 struct winreg_InitiateSystemShutdown r;
5923 r.in.hostname = _hostname;
5924 r.in.message = _message;
5925 r.in.timeout = _timeout;
5926 r.in.force_apps = _force_apps;
5927 r.in.do_reboot = _do_reboot;
5929 status = dcerpc_winreg_InitiateSystemShutdown_r(h, mem_ctx, &r);
5930 if (!NT_STATUS_IS_OK(status)) {
5934 /* Return variables */
5937 *result = r.out.result;
5939 return NT_STATUS_OK;
5942 struct dcerpc_winreg_AbortSystemShutdown_r_state {
5943 TALLOC_CTX *out_mem_ctx;
5946 static void dcerpc_winreg_AbortSystemShutdown_r_done(struct tevent_req *subreq);
5948 struct tevent_req *dcerpc_winreg_AbortSystemShutdown_r_send(TALLOC_CTX *mem_ctx,
5949 struct tevent_context *ev,
5950 struct dcerpc_binding_handle *h,
5951 struct winreg_AbortSystemShutdown *r)
5953 struct tevent_req *req;
5954 struct dcerpc_winreg_AbortSystemShutdown_r_state *state;
5955 struct tevent_req *subreq;
5957 req = tevent_req_create(mem_ctx, &state,
5958 struct dcerpc_winreg_AbortSystemShutdown_r_state);
5963 state->out_mem_ctx = NULL;
5964 subreq = dcerpc_binding_handle_call_send(state, ev, h,
5965 NULL, &ndr_table_winreg,
5966 NDR_WINREG_ABORTSYSTEMSHUTDOWN, state, r);
5967 if (tevent_req_nomem(subreq, req)) {
5968 return tevent_req_post(req, ev);
5970 tevent_req_set_callback(subreq, dcerpc_winreg_AbortSystemShutdown_r_done, req);
5975 static void dcerpc_winreg_AbortSystemShutdown_r_done(struct tevent_req *subreq)
5977 struct tevent_req *req =
5978 tevent_req_callback_data(subreq,
5982 status = dcerpc_binding_handle_call_recv(subreq);
5983 if (!NT_STATUS_IS_OK(status)) {
5984 tevent_req_nterror(req, status);
5988 tevent_req_done(req);
5991 NTSTATUS dcerpc_winreg_AbortSystemShutdown_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5993 struct dcerpc_winreg_AbortSystemShutdown_r_state *state =
5994 tevent_req_data(req,
5995 struct dcerpc_winreg_AbortSystemShutdown_r_state);
5998 if (tevent_req_is_nterror(req, &status)) {
5999 tevent_req_received(req);
6003 talloc_steal(mem_ctx, state->out_mem_ctx);
6005 tevent_req_received(req);
6006 return NT_STATUS_OK;
6009 NTSTATUS dcerpc_winreg_AbortSystemShutdown_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_AbortSystemShutdown *r)
6013 status = dcerpc_binding_handle_call(h,
6014 NULL, &ndr_table_winreg,
6015 NDR_WINREG_ABORTSYSTEMSHUTDOWN, mem_ctx, r);
6020 NTSTATUS dcerpc_winreg_AbortSystemShutdown_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_AbortSystemShutdown *r)
6024 status = dcerpc_winreg_AbortSystemShutdown_r(p->binding_handle, mem_ctx, r);
6026 if (NT_STATUS_IS_RPC(status)) {
6027 status = NT_STATUS_NET_WRITE_FAULT;
6033 struct dcerpc_winreg_AbortSystemShutdown_state {
6034 struct winreg_AbortSystemShutdown orig;
6035 struct winreg_AbortSystemShutdown tmp;
6036 TALLOC_CTX *out_mem_ctx;
6039 static void dcerpc_winreg_AbortSystemShutdown_done(struct tevent_req *subreq);
6041 struct tevent_req *dcerpc_winreg_AbortSystemShutdown_send(TALLOC_CTX *mem_ctx,
6042 struct tevent_context *ev,
6043 struct dcerpc_binding_handle *h,
6044 uint16_t *_server /* [in] [unique] */)
6046 struct tevent_req *req;
6047 struct dcerpc_winreg_AbortSystemShutdown_state *state;
6048 struct tevent_req *subreq;
6050 req = tevent_req_create(mem_ctx, &state,
6051 struct dcerpc_winreg_AbortSystemShutdown_state);
6055 state->out_mem_ctx = NULL;
6058 state->orig.in.server = _server;
6060 /* Out parameters */
6063 ZERO_STRUCT(state->orig.out.result);
6065 /* make a temporary copy, that we pass to the dispatch function */
6066 state->tmp = state->orig;
6068 subreq = dcerpc_winreg_AbortSystemShutdown_r_send(state, ev, h, &state->tmp);
6069 if (tevent_req_nomem(subreq, req)) {
6070 return tevent_req_post(req, ev);
6072 tevent_req_set_callback(subreq, dcerpc_winreg_AbortSystemShutdown_done, req);
6076 static void dcerpc_winreg_AbortSystemShutdown_done(struct tevent_req *subreq)
6078 struct tevent_req *req = tevent_req_callback_data(
6079 subreq, struct tevent_req);
6080 struct dcerpc_winreg_AbortSystemShutdown_state *state = tevent_req_data(
6081 req, struct dcerpc_winreg_AbortSystemShutdown_state);
6083 TALLOC_CTX *mem_ctx;
6085 if (state->out_mem_ctx) {
6086 mem_ctx = state->out_mem_ctx;
6091 status = dcerpc_winreg_AbortSystemShutdown_r_recv(subreq, mem_ctx);
6092 TALLOC_FREE(subreq);
6093 if (!NT_STATUS_IS_OK(status)) {
6094 tevent_req_nterror(req, status);
6098 /* Copy out parameters */
6101 state->orig.out.result = state->tmp.out.result;
6103 /* Reset temporary structure */
6104 ZERO_STRUCT(state->tmp);
6106 tevent_req_done(req);
6109 NTSTATUS dcerpc_winreg_AbortSystemShutdown_recv(struct tevent_req *req,
6110 TALLOC_CTX *mem_ctx,
6113 struct dcerpc_winreg_AbortSystemShutdown_state *state = tevent_req_data(
6114 req, struct dcerpc_winreg_AbortSystemShutdown_state);
6117 if (tevent_req_is_nterror(req, &status)) {
6118 tevent_req_received(req);
6122 /* Steal possible out parameters to the callers context */
6123 talloc_steal(mem_ctx, state->out_mem_ctx);
6126 *result = state->orig.out.result;
6128 tevent_req_received(req);
6129 return NT_STATUS_OK;
6132 NTSTATUS dcerpc_winreg_AbortSystemShutdown(struct dcerpc_binding_handle *h,
6133 TALLOC_CTX *mem_ctx,
6134 uint16_t *_server /* [in] [unique] */,
6137 struct winreg_AbortSystemShutdown r;
6141 r.in.server = _server;
6143 status = dcerpc_winreg_AbortSystemShutdown_r(h, mem_ctx, &r);
6144 if (!NT_STATUS_IS_OK(status)) {
6148 /* Return variables */
6151 *result = r.out.result;
6153 return NT_STATUS_OK;
6156 struct dcerpc_winreg_GetVersion_r_state {
6157 TALLOC_CTX *out_mem_ctx;
6160 static void dcerpc_winreg_GetVersion_r_done(struct tevent_req *subreq);
6162 struct tevent_req *dcerpc_winreg_GetVersion_r_send(TALLOC_CTX *mem_ctx,
6163 struct tevent_context *ev,
6164 struct dcerpc_binding_handle *h,
6165 struct winreg_GetVersion *r)
6167 struct tevent_req *req;
6168 struct dcerpc_winreg_GetVersion_r_state *state;
6169 struct tevent_req *subreq;
6171 req = tevent_req_create(mem_ctx, &state,
6172 struct dcerpc_winreg_GetVersion_r_state);
6177 state->out_mem_ctx = talloc_new(state);
6178 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6179 return tevent_req_post(req, ev);
6182 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6183 NULL, &ndr_table_winreg,
6184 NDR_WINREG_GETVERSION, state->out_mem_ctx, r);
6185 if (tevent_req_nomem(subreq, req)) {
6186 return tevent_req_post(req, ev);
6188 tevent_req_set_callback(subreq, dcerpc_winreg_GetVersion_r_done, req);
6193 static void dcerpc_winreg_GetVersion_r_done(struct tevent_req *subreq)
6195 struct tevent_req *req =
6196 tevent_req_callback_data(subreq,
6200 status = dcerpc_binding_handle_call_recv(subreq);
6201 if (!NT_STATUS_IS_OK(status)) {
6202 tevent_req_nterror(req, status);
6206 tevent_req_done(req);
6209 NTSTATUS dcerpc_winreg_GetVersion_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6211 struct dcerpc_winreg_GetVersion_r_state *state =
6212 tevent_req_data(req,
6213 struct dcerpc_winreg_GetVersion_r_state);
6216 if (tevent_req_is_nterror(req, &status)) {
6217 tevent_req_received(req);
6221 talloc_steal(mem_ctx, state->out_mem_ctx);
6223 tevent_req_received(req);
6224 return NT_STATUS_OK;
6227 NTSTATUS dcerpc_winreg_GetVersion_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_GetVersion *r)
6231 status = dcerpc_binding_handle_call(h,
6232 NULL, &ndr_table_winreg,
6233 NDR_WINREG_GETVERSION, mem_ctx, r);
6238 NTSTATUS dcerpc_winreg_GetVersion_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_GetVersion *r)
6242 status = dcerpc_winreg_GetVersion_r(p->binding_handle, mem_ctx, r);
6244 if (NT_STATUS_IS_RPC(status)) {
6245 status = NT_STATUS_NET_WRITE_FAULT;
6251 struct dcerpc_winreg_GetVersion_state {
6252 struct winreg_GetVersion orig;
6253 struct winreg_GetVersion tmp;
6254 TALLOC_CTX *out_mem_ctx;
6257 static void dcerpc_winreg_GetVersion_done(struct tevent_req *subreq);
6259 struct tevent_req *dcerpc_winreg_GetVersion_send(TALLOC_CTX *mem_ctx,
6260 struct tevent_context *ev,
6261 struct dcerpc_binding_handle *h,
6262 struct policy_handle *_handle /* [in] [ref] */,
6263 uint32_t *_version /* [out] [ref] */)
6265 struct tevent_req *req;
6266 struct dcerpc_winreg_GetVersion_state *state;
6267 struct tevent_req *subreq;
6269 req = tevent_req_create(mem_ctx, &state,
6270 struct dcerpc_winreg_GetVersion_state);
6274 state->out_mem_ctx = NULL;
6277 state->orig.in.handle = _handle;
6279 /* Out parameters */
6280 state->orig.out.version = _version;
6283 ZERO_STRUCT(state->orig.out.result);
6285 state->out_mem_ctx = talloc_named_const(state, 0,
6286 "dcerpc_winreg_GetVersion_out_memory");
6287 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6288 return tevent_req_post(req, ev);
6291 /* make a temporary copy, that we pass to the dispatch function */
6292 state->tmp = state->orig;
6294 subreq = dcerpc_winreg_GetVersion_r_send(state, ev, h, &state->tmp);
6295 if (tevent_req_nomem(subreq, req)) {
6296 return tevent_req_post(req, ev);
6298 tevent_req_set_callback(subreq, dcerpc_winreg_GetVersion_done, req);
6302 static void dcerpc_winreg_GetVersion_done(struct tevent_req *subreq)
6304 struct tevent_req *req = tevent_req_callback_data(
6305 subreq, struct tevent_req);
6306 struct dcerpc_winreg_GetVersion_state *state = tevent_req_data(
6307 req, struct dcerpc_winreg_GetVersion_state);
6309 TALLOC_CTX *mem_ctx;
6311 if (state->out_mem_ctx) {
6312 mem_ctx = state->out_mem_ctx;
6317 status = dcerpc_winreg_GetVersion_r_recv(subreq, mem_ctx);
6318 TALLOC_FREE(subreq);
6319 if (!NT_STATUS_IS_OK(status)) {
6320 tevent_req_nterror(req, status);
6324 /* Copy out parameters */
6325 *state->orig.out.version = *state->tmp.out.version;
6328 state->orig.out.result = state->tmp.out.result;
6330 /* Reset temporary structure */
6331 ZERO_STRUCT(state->tmp);
6333 tevent_req_done(req);
6336 NTSTATUS dcerpc_winreg_GetVersion_recv(struct tevent_req *req,
6337 TALLOC_CTX *mem_ctx,
6340 struct dcerpc_winreg_GetVersion_state *state = tevent_req_data(
6341 req, struct dcerpc_winreg_GetVersion_state);
6344 if (tevent_req_is_nterror(req, &status)) {
6345 tevent_req_received(req);
6349 /* Steal possible out parameters to the callers context */
6350 talloc_steal(mem_ctx, state->out_mem_ctx);
6353 *result = state->orig.out.result;
6355 tevent_req_received(req);
6356 return NT_STATUS_OK;
6359 NTSTATUS dcerpc_winreg_GetVersion(struct dcerpc_binding_handle *h,
6360 TALLOC_CTX *mem_ctx,
6361 struct policy_handle *_handle /* [in] [ref] */,
6362 uint32_t *_version /* [out] [ref] */,
6365 struct winreg_GetVersion r;
6369 r.in.handle = _handle;
6371 status = dcerpc_winreg_GetVersion_r(h, mem_ctx, &r);
6372 if (!NT_STATUS_IS_OK(status)) {
6376 /* Return variables */
6377 *_version = *r.out.version;
6380 *result = r.out.result;
6382 return NT_STATUS_OK;
6385 struct dcerpc_winreg_OpenHKCC_r_state {
6386 TALLOC_CTX *out_mem_ctx;
6389 static void dcerpc_winreg_OpenHKCC_r_done(struct tevent_req *subreq);
6391 struct tevent_req *dcerpc_winreg_OpenHKCC_r_send(TALLOC_CTX *mem_ctx,
6392 struct tevent_context *ev,
6393 struct dcerpc_binding_handle *h,
6394 struct winreg_OpenHKCC *r)
6396 struct tevent_req *req;
6397 struct dcerpc_winreg_OpenHKCC_r_state *state;
6398 struct tevent_req *subreq;
6400 req = tevent_req_create(mem_ctx, &state,
6401 struct dcerpc_winreg_OpenHKCC_r_state);
6406 state->out_mem_ctx = talloc_new(state);
6407 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6408 return tevent_req_post(req, ev);
6411 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6412 NULL, &ndr_table_winreg,
6413 NDR_WINREG_OPENHKCC, state->out_mem_ctx, r);
6414 if (tevent_req_nomem(subreq, req)) {
6415 return tevent_req_post(req, ev);
6417 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCC_r_done, req);
6422 static void dcerpc_winreg_OpenHKCC_r_done(struct tevent_req *subreq)
6424 struct tevent_req *req =
6425 tevent_req_callback_data(subreq,
6429 status = dcerpc_binding_handle_call_recv(subreq);
6430 if (!NT_STATUS_IS_OK(status)) {
6431 tevent_req_nterror(req, status);
6435 tevent_req_done(req);
6438 NTSTATUS dcerpc_winreg_OpenHKCC_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6440 struct dcerpc_winreg_OpenHKCC_r_state *state =
6441 tevent_req_data(req,
6442 struct dcerpc_winreg_OpenHKCC_r_state);
6445 if (tevent_req_is_nterror(req, &status)) {
6446 tevent_req_received(req);
6450 talloc_steal(mem_ctx, state->out_mem_ctx);
6452 tevent_req_received(req);
6453 return NT_STATUS_OK;
6456 NTSTATUS dcerpc_winreg_OpenHKCC_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKCC *r)
6460 status = dcerpc_binding_handle_call(h,
6461 NULL, &ndr_table_winreg,
6462 NDR_WINREG_OPENHKCC, mem_ctx, r);
6467 NTSTATUS dcerpc_winreg_OpenHKCC_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenHKCC *r)
6471 status = dcerpc_winreg_OpenHKCC_r(p->binding_handle, mem_ctx, r);
6473 if (NT_STATUS_IS_RPC(status)) {
6474 status = NT_STATUS_NET_WRITE_FAULT;
6480 struct dcerpc_winreg_OpenHKCC_state {
6481 struct winreg_OpenHKCC orig;
6482 struct winreg_OpenHKCC tmp;
6483 TALLOC_CTX *out_mem_ctx;
6486 static void dcerpc_winreg_OpenHKCC_done(struct tevent_req *subreq);
6488 struct tevent_req *dcerpc_winreg_OpenHKCC_send(TALLOC_CTX *mem_ctx,
6489 struct tevent_context *ev,
6490 struct dcerpc_binding_handle *h,
6491 uint16_t *_system_name /* [in] [unique] */,
6492 uint32_t _access_mask /* [in] */,
6493 struct policy_handle *_handle /* [out] [ref] */)
6495 struct tevent_req *req;
6496 struct dcerpc_winreg_OpenHKCC_state *state;
6497 struct tevent_req *subreq;
6499 req = tevent_req_create(mem_ctx, &state,
6500 struct dcerpc_winreg_OpenHKCC_state);
6504 state->out_mem_ctx = NULL;
6507 state->orig.in.system_name = _system_name;
6508 state->orig.in.access_mask = _access_mask;
6510 /* Out parameters */
6511 state->orig.out.handle = _handle;
6514 ZERO_STRUCT(state->orig.out.result);
6516 state->out_mem_ctx = talloc_named_const(state, 0,
6517 "dcerpc_winreg_OpenHKCC_out_memory");
6518 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6519 return tevent_req_post(req, ev);
6522 /* make a temporary copy, that we pass to the dispatch function */
6523 state->tmp = state->orig;
6525 subreq = dcerpc_winreg_OpenHKCC_r_send(state, ev, h, &state->tmp);
6526 if (tevent_req_nomem(subreq, req)) {
6527 return tevent_req_post(req, ev);
6529 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKCC_done, req);
6533 static void dcerpc_winreg_OpenHKCC_done(struct tevent_req *subreq)
6535 struct tevent_req *req = tevent_req_callback_data(
6536 subreq, struct tevent_req);
6537 struct dcerpc_winreg_OpenHKCC_state *state = tevent_req_data(
6538 req, struct dcerpc_winreg_OpenHKCC_state);
6540 TALLOC_CTX *mem_ctx;
6542 if (state->out_mem_ctx) {
6543 mem_ctx = state->out_mem_ctx;
6548 status = dcerpc_winreg_OpenHKCC_r_recv(subreq, mem_ctx);
6549 TALLOC_FREE(subreq);
6550 if (!NT_STATUS_IS_OK(status)) {
6551 tevent_req_nterror(req, status);
6555 /* Copy out parameters */
6556 *state->orig.out.handle = *state->tmp.out.handle;
6559 state->orig.out.result = state->tmp.out.result;
6561 /* Reset temporary structure */
6562 ZERO_STRUCT(state->tmp);
6564 tevent_req_done(req);
6567 NTSTATUS dcerpc_winreg_OpenHKCC_recv(struct tevent_req *req,
6568 TALLOC_CTX *mem_ctx,
6571 struct dcerpc_winreg_OpenHKCC_state *state = tevent_req_data(
6572 req, struct dcerpc_winreg_OpenHKCC_state);
6575 if (tevent_req_is_nterror(req, &status)) {
6576 tevent_req_received(req);
6580 /* Steal possible out parameters to the callers context */
6581 talloc_steal(mem_ctx, state->out_mem_ctx);
6584 *result = state->orig.out.result;
6586 tevent_req_received(req);
6587 return NT_STATUS_OK;
6590 NTSTATUS dcerpc_winreg_OpenHKCC(struct dcerpc_binding_handle *h,
6591 TALLOC_CTX *mem_ctx,
6592 uint16_t *_system_name /* [in] [unique] */,
6593 uint32_t _access_mask /* [in] */,
6594 struct policy_handle *_handle /* [out] [ref] */,
6597 struct winreg_OpenHKCC r;
6601 r.in.system_name = _system_name;
6602 r.in.access_mask = _access_mask;
6604 status = dcerpc_winreg_OpenHKCC_r(h, mem_ctx, &r);
6605 if (!NT_STATUS_IS_OK(status)) {
6609 /* Return variables */
6610 *_handle = *r.out.handle;
6613 *result = r.out.result;
6615 return NT_STATUS_OK;
6618 struct dcerpc_winreg_OpenHKDD_r_state {
6619 TALLOC_CTX *out_mem_ctx;
6622 static void dcerpc_winreg_OpenHKDD_r_done(struct tevent_req *subreq);
6624 struct tevent_req *dcerpc_winreg_OpenHKDD_r_send(TALLOC_CTX *mem_ctx,
6625 struct tevent_context *ev,
6626 struct dcerpc_binding_handle *h,
6627 struct winreg_OpenHKDD *r)
6629 struct tevent_req *req;
6630 struct dcerpc_winreg_OpenHKDD_r_state *state;
6631 struct tevent_req *subreq;
6633 req = tevent_req_create(mem_ctx, &state,
6634 struct dcerpc_winreg_OpenHKDD_r_state);
6639 state->out_mem_ctx = talloc_new(state);
6640 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6641 return tevent_req_post(req, ev);
6644 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6645 NULL, &ndr_table_winreg,
6646 NDR_WINREG_OPENHKDD, state->out_mem_ctx, r);
6647 if (tevent_req_nomem(subreq, req)) {
6648 return tevent_req_post(req, ev);
6650 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKDD_r_done, req);
6655 static void dcerpc_winreg_OpenHKDD_r_done(struct tevent_req *subreq)
6657 struct tevent_req *req =
6658 tevent_req_callback_data(subreq,
6662 status = dcerpc_binding_handle_call_recv(subreq);
6663 if (!NT_STATUS_IS_OK(status)) {
6664 tevent_req_nterror(req, status);
6668 tevent_req_done(req);
6671 NTSTATUS dcerpc_winreg_OpenHKDD_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6673 struct dcerpc_winreg_OpenHKDD_r_state *state =
6674 tevent_req_data(req,
6675 struct dcerpc_winreg_OpenHKDD_r_state);
6678 if (tevent_req_is_nterror(req, &status)) {
6679 tevent_req_received(req);
6683 talloc_steal(mem_ctx, state->out_mem_ctx);
6685 tevent_req_received(req);
6686 return NT_STATUS_OK;
6689 NTSTATUS dcerpc_winreg_OpenHKDD_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKDD *r)
6693 status = dcerpc_binding_handle_call(h,
6694 NULL, &ndr_table_winreg,
6695 NDR_WINREG_OPENHKDD, mem_ctx, r);
6700 NTSTATUS dcerpc_winreg_OpenHKDD_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenHKDD *r)
6704 status = dcerpc_winreg_OpenHKDD_r(p->binding_handle, mem_ctx, r);
6706 if (NT_STATUS_IS_RPC(status)) {
6707 status = NT_STATUS_NET_WRITE_FAULT;
6713 struct dcerpc_winreg_OpenHKDD_state {
6714 struct winreg_OpenHKDD orig;
6715 struct winreg_OpenHKDD tmp;
6716 TALLOC_CTX *out_mem_ctx;
6719 static void dcerpc_winreg_OpenHKDD_done(struct tevent_req *subreq);
6721 struct tevent_req *dcerpc_winreg_OpenHKDD_send(TALLOC_CTX *mem_ctx,
6722 struct tevent_context *ev,
6723 struct dcerpc_binding_handle *h,
6724 uint16_t *_system_name /* [in] [unique] */,
6725 uint32_t _access_mask /* [in] */,
6726 struct policy_handle *_handle /* [out] [ref] */)
6728 struct tevent_req *req;
6729 struct dcerpc_winreg_OpenHKDD_state *state;
6730 struct tevent_req *subreq;
6732 req = tevent_req_create(mem_ctx, &state,
6733 struct dcerpc_winreg_OpenHKDD_state);
6737 state->out_mem_ctx = NULL;
6740 state->orig.in.system_name = _system_name;
6741 state->orig.in.access_mask = _access_mask;
6743 /* Out parameters */
6744 state->orig.out.handle = _handle;
6747 ZERO_STRUCT(state->orig.out.result);
6749 state->out_mem_ctx = talloc_named_const(state, 0,
6750 "dcerpc_winreg_OpenHKDD_out_memory");
6751 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6752 return tevent_req_post(req, ev);
6755 /* make a temporary copy, that we pass to the dispatch function */
6756 state->tmp = state->orig;
6758 subreq = dcerpc_winreg_OpenHKDD_r_send(state, ev, h, &state->tmp);
6759 if (tevent_req_nomem(subreq, req)) {
6760 return tevent_req_post(req, ev);
6762 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKDD_done, req);
6766 static void dcerpc_winreg_OpenHKDD_done(struct tevent_req *subreq)
6768 struct tevent_req *req = tevent_req_callback_data(
6769 subreq, struct tevent_req);
6770 struct dcerpc_winreg_OpenHKDD_state *state = tevent_req_data(
6771 req, struct dcerpc_winreg_OpenHKDD_state);
6773 TALLOC_CTX *mem_ctx;
6775 if (state->out_mem_ctx) {
6776 mem_ctx = state->out_mem_ctx;
6781 status = dcerpc_winreg_OpenHKDD_r_recv(subreq, mem_ctx);
6782 TALLOC_FREE(subreq);
6783 if (!NT_STATUS_IS_OK(status)) {
6784 tevent_req_nterror(req, status);
6788 /* Copy out parameters */
6789 *state->orig.out.handle = *state->tmp.out.handle;
6792 state->orig.out.result = state->tmp.out.result;
6794 /* Reset temporary structure */
6795 ZERO_STRUCT(state->tmp);
6797 tevent_req_done(req);
6800 NTSTATUS dcerpc_winreg_OpenHKDD_recv(struct tevent_req *req,
6801 TALLOC_CTX *mem_ctx,
6804 struct dcerpc_winreg_OpenHKDD_state *state = tevent_req_data(
6805 req, struct dcerpc_winreg_OpenHKDD_state);
6808 if (tevent_req_is_nterror(req, &status)) {
6809 tevent_req_received(req);
6813 /* Steal possible out parameters to the callers context */
6814 talloc_steal(mem_ctx, state->out_mem_ctx);
6817 *result = state->orig.out.result;
6819 tevent_req_received(req);
6820 return NT_STATUS_OK;
6823 NTSTATUS dcerpc_winreg_OpenHKDD(struct dcerpc_binding_handle *h,
6824 TALLOC_CTX *mem_ctx,
6825 uint16_t *_system_name /* [in] [unique] */,
6826 uint32_t _access_mask /* [in] */,
6827 struct policy_handle *_handle /* [out] [ref] */,
6830 struct winreg_OpenHKDD r;
6834 r.in.system_name = _system_name;
6835 r.in.access_mask = _access_mask;
6837 status = dcerpc_winreg_OpenHKDD_r(h, mem_ctx, &r);
6838 if (!NT_STATUS_IS_OK(status)) {
6842 /* Return variables */
6843 *_handle = *r.out.handle;
6846 *result = r.out.result;
6848 return NT_STATUS_OK;
6851 struct dcerpc_winreg_QueryMultipleValues_r_state {
6852 TALLOC_CTX *out_mem_ctx;
6855 static void dcerpc_winreg_QueryMultipleValues_r_done(struct tevent_req *subreq);
6857 struct tevent_req *dcerpc_winreg_QueryMultipleValues_r_send(TALLOC_CTX *mem_ctx,
6858 struct tevent_context *ev,
6859 struct dcerpc_binding_handle *h,
6860 struct winreg_QueryMultipleValues *r)
6862 struct tevent_req *req;
6863 struct dcerpc_winreg_QueryMultipleValues_r_state *state;
6864 struct tevent_req *subreq;
6866 req = tevent_req_create(mem_ctx, &state,
6867 struct dcerpc_winreg_QueryMultipleValues_r_state);
6872 state->out_mem_ctx = talloc_new(state);
6873 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6874 return tevent_req_post(req, ev);
6877 subreq = dcerpc_binding_handle_call_send(state, ev, h,
6878 NULL, &ndr_table_winreg,
6879 NDR_WINREG_QUERYMULTIPLEVALUES, state->out_mem_ctx, r);
6880 if (tevent_req_nomem(subreq, req)) {
6881 return tevent_req_post(req, ev);
6883 tevent_req_set_callback(subreq, dcerpc_winreg_QueryMultipleValues_r_done, req);
6888 static void dcerpc_winreg_QueryMultipleValues_r_done(struct tevent_req *subreq)
6890 struct tevent_req *req =
6891 tevent_req_callback_data(subreq,
6895 status = dcerpc_binding_handle_call_recv(subreq);
6896 if (!NT_STATUS_IS_OK(status)) {
6897 tevent_req_nterror(req, status);
6901 tevent_req_done(req);
6904 NTSTATUS dcerpc_winreg_QueryMultipleValues_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6906 struct dcerpc_winreg_QueryMultipleValues_r_state *state =
6907 tevent_req_data(req,
6908 struct dcerpc_winreg_QueryMultipleValues_r_state);
6911 if (tevent_req_is_nterror(req, &status)) {
6912 tevent_req_received(req);
6916 talloc_steal(mem_ctx, state->out_mem_ctx);
6918 tevent_req_received(req);
6919 return NT_STATUS_OK;
6922 NTSTATUS dcerpc_winreg_QueryMultipleValues_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_QueryMultipleValues *r)
6926 status = dcerpc_binding_handle_call(h,
6927 NULL, &ndr_table_winreg,
6928 NDR_WINREG_QUERYMULTIPLEVALUES, mem_ctx, r);
6933 NTSTATUS dcerpc_winreg_QueryMultipleValues_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_QueryMultipleValues *r)
6937 status = dcerpc_winreg_QueryMultipleValues_r(p->binding_handle, mem_ctx, r);
6939 if (NT_STATUS_IS_RPC(status)) {
6940 status = NT_STATUS_NET_WRITE_FAULT;
6946 struct dcerpc_winreg_QueryMultipleValues_state {
6947 struct winreg_QueryMultipleValues orig;
6948 struct winreg_QueryMultipleValues tmp;
6949 TALLOC_CTX *out_mem_ctx;
6952 static void dcerpc_winreg_QueryMultipleValues_done(struct tevent_req *subreq);
6954 struct tevent_req *dcerpc_winreg_QueryMultipleValues_send(TALLOC_CTX *mem_ctx,
6955 struct tevent_context *ev,
6956 struct dcerpc_binding_handle *h,
6957 struct policy_handle *_key_handle /* [in] [ref] */,
6958 struct QueryMultipleValue *_values_in /* [in] [ref,length_is(num_values),size_is(num_values)] */,
6959 struct QueryMultipleValue *_values_out /* [out] [ref,length_is(num_values),size_is(num_values)] */,
6960 uint32_t _num_values /* [in] */,
6961 uint8_t *_buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
6962 uint32_t *_buffer_size /* [in,out] [ref] */)
6964 struct tevent_req *req;
6965 struct dcerpc_winreg_QueryMultipleValues_state *state;
6966 struct tevent_req *subreq;
6968 req = tevent_req_create(mem_ctx, &state,
6969 struct dcerpc_winreg_QueryMultipleValues_state);
6973 state->out_mem_ctx = NULL;
6976 state->orig.in.key_handle = _key_handle;
6977 state->orig.in.values_in = _values_in;
6978 state->orig.in.num_values = _num_values;
6979 state->orig.in.buffer = _buffer;
6980 state->orig.in.buffer_size = _buffer_size;
6982 /* Out parameters */
6983 state->orig.out.values_out = _values_out;
6984 state->orig.out.buffer = _buffer;
6985 state->orig.out.buffer_size = _buffer_size;
6988 ZERO_STRUCT(state->orig.out.result);
6990 state->out_mem_ctx = talloc_named_const(state, 0,
6991 "dcerpc_winreg_QueryMultipleValues_out_memory");
6992 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6993 return tevent_req_post(req, ev);
6996 /* make a temporary copy, that we pass to the dispatch function */
6997 state->tmp = state->orig;
6999 subreq = dcerpc_winreg_QueryMultipleValues_r_send(state, ev, h, &state->tmp);
7000 if (tevent_req_nomem(subreq, req)) {
7001 return tevent_req_post(req, ev);
7003 tevent_req_set_callback(subreq, dcerpc_winreg_QueryMultipleValues_done, req);
7007 static void dcerpc_winreg_QueryMultipleValues_done(struct tevent_req *subreq)
7009 struct tevent_req *req = tevent_req_callback_data(
7010 subreq, struct tevent_req);
7011 struct dcerpc_winreg_QueryMultipleValues_state *state = tevent_req_data(
7012 req, struct dcerpc_winreg_QueryMultipleValues_state);
7014 TALLOC_CTX *mem_ctx;
7016 if (state->out_mem_ctx) {
7017 mem_ctx = state->out_mem_ctx;
7022 status = dcerpc_winreg_QueryMultipleValues_r_recv(subreq, mem_ctx);
7023 TALLOC_FREE(subreq);
7024 if (!NT_STATUS_IS_OK(status)) {
7025 tevent_req_nterror(req, status);
7029 /* Copy out parameters */
7031 size_t _copy_len_values_out;
7032 _copy_len_values_out = state->tmp.in.num_values;
7033 memcpy(state->orig.out.values_out, state->tmp.out.values_out, _copy_len_values_out * sizeof(*state->orig.out.values_out));
7035 if (state->orig.out.buffer && state->tmp.out.buffer) {
7037 size_t _copy_len_buffer;
7038 if ((*state->tmp.out.buffer_size) > (*state->tmp.in.buffer_size)) {
7039 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
7042 _copy_len_buffer = *state->tmp.out.buffer_size;
7043 memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
7046 *state->orig.out.buffer_size = *state->tmp.out.buffer_size;
7049 state->orig.out.result = state->tmp.out.result;
7051 /* Reset temporary structure */
7052 ZERO_STRUCT(state->tmp);
7054 tevent_req_done(req);
7057 NTSTATUS dcerpc_winreg_QueryMultipleValues_recv(struct tevent_req *req,
7058 TALLOC_CTX *mem_ctx,
7061 struct dcerpc_winreg_QueryMultipleValues_state *state = tevent_req_data(
7062 req, struct dcerpc_winreg_QueryMultipleValues_state);
7065 if (tevent_req_is_nterror(req, &status)) {
7066 tevent_req_received(req);
7070 /* Steal possible out parameters to the callers context */
7071 talloc_steal(mem_ctx, state->out_mem_ctx);
7074 *result = state->orig.out.result;
7076 tevent_req_received(req);
7077 return NT_STATUS_OK;
7080 NTSTATUS dcerpc_winreg_QueryMultipleValues(struct dcerpc_binding_handle *h,
7081 TALLOC_CTX *mem_ctx,
7082 struct policy_handle *_key_handle /* [in] [ref] */,
7083 struct QueryMultipleValue *_values_in /* [in] [ref,length_is(num_values),size_is(num_values)] */,
7084 struct QueryMultipleValue *_values_out /* [out] [ref,length_is(num_values),size_is(num_values)] */,
7085 uint32_t _num_values /* [in] */,
7086 uint8_t *_buffer /* [in,out] [unique,length_is(*buffer_size),size_is(*buffer_size)] */,
7087 uint32_t *_buffer_size /* [in,out] [ref] */,
7090 struct winreg_QueryMultipleValues r;
7094 r.in.key_handle = _key_handle;
7095 r.in.values_in = _values_in;
7096 r.in.num_values = _num_values;
7097 r.in.buffer = _buffer;
7098 r.in.buffer_size = _buffer_size;
7100 status = dcerpc_winreg_QueryMultipleValues_r(h, mem_ctx, &r);
7101 if (!NT_STATUS_IS_OK(status)) {
7105 /* Return variables */
7107 size_t _copy_len_values_out;
7108 _copy_len_values_out = r.in.num_values;
7109 memcpy(_values_out, r.out.values_out, _copy_len_values_out * sizeof(*_values_out));
7111 if (_buffer && r.out.buffer) {
7113 size_t _copy_len_buffer;
7114 if ((*r.out.buffer_size) > (*r.in.buffer_size)) {
7115 return NT_STATUS_INVALID_NETWORK_RESPONSE;
7117 _copy_len_buffer = *r.out.buffer_size;
7118 memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
7121 *_buffer_size = *r.out.buffer_size;
7124 *result = r.out.result;
7126 return NT_STATUS_OK;
7129 struct dcerpc_winreg_InitiateSystemShutdownEx_r_state {
7130 TALLOC_CTX *out_mem_ctx;
7133 static void dcerpc_winreg_InitiateSystemShutdownEx_r_done(struct tevent_req *subreq);
7135 struct tevent_req *dcerpc_winreg_InitiateSystemShutdownEx_r_send(TALLOC_CTX *mem_ctx,
7136 struct tevent_context *ev,
7137 struct dcerpc_binding_handle *h,
7138 struct winreg_InitiateSystemShutdownEx *r)
7140 struct tevent_req *req;
7141 struct dcerpc_winreg_InitiateSystemShutdownEx_r_state *state;
7142 struct tevent_req *subreq;
7144 req = tevent_req_create(mem_ctx, &state,
7145 struct dcerpc_winreg_InitiateSystemShutdownEx_r_state);
7150 state->out_mem_ctx = NULL;
7151 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7152 NULL, &ndr_table_winreg,
7153 NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, state, r);
7154 if (tevent_req_nomem(subreq, req)) {
7155 return tevent_req_post(req, ev);
7157 tevent_req_set_callback(subreq, dcerpc_winreg_InitiateSystemShutdownEx_r_done, req);
7162 static void dcerpc_winreg_InitiateSystemShutdownEx_r_done(struct tevent_req *subreq)
7164 struct tevent_req *req =
7165 tevent_req_callback_data(subreq,
7169 status = dcerpc_binding_handle_call_recv(subreq);
7170 if (!NT_STATUS_IS_OK(status)) {
7171 tevent_req_nterror(req, status);
7175 tevent_req_done(req);
7178 NTSTATUS dcerpc_winreg_InitiateSystemShutdownEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7180 struct dcerpc_winreg_InitiateSystemShutdownEx_r_state *state =
7181 tevent_req_data(req,
7182 struct dcerpc_winreg_InitiateSystemShutdownEx_r_state);
7185 if (tevent_req_is_nterror(req, &status)) {
7186 tevent_req_received(req);
7190 talloc_steal(mem_ctx, state->out_mem_ctx);
7192 tevent_req_received(req);
7193 return NT_STATUS_OK;
7196 NTSTATUS dcerpc_winreg_InitiateSystemShutdownEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_InitiateSystemShutdownEx *r)
7200 status = dcerpc_binding_handle_call(h,
7201 NULL, &ndr_table_winreg,
7202 NDR_WINREG_INITIATESYSTEMSHUTDOWNEX, mem_ctx, r);
7207 NTSTATUS dcerpc_winreg_InitiateSystemShutdownEx_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_InitiateSystemShutdownEx *r)
7211 status = dcerpc_winreg_InitiateSystemShutdownEx_r(p->binding_handle, mem_ctx, r);
7213 if (NT_STATUS_IS_RPC(status)) {
7214 status = NT_STATUS_NET_WRITE_FAULT;
7220 struct dcerpc_winreg_InitiateSystemShutdownEx_state {
7221 struct winreg_InitiateSystemShutdownEx orig;
7222 struct winreg_InitiateSystemShutdownEx tmp;
7223 TALLOC_CTX *out_mem_ctx;
7226 static void dcerpc_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq);
7228 struct tevent_req *dcerpc_winreg_InitiateSystemShutdownEx_send(TALLOC_CTX *mem_ctx,
7229 struct tevent_context *ev,
7230 struct dcerpc_binding_handle *h,
7231 uint16_t *_hostname /* [in] [unique] */,
7232 struct lsa_StringLarge *_message /* [in] [unique] */,
7233 uint32_t _timeout /* [in] */,
7234 uint8_t _force_apps /* [in] */,
7235 uint8_t _do_reboot /* [in] */,
7236 uint32_t _reason /* [in] */)
7238 struct tevent_req *req;
7239 struct dcerpc_winreg_InitiateSystemShutdownEx_state *state;
7240 struct tevent_req *subreq;
7242 req = tevent_req_create(mem_ctx, &state,
7243 struct dcerpc_winreg_InitiateSystemShutdownEx_state);
7247 state->out_mem_ctx = NULL;
7250 state->orig.in.hostname = _hostname;
7251 state->orig.in.message = _message;
7252 state->orig.in.timeout = _timeout;
7253 state->orig.in.force_apps = _force_apps;
7254 state->orig.in.do_reboot = _do_reboot;
7255 state->orig.in.reason = _reason;
7257 /* Out parameters */
7260 ZERO_STRUCT(state->orig.out.result);
7262 /* make a temporary copy, that we pass to the dispatch function */
7263 state->tmp = state->orig;
7265 subreq = dcerpc_winreg_InitiateSystemShutdownEx_r_send(state, ev, h, &state->tmp);
7266 if (tevent_req_nomem(subreq, req)) {
7267 return tevent_req_post(req, ev);
7269 tevent_req_set_callback(subreq, dcerpc_winreg_InitiateSystemShutdownEx_done, req);
7273 static void dcerpc_winreg_InitiateSystemShutdownEx_done(struct tevent_req *subreq)
7275 struct tevent_req *req = tevent_req_callback_data(
7276 subreq, struct tevent_req);
7277 struct dcerpc_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
7278 req, struct dcerpc_winreg_InitiateSystemShutdownEx_state);
7280 TALLOC_CTX *mem_ctx;
7282 if (state->out_mem_ctx) {
7283 mem_ctx = state->out_mem_ctx;
7288 status = dcerpc_winreg_InitiateSystemShutdownEx_r_recv(subreq, mem_ctx);
7289 TALLOC_FREE(subreq);
7290 if (!NT_STATUS_IS_OK(status)) {
7291 tevent_req_nterror(req, status);
7295 /* Copy out parameters */
7298 state->orig.out.result = state->tmp.out.result;
7300 /* Reset temporary structure */
7301 ZERO_STRUCT(state->tmp);
7303 tevent_req_done(req);
7306 NTSTATUS dcerpc_winreg_InitiateSystemShutdownEx_recv(struct tevent_req *req,
7307 TALLOC_CTX *mem_ctx,
7310 struct dcerpc_winreg_InitiateSystemShutdownEx_state *state = tevent_req_data(
7311 req, struct dcerpc_winreg_InitiateSystemShutdownEx_state);
7314 if (tevent_req_is_nterror(req, &status)) {
7315 tevent_req_received(req);
7319 /* Steal possible out parameters to the callers context */
7320 talloc_steal(mem_ctx, state->out_mem_ctx);
7323 *result = state->orig.out.result;
7325 tevent_req_received(req);
7326 return NT_STATUS_OK;
7329 NTSTATUS dcerpc_winreg_InitiateSystemShutdownEx(struct dcerpc_binding_handle *h,
7330 TALLOC_CTX *mem_ctx,
7331 uint16_t *_hostname /* [in] [unique] */,
7332 struct lsa_StringLarge *_message /* [in] [unique] */,
7333 uint32_t _timeout /* [in] */,
7334 uint8_t _force_apps /* [in] */,
7335 uint8_t _do_reboot /* [in] */,
7336 uint32_t _reason /* [in] */,
7339 struct winreg_InitiateSystemShutdownEx r;
7343 r.in.hostname = _hostname;
7344 r.in.message = _message;
7345 r.in.timeout = _timeout;
7346 r.in.force_apps = _force_apps;
7347 r.in.do_reboot = _do_reboot;
7348 r.in.reason = _reason;
7350 status = dcerpc_winreg_InitiateSystemShutdownEx_r(h, mem_ctx, &r);
7351 if (!NT_STATUS_IS_OK(status)) {
7355 /* Return variables */
7358 *result = r.out.result;
7360 return NT_STATUS_OK;
7363 struct dcerpc_winreg_SaveKeyEx_r_state {
7364 TALLOC_CTX *out_mem_ctx;
7367 static void dcerpc_winreg_SaveKeyEx_r_done(struct tevent_req *subreq);
7369 struct tevent_req *dcerpc_winreg_SaveKeyEx_r_send(TALLOC_CTX *mem_ctx,
7370 struct tevent_context *ev,
7371 struct dcerpc_binding_handle *h,
7372 struct winreg_SaveKeyEx *r)
7374 struct tevent_req *req;
7375 struct dcerpc_winreg_SaveKeyEx_r_state *state;
7376 struct tevent_req *subreq;
7378 req = tevent_req_create(mem_ctx, &state,
7379 struct dcerpc_winreg_SaveKeyEx_r_state);
7384 state->out_mem_ctx = NULL;
7385 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7386 NULL, &ndr_table_winreg,
7387 NDR_WINREG_SAVEKEYEX, state, r);
7388 if (tevent_req_nomem(subreq, req)) {
7389 return tevent_req_post(req, ev);
7391 tevent_req_set_callback(subreq, dcerpc_winreg_SaveKeyEx_r_done, req);
7396 static void dcerpc_winreg_SaveKeyEx_r_done(struct tevent_req *subreq)
7398 struct tevent_req *req =
7399 tevent_req_callback_data(subreq,
7403 status = dcerpc_binding_handle_call_recv(subreq);
7404 if (!NT_STATUS_IS_OK(status)) {
7405 tevent_req_nterror(req, status);
7409 tevent_req_done(req);
7412 NTSTATUS dcerpc_winreg_SaveKeyEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7414 struct dcerpc_winreg_SaveKeyEx_r_state *state =
7415 tevent_req_data(req,
7416 struct dcerpc_winreg_SaveKeyEx_r_state);
7419 if (tevent_req_is_nterror(req, &status)) {
7420 tevent_req_received(req);
7424 talloc_steal(mem_ctx, state->out_mem_ctx);
7426 tevent_req_received(req);
7427 return NT_STATUS_OK;
7430 NTSTATUS dcerpc_winreg_SaveKeyEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_SaveKeyEx *r)
7434 status = dcerpc_binding_handle_call(h,
7435 NULL, &ndr_table_winreg,
7436 NDR_WINREG_SAVEKEYEX, mem_ctx, r);
7441 NTSTATUS dcerpc_winreg_SaveKeyEx_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_SaveKeyEx *r)
7445 status = dcerpc_winreg_SaveKeyEx_r(p->binding_handle, mem_ctx, r);
7447 if (NT_STATUS_IS_RPC(status)) {
7448 status = NT_STATUS_NET_WRITE_FAULT;
7454 struct dcerpc_winreg_SaveKeyEx_state {
7455 struct winreg_SaveKeyEx orig;
7456 struct winreg_SaveKeyEx tmp;
7457 TALLOC_CTX *out_mem_ctx;
7460 static void dcerpc_winreg_SaveKeyEx_done(struct tevent_req *subreq);
7462 struct tevent_req *dcerpc_winreg_SaveKeyEx_send(TALLOC_CTX *mem_ctx,
7463 struct tevent_context *ev,
7464 struct dcerpc_binding_handle *h,
7465 struct policy_handle *_handle /* [in] [ref] */,
7466 struct winreg_String *_filename /* [in] [ref] */,
7467 struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */,
7468 uint32_t _flags /* [in] */)
7470 struct tevent_req *req;
7471 struct dcerpc_winreg_SaveKeyEx_state *state;
7472 struct tevent_req *subreq;
7474 req = tevent_req_create(mem_ctx, &state,
7475 struct dcerpc_winreg_SaveKeyEx_state);
7479 state->out_mem_ctx = NULL;
7482 state->orig.in.handle = _handle;
7483 state->orig.in.filename = _filename;
7484 state->orig.in.sec_attrib = _sec_attrib;
7485 state->orig.in.flags = _flags;
7487 /* Out parameters */
7490 ZERO_STRUCT(state->orig.out.result);
7492 /* make a temporary copy, that we pass to the dispatch function */
7493 state->tmp = state->orig;
7495 subreq = dcerpc_winreg_SaveKeyEx_r_send(state, ev, h, &state->tmp);
7496 if (tevent_req_nomem(subreq, req)) {
7497 return tevent_req_post(req, ev);
7499 tevent_req_set_callback(subreq, dcerpc_winreg_SaveKeyEx_done, req);
7503 static void dcerpc_winreg_SaveKeyEx_done(struct tevent_req *subreq)
7505 struct tevent_req *req = tevent_req_callback_data(
7506 subreq, struct tevent_req);
7507 struct dcerpc_winreg_SaveKeyEx_state *state = tevent_req_data(
7508 req, struct dcerpc_winreg_SaveKeyEx_state);
7510 TALLOC_CTX *mem_ctx;
7512 if (state->out_mem_ctx) {
7513 mem_ctx = state->out_mem_ctx;
7518 status = dcerpc_winreg_SaveKeyEx_r_recv(subreq, mem_ctx);
7519 TALLOC_FREE(subreq);
7520 if (!NT_STATUS_IS_OK(status)) {
7521 tevent_req_nterror(req, status);
7525 /* Copy out parameters */
7528 state->orig.out.result = state->tmp.out.result;
7530 /* Reset temporary structure */
7531 ZERO_STRUCT(state->tmp);
7533 tevent_req_done(req);
7536 NTSTATUS dcerpc_winreg_SaveKeyEx_recv(struct tevent_req *req,
7537 TALLOC_CTX *mem_ctx,
7540 struct dcerpc_winreg_SaveKeyEx_state *state = tevent_req_data(
7541 req, struct dcerpc_winreg_SaveKeyEx_state);
7544 if (tevent_req_is_nterror(req, &status)) {
7545 tevent_req_received(req);
7549 /* Steal possible out parameters to the callers context */
7550 talloc_steal(mem_ctx, state->out_mem_ctx);
7553 *result = state->orig.out.result;
7555 tevent_req_received(req);
7556 return NT_STATUS_OK;
7559 NTSTATUS dcerpc_winreg_SaveKeyEx(struct dcerpc_binding_handle *h,
7560 TALLOC_CTX *mem_ctx,
7561 struct policy_handle *_handle /* [in] [ref] */,
7562 struct winreg_String *_filename /* [in] [ref] */,
7563 struct KeySecurityAttribute *_sec_attrib /* [in] [unique] */,
7564 uint32_t _flags /* [in] */,
7567 struct winreg_SaveKeyEx r;
7571 r.in.handle = _handle;
7572 r.in.filename = _filename;
7573 r.in.sec_attrib = _sec_attrib;
7574 r.in.flags = _flags;
7576 status = dcerpc_winreg_SaveKeyEx_r(h, mem_ctx, &r);
7577 if (!NT_STATUS_IS_OK(status)) {
7581 /* Return variables */
7584 *result = r.out.result;
7586 return NT_STATUS_OK;
7589 struct dcerpc_winreg_OpenHKPT_r_state {
7590 TALLOC_CTX *out_mem_ctx;
7593 static void dcerpc_winreg_OpenHKPT_r_done(struct tevent_req *subreq);
7595 struct tevent_req *dcerpc_winreg_OpenHKPT_r_send(TALLOC_CTX *mem_ctx,
7596 struct tevent_context *ev,
7597 struct dcerpc_binding_handle *h,
7598 struct winreg_OpenHKPT *r)
7600 struct tevent_req *req;
7601 struct dcerpc_winreg_OpenHKPT_r_state *state;
7602 struct tevent_req *subreq;
7604 req = tevent_req_create(mem_ctx, &state,
7605 struct dcerpc_winreg_OpenHKPT_r_state);
7610 state->out_mem_ctx = talloc_new(state);
7611 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7612 return tevent_req_post(req, ev);
7615 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7616 NULL, &ndr_table_winreg,
7617 NDR_WINREG_OPENHKPT, state->out_mem_ctx, r);
7618 if (tevent_req_nomem(subreq, req)) {
7619 return tevent_req_post(req, ev);
7621 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPT_r_done, req);
7626 static void dcerpc_winreg_OpenHKPT_r_done(struct tevent_req *subreq)
7628 struct tevent_req *req =
7629 tevent_req_callback_data(subreq,
7633 status = dcerpc_binding_handle_call_recv(subreq);
7634 if (!NT_STATUS_IS_OK(status)) {
7635 tevent_req_nterror(req, status);
7639 tevent_req_done(req);
7642 NTSTATUS dcerpc_winreg_OpenHKPT_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7644 struct dcerpc_winreg_OpenHKPT_r_state *state =
7645 tevent_req_data(req,
7646 struct dcerpc_winreg_OpenHKPT_r_state);
7649 if (tevent_req_is_nterror(req, &status)) {
7650 tevent_req_received(req);
7654 talloc_steal(mem_ctx, state->out_mem_ctx);
7656 tevent_req_received(req);
7657 return NT_STATUS_OK;
7660 NTSTATUS dcerpc_winreg_OpenHKPT_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKPT *r)
7664 status = dcerpc_binding_handle_call(h,
7665 NULL, &ndr_table_winreg,
7666 NDR_WINREG_OPENHKPT, mem_ctx, r);
7671 NTSTATUS dcerpc_winreg_OpenHKPT_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenHKPT *r)
7675 status = dcerpc_winreg_OpenHKPT_r(p->binding_handle, mem_ctx, r);
7677 if (NT_STATUS_IS_RPC(status)) {
7678 status = NT_STATUS_NET_WRITE_FAULT;
7684 struct dcerpc_winreg_OpenHKPT_state {
7685 struct winreg_OpenHKPT orig;
7686 struct winreg_OpenHKPT tmp;
7687 TALLOC_CTX *out_mem_ctx;
7690 static void dcerpc_winreg_OpenHKPT_done(struct tevent_req *subreq);
7692 struct tevent_req *dcerpc_winreg_OpenHKPT_send(TALLOC_CTX *mem_ctx,
7693 struct tevent_context *ev,
7694 struct dcerpc_binding_handle *h,
7695 uint16_t *_system_name /* [in] [unique] */,
7696 uint32_t _access_mask /* [in] */,
7697 struct policy_handle *_handle /* [out] [ref] */)
7699 struct tevent_req *req;
7700 struct dcerpc_winreg_OpenHKPT_state *state;
7701 struct tevent_req *subreq;
7703 req = tevent_req_create(mem_ctx, &state,
7704 struct dcerpc_winreg_OpenHKPT_state);
7708 state->out_mem_ctx = NULL;
7711 state->orig.in.system_name = _system_name;
7712 state->orig.in.access_mask = _access_mask;
7714 /* Out parameters */
7715 state->orig.out.handle = _handle;
7718 ZERO_STRUCT(state->orig.out.result);
7720 state->out_mem_ctx = talloc_named_const(state, 0,
7721 "dcerpc_winreg_OpenHKPT_out_memory");
7722 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7723 return tevent_req_post(req, ev);
7726 /* make a temporary copy, that we pass to the dispatch function */
7727 state->tmp = state->orig;
7729 subreq = dcerpc_winreg_OpenHKPT_r_send(state, ev, h, &state->tmp);
7730 if (tevent_req_nomem(subreq, req)) {
7731 return tevent_req_post(req, ev);
7733 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPT_done, req);
7737 static void dcerpc_winreg_OpenHKPT_done(struct tevent_req *subreq)
7739 struct tevent_req *req = tevent_req_callback_data(
7740 subreq, struct tevent_req);
7741 struct dcerpc_winreg_OpenHKPT_state *state = tevent_req_data(
7742 req, struct dcerpc_winreg_OpenHKPT_state);
7744 TALLOC_CTX *mem_ctx;
7746 if (state->out_mem_ctx) {
7747 mem_ctx = state->out_mem_ctx;
7752 status = dcerpc_winreg_OpenHKPT_r_recv(subreq, mem_ctx);
7753 TALLOC_FREE(subreq);
7754 if (!NT_STATUS_IS_OK(status)) {
7755 tevent_req_nterror(req, status);
7759 /* Copy out parameters */
7760 *state->orig.out.handle = *state->tmp.out.handle;
7763 state->orig.out.result = state->tmp.out.result;
7765 /* Reset temporary structure */
7766 ZERO_STRUCT(state->tmp);
7768 tevent_req_done(req);
7771 NTSTATUS dcerpc_winreg_OpenHKPT_recv(struct tevent_req *req,
7772 TALLOC_CTX *mem_ctx,
7775 struct dcerpc_winreg_OpenHKPT_state *state = tevent_req_data(
7776 req, struct dcerpc_winreg_OpenHKPT_state);
7779 if (tevent_req_is_nterror(req, &status)) {
7780 tevent_req_received(req);
7784 /* Steal possible out parameters to the callers context */
7785 talloc_steal(mem_ctx, state->out_mem_ctx);
7788 *result = state->orig.out.result;
7790 tevent_req_received(req);
7791 return NT_STATUS_OK;
7794 NTSTATUS dcerpc_winreg_OpenHKPT(struct dcerpc_binding_handle *h,
7795 TALLOC_CTX *mem_ctx,
7796 uint16_t *_system_name /* [in] [unique] */,
7797 uint32_t _access_mask /* [in] */,
7798 struct policy_handle *_handle /* [out] [ref] */,
7801 struct winreg_OpenHKPT r;
7805 r.in.system_name = _system_name;
7806 r.in.access_mask = _access_mask;
7808 status = dcerpc_winreg_OpenHKPT_r(h, mem_ctx, &r);
7809 if (!NT_STATUS_IS_OK(status)) {
7813 /* Return variables */
7814 *_handle = *r.out.handle;
7817 *result = r.out.result;
7819 return NT_STATUS_OK;
7822 struct dcerpc_winreg_OpenHKPN_r_state {
7823 TALLOC_CTX *out_mem_ctx;
7826 static void dcerpc_winreg_OpenHKPN_r_done(struct tevent_req *subreq);
7828 struct tevent_req *dcerpc_winreg_OpenHKPN_r_send(TALLOC_CTX *mem_ctx,
7829 struct tevent_context *ev,
7830 struct dcerpc_binding_handle *h,
7831 struct winreg_OpenHKPN *r)
7833 struct tevent_req *req;
7834 struct dcerpc_winreg_OpenHKPN_r_state *state;
7835 struct tevent_req *subreq;
7837 req = tevent_req_create(mem_ctx, &state,
7838 struct dcerpc_winreg_OpenHKPN_r_state);
7843 state->out_mem_ctx = talloc_new(state);
7844 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7845 return tevent_req_post(req, ev);
7848 subreq = dcerpc_binding_handle_call_send(state, ev, h,
7849 NULL, &ndr_table_winreg,
7850 NDR_WINREG_OPENHKPN, state->out_mem_ctx, r);
7851 if (tevent_req_nomem(subreq, req)) {
7852 return tevent_req_post(req, ev);
7854 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPN_r_done, req);
7859 static void dcerpc_winreg_OpenHKPN_r_done(struct tevent_req *subreq)
7861 struct tevent_req *req =
7862 tevent_req_callback_data(subreq,
7866 status = dcerpc_binding_handle_call_recv(subreq);
7867 if (!NT_STATUS_IS_OK(status)) {
7868 tevent_req_nterror(req, status);
7872 tevent_req_done(req);
7875 NTSTATUS dcerpc_winreg_OpenHKPN_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7877 struct dcerpc_winreg_OpenHKPN_r_state *state =
7878 tevent_req_data(req,
7879 struct dcerpc_winreg_OpenHKPN_r_state);
7882 if (tevent_req_is_nterror(req, &status)) {
7883 tevent_req_received(req);
7887 talloc_steal(mem_ctx, state->out_mem_ctx);
7889 tevent_req_received(req);
7890 return NT_STATUS_OK;
7893 NTSTATUS dcerpc_winreg_OpenHKPN_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_OpenHKPN *r)
7897 status = dcerpc_binding_handle_call(h,
7898 NULL, &ndr_table_winreg,
7899 NDR_WINREG_OPENHKPN, mem_ctx, r);
7904 NTSTATUS dcerpc_winreg_OpenHKPN_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_OpenHKPN *r)
7908 status = dcerpc_winreg_OpenHKPN_r(p->binding_handle, mem_ctx, r);
7910 if (NT_STATUS_IS_RPC(status)) {
7911 status = NT_STATUS_NET_WRITE_FAULT;
7917 struct dcerpc_winreg_OpenHKPN_state {
7918 struct winreg_OpenHKPN orig;
7919 struct winreg_OpenHKPN tmp;
7920 TALLOC_CTX *out_mem_ctx;
7923 static void dcerpc_winreg_OpenHKPN_done(struct tevent_req *subreq);
7925 struct tevent_req *dcerpc_winreg_OpenHKPN_send(TALLOC_CTX *mem_ctx,
7926 struct tevent_context *ev,
7927 struct dcerpc_binding_handle *h,
7928 uint16_t *_system_name /* [in] [unique] */,
7929 uint32_t _access_mask /* [in] */,
7930 struct policy_handle *_handle /* [out] [ref] */)
7932 struct tevent_req *req;
7933 struct dcerpc_winreg_OpenHKPN_state *state;
7934 struct tevent_req *subreq;
7936 req = tevent_req_create(mem_ctx, &state,
7937 struct dcerpc_winreg_OpenHKPN_state);
7941 state->out_mem_ctx = NULL;
7944 state->orig.in.system_name = _system_name;
7945 state->orig.in.access_mask = _access_mask;
7947 /* Out parameters */
7948 state->orig.out.handle = _handle;
7951 ZERO_STRUCT(state->orig.out.result);
7953 state->out_mem_ctx = talloc_named_const(state, 0,
7954 "dcerpc_winreg_OpenHKPN_out_memory");
7955 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7956 return tevent_req_post(req, ev);
7959 /* make a temporary copy, that we pass to the dispatch function */
7960 state->tmp = state->orig;
7962 subreq = dcerpc_winreg_OpenHKPN_r_send(state, ev, h, &state->tmp);
7963 if (tevent_req_nomem(subreq, req)) {
7964 return tevent_req_post(req, ev);
7966 tevent_req_set_callback(subreq, dcerpc_winreg_OpenHKPN_done, req);
7970 static void dcerpc_winreg_OpenHKPN_done(struct tevent_req *subreq)
7972 struct tevent_req *req = tevent_req_callback_data(
7973 subreq, struct tevent_req);
7974 struct dcerpc_winreg_OpenHKPN_state *state = tevent_req_data(
7975 req, struct dcerpc_winreg_OpenHKPN_state);
7977 TALLOC_CTX *mem_ctx;
7979 if (state->out_mem_ctx) {
7980 mem_ctx = state->out_mem_ctx;
7985 status = dcerpc_winreg_OpenHKPN_r_recv(subreq, mem_ctx);
7986 TALLOC_FREE(subreq);
7987 if (!NT_STATUS_IS_OK(status)) {
7988 tevent_req_nterror(req, status);
7992 /* Copy out parameters */
7993 *state->orig.out.handle = *state->tmp.out.handle;
7996 state->orig.out.result = state->tmp.out.result;
7998 /* Reset temporary structure */
7999 ZERO_STRUCT(state->tmp);
8001 tevent_req_done(req);
8004 NTSTATUS dcerpc_winreg_OpenHKPN_recv(struct tevent_req *req,
8005 TALLOC_CTX *mem_ctx,
8008 struct dcerpc_winreg_OpenHKPN_state *state = tevent_req_data(
8009 req, struct dcerpc_winreg_OpenHKPN_state);
8012 if (tevent_req_is_nterror(req, &status)) {
8013 tevent_req_received(req);
8017 /* Steal possible out parameters to the callers context */
8018 talloc_steal(mem_ctx, state->out_mem_ctx);
8021 *result = state->orig.out.result;
8023 tevent_req_received(req);
8024 return NT_STATUS_OK;
8027 NTSTATUS dcerpc_winreg_OpenHKPN(struct dcerpc_binding_handle *h,
8028 TALLOC_CTX *mem_ctx,
8029 uint16_t *_system_name /* [in] [unique] */,
8030 uint32_t _access_mask /* [in] */,
8031 struct policy_handle *_handle /* [out] [ref] */,
8034 struct winreg_OpenHKPN r;
8038 r.in.system_name = _system_name;
8039 r.in.access_mask = _access_mask;
8041 status = dcerpc_winreg_OpenHKPN_r(h, mem_ctx, &r);
8042 if (!NT_STATUS_IS_OK(status)) {
8046 /* Return variables */
8047 *_handle = *r.out.handle;
8050 *result = r.out.result;
8052 return NT_STATUS_OK;
8055 struct dcerpc_winreg_QueryMultipleValues2_r_state {
8056 TALLOC_CTX *out_mem_ctx;
8059 static void dcerpc_winreg_QueryMultipleValues2_r_done(struct tevent_req *subreq);
8061 struct tevent_req *dcerpc_winreg_QueryMultipleValues2_r_send(TALLOC_CTX *mem_ctx,
8062 struct tevent_context *ev,
8063 struct dcerpc_binding_handle *h,
8064 struct winreg_QueryMultipleValues2 *r)
8066 struct tevent_req *req;
8067 struct dcerpc_winreg_QueryMultipleValues2_r_state *state;
8068 struct tevent_req *subreq;
8070 req = tevent_req_create(mem_ctx, &state,
8071 struct dcerpc_winreg_QueryMultipleValues2_r_state);
8076 state->out_mem_ctx = talloc_new(state);
8077 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8078 return tevent_req_post(req, ev);
8081 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8082 NULL, &ndr_table_winreg,
8083 NDR_WINREG_QUERYMULTIPLEVALUES2, state->out_mem_ctx, r);
8084 if (tevent_req_nomem(subreq, req)) {
8085 return tevent_req_post(req, ev);
8087 tevent_req_set_callback(subreq, dcerpc_winreg_QueryMultipleValues2_r_done, req);
8092 static void dcerpc_winreg_QueryMultipleValues2_r_done(struct tevent_req *subreq)
8094 struct tevent_req *req =
8095 tevent_req_callback_data(subreq,
8099 status = dcerpc_binding_handle_call_recv(subreq);
8100 if (!NT_STATUS_IS_OK(status)) {
8101 tevent_req_nterror(req, status);
8105 tevent_req_done(req);
8108 NTSTATUS dcerpc_winreg_QueryMultipleValues2_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8110 struct dcerpc_winreg_QueryMultipleValues2_r_state *state =
8111 tevent_req_data(req,
8112 struct dcerpc_winreg_QueryMultipleValues2_r_state);
8115 if (tevent_req_is_nterror(req, &status)) {
8116 tevent_req_received(req);
8120 talloc_steal(mem_ctx, state->out_mem_ctx);
8122 tevent_req_received(req);
8123 return NT_STATUS_OK;
8126 NTSTATUS dcerpc_winreg_QueryMultipleValues2_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_QueryMultipleValues2 *r)
8130 status = dcerpc_binding_handle_call(h,
8131 NULL, &ndr_table_winreg,
8132 NDR_WINREG_QUERYMULTIPLEVALUES2, mem_ctx, r);
8137 NTSTATUS dcerpc_winreg_QueryMultipleValues2_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_QueryMultipleValues2 *r)
8141 status = dcerpc_winreg_QueryMultipleValues2_r(p->binding_handle, mem_ctx, r);
8143 if (NT_STATUS_IS_RPC(status)) {
8144 status = NT_STATUS_NET_WRITE_FAULT;
8150 struct dcerpc_winreg_QueryMultipleValues2_state {
8151 struct winreg_QueryMultipleValues2 orig;
8152 struct winreg_QueryMultipleValues2 tmp;
8153 TALLOC_CTX *out_mem_ctx;
8156 static void dcerpc_winreg_QueryMultipleValues2_done(struct tevent_req *subreq);
8158 struct tevent_req *dcerpc_winreg_QueryMultipleValues2_send(TALLOC_CTX *mem_ctx,
8159 struct tevent_context *ev,
8160 struct dcerpc_binding_handle *h,
8161 struct policy_handle *_key_handle /* [in] [ref] */,
8162 struct QueryMultipleValue *_values_in /* [in] [ref,length_is(num_values),size_is(num_values)] */,
8163 struct QueryMultipleValue *_values_out /* [out] [ref,length_is(num_values),size_is(num_values)] */,
8164 uint32_t _num_values /* [in] */,
8165 uint8_t *_buffer /* [in,out] [unique,length_is(*offered),size_is(*offered)] */,
8166 uint32_t *_offered /* [in] [ref] */,
8167 uint32_t *_needed /* [out] [ref] */)
8169 struct tevent_req *req;
8170 struct dcerpc_winreg_QueryMultipleValues2_state *state;
8171 struct tevent_req *subreq;
8173 req = tevent_req_create(mem_ctx, &state,
8174 struct dcerpc_winreg_QueryMultipleValues2_state);
8178 state->out_mem_ctx = NULL;
8181 state->orig.in.key_handle = _key_handle;
8182 state->orig.in.values_in = _values_in;
8183 state->orig.in.num_values = _num_values;
8184 state->orig.in.buffer = _buffer;
8185 state->orig.in.offered = _offered;
8187 /* Out parameters */
8188 state->orig.out.values_out = _values_out;
8189 state->orig.out.buffer = _buffer;
8190 state->orig.out.needed = _needed;
8193 ZERO_STRUCT(state->orig.out.result);
8195 state->out_mem_ctx = talloc_named_const(state, 0,
8196 "dcerpc_winreg_QueryMultipleValues2_out_memory");
8197 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8198 return tevent_req_post(req, ev);
8201 /* make a temporary copy, that we pass to the dispatch function */
8202 state->tmp = state->orig;
8204 subreq = dcerpc_winreg_QueryMultipleValues2_r_send(state, ev, h, &state->tmp);
8205 if (tevent_req_nomem(subreq, req)) {
8206 return tevent_req_post(req, ev);
8208 tevent_req_set_callback(subreq, dcerpc_winreg_QueryMultipleValues2_done, req);
8212 static void dcerpc_winreg_QueryMultipleValues2_done(struct tevent_req *subreq)
8214 struct tevent_req *req = tevent_req_callback_data(
8215 subreq, struct tevent_req);
8216 struct dcerpc_winreg_QueryMultipleValues2_state *state = tevent_req_data(
8217 req, struct dcerpc_winreg_QueryMultipleValues2_state);
8219 TALLOC_CTX *mem_ctx;
8221 if (state->out_mem_ctx) {
8222 mem_ctx = state->out_mem_ctx;
8227 status = dcerpc_winreg_QueryMultipleValues2_r_recv(subreq, mem_ctx);
8228 TALLOC_FREE(subreq);
8229 if (!NT_STATUS_IS_OK(status)) {
8230 tevent_req_nterror(req, status);
8234 /* Copy out parameters */
8236 size_t _copy_len_values_out;
8237 _copy_len_values_out = state->tmp.in.num_values;
8238 memcpy(state->orig.out.values_out, state->tmp.out.values_out, _copy_len_values_out * sizeof(*state->orig.out.values_out));
8240 if (state->orig.out.buffer && state->tmp.out.buffer) {
8242 size_t _copy_len_buffer;
8243 _copy_len_buffer = *state->tmp.in.offered;
8244 memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
8247 *state->orig.out.needed = *state->tmp.out.needed;
8250 state->orig.out.result = state->tmp.out.result;
8252 /* Reset temporary structure */
8253 ZERO_STRUCT(state->tmp);
8255 tevent_req_done(req);
8258 NTSTATUS dcerpc_winreg_QueryMultipleValues2_recv(struct tevent_req *req,
8259 TALLOC_CTX *mem_ctx,
8262 struct dcerpc_winreg_QueryMultipleValues2_state *state = tevent_req_data(
8263 req, struct dcerpc_winreg_QueryMultipleValues2_state);
8266 if (tevent_req_is_nterror(req, &status)) {
8267 tevent_req_received(req);
8271 /* Steal possible out parameters to the callers context */
8272 talloc_steal(mem_ctx, state->out_mem_ctx);
8275 *result = state->orig.out.result;
8277 tevent_req_received(req);
8278 return NT_STATUS_OK;
8281 NTSTATUS dcerpc_winreg_QueryMultipleValues2(struct dcerpc_binding_handle *h,
8282 TALLOC_CTX *mem_ctx,
8283 struct policy_handle *_key_handle /* [in] [ref] */,
8284 struct QueryMultipleValue *_values_in /* [in] [ref,length_is(num_values),size_is(num_values)] */,
8285 struct QueryMultipleValue *_values_out /* [out] [ref,length_is(num_values),size_is(num_values)] */,
8286 uint32_t _num_values /* [in] */,
8287 uint8_t *_buffer /* [in,out] [unique,length_is(*offered),size_is(*offered)] */,
8288 uint32_t *_offered /* [in] [ref] */,
8289 uint32_t *_needed /* [out] [ref] */,
8292 struct winreg_QueryMultipleValues2 r;
8296 r.in.key_handle = _key_handle;
8297 r.in.values_in = _values_in;
8298 r.in.num_values = _num_values;
8299 r.in.buffer = _buffer;
8300 r.in.offered = _offered;
8302 status = dcerpc_winreg_QueryMultipleValues2_r(h, mem_ctx, &r);
8303 if (!NT_STATUS_IS_OK(status)) {
8307 /* Return variables */
8309 size_t _copy_len_values_out;
8310 _copy_len_values_out = r.in.num_values;
8311 memcpy(_values_out, r.out.values_out, _copy_len_values_out * sizeof(*_values_out));
8313 if (_buffer && r.out.buffer) {
8315 size_t _copy_len_buffer;
8316 _copy_len_buffer = *r.in.offered;
8317 memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
8320 *_needed = *r.out.needed;
8323 *result = r.out.result;
8325 return NT_STATUS_OK;
8328 struct dcerpc_winreg_DeleteKeyEx_r_state {
8329 TALLOC_CTX *out_mem_ctx;
8332 static void dcerpc_winreg_DeleteKeyEx_r_done(struct tevent_req *subreq);
8334 struct tevent_req *dcerpc_winreg_DeleteKeyEx_r_send(TALLOC_CTX *mem_ctx,
8335 struct tevent_context *ev,
8336 struct dcerpc_binding_handle *h,
8337 struct winreg_DeleteKeyEx *r)
8339 struct tevent_req *req;
8340 struct dcerpc_winreg_DeleteKeyEx_r_state *state;
8341 struct tevent_req *subreq;
8343 req = tevent_req_create(mem_ctx, &state,
8344 struct dcerpc_winreg_DeleteKeyEx_r_state);
8349 state->out_mem_ctx = NULL;
8350 subreq = dcerpc_binding_handle_call_send(state, ev, h,
8351 NULL, &ndr_table_winreg,
8352 NDR_WINREG_DELETEKEYEX, state, r);
8353 if (tevent_req_nomem(subreq, req)) {
8354 return tevent_req_post(req, ev);
8356 tevent_req_set_callback(subreq, dcerpc_winreg_DeleteKeyEx_r_done, req);
8361 static void dcerpc_winreg_DeleteKeyEx_r_done(struct tevent_req *subreq)
8363 struct tevent_req *req =
8364 tevent_req_callback_data(subreq,
8368 status = dcerpc_binding_handle_call_recv(subreq);
8369 if (!NT_STATUS_IS_OK(status)) {
8370 tevent_req_nterror(req, status);
8374 tevent_req_done(req);
8377 NTSTATUS dcerpc_winreg_DeleteKeyEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8379 struct dcerpc_winreg_DeleteKeyEx_r_state *state =
8380 tevent_req_data(req,
8381 struct dcerpc_winreg_DeleteKeyEx_r_state);
8384 if (tevent_req_is_nterror(req, &status)) {
8385 tevent_req_received(req);
8389 talloc_steal(mem_ctx, state->out_mem_ctx);
8391 tevent_req_received(req);
8392 return NT_STATUS_OK;
8395 NTSTATUS dcerpc_winreg_DeleteKeyEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct winreg_DeleteKeyEx *r)
8399 status = dcerpc_binding_handle_call(h,
8400 NULL, &ndr_table_winreg,
8401 NDR_WINREG_DELETEKEYEX, mem_ctx, r);
8406 NTSTATUS dcerpc_winreg_DeleteKeyEx_compat(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_DeleteKeyEx *r)
8410 status = dcerpc_winreg_DeleteKeyEx_r(p->binding_handle, mem_ctx, r);
8412 if (NT_STATUS_IS_RPC(status)) {
8413 status = NT_STATUS_NET_WRITE_FAULT;
8419 struct dcerpc_winreg_DeleteKeyEx_state {
8420 struct winreg_DeleteKeyEx orig;
8421 struct winreg_DeleteKeyEx tmp;
8422 TALLOC_CTX *out_mem_ctx;
8425 static void dcerpc_winreg_DeleteKeyEx_done(struct tevent_req *subreq);
8427 struct tevent_req *dcerpc_winreg_DeleteKeyEx_send(TALLOC_CTX *mem_ctx,
8428 struct tevent_context *ev,
8429 struct dcerpc_binding_handle *h,
8430 struct policy_handle *_handle /* [in] [ref] */,
8431 struct winreg_String *_key /* [in] [ref] */,
8432 uint32_t _access_mask /* [in] */,
8433 uint32_t _reserved /* [in] */)
8435 struct tevent_req *req;
8436 struct dcerpc_winreg_DeleteKeyEx_state *state;
8437 struct tevent_req *subreq;
8439 req = tevent_req_create(mem_ctx, &state,
8440 struct dcerpc_winreg_DeleteKeyEx_state);
8444 state->out_mem_ctx = NULL;
8447 state->orig.in.handle = _handle;
8448 state->orig.in.key = _key;
8449 state->orig.in.access_mask = _access_mask;
8450 state->orig.in.reserved = _reserved;
8452 /* Out parameters */
8455 ZERO_STRUCT(state->orig.out.result);
8457 /* make a temporary copy, that we pass to the dispatch function */
8458 state->tmp = state->orig;
8460 subreq = dcerpc_winreg_DeleteKeyEx_r_send(state, ev, h, &state->tmp);
8461 if (tevent_req_nomem(subreq, req)) {
8462 return tevent_req_post(req, ev);
8464 tevent_req_set_callback(subreq, dcerpc_winreg_DeleteKeyEx_done, req);
8468 static void dcerpc_winreg_DeleteKeyEx_done(struct tevent_req *subreq)
8470 struct tevent_req *req = tevent_req_callback_data(
8471 subreq, struct tevent_req);
8472 struct dcerpc_winreg_DeleteKeyEx_state *state = tevent_req_data(
8473 req, struct dcerpc_winreg_DeleteKeyEx_state);
8475 TALLOC_CTX *mem_ctx;
8477 if (state->out_mem_ctx) {
8478 mem_ctx = state->out_mem_ctx;
8483 status = dcerpc_winreg_DeleteKeyEx_r_recv(subreq, mem_ctx);
8484 TALLOC_FREE(subreq);
8485 if (!NT_STATUS_IS_OK(status)) {
8486 tevent_req_nterror(req, status);
8490 /* Copy out parameters */
8493 state->orig.out.result = state->tmp.out.result;
8495 /* Reset temporary structure */
8496 ZERO_STRUCT(state->tmp);
8498 tevent_req_done(req);
8501 NTSTATUS dcerpc_winreg_DeleteKeyEx_recv(struct tevent_req *req,
8502 TALLOC_CTX *mem_ctx,
8505 struct dcerpc_winreg_DeleteKeyEx_state *state = tevent_req_data(
8506 req, struct dcerpc_winreg_DeleteKeyEx_state);
8509 if (tevent_req_is_nterror(req, &status)) {
8510 tevent_req_received(req);
8514 /* Steal possible out parameters to the callers context */
8515 talloc_steal(mem_ctx, state->out_mem_ctx);
8518 *result = state->orig.out.result;
8520 tevent_req_received(req);
8521 return NT_STATUS_OK;
8524 NTSTATUS dcerpc_winreg_DeleteKeyEx(struct dcerpc_binding_handle *h,
8525 TALLOC_CTX *mem_ctx,
8526 struct policy_handle *_handle /* [in] [ref] */,
8527 struct winreg_String *_key /* [in] [ref] */,
8528 uint32_t _access_mask /* [in] */,
8529 uint32_t _reserved /* [in] */,
8532 struct winreg_DeleteKeyEx r;
8536 r.in.handle = _handle;
8538 r.in.access_mask = _access_mask;
8539 r.in.reserved = _reserved;
8541 status = dcerpc_winreg_DeleteKeyEx_r(h, mem_ctx, &r);
8542 if (!NT_STATUS_IS_OK(status)) {
8546 /* Return variables */
8549 *result = r.out.result;
8551 return NT_STATUS_OK;