librpc: rerun "make idl"
[Samba/cd1.git] / librpc / gen_ndr / cli_svcctl.c
blob80237c588901abc3c3c40a709739ef42822f25ad
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_svcctl.h"
9 struct rpccli_svcctl_CloseServiceHandle_state {
10 struct svcctl_CloseServiceHandle orig;
11 struct svcctl_CloseServiceHandle tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_svcctl_CloseServiceHandle_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_svcctl_CloseServiceHandle_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 struct policy_handle *_handle /* [in,out] [ref] */)
23 struct tevent_req *req;
24 struct rpccli_svcctl_CloseServiceHandle_state *state;
25 struct tevent_req *subreq;
27 req = tevent_req_create(mem_ctx, &state,
28 struct rpccli_svcctl_CloseServiceHandle_state);
29 if (req == NULL) {
30 return NULL;
32 state->out_mem_ctx = NULL;
33 state->dispatch_recv = cli->dispatch_recv;
35 /* In parameters */
36 state->orig.in.handle = _handle;
38 /* Out parameters */
39 state->orig.out.handle = _handle;
41 /* Result */
42 ZERO_STRUCT(state->orig.out.result);
44 state->out_mem_ctx = talloc_named_const(state, 0,
45 "rpccli_svcctl_CloseServiceHandle_out_memory");
46 if (tevent_req_nomem(state->out_mem_ctx, req)) {
47 return tevent_req_post(req, ev);
50 /* make a temporary copy, that we pass to the dispatch function */
51 state->tmp = state->orig;
53 subreq = cli->dispatch_send(state, ev, cli,
54 &ndr_table_svcctl,
55 NDR_SVCCTL_CLOSESERVICEHANDLE,
56 &state->tmp);
57 if (tevent_req_nomem(subreq, req)) {
58 return tevent_req_post(req, ev);
60 tevent_req_set_callback(subreq, rpccli_svcctl_CloseServiceHandle_done, req);
61 return req;
64 static void rpccli_svcctl_CloseServiceHandle_done(struct tevent_req *subreq)
66 struct tevent_req *req = tevent_req_callback_data(
67 subreq, struct tevent_req);
68 struct rpccli_svcctl_CloseServiceHandle_state *state = tevent_req_data(
69 req, struct rpccli_svcctl_CloseServiceHandle_state);
70 NTSTATUS status;
71 TALLOC_CTX *mem_ctx;
73 if (state->out_mem_ctx) {
74 mem_ctx = state->out_mem_ctx;
75 } else {
76 mem_ctx = state;
79 status = state->dispatch_recv(subreq, mem_ctx);
80 TALLOC_FREE(subreq);
81 if (!NT_STATUS_IS_OK(status)) {
82 tevent_req_nterror(req, status);
83 return;
86 /* Copy out parameters */
87 *state->orig.out.handle = *state->tmp.out.handle;
89 /* Copy result */
90 state->orig.out.result = state->tmp.out.result;
92 /* Reset temporary structure */
93 ZERO_STRUCT(state->tmp);
95 tevent_req_done(req);
98 NTSTATUS rpccli_svcctl_CloseServiceHandle_recv(struct tevent_req *req,
99 TALLOC_CTX *mem_ctx,
100 WERROR *result)
102 struct rpccli_svcctl_CloseServiceHandle_state *state = tevent_req_data(
103 req, struct rpccli_svcctl_CloseServiceHandle_state);
104 NTSTATUS status;
106 if (tevent_req_is_nterror(req, &status)) {
107 tevent_req_received(req);
108 return status;
111 /* Steal possbile out parameters to the callers context */
112 talloc_steal(mem_ctx, state->out_mem_ctx);
114 /* Return result */
115 *result = state->orig.out.result;
117 tevent_req_received(req);
118 return NT_STATUS_OK;
121 NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli,
122 TALLOC_CTX *mem_ctx,
123 struct policy_handle *handle /* [in,out] [ref] */,
124 WERROR *werror)
126 struct svcctl_CloseServiceHandle r;
127 NTSTATUS status;
129 /* In parameters */
130 r.in.handle = handle;
132 status = cli->dispatch(cli,
133 mem_ctx,
134 &ndr_table_svcctl,
135 NDR_SVCCTL_CLOSESERVICEHANDLE,
136 &r);
138 if (!NT_STATUS_IS_OK(status)) {
139 return status;
142 if (NT_STATUS_IS_ERR(status)) {
143 return status;
146 /* Return variables */
147 *handle = *r.out.handle;
149 /* Return result */
150 if (werror) {
151 *werror = r.out.result;
154 return werror_to_ntstatus(r.out.result);
157 struct rpccli_svcctl_ControlService_state {
158 struct svcctl_ControlService orig;
159 struct svcctl_ControlService tmp;
160 TALLOC_CTX *out_mem_ctx;
161 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
164 static void rpccli_svcctl_ControlService_done(struct tevent_req *subreq);
166 struct tevent_req *rpccli_svcctl_ControlService_send(TALLOC_CTX *mem_ctx,
167 struct tevent_context *ev,
168 struct rpc_pipe_client *cli,
169 struct policy_handle *_handle /* [in] [ref] */,
170 enum SERVICE_CONTROL _control /* [in] */,
171 struct SERVICE_STATUS *_service_status /* [out] [ref] */)
173 struct tevent_req *req;
174 struct rpccli_svcctl_ControlService_state *state;
175 struct tevent_req *subreq;
177 req = tevent_req_create(mem_ctx, &state,
178 struct rpccli_svcctl_ControlService_state);
179 if (req == NULL) {
180 return NULL;
182 state->out_mem_ctx = NULL;
183 state->dispatch_recv = cli->dispatch_recv;
185 /* In parameters */
186 state->orig.in.handle = _handle;
187 state->orig.in.control = _control;
189 /* Out parameters */
190 state->orig.out.service_status = _service_status;
192 /* Result */
193 ZERO_STRUCT(state->orig.out.result);
195 state->out_mem_ctx = talloc_named_const(state, 0,
196 "rpccli_svcctl_ControlService_out_memory");
197 if (tevent_req_nomem(state->out_mem_ctx, req)) {
198 return tevent_req_post(req, ev);
201 /* make a temporary copy, that we pass to the dispatch function */
202 state->tmp = state->orig;
204 subreq = cli->dispatch_send(state, ev, cli,
205 &ndr_table_svcctl,
206 NDR_SVCCTL_CONTROLSERVICE,
207 &state->tmp);
208 if (tevent_req_nomem(subreq, req)) {
209 return tevent_req_post(req, ev);
211 tevent_req_set_callback(subreq, rpccli_svcctl_ControlService_done, req);
212 return req;
215 static void rpccli_svcctl_ControlService_done(struct tevent_req *subreq)
217 struct tevent_req *req = tevent_req_callback_data(
218 subreq, struct tevent_req);
219 struct rpccli_svcctl_ControlService_state *state = tevent_req_data(
220 req, struct rpccli_svcctl_ControlService_state);
221 NTSTATUS status;
222 TALLOC_CTX *mem_ctx;
224 if (state->out_mem_ctx) {
225 mem_ctx = state->out_mem_ctx;
226 } else {
227 mem_ctx = state;
230 status = state->dispatch_recv(subreq, mem_ctx);
231 TALLOC_FREE(subreq);
232 if (!NT_STATUS_IS_OK(status)) {
233 tevent_req_nterror(req, status);
234 return;
237 /* Copy out parameters */
238 *state->orig.out.service_status = *state->tmp.out.service_status;
240 /* Copy result */
241 state->orig.out.result = state->tmp.out.result;
243 /* Reset temporary structure */
244 ZERO_STRUCT(state->tmp);
246 tevent_req_done(req);
249 NTSTATUS rpccli_svcctl_ControlService_recv(struct tevent_req *req,
250 TALLOC_CTX *mem_ctx,
251 WERROR *result)
253 struct rpccli_svcctl_ControlService_state *state = tevent_req_data(
254 req, struct rpccli_svcctl_ControlService_state);
255 NTSTATUS status;
257 if (tevent_req_is_nterror(req, &status)) {
258 tevent_req_received(req);
259 return status;
262 /* Steal possbile out parameters to the callers context */
263 talloc_steal(mem_ctx, state->out_mem_ctx);
265 /* Return result */
266 *result = state->orig.out.result;
268 tevent_req_received(req);
269 return NT_STATUS_OK;
272 NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli,
273 TALLOC_CTX *mem_ctx,
274 struct policy_handle *handle /* [in] [ref] */,
275 enum SERVICE_CONTROL control /* [in] */,
276 struct SERVICE_STATUS *service_status /* [out] [ref] */,
277 WERROR *werror)
279 struct svcctl_ControlService r;
280 NTSTATUS status;
282 /* In parameters */
283 r.in.handle = handle;
284 r.in.control = control;
286 status = cli->dispatch(cli,
287 mem_ctx,
288 &ndr_table_svcctl,
289 NDR_SVCCTL_CONTROLSERVICE,
290 &r);
292 if (!NT_STATUS_IS_OK(status)) {
293 return status;
296 if (NT_STATUS_IS_ERR(status)) {
297 return status;
300 /* Return variables */
301 *service_status = *r.out.service_status;
303 /* Return result */
304 if (werror) {
305 *werror = r.out.result;
308 return werror_to_ntstatus(r.out.result);
311 struct rpccli_svcctl_DeleteService_state {
312 struct svcctl_DeleteService orig;
313 struct svcctl_DeleteService tmp;
314 TALLOC_CTX *out_mem_ctx;
315 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
318 static void rpccli_svcctl_DeleteService_done(struct tevent_req *subreq);
320 struct tevent_req *rpccli_svcctl_DeleteService_send(TALLOC_CTX *mem_ctx,
321 struct tevent_context *ev,
322 struct rpc_pipe_client *cli,
323 struct policy_handle *_handle /* [in] [ref] */)
325 struct tevent_req *req;
326 struct rpccli_svcctl_DeleteService_state *state;
327 struct tevent_req *subreq;
329 req = tevent_req_create(mem_ctx, &state,
330 struct rpccli_svcctl_DeleteService_state);
331 if (req == NULL) {
332 return NULL;
334 state->out_mem_ctx = NULL;
335 state->dispatch_recv = cli->dispatch_recv;
337 /* In parameters */
338 state->orig.in.handle = _handle;
340 /* Out parameters */
342 /* Result */
343 ZERO_STRUCT(state->orig.out.result);
345 /* make a temporary copy, that we pass to the dispatch function */
346 state->tmp = state->orig;
348 subreq = cli->dispatch_send(state, ev, cli,
349 &ndr_table_svcctl,
350 NDR_SVCCTL_DELETESERVICE,
351 &state->tmp);
352 if (tevent_req_nomem(subreq, req)) {
353 return tevent_req_post(req, ev);
355 tevent_req_set_callback(subreq, rpccli_svcctl_DeleteService_done, req);
356 return req;
359 static void rpccli_svcctl_DeleteService_done(struct tevent_req *subreq)
361 struct tevent_req *req = tevent_req_callback_data(
362 subreq, struct tevent_req);
363 struct rpccli_svcctl_DeleteService_state *state = tevent_req_data(
364 req, struct rpccli_svcctl_DeleteService_state);
365 NTSTATUS status;
366 TALLOC_CTX *mem_ctx;
368 if (state->out_mem_ctx) {
369 mem_ctx = state->out_mem_ctx;
370 } else {
371 mem_ctx = state;
374 status = state->dispatch_recv(subreq, mem_ctx);
375 TALLOC_FREE(subreq);
376 if (!NT_STATUS_IS_OK(status)) {
377 tevent_req_nterror(req, status);
378 return;
381 /* Copy out parameters */
383 /* Copy result */
384 state->orig.out.result = state->tmp.out.result;
386 /* Reset temporary structure */
387 ZERO_STRUCT(state->tmp);
389 tevent_req_done(req);
392 NTSTATUS rpccli_svcctl_DeleteService_recv(struct tevent_req *req,
393 TALLOC_CTX *mem_ctx,
394 WERROR *result)
396 struct rpccli_svcctl_DeleteService_state *state = tevent_req_data(
397 req, struct rpccli_svcctl_DeleteService_state);
398 NTSTATUS status;
400 if (tevent_req_is_nterror(req, &status)) {
401 tevent_req_received(req);
402 return status;
405 /* Steal possbile out parameters to the callers context */
406 talloc_steal(mem_ctx, state->out_mem_ctx);
408 /* Return result */
409 *result = state->orig.out.result;
411 tevent_req_received(req);
412 return NT_STATUS_OK;
415 NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli,
416 TALLOC_CTX *mem_ctx,
417 struct policy_handle *handle /* [in] [ref] */,
418 WERROR *werror)
420 struct svcctl_DeleteService r;
421 NTSTATUS status;
423 /* In parameters */
424 r.in.handle = handle;
426 status = cli->dispatch(cli,
427 mem_ctx,
428 &ndr_table_svcctl,
429 NDR_SVCCTL_DELETESERVICE,
430 &r);
432 if (!NT_STATUS_IS_OK(status)) {
433 return status;
436 if (NT_STATUS_IS_ERR(status)) {
437 return status;
440 /* Return variables */
442 /* Return result */
443 if (werror) {
444 *werror = r.out.result;
447 return werror_to_ntstatus(r.out.result);
450 struct rpccli_svcctl_LockServiceDatabase_state {
451 struct svcctl_LockServiceDatabase orig;
452 struct svcctl_LockServiceDatabase tmp;
453 TALLOC_CTX *out_mem_ctx;
454 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
457 static void rpccli_svcctl_LockServiceDatabase_done(struct tevent_req *subreq);
459 struct tevent_req *rpccli_svcctl_LockServiceDatabase_send(TALLOC_CTX *mem_ctx,
460 struct tevent_context *ev,
461 struct rpc_pipe_client *cli,
462 struct policy_handle *_handle /* [in] [ref] */,
463 struct policy_handle *_lock /* [out] [ref] */)
465 struct tevent_req *req;
466 struct rpccli_svcctl_LockServiceDatabase_state *state;
467 struct tevent_req *subreq;
469 req = tevent_req_create(mem_ctx, &state,
470 struct rpccli_svcctl_LockServiceDatabase_state);
471 if (req == NULL) {
472 return NULL;
474 state->out_mem_ctx = NULL;
475 state->dispatch_recv = cli->dispatch_recv;
477 /* In parameters */
478 state->orig.in.handle = _handle;
480 /* Out parameters */
481 state->orig.out.lock = _lock;
483 /* Result */
484 ZERO_STRUCT(state->orig.out.result);
486 state->out_mem_ctx = talloc_named_const(state, 0,
487 "rpccli_svcctl_LockServiceDatabase_out_memory");
488 if (tevent_req_nomem(state->out_mem_ctx, req)) {
489 return tevent_req_post(req, ev);
492 /* make a temporary copy, that we pass to the dispatch function */
493 state->tmp = state->orig;
495 subreq = cli->dispatch_send(state, ev, cli,
496 &ndr_table_svcctl,
497 NDR_SVCCTL_LOCKSERVICEDATABASE,
498 &state->tmp);
499 if (tevent_req_nomem(subreq, req)) {
500 return tevent_req_post(req, ev);
502 tevent_req_set_callback(subreq, rpccli_svcctl_LockServiceDatabase_done, req);
503 return req;
506 static void rpccli_svcctl_LockServiceDatabase_done(struct tevent_req *subreq)
508 struct tevent_req *req = tevent_req_callback_data(
509 subreq, struct tevent_req);
510 struct rpccli_svcctl_LockServiceDatabase_state *state = tevent_req_data(
511 req, struct rpccli_svcctl_LockServiceDatabase_state);
512 NTSTATUS status;
513 TALLOC_CTX *mem_ctx;
515 if (state->out_mem_ctx) {
516 mem_ctx = state->out_mem_ctx;
517 } else {
518 mem_ctx = state;
521 status = state->dispatch_recv(subreq, mem_ctx);
522 TALLOC_FREE(subreq);
523 if (!NT_STATUS_IS_OK(status)) {
524 tevent_req_nterror(req, status);
525 return;
528 /* Copy out parameters */
529 *state->orig.out.lock = *state->tmp.out.lock;
531 /* Copy result */
532 state->orig.out.result = state->tmp.out.result;
534 /* Reset temporary structure */
535 ZERO_STRUCT(state->tmp);
537 tevent_req_done(req);
540 NTSTATUS rpccli_svcctl_LockServiceDatabase_recv(struct tevent_req *req,
541 TALLOC_CTX *mem_ctx,
542 WERROR *result)
544 struct rpccli_svcctl_LockServiceDatabase_state *state = tevent_req_data(
545 req, struct rpccli_svcctl_LockServiceDatabase_state);
546 NTSTATUS status;
548 if (tevent_req_is_nterror(req, &status)) {
549 tevent_req_received(req);
550 return status;
553 /* Steal possbile out parameters to the callers context */
554 talloc_steal(mem_ctx, state->out_mem_ctx);
556 /* Return result */
557 *result = state->orig.out.result;
559 tevent_req_received(req);
560 return NT_STATUS_OK;
563 NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli,
564 TALLOC_CTX *mem_ctx,
565 struct policy_handle *handle /* [in] [ref] */,
566 struct policy_handle *lock /* [out] [ref] */,
567 WERROR *werror)
569 struct svcctl_LockServiceDatabase r;
570 NTSTATUS status;
572 /* In parameters */
573 r.in.handle = handle;
575 status = cli->dispatch(cli,
576 mem_ctx,
577 &ndr_table_svcctl,
578 NDR_SVCCTL_LOCKSERVICEDATABASE,
579 &r);
581 if (!NT_STATUS_IS_OK(status)) {
582 return status;
585 if (NT_STATUS_IS_ERR(status)) {
586 return status;
589 /* Return variables */
590 *lock = *r.out.lock;
592 /* Return result */
593 if (werror) {
594 *werror = r.out.result;
597 return werror_to_ntstatus(r.out.result);
600 struct rpccli_svcctl_QueryServiceObjectSecurity_state {
601 struct svcctl_QueryServiceObjectSecurity orig;
602 struct svcctl_QueryServiceObjectSecurity tmp;
603 TALLOC_CTX *out_mem_ctx;
604 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
607 static void rpccli_svcctl_QueryServiceObjectSecurity_done(struct tevent_req *subreq);
609 struct tevent_req *rpccli_svcctl_QueryServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
610 struct tevent_context *ev,
611 struct rpc_pipe_client *cli,
612 struct policy_handle *_handle /* [in] [ref] */,
613 uint32_t _security_flags /* [in] */,
614 uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
615 uint32_t _offered /* [in] [range(0,0x40000)] */,
616 uint32_t *_needed /* [out] [ref,range(0,0x40000)] */)
618 struct tevent_req *req;
619 struct rpccli_svcctl_QueryServiceObjectSecurity_state *state;
620 struct tevent_req *subreq;
622 req = tevent_req_create(mem_ctx, &state,
623 struct rpccli_svcctl_QueryServiceObjectSecurity_state);
624 if (req == NULL) {
625 return NULL;
627 state->out_mem_ctx = NULL;
628 state->dispatch_recv = cli->dispatch_recv;
630 /* In parameters */
631 state->orig.in.handle = _handle;
632 state->orig.in.security_flags = _security_flags;
633 state->orig.in.offered = _offered;
635 /* Out parameters */
636 state->orig.out.buffer = _buffer;
637 state->orig.out.needed = _needed;
639 /* Result */
640 ZERO_STRUCT(state->orig.out.result);
642 state->out_mem_ctx = talloc_named_const(state, 0,
643 "rpccli_svcctl_QueryServiceObjectSecurity_out_memory");
644 if (tevent_req_nomem(state->out_mem_ctx, req)) {
645 return tevent_req_post(req, ev);
648 /* make a temporary copy, that we pass to the dispatch function */
649 state->tmp = state->orig;
651 subreq = cli->dispatch_send(state, ev, cli,
652 &ndr_table_svcctl,
653 NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY,
654 &state->tmp);
655 if (tevent_req_nomem(subreq, req)) {
656 return tevent_req_post(req, ev);
658 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceObjectSecurity_done, req);
659 return req;
662 static void rpccli_svcctl_QueryServiceObjectSecurity_done(struct tevent_req *subreq)
664 struct tevent_req *req = tevent_req_callback_data(
665 subreq, struct tevent_req);
666 struct rpccli_svcctl_QueryServiceObjectSecurity_state *state = tevent_req_data(
667 req, struct rpccli_svcctl_QueryServiceObjectSecurity_state);
668 NTSTATUS status;
669 TALLOC_CTX *mem_ctx;
671 if (state->out_mem_ctx) {
672 mem_ctx = state->out_mem_ctx;
673 } else {
674 mem_ctx = state;
677 status = state->dispatch_recv(subreq, mem_ctx);
678 TALLOC_FREE(subreq);
679 if (!NT_STATUS_IS_OK(status)) {
680 tevent_req_nterror(req, status);
681 return;
684 /* Copy out parameters */
685 memcpy(state->orig.out.buffer, state->tmp.out.buffer, (state->tmp.in.offered) * sizeof(*state->orig.out.buffer));
686 *state->orig.out.needed = *state->tmp.out.needed;
688 /* Copy result */
689 state->orig.out.result = state->tmp.out.result;
691 /* Reset temporary structure */
692 ZERO_STRUCT(state->tmp);
694 tevent_req_done(req);
697 NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity_recv(struct tevent_req *req,
698 TALLOC_CTX *mem_ctx,
699 WERROR *result)
701 struct rpccli_svcctl_QueryServiceObjectSecurity_state *state = tevent_req_data(
702 req, struct rpccli_svcctl_QueryServiceObjectSecurity_state);
703 NTSTATUS status;
705 if (tevent_req_is_nterror(req, &status)) {
706 tevent_req_received(req);
707 return status;
710 /* Steal possbile out parameters to the callers context */
711 talloc_steal(mem_ctx, state->out_mem_ctx);
713 /* Return result */
714 *result = state->orig.out.result;
716 tevent_req_received(req);
717 return NT_STATUS_OK;
720 NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
721 TALLOC_CTX *mem_ctx,
722 struct policy_handle *handle /* [in] [ref] */,
723 uint32_t security_flags /* [in] */,
724 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
725 uint32_t offered /* [in] [range(0,0x40000)] */,
726 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
727 WERROR *werror)
729 struct svcctl_QueryServiceObjectSecurity r;
730 NTSTATUS status;
732 /* In parameters */
733 r.in.handle = handle;
734 r.in.security_flags = security_flags;
735 r.in.offered = offered;
737 status = cli->dispatch(cli,
738 mem_ctx,
739 &ndr_table_svcctl,
740 NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY,
741 &r);
743 if (!NT_STATUS_IS_OK(status)) {
744 return status;
747 if (NT_STATUS_IS_ERR(status)) {
748 return status;
751 /* Return variables */
752 memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
753 *needed = *r.out.needed;
755 /* Return result */
756 if (werror) {
757 *werror = r.out.result;
760 return werror_to_ntstatus(r.out.result);
763 struct rpccli_svcctl_SetServiceObjectSecurity_state {
764 struct svcctl_SetServiceObjectSecurity orig;
765 struct svcctl_SetServiceObjectSecurity tmp;
766 TALLOC_CTX *out_mem_ctx;
767 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
770 static void rpccli_svcctl_SetServiceObjectSecurity_done(struct tevent_req *subreq);
772 struct tevent_req *rpccli_svcctl_SetServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
773 struct tevent_context *ev,
774 struct rpc_pipe_client *cli,
775 struct policy_handle *_handle /* [in] [ref] */,
776 uint32_t _security_flags /* [in] */,
777 uint8_t *_buffer /* [in] [ref,size_is(offered)] */,
778 uint32_t _offered /* [in] */)
780 struct tevent_req *req;
781 struct rpccli_svcctl_SetServiceObjectSecurity_state *state;
782 struct tevent_req *subreq;
784 req = tevent_req_create(mem_ctx, &state,
785 struct rpccli_svcctl_SetServiceObjectSecurity_state);
786 if (req == NULL) {
787 return NULL;
789 state->out_mem_ctx = NULL;
790 state->dispatch_recv = cli->dispatch_recv;
792 /* In parameters */
793 state->orig.in.handle = _handle;
794 state->orig.in.security_flags = _security_flags;
795 state->orig.in.buffer = _buffer;
796 state->orig.in.offered = _offered;
798 /* Out parameters */
800 /* Result */
801 ZERO_STRUCT(state->orig.out.result);
803 /* make a temporary copy, that we pass to the dispatch function */
804 state->tmp = state->orig;
806 subreq = cli->dispatch_send(state, ev, cli,
807 &ndr_table_svcctl,
808 NDR_SVCCTL_SETSERVICEOBJECTSECURITY,
809 &state->tmp);
810 if (tevent_req_nomem(subreq, req)) {
811 return tevent_req_post(req, ev);
813 tevent_req_set_callback(subreq, rpccli_svcctl_SetServiceObjectSecurity_done, req);
814 return req;
817 static void rpccli_svcctl_SetServiceObjectSecurity_done(struct tevent_req *subreq)
819 struct tevent_req *req = tevent_req_callback_data(
820 subreq, struct tevent_req);
821 struct rpccli_svcctl_SetServiceObjectSecurity_state *state = tevent_req_data(
822 req, struct rpccli_svcctl_SetServiceObjectSecurity_state);
823 NTSTATUS status;
824 TALLOC_CTX *mem_ctx;
826 if (state->out_mem_ctx) {
827 mem_ctx = state->out_mem_ctx;
828 } else {
829 mem_ctx = state;
832 status = state->dispatch_recv(subreq, mem_ctx);
833 TALLOC_FREE(subreq);
834 if (!NT_STATUS_IS_OK(status)) {
835 tevent_req_nterror(req, status);
836 return;
839 /* Copy out parameters */
841 /* Copy result */
842 state->orig.out.result = state->tmp.out.result;
844 /* Reset temporary structure */
845 ZERO_STRUCT(state->tmp);
847 tevent_req_done(req);
850 NTSTATUS rpccli_svcctl_SetServiceObjectSecurity_recv(struct tevent_req *req,
851 TALLOC_CTX *mem_ctx,
852 WERROR *result)
854 struct rpccli_svcctl_SetServiceObjectSecurity_state *state = tevent_req_data(
855 req, struct rpccli_svcctl_SetServiceObjectSecurity_state);
856 NTSTATUS status;
858 if (tevent_req_is_nterror(req, &status)) {
859 tevent_req_received(req);
860 return status;
863 /* Steal possbile out parameters to the callers context */
864 talloc_steal(mem_ctx, state->out_mem_ctx);
866 /* Return result */
867 *result = state->orig.out.result;
869 tevent_req_received(req);
870 return NT_STATUS_OK;
873 NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
874 TALLOC_CTX *mem_ctx,
875 struct policy_handle *handle /* [in] [ref] */,
876 uint32_t security_flags /* [in] */,
877 uint8_t *buffer /* [in] [ref,size_is(offered)] */,
878 uint32_t offered /* [in] */,
879 WERROR *werror)
881 struct svcctl_SetServiceObjectSecurity r;
882 NTSTATUS status;
884 /* In parameters */
885 r.in.handle = handle;
886 r.in.security_flags = security_flags;
887 r.in.buffer = buffer;
888 r.in.offered = offered;
890 status = cli->dispatch(cli,
891 mem_ctx,
892 &ndr_table_svcctl,
893 NDR_SVCCTL_SETSERVICEOBJECTSECURITY,
894 &r);
896 if (!NT_STATUS_IS_OK(status)) {
897 return status;
900 if (NT_STATUS_IS_ERR(status)) {
901 return status;
904 /* Return variables */
906 /* Return result */
907 if (werror) {
908 *werror = r.out.result;
911 return werror_to_ntstatus(r.out.result);
914 struct rpccli_svcctl_QueryServiceStatus_state {
915 struct svcctl_QueryServiceStatus orig;
916 struct svcctl_QueryServiceStatus tmp;
917 TALLOC_CTX *out_mem_ctx;
918 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
921 static void rpccli_svcctl_QueryServiceStatus_done(struct tevent_req *subreq);
923 struct tevent_req *rpccli_svcctl_QueryServiceStatus_send(TALLOC_CTX *mem_ctx,
924 struct tevent_context *ev,
925 struct rpc_pipe_client *cli,
926 struct policy_handle *_handle /* [in] [ref] */,
927 struct SERVICE_STATUS *_service_status /* [out] [ref] */)
929 struct tevent_req *req;
930 struct rpccli_svcctl_QueryServiceStatus_state *state;
931 struct tevent_req *subreq;
933 req = tevent_req_create(mem_ctx, &state,
934 struct rpccli_svcctl_QueryServiceStatus_state);
935 if (req == NULL) {
936 return NULL;
938 state->out_mem_ctx = NULL;
939 state->dispatch_recv = cli->dispatch_recv;
941 /* In parameters */
942 state->orig.in.handle = _handle;
944 /* Out parameters */
945 state->orig.out.service_status = _service_status;
947 /* Result */
948 ZERO_STRUCT(state->orig.out.result);
950 state->out_mem_ctx = talloc_named_const(state, 0,
951 "rpccli_svcctl_QueryServiceStatus_out_memory");
952 if (tevent_req_nomem(state->out_mem_ctx, req)) {
953 return tevent_req_post(req, ev);
956 /* make a temporary copy, that we pass to the dispatch function */
957 state->tmp = state->orig;
959 subreq = cli->dispatch_send(state, ev, cli,
960 &ndr_table_svcctl,
961 NDR_SVCCTL_QUERYSERVICESTATUS,
962 &state->tmp);
963 if (tevent_req_nomem(subreq, req)) {
964 return tevent_req_post(req, ev);
966 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceStatus_done, req);
967 return req;
970 static void rpccli_svcctl_QueryServiceStatus_done(struct tevent_req *subreq)
972 struct tevent_req *req = tevent_req_callback_data(
973 subreq, struct tevent_req);
974 struct rpccli_svcctl_QueryServiceStatus_state *state = tevent_req_data(
975 req, struct rpccli_svcctl_QueryServiceStatus_state);
976 NTSTATUS status;
977 TALLOC_CTX *mem_ctx;
979 if (state->out_mem_ctx) {
980 mem_ctx = state->out_mem_ctx;
981 } else {
982 mem_ctx = state;
985 status = state->dispatch_recv(subreq, mem_ctx);
986 TALLOC_FREE(subreq);
987 if (!NT_STATUS_IS_OK(status)) {
988 tevent_req_nterror(req, status);
989 return;
992 /* Copy out parameters */
993 *state->orig.out.service_status = *state->tmp.out.service_status;
995 /* Copy result */
996 state->orig.out.result = state->tmp.out.result;
998 /* Reset temporary structure */
999 ZERO_STRUCT(state->tmp);
1001 tevent_req_done(req);
1004 NTSTATUS rpccli_svcctl_QueryServiceStatus_recv(struct tevent_req *req,
1005 TALLOC_CTX *mem_ctx,
1006 WERROR *result)
1008 struct rpccli_svcctl_QueryServiceStatus_state *state = tevent_req_data(
1009 req, struct rpccli_svcctl_QueryServiceStatus_state);
1010 NTSTATUS status;
1012 if (tevent_req_is_nterror(req, &status)) {
1013 tevent_req_received(req);
1014 return status;
1017 /* Steal possbile out parameters to the callers context */
1018 talloc_steal(mem_ctx, state->out_mem_ctx);
1020 /* Return result */
1021 *result = state->orig.out.result;
1023 tevent_req_received(req);
1024 return NT_STATUS_OK;
1027 NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli,
1028 TALLOC_CTX *mem_ctx,
1029 struct policy_handle *handle /* [in] [ref] */,
1030 struct SERVICE_STATUS *service_status /* [out] [ref] */,
1031 WERROR *werror)
1033 struct svcctl_QueryServiceStatus r;
1034 NTSTATUS status;
1036 /* In parameters */
1037 r.in.handle = handle;
1039 status = cli->dispatch(cli,
1040 mem_ctx,
1041 &ndr_table_svcctl,
1042 NDR_SVCCTL_QUERYSERVICESTATUS,
1043 &r);
1045 if (!NT_STATUS_IS_OK(status)) {
1046 return status;
1049 if (NT_STATUS_IS_ERR(status)) {
1050 return status;
1053 /* Return variables */
1054 *service_status = *r.out.service_status;
1056 /* Return result */
1057 if (werror) {
1058 *werror = r.out.result;
1061 return werror_to_ntstatus(r.out.result);
1064 struct rpccli_svcctl_SetServiceStatus_state {
1065 struct svcctl_SetServiceStatus orig;
1066 struct svcctl_SetServiceStatus tmp;
1067 TALLOC_CTX *out_mem_ctx;
1068 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1071 static void rpccli_svcctl_SetServiceStatus_done(struct tevent_req *subreq);
1073 struct tevent_req *rpccli_svcctl_SetServiceStatus_send(TALLOC_CTX *mem_ctx,
1074 struct tevent_context *ev,
1075 struct rpc_pipe_client *cli)
1077 struct tevent_req *req;
1078 struct rpccli_svcctl_SetServiceStatus_state *state;
1079 struct tevent_req *subreq;
1081 req = tevent_req_create(mem_ctx, &state,
1082 struct rpccli_svcctl_SetServiceStatus_state);
1083 if (req == NULL) {
1084 return NULL;
1086 state->out_mem_ctx = NULL;
1087 state->dispatch_recv = cli->dispatch_recv;
1089 /* In parameters */
1091 /* Out parameters */
1093 /* Result */
1094 ZERO_STRUCT(state->orig.out.result);
1096 /* make a temporary copy, that we pass to the dispatch function */
1097 state->tmp = state->orig;
1099 subreq = cli->dispatch_send(state, ev, cli,
1100 &ndr_table_svcctl,
1101 NDR_SVCCTL_SETSERVICESTATUS,
1102 &state->tmp);
1103 if (tevent_req_nomem(subreq, req)) {
1104 return tevent_req_post(req, ev);
1106 tevent_req_set_callback(subreq, rpccli_svcctl_SetServiceStatus_done, req);
1107 return req;
1110 static void rpccli_svcctl_SetServiceStatus_done(struct tevent_req *subreq)
1112 struct tevent_req *req = tevent_req_callback_data(
1113 subreq, struct tevent_req);
1114 struct rpccli_svcctl_SetServiceStatus_state *state = tevent_req_data(
1115 req, struct rpccli_svcctl_SetServiceStatus_state);
1116 NTSTATUS status;
1117 TALLOC_CTX *mem_ctx;
1119 if (state->out_mem_ctx) {
1120 mem_ctx = state->out_mem_ctx;
1121 } else {
1122 mem_ctx = state;
1125 status = state->dispatch_recv(subreq, mem_ctx);
1126 TALLOC_FREE(subreq);
1127 if (!NT_STATUS_IS_OK(status)) {
1128 tevent_req_nterror(req, status);
1129 return;
1132 /* Copy out parameters */
1134 /* Copy result */
1135 state->orig.out.result = state->tmp.out.result;
1137 /* Reset temporary structure */
1138 ZERO_STRUCT(state->tmp);
1140 tevent_req_done(req);
1143 NTSTATUS rpccli_svcctl_SetServiceStatus_recv(struct tevent_req *req,
1144 TALLOC_CTX *mem_ctx,
1145 WERROR *result)
1147 struct rpccli_svcctl_SetServiceStatus_state *state = tevent_req_data(
1148 req, struct rpccli_svcctl_SetServiceStatus_state);
1149 NTSTATUS status;
1151 if (tevent_req_is_nterror(req, &status)) {
1152 tevent_req_received(req);
1153 return status;
1156 /* Steal possbile out parameters to the callers context */
1157 talloc_steal(mem_ctx, state->out_mem_ctx);
1159 /* Return result */
1160 *result = state->orig.out.result;
1162 tevent_req_received(req);
1163 return NT_STATUS_OK;
1166 NTSTATUS rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client *cli,
1167 TALLOC_CTX *mem_ctx,
1168 WERROR *werror)
1170 struct svcctl_SetServiceStatus r;
1171 NTSTATUS status;
1173 /* In parameters */
1175 status = cli->dispatch(cli,
1176 mem_ctx,
1177 &ndr_table_svcctl,
1178 NDR_SVCCTL_SETSERVICESTATUS,
1179 &r);
1181 if (!NT_STATUS_IS_OK(status)) {
1182 return status;
1185 if (NT_STATUS_IS_ERR(status)) {
1186 return status;
1189 /* Return variables */
1191 /* Return result */
1192 if (werror) {
1193 *werror = r.out.result;
1196 return werror_to_ntstatus(r.out.result);
1199 struct rpccli_svcctl_UnlockServiceDatabase_state {
1200 struct svcctl_UnlockServiceDatabase orig;
1201 struct svcctl_UnlockServiceDatabase tmp;
1202 TALLOC_CTX *out_mem_ctx;
1203 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1206 static void rpccli_svcctl_UnlockServiceDatabase_done(struct tevent_req *subreq);
1208 struct tevent_req *rpccli_svcctl_UnlockServiceDatabase_send(TALLOC_CTX *mem_ctx,
1209 struct tevent_context *ev,
1210 struct rpc_pipe_client *cli,
1211 struct policy_handle *_lock /* [in,out] [ref] */)
1213 struct tevent_req *req;
1214 struct rpccli_svcctl_UnlockServiceDatabase_state *state;
1215 struct tevent_req *subreq;
1217 req = tevent_req_create(mem_ctx, &state,
1218 struct rpccli_svcctl_UnlockServiceDatabase_state);
1219 if (req == NULL) {
1220 return NULL;
1222 state->out_mem_ctx = NULL;
1223 state->dispatch_recv = cli->dispatch_recv;
1225 /* In parameters */
1226 state->orig.in.lock = _lock;
1228 /* Out parameters */
1229 state->orig.out.lock = _lock;
1231 /* Result */
1232 ZERO_STRUCT(state->orig.out.result);
1234 state->out_mem_ctx = talloc_named_const(state, 0,
1235 "rpccli_svcctl_UnlockServiceDatabase_out_memory");
1236 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1237 return tevent_req_post(req, ev);
1240 /* make a temporary copy, that we pass to the dispatch function */
1241 state->tmp = state->orig;
1243 subreq = cli->dispatch_send(state, ev, cli,
1244 &ndr_table_svcctl,
1245 NDR_SVCCTL_UNLOCKSERVICEDATABASE,
1246 &state->tmp);
1247 if (tevent_req_nomem(subreq, req)) {
1248 return tevent_req_post(req, ev);
1250 tevent_req_set_callback(subreq, rpccli_svcctl_UnlockServiceDatabase_done, req);
1251 return req;
1254 static void rpccli_svcctl_UnlockServiceDatabase_done(struct tevent_req *subreq)
1256 struct tevent_req *req = tevent_req_callback_data(
1257 subreq, struct tevent_req);
1258 struct rpccli_svcctl_UnlockServiceDatabase_state *state = tevent_req_data(
1259 req, struct rpccli_svcctl_UnlockServiceDatabase_state);
1260 NTSTATUS status;
1261 TALLOC_CTX *mem_ctx;
1263 if (state->out_mem_ctx) {
1264 mem_ctx = state->out_mem_ctx;
1265 } else {
1266 mem_ctx = state;
1269 status = state->dispatch_recv(subreq, mem_ctx);
1270 TALLOC_FREE(subreq);
1271 if (!NT_STATUS_IS_OK(status)) {
1272 tevent_req_nterror(req, status);
1273 return;
1276 /* Copy out parameters */
1277 *state->orig.out.lock = *state->tmp.out.lock;
1279 /* Copy result */
1280 state->orig.out.result = state->tmp.out.result;
1282 /* Reset temporary structure */
1283 ZERO_STRUCT(state->tmp);
1285 tevent_req_done(req);
1288 NTSTATUS rpccli_svcctl_UnlockServiceDatabase_recv(struct tevent_req *req,
1289 TALLOC_CTX *mem_ctx,
1290 WERROR *result)
1292 struct rpccli_svcctl_UnlockServiceDatabase_state *state = tevent_req_data(
1293 req, struct rpccli_svcctl_UnlockServiceDatabase_state);
1294 NTSTATUS status;
1296 if (tevent_req_is_nterror(req, &status)) {
1297 tevent_req_received(req);
1298 return status;
1301 /* Steal possbile out parameters to the callers context */
1302 talloc_steal(mem_ctx, state->out_mem_ctx);
1304 /* Return result */
1305 *result = state->orig.out.result;
1307 tevent_req_received(req);
1308 return NT_STATUS_OK;
1311 NTSTATUS rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli,
1312 TALLOC_CTX *mem_ctx,
1313 struct policy_handle *lock /* [in,out] [ref] */,
1314 WERROR *werror)
1316 struct svcctl_UnlockServiceDatabase r;
1317 NTSTATUS status;
1319 /* In parameters */
1320 r.in.lock = lock;
1322 status = cli->dispatch(cli,
1323 mem_ctx,
1324 &ndr_table_svcctl,
1325 NDR_SVCCTL_UNLOCKSERVICEDATABASE,
1326 &r);
1328 if (!NT_STATUS_IS_OK(status)) {
1329 return status;
1332 if (NT_STATUS_IS_ERR(status)) {
1333 return status;
1336 /* Return variables */
1337 *lock = *r.out.lock;
1339 /* Return result */
1340 if (werror) {
1341 *werror = r.out.result;
1344 return werror_to_ntstatus(r.out.result);
1347 struct rpccli_svcctl_NotifyBootConfigStatus_state {
1348 struct svcctl_NotifyBootConfigStatus orig;
1349 struct svcctl_NotifyBootConfigStatus tmp;
1350 TALLOC_CTX *out_mem_ctx;
1351 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1354 static void rpccli_svcctl_NotifyBootConfigStatus_done(struct tevent_req *subreq);
1356 struct tevent_req *rpccli_svcctl_NotifyBootConfigStatus_send(TALLOC_CTX *mem_ctx,
1357 struct tevent_context *ev,
1358 struct rpc_pipe_client *cli)
1360 struct tevent_req *req;
1361 struct rpccli_svcctl_NotifyBootConfigStatus_state *state;
1362 struct tevent_req *subreq;
1364 req = tevent_req_create(mem_ctx, &state,
1365 struct rpccli_svcctl_NotifyBootConfigStatus_state);
1366 if (req == NULL) {
1367 return NULL;
1369 state->out_mem_ctx = NULL;
1370 state->dispatch_recv = cli->dispatch_recv;
1372 /* In parameters */
1374 /* Out parameters */
1376 /* Result */
1377 ZERO_STRUCT(state->orig.out.result);
1379 /* make a temporary copy, that we pass to the dispatch function */
1380 state->tmp = state->orig;
1382 subreq = cli->dispatch_send(state, ev, cli,
1383 &ndr_table_svcctl,
1384 NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS,
1385 &state->tmp);
1386 if (tevent_req_nomem(subreq, req)) {
1387 return tevent_req_post(req, ev);
1389 tevent_req_set_callback(subreq, rpccli_svcctl_NotifyBootConfigStatus_done, req);
1390 return req;
1393 static void rpccli_svcctl_NotifyBootConfigStatus_done(struct tevent_req *subreq)
1395 struct tevent_req *req = tevent_req_callback_data(
1396 subreq, struct tevent_req);
1397 struct rpccli_svcctl_NotifyBootConfigStatus_state *state = tevent_req_data(
1398 req, struct rpccli_svcctl_NotifyBootConfigStatus_state);
1399 NTSTATUS status;
1400 TALLOC_CTX *mem_ctx;
1402 if (state->out_mem_ctx) {
1403 mem_ctx = state->out_mem_ctx;
1404 } else {
1405 mem_ctx = state;
1408 status = state->dispatch_recv(subreq, mem_ctx);
1409 TALLOC_FREE(subreq);
1410 if (!NT_STATUS_IS_OK(status)) {
1411 tevent_req_nterror(req, status);
1412 return;
1415 /* Copy out parameters */
1417 /* Copy result */
1418 state->orig.out.result = state->tmp.out.result;
1420 /* Reset temporary structure */
1421 ZERO_STRUCT(state->tmp);
1423 tevent_req_done(req);
1426 NTSTATUS rpccli_svcctl_NotifyBootConfigStatus_recv(struct tevent_req *req,
1427 TALLOC_CTX *mem_ctx,
1428 WERROR *result)
1430 struct rpccli_svcctl_NotifyBootConfigStatus_state *state = tevent_req_data(
1431 req, struct rpccli_svcctl_NotifyBootConfigStatus_state);
1432 NTSTATUS status;
1434 if (tevent_req_is_nterror(req, &status)) {
1435 tevent_req_received(req);
1436 return status;
1439 /* Steal possbile out parameters to the callers context */
1440 talloc_steal(mem_ctx, state->out_mem_ctx);
1442 /* Return result */
1443 *result = state->orig.out.result;
1445 tevent_req_received(req);
1446 return NT_STATUS_OK;
1449 NTSTATUS rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli,
1450 TALLOC_CTX *mem_ctx,
1451 WERROR *werror)
1453 struct svcctl_NotifyBootConfigStatus r;
1454 NTSTATUS status;
1456 /* In parameters */
1458 status = cli->dispatch(cli,
1459 mem_ctx,
1460 &ndr_table_svcctl,
1461 NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS,
1462 &r);
1464 if (!NT_STATUS_IS_OK(status)) {
1465 return status;
1468 if (NT_STATUS_IS_ERR(status)) {
1469 return status;
1472 /* Return variables */
1474 /* Return result */
1475 if (werror) {
1476 *werror = r.out.result;
1479 return werror_to_ntstatus(r.out.result);
1482 struct rpccli_svcctl_SCSetServiceBitsW_state {
1483 struct svcctl_SCSetServiceBitsW orig;
1484 struct svcctl_SCSetServiceBitsW tmp;
1485 TALLOC_CTX *out_mem_ctx;
1486 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1489 static void rpccli_svcctl_SCSetServiceBitsW_done(struct tevent_req *subreq);
1491 struct tevent_req *rpccli_svcctl_SCSetServiceBitsW_send(TALLOC_CTX *mem_ctx,
1492 struct tevent_context *ev,
1493 struct rpc_pipe_client *cli,
1494 struct policy_handle *_handle /* [in] [ref] */,
1495 uint32_t _bits /* [in] */,
1496 uint32_t _bitson /* [in] */,
1497 uint32_t _immediate /* [in] */)
1499 struct tevent_req *req;
1500 struct rpccli_svcctl_SCSetServiceBitsW_state *state;
1501 struct tevent_req *subreq;
1503 req = tevent_req_create(mem_ctx, &state,
1504 struct rpccli_svcctl_SCSetServiceBitsW_state);
1505 if (req == NULL) {
1506 return NULL;
1508 state->out_mem_ctx = NULL;
1509 state->dispatch_recv = cli->dispatch_recv;
1511 /* In parameters */
1512 state->orig.in.handle = _handle;
1513 state->orig.in.bits = _bits;
1514 state->orig.in.bitson = _bitson;
1515 state->orig.in.immediate = _immediate;
1517 /* Out parameters */
1519 /* Result */
1520 ZERO_STRUCT(state->orig.out.result);
1522 /* make a temporary copy, that we pass to the dispatch function */
1523 state->tmp = state->orig;
1525 subreq = cli->dispatch_send(state, ev, cli,
1526 &ndr_table_svcctl,
1527 NDR_SVCCTL_SCSETSERVICEBITSW,
1528 &state->tmp);
1529 if (tevent_req_nomem(subreq, req)) {
1530 return tevent_req_post(req, ev);
1532 tevent_req_set_callback(subreq, rpccli_svcctl_SCSetServiceBitsW_done, req);
1533 return req;
1536 static void rpccli_svcctl_SCSetServiceBitsW_done(struct tevent_req *subreq)
1538 struct tevent_req *req = tevent_req_callback_data(
1539 subreq, struct tevent_req);
1540 struct rpccli_svcctl_SCSetServiceBitsW_state *state = tevent_req_data(
1541 req, struct rpccli_svcctl_SCSetServiceBitsW_state);
1542 NTSTATUS status;
1543 TALLOC_CTX *mem_ctx;
1545 if (state->out_mem_ctx) {
1546 mem_ctx = state->out_mem_ctx;
1547 } else {
1548 mem_ctx = state;
1551 status = state->dispatch_recv(subreq, mem_ctx);
1552 TALLOC_FREE(subreq);
1553 if (!NT_STATUS_IS_OK(status)) {
1554 tevent_req_nterror(req, status);
1555 return;
1558 /* Copy out parameters */
1560 /* Copy result */
1561 state->orig.out.result = state->tmp.out.result;
1563 /* Reset temporary structure */
1564 ZERO_STRUCT(state->tmp);
1566 tevent_req_done(req);
1569 NTSTATUS rpccli_svcctl_SCSetServiceBitsW_recv(struct tevent_req *req,
1570 TALLOC_CTX *mem_ctx,
1571 WERROR *result)
1573 struct rpccli_svcctl_SCSetServiceBitsW_state *state = tevent_req_data(
1574 req, struct rpccli_svcctl_SCSetServiceBitsW_state);
1575 NTSTATUS status;
1577 if (tevent_req_is_nterror(req, &status)) {
1578 tevent_req_received(req);
1579 return status;
1582 /* Steal possbile out parameters to the callers context */
1583 talloc_steal(mem_ctx, state->out_mem_ctx);
1585 /* Return result */
1586 *result = state->orig.out.result;
1588 tevent_req_received(req);
1589 return NT_STATUS_OK;
1592 NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli,
1593 TALLOC_CTX *mem_ctx,
1594 struct policy_handle *handle /* [in] [ref] */,
1595 uint32_t bits /* [in] */,
1596 uint32_t bitson /* [in] */,
1597 uint32_t immediate /* [in] */,
1598 WERROR *werror)
1600 struct svcctl_SCSetServiceBitsW r;
1601 NTSTATUS status;
1603 /* In parameters */
1604 r.in.handle = handle;
1605 r.in.bits = bits;
1606 r.in.bitson = bitson;
1607 r.in.immediate = immediate;
1609 status = cli->dispatch(cli,
1610 mem_ctx,
1611 &ndr_table_svcctl,
1612 NDR_SVCCTL_SCSETSERVICEBITSW,
1613 &r);
1615 if (!NT_STATUS_IS_OK(status)) {
1616 return status;
1619 if (NT_STATUS_IS_ERR(status)) {
1620 return status;
1623 /* Return variables */
1625 /* Return result */
1626 if (werror) {
1627 *werror = r.out.result;
1630 return werror_to_ntstatus(r.out.result);
1633 struct rpccli_svcctl_ChangeServiceConfigW_state {
1634 struct svcctl_ChangeServiceConfigW orig;
1635 struct svcctl_ChangeServiceConfigW tmp;
1636 TALLOC_CTX *out_mem_ctx;
1637 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1640 static void rpccli_svcctl_ChangeServiceConfigW_done(struct tevent_req *subreq);
1642 struct tevent_req *rpccli_svcctl_ChangeServiceConfigW_send(TALLOC_CTX *mem_ctx,
1643 struct tevent_context *ev,
1644 struct rpc_pipe_client *cli,
1645 struct policy_handle *_handle /* [in] [ref] */,
1646 uint32_t _type /* [in] */,
1647 enum svcctl_StartType _start_type /* [in] */,
1648 enum svcctl_ErrorControl _error_control /* [in] */,
1649 const char *_binary_path /* [in] [unique,charset(UTF16)] */,
1650 const char *_load_order_group /* [in] [unique,charset(UTF16)] */,
1651 uint32_t *_tag_id /* [out] [ref] */,
1652 const char *_dependencies /* [in] [unique,charset(UTF16)] */,
1653 const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
1654 const char *_password /* [in] [unique,charset(UTF16)] */,
1655 const char *_display_name /* [in] [unique,charset(UTF16)] */)
1657 struct tevent_req *req;
1658 struct rpccli_svcctl_ChangeServiceConfigW_state *state;
1659 struct tevent_req *subreq;
1661 req = tevent_req_create(mem_ctx, &state,
1662 struct rpccli_svcctl_ChangeServiceConfigW_state);
1663 if (req == NULL) {
1664 return NULL;
1666 state->out_mem_ctx = NULL;
1667 state->dispatch_recv = cli->dispatch_recv;
1669 /* In parameters */
1670 state->orig.in.handle = _handle;
1671 state->orig.in.type = _type;
1672 state->orig.in.start_type = _start_type;
1673 state->orig.in.error_control = _error_control;
1674 state->orig.in.binary_path = _binary_path;
1675 state->orig.in.load_order_group = _load_order_group;
1676 state->orig.in.dependencies = _dependencies;
1677 state->orig.in.service_start_name = _service_start_name;
1678 state->orig.in.password = _password;
1679 state->orig.in.display_name = _display_name;
1681 /* Out parameters */
1682 state->orig.out.tag_id = _tag_id;
1684 /* Result */
1685 ZERO_STRUCT(state->orig.out.result);
1687 state->out_mem_ctx = talloc_named_const(state, 0,
1688 "rpccli_svcctl_ChangeServiceConfigW_out_memory");
1689 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1690 return tevent_req_post(req, ev);
1693 /* make a temporary copy, that we pass to the dispatch function */
1694 state->tmp = state->orig;
1696 subreq = cli->dispatch_send(state, ev, cli,
1697 &ndr_table_svcctl,
1698 NDR_SVCCTL_CHANGESERVICECONFIGW,
1699 &state->tmp);
1700 if (tevent_req_nomem(subreq, req)) {
1701 return tevent_req_post(req, ev);
1703 tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfigW_done, req);
1704 return req;
1707 static void rpccli_svcctl_ChangeServiceConfigW_done(struct tevent_req *subreq)
1709 struct tevent_req *req = tevent_req_callback_data(
1710 subreq, struct tevent_req);
1711 struct rpccli_svcctl_ChangeServiceConfigW_state *state = tevent_req_data(
1712 req, struct rpccli_svcctl_ChangeServiceConfigW_state);
1713 NTSTATUS status;
1714 TALLOC_CTX *mem_ctx;
1716 if (state->out_mem_ctx) {
1717 mem_ctx = state->out_mem_ctx;
1718 } else {
1719 mem_ctx = state;
1722 status = state->dispatch_recv(subreq, mem_ctx);
1723 TALLOC_FREE(subreq);
1724 if (!NT_STATUS_IS_OK(status)) {
1725 tevent_req_nterror(req, status);
1726 return;
1729 /* Copy out parameters */
1730 *state->orig.out.tag_id = *state->tmp.out.tag_id;
1732 /* Copy result */
1733 state->orig.out.result = state->tmp.out.result;
1735 /* Reset temporary structure */
1736 ZERO_STRUCT(state->tmp);
1738 tevent_req_done(req);
1741 NTSTATUS rpccli_svcctl_ChangeServiceConfigW_recv(struct tevent_req *req,
1742 TALLOC_CTX *mem_ctx,
1743 WERROR *result)
1745 struct rpccli_svcctl_ChangeServiceConfigW_state *state = tevent_req_data(
1746 req, struct rpccli_svcctl_ChangeServiceConfigW_state);
1747 NTSTATUS status;
1749 if (tevent_req_is_nterror(req, &status)) {
1750 tevent_req_received(req);
1751 return status;
1754 /* Steal possbile out parameters to the callers context */
1755 talloc_steal(mem_ctx, state->out_mem_ctx);
1757 /* Return result */
1758 *result = state->orig.out.result;
1760 tevent_req_received(req);
1761 return NT_STATUS_OK;
1764 NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli,
1765 TALLOC_CTX *mem_ctx,
1766 struct policy_handle *handle /* [in] [ref] */,
1767 uint32_t type /* [in] */,
1768 enum svcctl_StartType start_type /* [in] */,
1769 enum svcctl_ErrorControl error_control /* [in] */,
1770 const char *binary_path /* [in] [unique,charset(UTF16)] */,
1771 const char *load_order_group /* [in] [unique,charset(UTF16)] */,
1772 uint32_t *tag_id /* [out] [ref] */,
1773 const char *dependencies /* [in] [unique,charset(UTF16)] */,
1774 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
1775 const char *password /* [in] [unique,charset(UTF16)] */,
1776 const char *display_name /* [in] [unique,charset(UTF16)] */,
1777 WERROR *werror)
1779 struct svcctl_ChangeServiceConfigW r;
1780 NTSTATUS status;
1782 /* In parameters */
1783 r.in.handle = handle;
1784 r.in.type = type;
1785 r.in.start_type = start_type;
1786 r.in.error_control = error_control;
1787 r.in.binary_path = binary_path;
1788 r.in.load_order_group = load_order_group;
1789 r.in.dependencies = dependencies;
1790 r.in.service_start_name = service_start_name;
1791 r.in.password = password;
1792 r.in.display_name = display_name;
1794 status = cli->dispatch(cli,
1795 mem_ctx,
1796 &ndr_table_svcctl,
1797 NDR_SVCCTL_CHANGESERVICECONFIGW,
1798 &r);
1800 if (!NT_STATUS_IS_OK(status)) {
1801 return status;
1804 if (NT_STATUS_IS_ERR(status)) {
1805 return status;
1808 /* Return variables */
1809 *tag_id = *r.out.tag_id;
1811 /* Return result */
1812 if (werror) {
1813 *werror = r.out.result;
1816 return werror_to_ntstatus(r.out.result);
1819 struct rpccli_svcctl_CreateServiceW_state {
1820 struct svcctl_CreateServiceW orig;
1821 struct svcctl_CreateServiceW tmp;
1822 TALLOC_CTX *out_mem_ctx;
1823 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1826 static void rpccli_svcctl_CreateServiceW_done(struct tevent_req *subreq);
1828 struct tevent_req *rpccli_svcctl_CreateServiceW_send(TALLOC_CTX *mem_ctx,
1829 struct tevent_context *ev,
1830 struct rpc_pipe_client *cli,
1831 struct policy_handle *_scmanager_handle /* [in] [ref] */,
1832 const char *_ServiceName /* [in] [charset(UTF16)] */,
1833 const char *_DisplayName /* [in] [unique,charset(UTF16)] */,
1834 uint32_t _desired_access /* [in] */,
1835 uint32_t _type /* [in] */,
1836 enum svcctl_StartType _start_type /* [in] */,
1837 enum svcctl_ErrorControl _error_control /* [in] */,
1838 const char *_binary_path /* [in] [charset(UTF16)] */,
1839 const char *_LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
1840 uint32_t *_TagId /* [in,out] [unique] */,
1841 uint8_t *_dependencies /* [in] [unique,size_is(dependencies_size)] */,
1842 uint32_t _dependencies_size /* [in] */,
1843 const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
1844 uint8_t *_password /* [in] [unique,size_is(password_size)] */,
1845 uint32_t _password_size /* [in] */,
1846 struct policy_handle *_handle /* [out] [ref] */)
1848 struct tevent_req *req;
1849 struct rpccli_svcctl_CreateServiceW_state *state;
1850 struct tevent_req *subreq;
1852 req = tevent_req_create(mem_ctx, &state,
1853 struct rpccli_svcctl_CreateServiceW_state);
1854 if (req == NULL) {
1855 return NULL;
1857 state->out_mem_ctx = NULL;
1858 state->dispatch_recv = cli->dispatch_recv;
1860 /* In parameters */
1861 state->orig.in.scmanager_handle = _scmanager_handle;
1862 state->orig.in.ServiceName = _ServiceName;
1863 state->orig.in.DisplayName = _DisplayName;
1864 state->orig.in.desired_access = _desired_access;
1865 state->orig.in.type = _type;
1866 state->orig.in.start_type = _start_type;
1867 state->orig.in.error_control = _error_control;
1868 state->orig.in.binary_path = _binary_path;
1869 state->orig.in.LoadOrderGroupKey = _LoadOrderGroupKey;
1870 state->orig.in.TagId = _TagId;
1871 state->orig.in.dependencies = _dependencies;
1872 state->orig.in.dependencies_size = _dependencies_size;
1873 state->orig.in.service_start_name = _service_start_name;
1874 state->orig.in.password = _password;
1875 state->orig.in.password_size = _password_size;
1877 /* Out parameters */
1878 state->orig.out.TagId = _TagId;
1879 state->orig.out.handle = _handle;
1881 /* Result */
1882 ZERO_STRUCT(state->orig.out.result);
1884 state->out_mem_ctx = talloc_named_const(state, 0,
1885 "rpccli_svcctl_CreateServiceW_out_memory");
1886 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1887 return tevent_req_post(req, ev);
1890 /* make a temporary copy, that we pass to the dispatch function */
1891 state->tmp = state->orig;
1893 subreq = cli->dispatch_send(state, ev, cli,
1894 &ndr_table_svcctl,
1895 NDR_SVCCTL_CREATESERVICEW,
1896 &state->tmp);
1897 if (tevent_req_nomem(subreq, req)) {
1898 return tevent_req_post(req, ev);
1900 tevent_req_set_callback(subreq, rpccli_svcctl_CreateServiceW_done, req);
1901 return req;
1904 static void rpccli_svcctl_CreateServiceW_done(struct tevent_req *subreq)
1906 struct tevent_req *req = tevent_req_callback_data(
1907 subreq, struct tevent_req);
1908 struct rpccli_svcctl_CreateServiceW_state *state = tevent_req_data(
1909 req, struct rpccli_svcctl_CreateServiceW_state);
1910 NTSTATUS status;
1911 TALLOC_CTX *mem_ctx;
1913 if (state->out_mem_ctx) {
1914 mem_ctx = state->out_mem_ctx;
1915 } else {
1916 mem_ctx = state;
1919 status = state->dispatch_recv(subreq, mem_ctx);
1920 TALLOC_FREE(subreq);
1921 if (!NT_STATUS_IS_OK(status)) {
1922 tevent_req_nterror(req, status);
1923 return;
1926 /* Copy out parameters */
1927 if (state->orig.out.TagId && state->tmp.out.TagId) {
1928 *state->orig.out.TagId = *state->tmp.out.TagId;
1930 *state->orig.out.handle = *state->tmp.out.handle;
1932 /* Copy result */
1933 state->orig.out.result = state->tmp.out.result;
1935 /* Reset temporary structure */
1936 ZERO_STRUCT(state->tmp);
1938 tevent_req_done(req);
1941 NTSTATUS rpccli_svcctl_CreateServiceW_recv(struct tevent_req *req,
1942 TALLOC_CTX *mem_ctx,
1943 WERROR *result)
1945 struct rpccli_svcctl_CreateServiceW_state *state = tevent_req_data(
1946 req, struct rpccli_svcctl_CreateServiceW_state);
1947 NTSTATUS status;
1949 if (tevent_req_is_nterror(req, &status)) {
1950 tevent_req_received(req);
1951 return status;
1954 /* Steal possbile out parameters to the callers context */
1955 talloc_steal(mem_ctx, state->out_mem_ctx);
1957 /* Return result */
1958 *result = state->orig.out.result;
1960 tevent_req_received(req);
1961 return NT_STATUS_OK;
1964 NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli,
1965 TALLOC_CTX *mem_ctx,
1966 struct policy_handle *scmanager_handle /* [in] [ref] */,
1967 const char *ServiceName /* [in] [charset(UTF16)] */,
1968 const char *DisplayName /* [in] [unique,charset(UTF16)] */,
1969 uint32_t desired_access /* [in] */,
1970 uint32_t type /* [in] */,
1971 enum svcctl_StartType start_type /* [in] */,
1972 enum svcctl_ErrorControl error_control /* [in] */,
1973 const char *binary_path /* [in] [charset(UTF16)] */,
1974 const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
1975 uint32_t *TagId /* [in,out] [unique] */,
1976 uint8_t *dependencies /* [in] [unique,size_is(dependencies_size)] */,
1977 uint32_t dependencies_size /* [in] */,
1978 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
1979 uint8_t *password /* [in] [unique,size_is(password_size)] */,
1980 uint32_t password_size /* [in] */,
1981 struct policy_handle *handle /* [out] [ref] */,
1982 WERROR *werror)
1984 struct svcctl_CreateServiceW r;
1985 NTSTATUS status;
1987 /* In parameters */
1988 r.in.scmanager_handle = scmanager_handle;
1989 r.in.ServiceName = ServiceName;
1990 r.in.DisplayName = DisplayName;
1991 r.in.desired_access = desired_access;
1992 r.in.type = type;
1993 r.in.start_type = start_type;
1994 r.in.error_control = error_control;
1995 r.in.binary_path = binary_path;
1996 r.in.LoadOrderGroupKey = LoadOrderGroupKey;
1997 r.in.TagId = TagId;
1998 r.in.dependencies = dependencies;
1999 r.in.dependencies_size = dependencies_size;
2000 r.in.service_start_name = service_start_name;
2001 r.in.password = password;
2002 r.in.password_size = password_size;
2004 status = cli->dispatch(cli,
2005 mem_ctx,
2006 &ndr_table_svcctl,
2007 NDR_SVCCTL_CREATESERVICEW,
2008 &r);
2010 if (!NT_STATUS_IS_OK(status)) {
2011 return status;
2014 if (NT_STATUS_IS_ERR(status)) {
2015 return status;
2018 /* Return variables */
2019 if (TagId && r.out.TagId) {
2020 *TagId = *r.out.TagId;
2022 *handle = *r.out.handle;
2024 /* Return result */
2025 if (werror) {
2026 *werror = r.out.result;
2029 return werror_to_ntstatus(r.out.result);
2032 struct rpccli_svcctl_EnumDependentServicesW_state {
2033 struct svcctl_EnumDependentServicesW orig;
2034 struct svcctl_EnumDependentServicesW tmp;
2035 TALLOC_CTX *out_mem_ctx;
2036 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2039 static void rpccli_svcctl_EnumDependentServicesW_done(struct tevent_req *subreq);
2041 struct tevent_req *rpccli_svcctl_EnumDependentServicesW_send(TALLOC_CTX *mem_ctx,
2042 struct tevent_context *ev,
2043 struct rpc_pipe_client *cli,
2044 struct policy_handle *_service /* [in] [ref] */,
2045 enum svcctl_ServiceState _state /* [in] */,
2046 uint8_t *_service_status /* [out] [ref,size_is(offered)] */,
2047 uint32_t _offered /* [in] [range(0,0x40000)] */,
2048 uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
2049 uint32_t *_services_returned /* [out] [ref,range(0,0x40000)] */)
2051 struct tevent_req *req;
2052 struct rpccli_svcctl_EnumDependentServicesW_state *state;
2053 struct tevent_req *subreq;
2055 req = tevent_req_create(mem_ctx, &state,
2056 struct rpccli_svcctl_EnumDependentServicesW_state);
2057 if (req == NULL) {
2058 return NULL;
2060 state->out_mem_ctx = NULL;
2061 state->dispatch_recv = cli->dispatch_recv;
2063 /* In parameters */
2064 state->orig.in.service = _service;
2065 state->orig.in.state = _state;
2066 state->orig.in.offered = _offered;
2068 /* Out parameters */
2069 state->orig.out.service_status = _service_status;
2070 state->orig.out.needed = _needed;
2071 state->orig.out.services_returned = _services_returned;
2073 /* Result */
2074 ZERO_STRUCT(state->orig.out.result);
2076 state->out_mem_ctx = talloc_named_const(state, 0,
2077 "rpccli_svcctl_EnumDependentServicesW_out_memory");
2078 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2079 return tevent_req_post(req, ev);
2082 /* make a temporary copy, that we pass to the dispatch function */
2083 state->tmp = state->orig;
2085 subreq = cli->dispatch_send(state, ev, cli,
2086 &ndr_table_svcctl,
2087 NDR_SVCCTL_ENUMDEPENDENTSERVICESW,
2088 &state->tmp);
2089 if (tevent_req_nomem(subreq, req)) {
2090 return tevent_req_post(req, ev);
2092 tevent_req_set_callback(subreq, rpccli_svcctl_EnumDependentServicesW_done, req);
2093 return req;
2096 static void rpccli_svcctl_EnumDependentServicesW_done(struct tevent_req *subreq)
2098 struct tevent_req *req = tevent_req_callback_data(
2099 subreq, struct tevent_req);
2100 struct rpccli_svcctl_EnumDependentServicesW_state *state = tevent_req_data(
2101 req, struct rpccli_svcctl_EnumDependentServicesW_state);
2102 NTSTATUS status;
2103 TALLOC_CTX *mem_ctx;
2105 if (state->out_mem_ctx) {
2106 mem_ctx = state->out_mem_ctx;
2107 } else {
2108 mem_ctx = state;
2111 status = state->dispatch_recv(subreq, mem_ctx);
2112 TALLOC_FREE(subreq);
2113 if (!NT_STATUS_IS_OK(status)) {
2114 tevent_req_nterror(req, status);
2115 return;
2118 /* Copy out parameters */
2119 memcpy(state->orig.out.service_status, state->tmp.out.service_status, (state->tmp.in.offered) * sizeof(*state->orig.out.service_status));
2120 *state->orig.out.needed = *state->tmp.out.needed;
2121 *state->orig.out.services_returned = *state->tmp.out.services_returned;
2123 /* Copy result */
2124 state->orig.out.result = state->tmp.out.result;
2126 /* Reset temporary structure */
2127 ZERO_STRUCT(state->tmp);
2129 tevent_req_done(req);
2132 NTSTATUS rpccli_svcctl_EnumDependentServicesW_recv(struct tevent_req *req,
2133 TALLOC_CTX *mem_ctx,
2134 WERROR *result)
2136 struct rpccli_svcctl_EnumDependentServicesW_state *state = tevent_req_data(
2137 req, struct rpccli_svcctl_EnumDependentServicesW_state);
2138 NTSTATUS status;
2140 if (tevent_req_is_nterror(req, &status)) {
2141 tevent_req_received(req);
2142 return status;
2145 /* Steal possbile out parameters to the callers context */
2146 talloc_steal(mem_ctx, state->out_mem_ctx);
2148 /* Return result */
2149 *result = state->orig.out.result;
2151 tevent_req_received(req);
2152 return NT_STATUS_OK;
2155 NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli,
2156 TALLOC_CTX *mem_ctx,
2157 struct policy_handle *service /* [in] [ref] */,
2158 enum svcctl_ServiceState state /* [in] */,
2159 uint8_t *service_status /* [out] [ref,size_is(offered)] */,
2160 uint32_t offered /* [in] [range(0,0x40000)] */,
2161 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
2162 uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */,
2163 WERROR *werror)
2165 struct svcctl_EnumDependentServicesW r;
2166 NTSTATUS status;
2168 /* In parameters */
2169 r.in.service = service;
2170 r.in.state = state;
2171 r.in.offered = offered;
2173 status = cli->dispatch(cli,
2174 mem_ctx,
2175 &ndr_table_svcctl,
2176 NDR_SVCCTL_ENUMDEPENDENTSERVICESW,
2177 &r);
2179 if (!NT_STATUS_IS_OK(status)) {
2180 return status;
2183 if (NT_STATUS_IS_ERR(status)) {
2184 return status;
2187 /* Return variables */
2188 memcpy(service_status, r.out.service_status, (r.in.offered) * sizeof(*service_status));
2189 *needed = *r.out.needed;
2190 *services_returned = *r.out.services_returned;
2192 /* Return result */
2193 if (werror) {
2194 *werror = r.out.result;
2197 return werror_to_ntstatus(r.out.result);
2200 struct rpccli_svcctl_EnumServicesStatusW_state {
2201 struct svcctl_EnumServicesStatusW orig;
2202 struct svcctl_EnumServicesStatusW tmp;
2203 TALLOC_CTX *out_mem_ctx;
2204 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2207 static void rpccli_svcctl_EnumServicesStatusW_done(struct tevent_req *subreq);
2209 struct tevent_req *rpccli_svcctl_EnumServicesStatusW_send(TALLOC_CTX *mem_ctx,
2210 struct tevent_context *ev,
2211 struct rpc_pipe_client *cli,
2212 struct policy_handle *_handle /* [in] [ref] */,
2213 uint32_t _type /* [in] */,
2214 enum svcctl_ServiceState _state /* [in] */,
2215 uint8_t *_service /* [out] [ref,size_is(offered)] */,
2216 uint32_t _offered /* [in] [range(0,0x40000)] */,
2217 uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
2218 uint32_t *_services_returned /* [out] [ref,range(0,0x40000)] */,
2219 uint32_t *_resume_handle /* [in,out] [unique] */)
2221 struct tevent_req *req;
2222 struct rpccli_svcctl_EnumServicesStatusW_state *state;
2223 struct tevent_req *subreq;
2225 req = tevent_req_create(mem_ctx, &state,
2226 struct rpccli_svcctl_EnumServicesStatusW_state);
2227 if (req == NULL) {
2228 return NULL;
2230 state->out_mem_ctx = NULL;
2231 state->dispatch_recv = cli->dispatch_recv;
2233 /* In parameters */
2234 state->orig.in.handle = _handle;
2235 state->orig.in.type = _type;
2236 state->orig.in.state = _state;
2237 state->orig.in.offered = _offered;
2238 state->orig.in.resume_handle = _resume_handle;
2240 /* Out parameters */
2241 state->orig.out.service = _service;
2242 state->orig.out.needed = _needed;
2243 state->orig.out.services_returned = _services_returned;
2244 state->orig.out.resume_handle = _resume_handle;
2246 /* Result */
2247 ZERO_STRUCT(state->orig.out.result);
2249 state->out_mem_ctx = talloc_named_const(state, 0,
2250 "rpccli_svcctl_EnumServicesStatusW_out_memory");
2251 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2252 return tevent_req_post(req, ev);
2255 /* make a temporary copy, that we pass to the dispatch function */
2256 state->tmp = state->orig;
2258 subreq = cli->dispatch_send(state, ev, cli,
2259 &ndr_table_svcctl,
2260 NDR_SVCCTL_ENUMSERVICESSTATUSW,
2261 &state->tmp);
2262 if (tevent_req_nomem(subreq, req)) {
2263 return tevent_req_post(req, ev);
2265 tevent_req_set_callback(subreq, rpccli_svcctl_EnumServicesStatusW_done, req);
2266 return req;
2269 static void rpccli_svcctl_EnumServicesStatusW_done(struct tevent_req *subreq)
2271 struct tevent_req *req = tevent_req_callback_data(
2272 subreq, struct tevent_req);
2273 struct rpccli_svcctl_EnumServicesStatusW_state *state = tevent_req_data(
2274 req, struct rpccli_svcctl_EnumServicesStatusW_state);
2275 NTSTATUS status;
2276 TALLOC_CTX *mem_ctx;
2278 if (state->out_mem_ctx) {
2279 mem_ctx = state->out_mem_ctx;
2280 } else {
2281 mem_ctx = state;
2284 status = state->dispatch_recv(subreq, mem_ctx);
2285 TALLOC_FREE(subreq);
2286 if (!NT_STATUS_IS_OK(status)) {
2287 tevent_req_nterror(req, status);
2288 return;
2291 /* Copy out parameters */
2292 memcpy(state->orig.out.service, state->tmp.out.service, (state->tmp.in.offered) * sizeof(*state->orig.out.service));
2293 *state->orig.out.needed = *state->tmp.out.needed;
2294 *state->orig.out.services_returned = *state->tmp.out.services_returned;
2295 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
2296 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2299 /* Copy result */
2300 state->orig.out.result = state->tmp.out.result;
2302 /* Reset temporary structure */
2303 ZERO_STRUCT(state->tmp);
2305 tevent_req_done(req);
2308 NTSTATUS rpccli_svcctl_EnumServicesStatusW_recv(struct tevent_req *req,
2309 TALLOC_CTX *mem_ctx,
2310 WERROR *result)
2312 struct rpccli_svcctl_EnumServicesStatusW_state *state = tevent_req_data(
2313 req, struct rpccli_svcctl_EnumServicesStatusW_state);
2314 NTSTATUS status;
2316 if (tevent_req_is_nterror(req, &status)) {
2317 tevent_req_received(req);
2318 return status;
2321 /* Steal possbile out parameters to the callers context */
2322 talloc_steal(mem_ctx, state->out_mem_ctx);
2324 /* Return result */
2325 *result = state->orig.out.result;
2327 tevent_req_received(req);
2328 return NT_STATUS_OK;
2331 NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli,
2332 TALLOC_CTX *mem_ctx,
2333 struct policy_handle *handle /* [in] [ref] */,
2334 uint32_t type /* [in] */,
2335 enum svcctl_ServiceState state /* [in] */,
2336 uint8_t *service /* [out] [ref,size_is(offered)] */,
2337 uint32_t offered /* [in] [range(0,0x40000)] */,
2338 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
2339 uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */,
2340 uint32_t *resume_handle /* [in,out] [unique] */,
2341 WERROR *werror)
2343 struct svcctl_EnumServicesStatusW r;
2344 NTSTATUS status;
2346 /* In parameters */
2347 r.in.handle = handle;
2348 r.in.type = type;
2349 r.in.state = state;
2350 r.in.offered = offered;
2351 r.in.resume_handle = resume_handle;
2353 status = cli->dispatch(cli,
2354 mem_ctx,
2355 &ndr_table_svcctl,
2356 NDR_SVCCTL_ENUMSERVICESSTATUSW,
2357 &r);
2359 if (!NT_STATUS_IS_OK(status)) {
2360 return status;
2363 if (NT_STATUS_IS_ERR(status)) {
2364 return status;
2367 /* Return variables */
2368 memcpy(service, r.out.service, (r.in.offered) * sizeof(*service));
2369 *needed = *r.out.needed;
2370 *services_returned = *r.out.services_returned;
2371 if (resume_handle && r.out.resume_handle) {
2372 *resume_handle = *r.out.resume_handle;
2375 /* Return result */
2376 if (werror) {
2377 *werror = r.out.result;
2380 return werror_to_ntstatus(r.out.result);
2383 struct rpccli_svcctl_OpenSCManagerW_state {
2384 struct svcctl_OpenSCManagerW orig;
2385 struct svcctl_OpenSCManagerW tmp;
2386 TALLOC_CTX *out_mem_ctx;
2387 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2390 static void rpccli_svcctl_OpenSCManagerW_done(struct tevent_req *subreq);
2392 struct tevent_req *rpccli_svcctl_OpenSCManagerW_send(TALLOC_CTX *mem_ctx,
2393 struct tevent_context *ev,
2394 struct rpc_pipe_client *cli,
2395 const char *_MachineName /* [in] [unique,charset(UTF16)] */,
2396 const char *_DatabaseName /* [in] [unique,charset(UTF16)] */,
2397 uint32_t _access_mask /* [in] */,
2398 struct policy_handle *_handle /* [out] [ref] */)
2400 struct tevent_req *req;
2401 struct rpccli_svcctl_OpenSCManagerW_state *state;
2402 struct tevent_req *subreq;
2404 req = tevent_req_create(mem_ctx, &state,
2405 struct rpccli_svcctl_OpenSCManagerW_state);
2406 if (req == NULL) {
2407 return NULL;
2409 state->out_mem_ctx = NULL;
2410 state->dispatch_recv = cli->dispatch_recv;
2412 /* In parameters */
2413 state->orig.in.MachineName = _MachineName;
2414 state->orig.in.DatabaseName = _DatabaseName;
2415 state->orig.in.access_mask = _access_mask;
2417 /* Out parameters */
2418 state->orig.out.handle = _handle;
2420 /* Result */
2421 ZERO_STRUCT(state->orig.out.result);
2423 state->out_mem_ctx = talloc_named_const(state, 0,
2424 "rpccli_svcctl_OpenSCManagerW_out_memory");
2425 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2426 return tevent_req_post(req, ev);
2429 /* make a temporary copy, that we pass to the dispatch function */
2430 state->tmp = state->orig;
2432 subreq = cli->dispatch_send(state, ev, cli,
2433 &ndr_table_svcctl,
2434 NDR_SVCCTL_OPENSCMANAGERW,
2435 &state->tmp);
2436 if (tevent_req_nomem(subreq, req)) {
2437 return tevent_req_post(req, ev);
2439 tevent_req_set_callback(subreq, rpccli_svcctl_OpenSCManagerW_done, req);
2440 return req;
2443 static void rpccli_svcctl_OpenSCManagerW_done(struct tevent_req *subreq)
2445 struct tevent_req *req = tevent_req_callback_data(
2446 subreq, struct tevent_req);
2447 struct rpccli_svcctl_OpenSCManagerW_state *state = tevent_req_data(
2448 req, struct rpccli_svcctl_OpenSCManagerW_state);
2449 NTSTATUS status;
2450 TALLOC_CTX *mem_ctx;
2452 if (state->out_mem_ctx) {
2453 mem_ctx = state->out_mem_ctx;
2454 } else {
2455 mem_ctx = state;
2458 status = state->dispatch_recv(subreq, mem_ctx);
2459 TALLOC_FREE(subreq);
2460 if (!NT_STATUS_IS_OK(status)) {
2461 tevent_req_nterror(req, status);
2462 return;
2465 /* Copy out parameters */
2466 *state->orig.out.handle = *state->tmp.out.handle;
2468 /* Copy result */
2469 state->orig.out.result = state->tmp.out.result;
2471 /* Reset temporary structure */
2472 ZERO_STRUCT(state->tmp);
2474 tevent_req_done(req);
2477 NTSTATUS rpccli_svcctl_OpenSCManagerW_recv(struct tevent_req *req,
2478 TALLOC_CTX *mem_ctx,
2479 WERROR *result)
2481 struct rpccli_svcctl_OpenSCManagerW_state *state = tevent_req_data(
2482 req, struct rpccli_svcctl_OpenSCManagerW_state);
2483 NTSTATUS status;
2485 if (tevent_req_is_nterror(req, &status)) {
2486 tevent_req_received(req);
2487 return status;
2490 /* Steal possbile out parameters to the callers context */
2491 talloc_steal(mem_ctx, state->out_mem_ctx);
2493 /* Return result */
2494 *result = state->orig.out.result;
2496 tevent_req_received(req);
2497 return NT_STATUS_OK;
2500 NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli,
2501 TALLOC_CTX *mem_ctx,
2502 const char *MachineName /* [in] [unique,charset(UTF16)] */,
2503 const char *DatabaseName /* [in] [unique,charset(UTF16)] */,
2504 uint32_t access_mask /* [in] */,
2505 struct policy_handle *handle /* [out] [ref] */,
2506 WERROR *werror)
2508 struct svcctl_OpenSCManagerW r;
2509 NTSTATUS status;
2511 /* In parameters */
2512 r.in.MachineName = MachineName;
2513 r.in.DatabaseName = DatabaseName;
2514 r.in.access_mask = access_mask;
2516 status = cli->dispatch(cli,
2517 mem_ctx,
2518 &ndr_table_svcctl,
2519 NDR_SVCCTL_OPENSCMANAGERW,
2520 &r);
2522 if (!NT_STATUS_IS_OK(status)) {
2523 return status;
2526 if (NT_STATUS_IS_ERR(status)) {
2527 return status;
2530 /* Return variables */
2531 *handle = *r.out.handle;
2533 /* Return result */
2534 if (werror) {
2535 *werror = r.out.result;
2538 return werror_to_ntstatus(r.out.result);
2541 struct rpccli_svcctl_OpenServiceW_state {
2542 struct svcctl_OpenServiceW orig;
2543 struct svcctl_OpenServiceW tmp;
2544 TALLOC_CTX *out_mem_ctx;
2545 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2548 static void rpccli_svcctl_OpenServiceW_done(struct tevent_req *subreq);
2550 struct tevent_req *rpccli_svcctl_OpenServiceW_send(TALLOC_CTX *mem_ctx,
2551 struct tevent_context *ev,
2552 struct rpc_pipe_client *cli,
2553 struct policy_handle *_scmanager_handle /* [in] [ref] */,
2554 const char *_ServiceName /* [in] [charset(UTF16)] */,
2555 uint32_t _access_mask /* [in] */,
2556 struct policy_handle *_handle /* [out] [ref] */)
2558 struct tevent_req *req;
2559 struct rpccli_svcctl_OpenServiceW_state *state;
2560 struct tevent_req *subreq;
2562 req = tevent_req_create(mem_ctx, &state,
2563 struct rpccli_svcctl_OpenServiceW_state);
2564 if (req == NULL) {
2565 return NULL;
2567 state->out_mem_ctx = NULL;
2568 state->dispatch_recv = cli->dispatch_recv;
2570 /* In parameters */
2571 state->orig.in.scmanager_handle = _scmanager_handle;
2572 state->orig.in.ServiceName = _ServiceName;
2573 state->orig.in.access_mask = _access_mask;
2575 /* Out parameters */
2576 state->orig.out.handle = _handle;
2578 /* Result */
2579 ZERO_STRUCT(state->orig.out.result);
2581 state->out_mem_ctx = talloc_named_const(state, 0,
2582 "rpccli_svcctl_OpenServiceW_out_memory");
2583 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2584 return tevent_req_post(req, ev);
2587 /* make a temporary copy, that we pass to the dispatch function */
2588 state->tmp = state->orig;
2590 subreq = cli->dispatch_send(state, ev, cli,
2591 &ndr_table_svcctl,
2592 NDR_SVCCTL_OPENSERVICEW,
2593 &state->tmp);
2594 if (tevent_req_nomem(subreq, req)) {
2595 return tevent_req_post(req, ev);
2597 tevent_req_set_callback(subreq, rpccli_svcctl_OpenServiceW_done, req);
2598 return req;
2601 static void rpccli_svcctl_OpenServiceW_done(struct tevent_req *subreq)
2603 struct tevent_req *req = tevent_req_callback_data(
2604 subreq, struct tevent_req);
2605 struct rpccli_svcctl_OpenServiceW_state *state = tevent_req_data(
2606 req, struct rpccli_svcctl_OpenServiceW_state);
2607 NTSTATUS status;
2608 TALLOC_CTX *mem_ctx;
2610 if (state->out_mem_ctx) {
2611 mem_ctx = state->out_mem_ctx;
2612 } else {
2613 mem_ctx = state;
2616 status = state->dispatch_recv(subreq, mem_ctx);
2617 TALLOC_FREE(subreq);
2618 if (!NT_STATUS_IS_OK(status)) {
2619 tevent_req_nterror(req, status);
2620 return;
2623 /* Copy out parameters */
2624 *state->orig.out.handle = *state->tmp.out.handle;
2626 /* Copy result */
2627 state->orig.out.result = state->tmp.out.result;
2629 /* Reset temporary structure */
2630 ZERO_STRUCT(state->tmp);
2632 tevent_req_done(req);
2635 NTSTATUS rpccli_svcctl_OpenServiceW_recv(struct tevent_req *req,
2636 TALLOC_CTX *mem_ctx,
2637 WERROR *result)
2639 struct rpccli_svcctl_OpenServiceW_state *state = tevent_req_data(
2640 req, struct rpccli_svcctl_OpenServiceW_state);
2641 NTSTATUS status;
2643 if (tevent_req_is_nterror(req, &status)) {
2644 tevent_req_received(req);
2645 return status;
2648 /* Steal possbile out parameters to the callers context */
2649 talloc_steal(mem_ctx, state->out_mem_ctx);
2651 /* Return result */
2652 *result = state->orig.out.result;
2654 tevent_req_received(req);
2655 return NT_STATUS_OK;
2658 NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli,
2659 TALLOC_CTX *mem_ctx,
2660 struct policy_handle *scmanager_handle /* [in] [ref] */,
2661 const char *ServiceName /* [in] [charset(UTF16)] */,
2662 uint32_t access_mask /* [in] */,
2663 struct policy_handle *handle /* [out] [ref] */,
2664 WERROR *werror)
2666 struct svcctl_OpenServiceW r;
2667 NTSTATUS status;
2669 /* In parameters */
2670 r.in.scmanager_handle = scmanager_handle;
2671 r.in.ServiceName = ServiceName;
2672 r.in.access_mask = access_mask;
2674 status = cli->dispatch(cli,
2675 mem_ctx,
2676 &ndr_table_svcctl,
2677 NDR_SVCCTL_OPENSERVICEW,
2678 &r);
2680 if (!NT_STATUS_IS_OK(status)) {
2681 return status;
2684 if (NT_STATUS_IS_ERR(status)) {
2685 return status;
2688 /* Return variables */
2689 *handle = *r.out.handle;
2691 /* Return result */
2692 if (werror) {
2693 *werror = r.out.result;
2696 return werror_to_ntstatus(r.out.result);
2699 struct rpccli_svcctl_QueryServiceConfigW_state {
2700 struct svcctl_QueryServiceConfigW orig;
2701 struct svcctl_QueryServiceConfigW tmp;
2702 TALLOC_CTX *out_mem_ctx;
2703 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2706 static void rpccli_svcctl_QueryServiceConfigW_done(struct tevent_req *subreq);
2708 struct tevent_req *rpccli_svcctl_QueryServiceConfigW_send(TALLOC_CTX *mem_ctx,
2709 struct tevent_context *ev,
2710 struct rpc_pipe_client *cli,
2711 struct policy_handle *_handle /* [in] [ref] */,
2712 struct QUERY_SERVICE_CONFIG *_query /* [out] [ref] */,
2713 uint32_t _offered /* [in] [range(0,8192)] */,
2714 uint32_t *_needed /* [out] [ref,range(0,8192)] */)
2716 struct tevent_req *req;
2717 struct rpccli_svcctl_QueryServiceConfigW_state *state;
2718 struct tevent_req *subreq;
2720 req = tevent_req_create(mem_ctx, &state,
2721 struct rpccli_svcctl_QueryServiceConfigW_state);
2722 if (req == NULL) {
2723 return NULL;
2725 state->out_mem_ctx = NULL;
2726 state->dispatch_recv = cli->dispatch_recv;
2728 /* In parameters */
2729 state->orig.in.handle = _handle;
2730 state->orig.in.offered = _offered;
2732 /* Out parameters */
2733 state->orig.out.query = _query;
2734 state->orig.out.needed = _needed;
2736 /* Result */
2737 ZERO_STRUCT(state->orig.out.result);
2739 state->out_mem_ctx = talloc_named_const(state, 0,
2740 "rpccli_svcctl_QueryServiceConfigW_out_memory");
2741 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2742 return tevent_req_post(req, ev);
2745 /* make a temporary copy, that we pass to the dispatch function */
2746 state->tmp = state->orig;
2748 subreq = cli->dispatch_send(state, ev, cli,
2749 &ndr_table_svcctl,
2750 NDR_SVCCTL_QUERYSERVICECONFIGW,
2751 &state->tmp);
2752 if (tevent_req_nomem(subreq, req)) {
2753 return tevent_req_post(req, ev);
2755 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfigW_done, req);
2756 return req;
2759 static void rpccli_svcctl_QueryServiceConfigW_done(struct tevent_req *subreq)
2761 struct tevent_req *req = tevent_req_callback_data(
2762 subreq, struct tevent_req);
2763 struct rpccli_svcctl_QueryServiceConfigW_state *state = tevent_req_data(
2764 req, struct rpccli_svcctl_QueryServiceConfigW_state);
2765 NTSTATUS status;
2766 TALLOC_CTX *mem_ctx;
2768 if (state->out_mem_ctx) {
2769 mem_ctx = state->out_mem_ctx;
2770 } else {
2771 mem_ctx = state;
2774 status = state->dispatch_recv(subreq, mem_ctx);
2775 TALLOC_FREE(subreq);
2776 if (!NT_STATUS_IS_OK(status)) {
2777 tevent_req_nterror(req, status);
2778 return;
2781 /* Copy out parameters */
2782 *state->orig.out.query = *state->tmp.out.query;
2783 *state->orig.out.needed = *state->tmp.out.needed;
2785 /* Copy result */
2786 state->orig.out.result = state->tmp.out.result;
2788 /* Reset temporary structure */
2789 ZERO_STRUCT(state->tmp);
2791 tevent_req_done(req);
2794 NTSTATUS rpccli_svcctl_QueryServiceConfigW_recv(struct tevent_req *req,
2795 TALLOC_CTX *mem_ctx,
2796 WERROR *result)
2798 struct rpccli_svcctl_QueryServiceConfigW_state *state = tevent_req_data(
2799 req, struct rpccli_svcctl_QueryServiceConfigW_state);
2800 NTSTATUS status;
2802 if (tevent_req_is_nterror(req, &status)) {
2803 tevent_req_received(req);
2804 return status;
2807 /* Steal possbile out parameters to the callers context */
2808 talloc_steal(mem_ctx, state->out_mem_ctx);
2810 /* Return result */
2811 *result = state->orig.out.result;
2813 tevent_req_received(req);
2814 return NT_STATUS_OK;
2817 NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
2818 TALLOC_CTX *mem_ctx,
2819 struct policy_handle *handle /* [in] [ref] */,
2820 struct QUERY_SERVICE_CONFIG *query /* [out] [ref] */,
2821 uint32_t offered /* [in] [range(0,8192)] */,
2822 uint32_t *needed /* [out] [ref,range(0,8192)] */,
2823 WERROR *werror)
2825 struct svcctl_QueryServiceConfigW r;
2826 NTSTATUS status;
2828 /* In parameters */
2829 r.in.handle = handle;
2830 r.in.offered = offered;
2832 status = cli->dispatch(cli,
2833 mem_ctx,
2834 &ndr_table_svcctl,
2835 NDR_SVCCTL_QUERYSERVICECONFIGW,
2836 &r);
2838 if (!NT_STATUS_IS_OK(status)) {
2839 return status;
2842 if (NT_STATUS_IS_ERR(status)) {
2843 return status;
2846 /* Return variables */
2847 *query = *r.out.query;
2848 *needed = *r.out.needed;
2850 /* Return result */
2851 if (werror) {
2852 *werror = r.out.result;
2855 return werror_to_ntstatus(r.out.result);
2858 struct rpccli_svcctl_QueryServiceLockStatusW_state {
2859 struct svcctl_QueryServiceLockStatusW orig;
2860 struct svcctl_QueryServiceLockStatusW tmp;
2861 TALLOC_CTX *out_mem_ctx;
2862 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2865 static void rpccli_svcctl_QueryServiceLockStatusW_done(struct tevent_req *subreq);
2867 struct tevent_req *rpccli_svcctl_QueryServiceLockStatusW_send(TALLOC_CTX *mem_ctx,
2868 struct tevent_context *ev,
2869 struct rpc_pipe_client *cli,
2870 struct policy_handle *_handle /* [in] [ref] */,
2871 uint32_t _offered /* [in] */,
2872 struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
2873 uint32_t *_needed /* [out] [ref] */)
2875 struct tevent_req *req;
2876 struct rpccli_svcctl_QueryServiceLockStatusW_state *state;
2877 struct tevent_req *subreq;
2879 req = tevent_req_create(mem_ctx, &state,
2880 struct rpccli_svcctl_QueryServiceLockStatusW_state);
2881 if (req == NULL) {
2882 return NULL;
2884 state->out_mem_ctx = NULL;
2885 state->dispatch_recv = cli->dispatch_recv;
2887 /* In parameters */
2888 state->orig.in.handle = _handle;
2889 state->orig.in.offered = _offered;
2891 /* Out parameters */
2892 state->orig.out.lock_status = _lock_status;
2893 state->orig.out.needed = _needed;
2895 /* Result */
2896 ZERO_STRUCT(state->orig.out.result);
2898 state->out_mem_ctx = talloc_named_const(state, 0,
2899 "rpccli_svcctl_QueryServiceLockStatusW_out_memory");
2900 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2901 return tevent_req_post(req, ev);
2904 /* make a temporary copy, that we pass to the dispatch function */
2905 state->tmp = state->orig;
2907 subreq = cli->dispatch_send(state, ev, cli,
2908 &ndr_table_svcctl,
2909 NDR_SVCCTL_QUERYSERVICELOCKSTATUSW,
2910 &state->tmp);
2911 if (tevent_req_nomem(subreq, req)) {
2912 return tevent_req_post(req, ev);
2914 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceLockStatusW_done, req);
2915 return req;
2918 static void rpccli_svcctl_QueryServiceLockStatusW_done(struct tevent_req *subreq)
2920 struct tevent_req *req = tevent_req_callback_data(
2921 subreq, struct tevent_req);
2922 struct rpccli_svcctl_QueryServiceLockStatusW_state *state = tevent_req_data(
2923 req, struct rpccli_svcctl_QueryServiceLockStatusW_state);
2924 NTSTATUS status;
2925 TALLOC_CTX *mem_ctx;
2927 if (state->out_mem_ctx) {
2928 mem_ctx = state->out_mem_ctx;
2929 } else {
2930 mem_ctx = state;
2933 status = state->dispatch_recv(subreq, mem_ctx);
2934 TALLOC_FREE(subreq);
2935 if (!NT_STATUS_IS_OK(status)) {
2936 tevent_req_nterror(req, status);
2937 return;
2940 /* Copy out parameters */
2941 *state->orig.out.lock_status = *state->tmp.out.lock_status;
2942 *state->orig.out.needed = *state->tmp.out.needed;
2944 /* Copy result */
2945 state->orig.out.result = state->tmp.out.result;
2947 /* Reset temporary structure */
2948 ZERO_STRUCT(state->tmp);
2950 tevent_req_done(req);
2953 NTSTATUS rpccli_svcctl_QueryServiceLockStatusW_recv(struct tevent_req *req,
2954 TALLOC_CTX *mem_ctx,
2955 WERROR *result)
2957 struct rpccli_svcctl_QueryServiceLockStatusW_state *state = tevent_req_data(
2958 req, struct rpccli_svcctl_QueryServiceLockStatusW_state);
2959 NTSTATUS status;
2961 if (tevent_req_is_nterror(req, &status)) {
2962 tevent_req_received(req);
2963 return status;
2966 /* Steal possbile out parameters to the callers context */
2967 talloc_steal(mem_ctx, state->out_mem_ctx);
2969 /* Return result */
2970 *result = state->orig.out.result;
2972 tevent_req_received(req);
2973 return NT_STATUS_OK;
2976 NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli,
2977 TALLOC_CTX *mem_ctx,
2978 struct policy_handle *handle /* [in] [ref] */,
2979 uint32_t offered /* [in] */,
2980 struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
2981 uint32_t *needed /* [out] [ref] */,
2982 WERROR *werror)
2984 struct svcctl_QueryServiceLockStatusW r;
2985 NTSTATUS status;
2987 /* In parameters */
2988 r.in.handle = handle;
2989 r.in.offered = offered;
2991 status = cli->dispatch(cli,
2992 mem_ctx,
2993 &ndr_table_svcctl,
2994 NDR_SVCCTL_QUERYSERVICELOCKSTATUSW,
2995 &r);
2997 if (!NT_STATUS_IS_OK(status)) {
2998 return status;
3001 if (NT_STATUS_IS_ERR(status)) {
3002 return status;
3005 /* Return variables */
3006 *lock_status = *r.out.lock_status;
3007 *needed = *r.out.needed;
3009 /* Return result */
3010 if (werror) {
3011 *werror = r.out.result;
3014 return werror_to_ntstatus(r.out.result);
3017 struct rpccli_svcctl_StartServiceW_state {
3018 struct svcctl_StartServiceW orig;
3019 struct svcctl_StartServiceW tmp;
3020 TALLOC_CTX *out_mem_ctx;
3021 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3024 static void rpccli_svcctl_StartServiceW_done(struct tevent_req *subreq);
3026 struct tevent_req *rpccli_svcctl_StartServiceW_send(TALLOC_CTX *mem_ctx,
3027 struct tevent_context *ev,
3028 struct rpc_pipe_client *cli,
3029 struct policy_handle *_handle /* [in] [ref] */,
3030 uint32_t _NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
3031 struct svcctl_ArgumentString *_Arguments /* [in] [unique,size_is(NumArgs)] */)
3033 struct tevent_req *req;
3034 struct rpccli_svcctl_StartServiceW_state *state;
3035 struct tevent_req *subreq;
3037 req = tevent_req_create(mem_ctx, &state,
3038 struct rpccli_svcctl_StartServiceW_state);
3039 if (req == NULL) {
3040 return NULL;
3042 state->out_mem_ctx = NULL;
3043 state->dispatch_recv = cli->dispatch_recv;
3045 /* In parameters */
3046 state->orig.in.handle = _handle;
3047 state->orig.in.NumArgs = _NumArgs;
3048 state->orig.in.Arguments = _Arguments;
3050 /* Out parameters */
3052 /* Result */
3053 ZERO_STRUCT(state->orig.out.result);
3055 /* make a temporary copy, that we pass to the dispatch function */
3056 state->tmp = state->orig;
3058 subreq = cli->dispatch_send(state, ev, cli,
3059 &ndr_table_svcctl,
3060 NDR_SVCCTL_STARTSERVICEW,
3061 &state->tmp);
3062 if (tevent_req_nomem(subreq, req)) {
3063 return tevent_req_post(req, ev);
3065 tevent_req_set_callback(subreq, rpccli_svcctl_StartServiceW_done, req);
3066 return req;
3069 static void rpccli_svcctl_StartServiceW_done(struct tevent_req *subreq)
3071 struct tevent_req *req = tevent_req_callback_data(
3072 subreq, struct tevent_req);
3073 struct rpccli_svcctl_StartServiceW_state *state = tevent_req_data(
3074 req, struct rpccli_svcctl_StartServiceW_state);
3075 NTSTATUS status;
3076 TALLOC_CTX *mem_ctx;
3078 if (state->out_mem_ctx) {
3079 mem_ctx = state->out_mem_ctx;
3080 } else {
3081 mem_ctx = state;
3084 status = state->dispatch_recv(subreq, mem_ctx);
3085 TALLOC_FREE(subreq);
3086 if (!NT_STATUS_IS_OK(status)) {
3087 tevent_req_nterror(req, status);
3088 return;
3091 /* Copy out parameters */
3093 /* Copy result */
3094 state->orig.out.result = state->tmp.out.result;
3096 /* Reset temporary structure */
3097 ZERO_STRUCT(state->tmp);
3099 tevent_req_done(req);
3102 NTSTATUS rpccli_svcctl_StartServiceW_recv(struct tevent_req *req,
3103 TALLOC_CTX *mem_ctx,
3104 WERROR *result)
3106 struct rpccli_svcctl_StartServiceW_state *state = tevent_req_data(
3107 req, struct rpccli_svcctl_StartServiceW_state);
3108 NTSTATUS status;
3110 if (tevent_req_is_nterror(req, &status)) {
3111 tevent_req_received(req);
3112 return status;
3115 /* Steal possbile out parameters to the callers context */
3116 talloc_steal(mem_ctx, state->out_mem_ctx);
3118 /* Return result */
3119 *result = state->orig.out.result;
3121 tevent_req_received(req);
3122 return NT_STATUS_OK;
3125 NTSTATUS rpccli_svcctl_StartServiceW(struct rpc_pipe_client *cli,
3126 TALLOC_CTX *mem_ctx,
3127 struct policy_handle *handle /* [in] [ref] */,
3128 uint32_t NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
3129 struct svcctl_ArgumentString *Arguments /* [in] [unique,size_is(NumArgs)] */,
3130 WERROR *werror)
3132 struct svcctl_StartServiceW r;
3133 NTSTATUS status;
3135 /* In parameters */
3136 r.in.handle = handle;
3137 r.in.NumArgs = NumArgs;
3138 r.in.Arguments = Arguments;
3140 status = cli->dispatch(cli,
3141 mem_ctx,
3142 &ndr_table_svcctl,
3143 NDR_SVCCTL_STARTSERVICEW,
3144 &r);
3146 if (!NT_STATUS_IS_OK(status)) {
3147 return status;
3150 if (NT_STATUS_IS_ERR(status)) {
3151 return status;
3154 /* Return variables */
3156 /* Return result */
3157 if (werror) {
3158 *werror = r.out.result;
3161 return werror_to_ntstatus(r.out.result);
3164 struct rpccli_svcctl_GetServiceDisplayNameW_state {
3165 struct svcctl_GetServiceDisplayNameW orig;
3166 struct svcctl_GetServiceDisplayNameW tmp;
3167 TALLOC_CTX *out_mem_ctx;
3168 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3171 static void rpccli_svcctl_GetServiceDisplayNameW_done(struct tevent_req *subreq);
3173 struct tevent_req *rpccli_svcctl_GetServiceDisplayNameW_send(TALLOC_CTX *mem_ctx,
3174 struct tevent_context *ev,
3175 struct rpc_pipe_client *cli,
3176 struct policy_handle *_handle /* [in] [ref] */,
3177 const char *_service_name /* [in] [unique,charset(UTF16)] */,
3178 const char **_display_name /* [out] [ref,charset(UTF16)] */,
3179 uint32_t *_display_name_length /* [in,out] [unique] */)
3181 struct tevent_req *req;
3182 struct rpccli_svcctl_GetServiceDisplayNameW_state *state;
3183 struct tevent_req *subreq;
3185 req = tevent_req_create(mem_ctx, &state,
3186 struct rpccli_svcctl_GetServiceDisplayNameW_state);
3187 if (req == NULL) {
3188 return NULL;
3190 state->out_mem_ctx = NULL;
3191 state->dispatch_recv = cli->dispatch_recv;
3193 /* In parameters */
3194 state->orig.in.handle = _handle;
3195 state->orig.in.service_name = _service_name;
3196 state->orig.in.display_name_length = _display_name_length;
3198 /* Out parameters */
3199 state->orig.out.display_name = _display_name;
3200 state->orig.out.display_name_length = _display_name_length;
3202 /* Result */
3203 ZERO_STRUCT(state->orig.out.result);
3205 state->out_mem_ctx = talloc_named_const(state, 0,
3206 "rpccli_svcctl_GetServiceDisplayNameW_out_memory");
3207 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3208 return tevent_req_post(req, ev);
3211 /* make a temporary copy, that we pass to the dispatch function */
3212 state->tmp = state->orig;
3214 subreq = cli->dispatch_send(state, ev, cli,
3215 &ndr_table_svcctl,
3216 NDR_SVCCTL_GETSERVICEDISPLAYNAMEW,
3217 &state->tmp);
3218 if (tevent_req_nomem(subreq, req)) {
3219 return tevent_req_post(req, ev);
3221 tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceDisplayNameW_done, req);
3222 return req;
3225 static void rpccli_svcctl_GetServiceDisplayNameW_done(struct tevent_req *subreq)
3227 struct tevent_req *req = tevent_req_callback_data(
3228 subreq, struct tevent_req);
3229 struct rpccli_svcctl_GetServiceDisplayNameW_state *state = tevent_req_data(
3230 req, struct rpccli_svcctl_GetServiceDisplayNameW_state);
3231 NTSTATUS status;
3232 TALLOC_CTX *mem_ctx;
3234 if (state->out_mem_ctx) {
3235 mem_ctx = state->out_mem_ctx;
3236 } else {
3237 mem_ctx = state;
3240 status = state->dispatch_recv(subreq, mem_ctx);
3241 TALLOC_FREE(subreq);
3242 if (!NT_STATUS_IS_OK(status)) {
3243 tevent_req_nterror(req, status);
3244 return;
3247 /* Copy out parameters */
3248 *state->orig.out.display_name = *state->tmp.out.display_name;
3249 if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
3250 *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
3253 /* Copy result */
3254 state->orig.out.result = state->tmp.out.result;
3256 /* Reset temporary structure */
3257 ZERO_STRUCT(state->tmp);
3259 tevent_req_done(req);
3262 NTSTATUS rpccli_svcctl_GetServiceDisplayNameW_recv(struct tevent_req *req,
3263 TALLOC_CTX *mem_ctx,
3264 WERROR *result)
3266 struct rpccli_svcctl_GetServiceDisplayNameW_state *state = tevent_req_data(
3267 req, struct rpccli_svcctl_GetServiceDisplayNameW_state);
3268 NTSTATUS status;
3270 if (tevent_req_is_nterror(req, &status)) {
3271 tevent_req_received(req);
3272 return status;
3275 /* Steal possbile out parameters to the callers context */
3276 talloc_steal(mem_ctx, state->out_mem_ctx);
3278 /* Return result */
3279 *result = state->orig.out.result;
3281 tevent_req_received(req);
3282 return NT_STATUS_OK;
3285 NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli,
3286 TALLOC_CTX *mem_ctx,
3287 struct policy_handle *handle /* [in] [ref] */,
3288 const char *service_name /* [in] [unique,charset(UTF16)] */,
3289 const char **display_name /* [out] [ref,charset(UTF16)] */,
3290 uint32_t *display_name_length /* [in,out] [unique] */,
3291 WERROR *werror)
3293 struct svcctl_GetServiceDisplayNameW r;
3294 NTSTATUS status;
3296 /* In parameters */
3297 r.in.handle = handle;
3298 r.in.service_name = service_name;
3299 r.in.display_name_length = display_name_length;
3301 status = cli->dispatch(cli,
3302 mem_ctx,
3303 &ndr_table_svcctl,
3304 NDR_SVCCTL_GETSERVICEDISPLAYNAMEW,
3305 &r);
3307 if (!NT_STATUS_IS_OK(status)) {
3308 return status;
3311 if (NT_STATUS_IS_ERR(status)) {
3312 return status;
3315 /* Return variables */
3316 *display_name = *r.out.display_name;
3317 if (display_name_length && r.out.display_name_length) {
3318 *display_name_length = *r.out.display_name_length;
3321 /* Return result */
3322 if (werror) {
3323 *werror = r.out.result;
3326 return werror_to_ntstatus(r.out.result);
3329 struct rpccli_svcctl_GetServiceKeyNameW_state {
3330 struct svcctl_GetServiceKeyNameW orig;
3331 struct svcctl_GetServiceKeyNameW tmp;
3332 TALLOC_CTX *out_mem_ctx;
3333 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3336 static void rpccli_svcctl_GetServiceKeyNameW_done(struct tevent_req *subreq);
3338 struct tevent_req *rpccli_svcctl_GetServiceKeyNameW_send(TALLOC_CTX *mem_ctx,
3339 struct tevent_context *ev,
3340 struct rpc_pipe_client *cli,
3341 struct policy_handle *_handle /* [in] [ref] */,
3342 const char *_service_name /* [in] [unique,charset(UTF16)] */,
3343 const char **_key_name /* [out] [ref,charset(UTF16)] */,
3344 uint32_t *_display_name_length /* [in,out] [unique] */)
3346 struct tevent_req *req;
3347 struct rpccli_svcctl_GetServiceKeyNameW_state *state;
3348 struct tevent_req *subreq;
3350 req = tevent_req_create(mem_ctx, &state,
3351 struct rpccli_svcctl_GetServiceKeyNameW_state);
3352 if (req == NULL) {
3353 return NULL;
3355 state->out_mem_ctx = NULL;
3356 state->dispatch_recv = cli->dispatch_recv;
3358 /* In parameters */
3359 state->orig.in.handle = _handle;
3360 state->orig.in.service_name = _service_name;
3361 state->orig.in.display_name_length = _display_name_length;
3363 /* Out parameters */
3364 state->orig.out.key_name = _key_name;
3365 state->orig.out.display_name_length = _display_name_length;
3367 /* Result */
3368 ZERO_STRUCT(state->orig.out.result);
3370 state->out_mem_ctx = talloc_named_const(state, 0,
3371 "rpccli_svcctl_GetServiceKeyNameW_out_memory");
3372 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3373 return tevent_req_post(req, ev);
3376 /* make a temporary copy, that we pass to the dispatch function */
3377 state->tmp = state->orig;
3379 subreq = cli->dispatch_send(state, ev, cli,
3380 &ndr_table_svcctl,
3381 NDR_SVCCTL_GETSERVICEKEYNAMEW,
3382 &state->tmp);
3383 if (tevent_req_nomem(subreq, req)) {
3384 return tevent_req_post(req, ev);
3386 tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceKeyNameW_done, req);
3387 return req;
3390 static void rpccli_svcctl_GetServiceKeyNameW_done(struct tevent_req *subreq)
3392 struct tevent_req *req = tevent_req_callback_data(
3393 subreq, struct tevent_req);
3394 struct rpccli_svcctl_GetServiceKeyNameW_state *state = tevent_req_data(
3395 req, struct rpccli_svcctl_GetServiceKeyNameW_state);
3396 NTSTATUS status;
3397 TALLOC_CTX *mem_ctx;
3399 if (state->out_mem_ctx) {
3400 mem_ctx = state->out_mem_ctx;
3401 } else {
3402 mem_ctx = state;
3405 status = state->dispatch_recv(subreq, mem_ctx);
3406 TALLOC_FREE(subreq);
3407 if (!NT_STATUS_IS_OK(status)) {
3408 tevent_req_nterror(req, status);
3409 return;
3412 /* Copy out parameters */
3413 *state->orig.out.key_name = *state->tmp.out.key_name;
3414 if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
3415 *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
3418 /* Copy result */
3419 state->orig.out.result = state->tmp.out.result;
3421 /* Reset temporary structure */
3422 ZERO_STRUCT(state->tmp);
3424 tevent_req_done(req);
3427 NTSTATUS rpccli_svcctl_GetServiceKeyNameW_recv(struct tevent_req *req,
3428 TALLOC_CTX *mem_ctx,
3429 WERROR *result)
3431 struct rpccli_svcctl_GetServiceKeyNameW_state *state = tevent_req_data(
3432 req, struct rpccli_svcctl_GetServiceKeyNameW_state);
3433 NTSTATUS status;
3435 if (tevent_req_is_nterror(req, &status)) {
3436 tevent_req_received(req);
3437 return status;
3440 /* Steal possbile out parameters to the callers context */
3441 talloc_steal(mem_ctx, state->out_mem_ctx);
3443 /* Return result */
3444 *result = state->orig.out.result;
3446 tevent_req_received(req);
3447 return NT_STATUS_OK;
3450 NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli,
3451 TALLOC_CTX *mem_ctx,
3452 struct policy_handle *handle /* [in] [ref] */,
3453 const char *service_name /* [in] [unique,charset(UTF16)] */,
3454 const char **key_name /* [out] [ref,charset(UTF16)] */,
3455 uint32_t *display_name_length /* [in,out] [unique] */,
3456 WERROR *werror)
3458 struct svcctl_GetServiceKeyNameW r;
3459 NTSTATUS status;
3461 /* In parameters */
3462 r.in.handle = handle;
3463 r.in.service_name = service_name;
3464 r.in.display_name_length = display_name_length;
3466 status = cli->dispatch(cli,
3467 mem_ctx,
3468 &ndr_table_svcctl,
3469 NDR_SVCCTL_GETSERVICEKEYNAMEW,
3470 &r);
3472 if (!NT_STATUS_IS_OK(status)) {
3473 return status;
3476 if (NT_STATUS_IS_ERR(status)) {
3477 return status;
3480 /* Return variables */
3481 *key_name = *r.out.key_name;
3482 if (display_name_length && r.out.display_name_length) {
3483 *display_name_length = *r.out.display_name_length;
3486 /* Return result */
3487 if (werror) {
3488 *werror = r.out.result;
3491 return werror_to_ntstatus(r.out.result);
3494 struct rpccli_svcctl_SCSetServiceBitsA_state {
3495 struct svcctl_SCSetServiceBitsA orig;
3496 struct svcctl_SCSetServiceBitsA tmp;
3497 TALLOC_CTX *out_mem_ctx;
3498 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3501 static void rpccli_svcctl_SCSetServiceBitsA_done(struct tevent_req *subreq);
3503 struct tevent_req *rpccli_svcctl_SCSetServiceBitsA_send(TALLOC_CTX *mem_ctx,
3504 struct tevent_context *ev,
3505 struct rpc_pipe_client *cli,
3506 struct policy_handle *_handle /* [in] [ref] */,
3507 uint32_t _bits /* [in] */,
3508 uint32_t _bitson /* [in] */,
3509 uint32_t _immediate /* [in] */)
3511 struct tevent_req *req;
3512 struct rpccli_svcctl_SCSetServiceBitsA_state *state;
3513 struct tevent_req *subreq;
3515 req = tevent_req_create(mem_ctx, &state,
3516 struct rpccli_svcctl_SCSetServiceBitsA_state);
3517 if (req == NULL) {
3518 return NULL;
3520 state->out_mem_ctx = NULL;
3521 state->dispatch_recv = cli->dispatch_recv;
3523 /* In parameters */
3524 state->orig.in.handle = _handle;
3525 state->orig.in.bits = _bits;
3526 state->orig.in.bitson = _bitson;
3527 state->orig.in.immediate = _immediate;
3529 /* Out parameters */
3531 /* Result */
3532 ZERO_STRUCT(state->orig.out.result);
3534 /* make a temporary copy, that we pass to the dispatch function */
3535 state->tmp = state->orig;
3537 subreq = cli->dispatch_send(state, ev, cli,
3538 &ndr_table_svcctl,
3539 NDR_SVCCTL_SCSETSERVICEBITSA,
3540 &state->tmp);
3541 if (tevent_req_nomem(subreq, req)) {
3542 return tevent_req_post(req, ev);
3544 tevent_req_set_callback(subreq, rpccli_svcctl_SCSetServiceBitsA_done, req);
3545 return req;
3548 static void rpccli_svcctl_SCSetServiceBitsA_done(struct tevent_req *subreq)
3550 struct tevent_req *req = tevent_req_callback_data(
3551 subreq, struct tevent_req);
3552 struct rpccli_svcctl_SCSetServiceBitsA_state *state = tevent_req_data(
3553 req, struct rpccli_svcctl_SCSetServiceBitsA_state);
3554 NTSTATUS status;
3555 TALLOC_CTX *mem_ctx;
3557 if (state->out_mem_ctx) {
3558 mem_ctx = state->out_mem_ctx;
3559 } else {
3560 mem_ctx = state;
3563 status = state->dispatch_recv(subreq, mem_ctx);
3564 TALLOC_FREE(subreq);
3565 if (!NT_STATUS_IS_OK(status)) {
3566 tevent_req_nterror(req, status);
3567 return;
3570 /* Copy out parameters */
3572 /* Copy result */
3573 state->orig.out.result = state->tmp.out.result;
3575 /* Reset temporary structure */
3576 ZERO_STRUCT(state->tmp);
3578 tevent_req_done(req);
3581 NTSTATUS rpccli_svcctl_SCSetServiceBitsA_recv(struct tevent_req *req,
3582 TALLOC_CTX *mem_ctx,
3583 WERROR *result)
3585 struct rpccli_svcctl_SCSetServiceBitsA_state *state = tevent_req_data(
3586 req, struct rpccli_svcctl_SCSetServiceBitsA_state);
3587 NTSTATUS status;
3589 if (tevent_req_is_nterror(req, &status)) {
3590 tevent_req_received(req);
3591 return status;
3594 /* Steal possbile out parameters to the callers context */
3595 talloc_steal(mem_ctx, state->out_mem_ctx);
3597 /* Return result */
3598 *result = state->orig.out.result;
3600 tevent_req_received(req);
3601 return NT_STATUS_OK;
3604 NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli,
3605 TALLOC_CTX *mem_ctx,
3606 struct policy_handle *handle /* [in] [ref] */,
3607 uint32_t bits /* [in] */,
3608 uint32_t bitson /* [in] */,
3609 uint32_t immediate /* [in] */,
3610 WERROR *werror)
3612 struct svcctl_SCSetServiceBitsA r;
3613 NTSTATUS status;
3615 /* In parameters */
3616 r.in.handle = handle;
3617 r.in.bits = bits;
3618 r.in.bitson = bitson;
3619 r.in.immediate = immediate;
3621 status = cli->dispatch(cli,
3622 mem_ctx,
3623 &ndr_table_svcctl,
3624 NDR_SVCCTL_SCSETSERVICEBITSA,
3625 &r);
3627 if (!NT_STATUS_IS_OK(status)) {
3628 return status;
3631 if (NT_STATUS_IS_ERR(status)) {
3632 return status;
3635 /* Return variables */
3637 /* Return result */
3638 if (werror) {
3639 *werror = r.out.result;
3642 return werror_to_ntstatus(r.out.result);
3645 struct rpccli_svcctl_ChangeServiceConfigA_state {
3646 struct svcctl_ChangeServiceConfigA orig;
3647 struct svcctl_ChangeServiceConfigA tmp;
3648 TALLOC_CTX *out_mem_ctx;
3649 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3652 static void rpccli_svcctl_ChangeServiceConfigA_done(struct tevent_req *subreq);
3654 struct tevent_req *rpccli_svcctl_ChangeServiceConfigA_send(TALLOC_CTX *mem_ctx,
3655 struct tevent_context *ev,
3656 struct rpc_pipe_client *cli,
3657 struct policy_handle *_handle /* [in] [ref] */,
3658 uint32_t _type /* [in] */,
3659 enum svcctl_StartType _start_type /* [in] */,
3660 enum svcctl_ErrorControl _error_control /* [in] */,
3661 const char *_binary_path /* [in] [unique,charset(UTF16)] */,
3662 const char *_load_order_group /* [in] [unique,charset(UTF16)] */,
3663 uint32_t *_tag_id /* [out] [ref] */,
3664 const char *_dependencies /* [in] [unique,charset(UTF16)] */,
3665 const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
3666 const char *_password /* [in] [unique,charset(UTF16)] */,
3667 const char *_display_name /* [in] [unique,charset(UTF16)] */)
3669 struct tevent_req *req;
3670 struct rpccli_svcctl_ChangeServiceConfigA_state *state;
3671 struct tevent_req *subreq;
3673 req = tevent_req_create(mem_ctx, &state,
3674 struct rpccli_svcctl_ChangeServiceConfigA_state);
3675 if (req == NULL) {
3676 return NULL;
3678 state->out_mem_ctx = NULL;
3679 state->dispatch_recv = cli->dispatch_recv;
3681 /* In parameters */
3682 state->orig.in.handle = _handle;
3683 state->orig.in.type = _type;
3684 state->orig.in.start_type = _start_type;
3685 state->orig.in.error_control = _error_control;
3686 state->orig.in.binary_path = _binary_path;
3687 state->orig.in.load_order_group = _load_order_group;
3688 state->orig.in.dependencies = _dependencies;
3689 state->orig.in.service_start_name = _service_start_name;
3690 state->orig.in.password = _password;
3691 state->orig.in.display_name = _display_name;
3693 /* Out parameters */
3694 state->orig.out.tag_id = _tag_id;
3696 /* Result */
3697 ZERO_STRUCT(state->orig.out.result);
3699 state->out_mem_ctx = talloc_named_const(state, 0,
3700 "rpccli_svcctl_ChangeServiceConfigA_out_memory");
3701 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3702 return tevent_req_post(req, ev);
3705 /* make a temporary copy, that we pass to the dispatch function */
3706 state->tmp = state->orig;
3708 subreq = cli->dispatch_send(state, ev, cli,
3709 &ndr_table_svcctl,
3710 NDR_SVCCTL_CHANGESERVICECONFIGA,
3711 &state->tmp);
3712 if (tevent_req_nomem(subreq, req)) {
3713 return tevent_req_post(req, ev);
3715 tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfigA_done, req);
3716 return req;
3719 static void rpccli_svcctl_ChangeServiceConfigA_done(struct tevent_req *subreq)
3721 struct tevent_req *req = tevent_req_callback_data(
3722 subreq, struct tevent_req);
3723 struct rpccli_svcctl_ChangeServiceConfigA_state *state = tevent_req_data(
3724 req, struct rpccli_svcctl_ChangeServiceConfigA_state);
3725 NTSTATUS status;
3726 TALLOC_CTX *mem_ctx;
3728 if (state->out_mem_ctx) {
3729 mem_ctx = state->out_mem_ctx;
3730 } else {
3731 mem_ctx = state;
3734 status = state->dispatch_recv(subreq, mem_ctx);
3735 TALLOC_FREE(subreq);
3736 if (!NT_STATUS_IS_OK(status)) {
3737 tevent_req_nterror(req, status);
3738 return;
3741 /* Copy out parameters */
3742 *state->orig.out.tag_id = *state->tmp.out.tag_id;
3744 /* Copy result */
3745 state->orig.out.result = state->tmp.out.result;
3747 /* Reset temporary structure */
3748 ZERO_STRUCT(state->tmp);
3750 tevent_req_done(req);
3753 NTSTATUS rpccli_svcctl_ChangeServiceConfigA_recv(struct tevent_req *req,
3754 TALLOC_CTX *mem_ctx,
3755 WERROR *result)
3757 struct rpccli_svcctl_ChangeServiceConfigA_state *state = tevent_req_data(
3758 req, struct rpccli_svcctl_ChangeServiceConfigA_state);
3759 NTSTATUS status;
3761 if (tevent_req_is_nterror(req, &status)) {
3762 tevent_req_received(req);
3763 return status;
3766 /* Steal possbile out parameters to the callers context */
3767 talloc_steal(mem_ctx, state->out_mem_ctx);
3769 /* Return result */
3770 *result = state->orig.out.result;
3772 tevent_req_received(req);
3773 return NT_STATUS_OK;
3776 NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli,
3777 TALLOC_CTX *mem_ctx,
3778 struct policy_handle *handle /* [in] [ref] */,
3779 uint32_t type /* [in] */,
3780 enum svcctl_StartType start_type /* [in] */,
3781 enum svcctl_ErrorControl error_control /* [in] */,
3782 const char *binary_path /* [in] [unique,charset(UTF16)] */,
3783 const char *load_order_group /* [in] [unique,charset(UTF16)] */,
3784 uint32_t *tag_id /* [out] [ref] */,
3785 const char *dependencies /* [in] [unique,charset(UTF16)] */,
3786 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
3787 const char *password /* [in] [unique,charset(UTF16)] */,
3788 const char *display_name /* [in] [unique,charset(UTF16)] */,
3789 WERROR *werror)
3791 struct svcctl_ChangeServiceConfigA r;
3792 NTSTATUS status;
3794 /* In parameters */
3795 r.in.handle = handle;
3796 r.in.type = type;
3797 r.in.start_type = start_type;
3798 r.in.error_control = error_control;
3799 r.in.binary_path = binary_path;
3800 r.in.load_order_group = load_order_group;
3801 r.in.dependencies = dependencies;
3802 r.in.service_start_name = service_start_name;
3803 r.in.password = password;
3804 r.in.display_name = display_name;
3806 status = cli->dispatch(cli,
3807 mem_ctx,
3808 &ndr_table_svcctl,
3809 NDR_SVCCTL_CHANGESERVICECONFIGA,
3810 &r);
3812 if (!NT_STATUS_IS_OK(status)) {
3813 return status;
3816 if (NT_STATUS_IS_ERR(status)) {
3817 return status;
3820 /* Return variables */
3821 *tag_id = *r.out.tag_id;
3823 /* Return result */
3824 if (werror) {
3825 *werror = r.out.result;
3828 return werror_to_ntstatus(r.out.result);
3831 struct rpccli_svcctl_CreateServiceA_state {
3832 struct svcctl_CreateServiceA orig;
3833 struct svcctl_CreateServiceA tmp;
3834 TALLOC_CTX *out_mem_ctx;
3835 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3838 static void rpccli_svcctl_CreateServiceA_done(struct tevent_req *subreq);
3840 struct tevent_req *rpccli_svcctl_CreateServiceA_send(TALLOC_CTX *mem_ctx,
3841 struct tevent_context *ev,
3842 struct rpc_pipe_client *cli,
3843 struct policy_handle *_handle /* [in] [ref] */,
3844 const char *_ServiceName /* [in] [unique,charset(UTF16)] */,
3845 const char *_DisplayName /* [in] [unique,charset(UTF16)] */,
3846 uint32_t _desired_access /* [in] */,
3847 uint32_t _type /* [in] */,
3848 enum svcctl_StartType _start_type /* [in] */,
3849 enum svcctl_ErrorControl _error_control /* [in] */,
3850 const char *_binary_path /* [in] [unique,charset(UTF16)] */,
3851 const char *_LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
3852 uint32_t *_TagId /* [out] [unique] */,
3853 const char *_dependencies /* [in] [unique,charset(UTF16)] */,
3854 const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
3855 const char *_password /* [in] [unique,charset(UTF16)] */)
3857 struct tevent_req *req;
3858 struct rpccli_svcctl_CreateServiceA_state *state;
3859 struct tevent_req *subreq;
3861 req = tevent_req_create(mem_ctx, &state,
3862 struct rpccli_svcctl_CreateServiceA_state);
3863 if (req == NULL) {
3864 return NULL;
3866 state->out_mem_ctx = NULL;
3867 state->dispatch_recv = cli->dispatch_recv;
3869 /* In parameters */
3870 state->orig.in.handle = _handle;
3871 state->orig.in.ServiceName = _ServiceName;
3872 state->orig.in.DisplayName = _DisplayName;
3873 state->orig.in.desired_access = _desired_access;
3874 state->orig.in.type = _type;
3875 state->orig.in.start_type = _start_type;
3876 state->orig.in.error_control = _error_control;
3877 state->orig.in.binary_path = _binary_path;
3878 state->orig.in.LoadOrderGroupKey = _LoadOrderGroupKey;
3879 state->orig.in.dependencies = _dependencies;
3880 state->orig.in.service_start_name = _service_start_name;
3881 state->orig.in.password = _password;
3883 /* Out parameters */
3884 state->orig.out.TagId = _TagId;
3886 /* Result */
3887 ZERO_STRUCT(state->orig.out.result);
3889 state->out_mem_ctx = talloc_named_const(state, 0,
3890 "rpccli_svcctl_CreateServiceA_out_memory");
3891 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3892 return tevent_req_post(req, ev);
3895 /* make a temporary copy, that we pass to the dispatch function */
3896 state->tmp = state->orig;
3898 subreq = cli->dispatch_send(state, ev, cli,
3899 &ndr_table_svcctl,
3900 NDR_SVCCTL_CREATESERVICEA,
3901 &state->tmp);
3902 if (tevent_req_nomem(subreq, req)) {
3903 return tevent_req_post(req, ev);
3905 tevent_req_set_callback(subreq, rpccli_svcctl_CreateServiceA_done, req);
3906 return req;
3909 static void rpccli_svcctl_CreateServiceA_done(struct tevent_req *subreq)
3911 struct tevent_req *req = tevent_req_callback_data(
3912 subreq, struct tevent_req);
3913 struct rpccli_svcctl_CreateServiceA_state *state = tevent_req_data(
3914 req, struct rpccli_svcctl_CreateServiceA_state);
3915 NTSTATUS status;
3916 TALLOC_CTX *mem_ctx;
3918 if (state->out_mem_ctx) {
3919 mem_ctx = state->out_mem_ctx;
3920 } else {
3921 mem_ctx = state;
3924 status = state->dispatch_recv(subreq, mem_ctx);
3925 TALLOC_FREE(subreq);
3926 if (!NT_STATUS_IS_OK(status)) {
3927 tevent_req_nterror(req, status);
3928 return;
3931 /* Copy out parameters */
3932 if (state->orig.out.TagId && state->tmp.out.TagId) {
3933 *state->orig.out.TagId = *state->tmp.out.TagId;
3936 /* Copy result */
3937 state->orig.out.result = state->tmp.out.result;
3939 /* Reset temporary structure */
3940 ZERO_STRUCT(state->tmp);
3942 tevent_req_done(req);
3945 NTSTATUS rpccli_svcctl_CreateServiceA_recv(struct tevent_req *req,
3946 TALLOC_CTX *mem_ctx,
3947 WERROR *result)
3949 struct rpccli_svcctl_CreateServiceA_state *state = tevent_req_data(
3950 req, struct rpccli_svcctl_CreateServiceA_state);
3951 NTSTATUS status;
3953 if (tevent_req_is_nterror(req, &status)) {
3954 tevent_req_received(req);
3955 return status;
3958 /* Steal possbile out parameters to the callers context */
3959 talloc_steal(mem_ctx, state->out_mem_ctx);
3961 /* Return result */
3962 *result = state->orig.out.result;
3964 tevent_req_received(req);
3965 return NT_STATUS_OK;
3968 NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli,
3969 TALLOC_CTX *mem_ctx,
3970 struct policy_handle *handle /* [in] [ref] */,
3971 const char *ServiceName /* [in] [unique,charset(UTF16)] */,
3972 const char *DisplayName /* [in] [unique,charset(UTF16)] */,
3973 uint32_t desired_access /* [in] */,
3974 uint32_t type /* [in] */,
3975 enum svcctl_StartType start_type /* [in] */,
3976 enum svcctl_ErrorControl error_control /* [in] */,
3977 const char *binary_path /* [in] [unique,charset(UTF16)] */,
3978 const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
3979 uint32_t *TagId /* [out] [unique] */,
3980 const char *dependencies /* [in] [unique,charset(UTF16)] */,
3981 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
3982 const char *password /* [in] [unique,charset(UTF16)] */,
3983 WERROR *werror)
3985 struct svcctl_CreateServiceA r;
3986 NTSTATUS status;
3988 /* In parameters */
3989 r.in.handle = handle;
3990 r.in.ServiceName = ServiceName;
3991 r.in.DisplayName = DisplayName;
3992 r.in.desired_access = desired_access;
3993 r.in.type = type;
3994 r.in.start_type = start_type;
3995 r.in.error_control = error_control;
3996 r.in.binary_path = binary_path;
3997 r.in.LoadOrderGroupKey = LoadOrderGroupKey;
3998 r.in.dependencies = dependencies;
3999 r.in.service_start_name = service_start_name;
4000 r.in.password = password;
4002 status = cli->dispatch(cli,
4003 mem_ctx,
4004 &ndr_table_svcctl,
4005 NDR_SVCCTL_CREATESERVICEA,
4006 &r);
4008 if (!NT_STATUS_IS_OK(status)) {
4009 return status;
4012 if (NT_STATUS_IS_ERR(status)) {
4013 return status;
4016 /* Return variables */
4017 if (TagId && r.out.TagId) {
4018 *TagId = *r.out.TagId;
4021 /* Return result */
4022 if (werror) {
4023 *werror = r.out.result;
4026 return werror_to_ntstatus(r.out.result);
4029 struct rpccli_svcctl_EnumDependentServicesA_state {
4030 struct svcctl_EnumDependentServicesA orig;
4031 struct svcctl_EnumDependentServicesA tmp;
4032 TALLOC_CTX *out_mem_ctx;
4033 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4036 static void rpccli_svcctl_EnumDependentServicesA_done(struct tevent_req *subreq);
4038 struct tevent_req *rpccli_svcctl_EnumDependentServicesA_send(TALLOC_CTX *mem_ctx,
4039 struct tevent_context *ev,
4040 struct rpc_pipe_client *cli,
4041 struct policy_handle *_service /* [in] [ref] */,
4042 enum svcctl_ServiceState _state /* [in] */,
4043 struct ENUM_SERVICE_STATUSA *_service_status /* [out] [unique] */,
4044 uint32_t _offered /* [in] */,
4045 uint32_t *_needed /* [out] [ref] */,
4046 uint32_t *_services_returned /* [out] [ref] */)
4048 struct tevent_req *req;
4049 struct rpccli_svcctl_EnumDependentServicesA_state *state;
4050 struct tevent_req *subreq;
4052 req = tevent_req_create(mem_ctx, &state,
4053 struct rpccli_svcctl_EnumDependentServicesA_state);
4054 if (req == NULL) {
4055 return NULL;
4057 state->out_mem_ctx = NULL;
4058 state->dispatch_recv = cli->dispatch_recv;
4060 /* In parameters */
4061 state->orig.in.service = _service;
4062 state->orig.in.state = _state;
4063 state->orig.in.offered = _offered;
4065 /* Out parameters */
4066 state->orig.out.service_status = _service_status;
4067 state->orig.out.needed = _needed;
4068 state->orig.out.services_returned = _services_returned;
4070 /* Result */
4071 ZERO_STRUCT(state->orig.out.result);
4073 state->out_mem_ctx = talloc_named_const(state, 0,
4074 "rpccli_svcctl_EnumDependentServicesA_out_memory");
4075 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4076 return tevent_req_post(req, ev);
4079 /* make a temporary copy, that we pass to the dispatch function */
4080 state->tmp = state->orig;
4082 subreq = cli->dispatch_send(state, ev, cli,
4083 &ndr_table_svcctl,
4084 NDR_SVCCTL_ENUMDEPENDENTSERVICESA,
4085 &state->tmp);
4086 if (tevent_req_nomem(subreq, req)) {
4087 return tevent_req_post(req, ev);
4089 tevent_req_set_callback(subreq, rpccli_svcctl_EnumDependentServicesA_done, req);
4090 return req;
4093 static void rpccli_svcctl_EnumDependentServicesA_done(struct tevent_req *subreq)
4095 struct tevent_req *req = tevent_req_callback_data(
4096 subreq, struct tevent_req);
4097 struct rpccli_svcctl_EnumDependentServicesA_state *state = tevent_req_data(
4098 req, struct rpccli_svcctl_EnumDependentServicesA_state);
4099 NTSTATUS status;
4100 TALLOC_CTX *mem_ctx;
4102 if (state->out_mem_ctx) {
4103 mem_ctx = state->out_mem_ctx;
4104 } else {
4105 mem_ctx = state;
4108 status = state->dispatch_recv(subreq, mem_ctx);
4109 TALLOC_FREE(subreq);
4110 if (!NT_STATUS_IS_OK(status)) {
4111 tevent_req_nterror(req, status);
4112 return;
4115 /* Copy out parameters */
4116 if (state->orig.out.service_status && state->tmp.out.service_status) {
4117 *state->orig.out.service_status = *state->tmp.out.service_status;
4119 *state->orig.out.needed = *state->tmp.out.needed;
4120 *state->orig.out.services_returned = *state->tmp.out.services_returned;
4122 /* Copy result */
4123 state->orig.out.result = state->tmp.out.result;
4125 /* Reset temporary structure */
4126 ZERO_STRUCT(state->tmp);
4128 tevent_req_done(req);
4131 NTSTATUS rpccli_svcctl_EnumDependentServicesA_recv(struct tevent_req *req,
4132 TALLOC_CTX *mem_ctx,
4133 WERROR *result)
4135 struct rpccli_svcctl_EnumDependentServicesA_state *state = tevent_req_data(
4136 req, struct rpccli_svcctl_EnumDependentServicesA_state);
4137 NTSTATUS status;
4139 if (tevent_req_is_nterror(req, &status)) {
4140 tevent_req_received(req);
4141 return status;
4144 /* Steal possbile out parameters to the callers context */
4145 talloc_steal(mem_ctx, state->out_mem_ctx);
4147 /* Return result */
4148 *result = state->orig.out.result;
4150 tevent_req_received(req);
4151 return NT_STATUS_OK;
4154 NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli,
4155 TALLOC_CTX *mem_ctx,
4156 struct policy_handle *service /* [in] [ref] */,
4157 enum svcctl_ServiceState state /* [in] */,
4158 struct ENUM_SERVICE_STATUSA *service_status /* [out] [unique] */,
4159 uint32_t offered /* [in] */,
4160 uint32_t *needed /* [out] [ref] */,
4161 uint32_t *services_returned /* [out] [ref] */,
4162 WERROR *werror)
4164 struct svcctl_EnumDependentServicesA r;
4165 NTSTATUS status;
4167 /* In parameters */
4168 r.in.service = service;
4169 r.in.state = state;
4170 r.in.offered = offered;
4172 status = cli->dispatch(cli,
4173 mem_ctx,
4174 &ndr_table_svcctl,
4175 NDR_SVCCTL_ENUMDEPENDENTSERVICESA,
4176 &r);
4178 if (!NT_STATUS_IS_OK(status)) {
4179 return status;
4182 if (NT_STATUS_IS_ERR(status)) {
4183 return status;
4186 /* Return variables */
4187 if (service_status && r.out.service_status) {
4188 *service_status = *r.out.service_status;
4190 *needed = *r.out.needed;
4191 *services_returned = *r.out.services_returned;
4193 /* Return result */
4194 if (werror) {
4195 *werror = r.out.result;
4198 return werror_to_ntstatus(r.out.result);
4201 struct rpccli_svcctl_EnumServicesStatusA_state {
4202 struct svcctl_EnumServicesStatusA orig;
4203 struct svcctl_EnumServicesStatusA tmp;
4204 TALLOC_CTX *out_mem_ctx;
4205 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4208 static void rpccli_svcctl_EnumServicesStatusA_done(struct tevent_req *subreq);
4210 struct tevent_req *rpccli_svcctl_EnumServicesStatusA_send(TALLOC_CTX *mem_ctx,
4211 struct tevent_context *ev,
4212 struct rpc_pipe_client *cli,
4213 struct policy_handle *_handle /* [in] [ref] */,
4214 uint32_t _type /* [in] */,
4215 enum svcctl_ServiceState _state /* [in] */,
4216 uint32_t _offered /* [in] */,
4217 uint8_t *_service /* [out] [size_is(offered)] */,
4218 uint32_t *_needed /* [out] [ref] */,
4219 uint32_t *_services_returned /* [out] [ref] */,
4220 uint32_t *_resume_handle /* [in,out] [unique] */)
4222 struct tevent_req *req;
4223 struct rpccli_svcctl_EnumServicesStatusA_state *state;
4224 struct tevent_req *subreq;
4226 req = tevent_req_create(mem_ctx, &state,
4227 struct rpccli_svcctl_EnumServicesStatusA_state);
4228 if (req == NULL) {
4229 return NULL;
4231 state->out_mem_ctx = NULL;
4232 state->dispatch_recv = cli->dispatch_recv;
4234 /* In parameters */
4235 state->orig.in.handle = _handle;
4236 state->orig.in.type = _type;
4237 state->orig.in.state = _state;
4238 state->orig.in.offered = _offered;
4239 state->orig.in.resume_handle = _resume_handle;
4241 /* Out parameters */
4242 state->orig.out.service = _service;
4243 state->orig.out.needed = _needed;
4244 state->orig.out.services_returned = _services_returned;
4245 state->orig.out.resume_handle = _resume_handle;
4247 /* Result */
4248 ZERO_STRUCT(state->orig.out.result);
4250 state->out_mem_ctx = talloc_named_const(state, 0,
4251 "rpccli_svcctl_EnumServicesStatusA_out_memory");
4252 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4253 return tevent_req_post(req, ev);
4256 /* make a temporary copy, that we pass to the dispatch function */
4257 state->tmp = state->orig;
4259 subreq = cli->dispatch_send(state, ev, cli,
4260 &ndr_table_svcctl,
4261 NDR_SVCCTL_ENUMSERVICESSTATUSA,
4262 &state->tmp);
4263 if (tevent_req_nomem(subreq, req)) {
4264 return tevent_req_post(req, ev);
4266 tevent_req_set_callback(subreq, rpccli_svcctl_EnumServicesStatusA_done, req);
4267 return req;
4270 static void rpccli_svcctl_EnumServicesStatusA_done(struct tevent_req *subreq)
4272 struct tevent_req *req = tevent_req_callback_data(
4273 subreq, struct tevent_req);
4274 struct rpccli_svcctl_EnumServicesStatusA_state *state = tevent_req_data(
4275 req, struct rpccli_svcctl_EnumServicesStatusA_state);
4276 NTSTATUS status;
4277 TALLOC_CTX *mem_ctx;
4279 if (state->out_mem_ctx) {
4280 mem_ctx = state->out_mem_ctx;
4281 } else {
4282 mem_ctx = state;
4285 status = state->dispatch_recv(subreq, mem_ctx);
4286 TALLOC_FREE(subreq);
4287 if (!NT_STATUS_IS_OK(status)) {
4288 tevent_req_nterror(req, status);
4289 return;
4292 /* Copy out parameters */
4293 memcpy(state->orig.out.service, state->tmp.out.service, (state->tmp.in.offered) * sizeof(*state->orig.out.service));
4294 *state->orig.out.needed = *state->tmp.out.needed;
4295 *state->orig.out.services_returned = *state->tmp.out.services_returned;
4296 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
4297 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
4300 /* Copy result */
4301 state->orig.out.result = state->tmp.out.result;
4303 /* Reset temporary structure */
4304 ZERO_STRUCT(state->tmp);
4306 tevent_req_done(req);
4309 NTSTATUS rpccli_svcctl_EnumServicesStatusA_recv(struct tevent_req *req,
4310 TALLOC_CTX *mem_ctx,
4311 WERROR *result)
4313 struct rpccli_svcctl_EnumServicesStatusA_state *state = tevent_req_data(
4314 req, struct rpccli_svcctl_EnumServicesStatusA_state);
4315 NTSTATUS status;
4317 if (tevent_req_is_nterror(req, &status)) {
4318 tevent_req_received(req);
4319 return status;
4322 /* Steal possbile out parameters to the callers context */
4323 talloc_steal(mem_ctx, state->out_mem_ctx);
4325 /* Return result */
4326 *result = state->orig.out.result;
4328 tevent_req_received(req);
4329 return NT_STATUS_OK;
4332 NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli,
4333 TALLOC_CTX *mem_ctx,
4334 struct policy_handle *handle /* [in] [ref] */,
4335 uint32_t type /* [in] */,
4336 enum svcctl_ServiceState state /* [in] */,
4337 uint32_t offered /* [in] */,
4338 uint8_t *service /* [out] [size_is(offered)] */,
4339 uint32_t *needed /* [out] [ref] */,
4340 uint32_t *services_returned /* [out] [ref] */,
4341 uint32_t *resume_handle /* [in,out] [unique] */,
4342 WERROR *werror)
4344 struct svcctl_EnumServicesStatusA r;
4345 NTSTATUS status;
4347 /* In parameters */
4348 r.in.handle = handle;
4349 r.in.type = type;
4350 r.in.state = state;
4351 r.in.offered = offered;
4352 r.in.resume_handle = resume_handle;
4354 status = cli->dispatch(cli,
4355 mem_ctx,
4356 &ndr_table_svcctl,
4357 NDR_SVCCTL_ENUMSERVICESSTATUSA,
4358 &r);
4360 if (!NT_STATUS_IS_OK(status)) {
4361 return status;
4364 if (NT_STATUS_IS_ERR(status)) {
4365 return status;
4368 /* Return variables */
4369 memcpy(service, r.out.service, (r.in.offered) * sizeof(*service));
4370 *needed = *r.out.needed;
4371 *services_returned = *r.out.services_returned;
4372 if (resume_handle && r.out.resume_handle) {
4373 *resume_handle = *r.out.resume_handle;
4376 /* Return result */
4377 if (werror) {
4378 *werror = r.out.result;
4381 return werror_to_ntstatus(r.out.result);
4384 struct rpccli_svcctl_OpenSCManagerA_state {
4385 struct svcctl_OpenSCManagerA orig;
4386 struct svcctl_OpenSCManagerA tmp;
4387 TALLOC_CTX *out_mem_ctx;
4388 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4391 static void rpccli_svcctl_OpenSCManagerA_done(struct tevent_req *subreq);
4393 struct tevent_req *rpccli_svcctl_OpenSCManagerA_send(TALLOC_CTX *mem_ctx,
4394 struct tevent_context *ev,
4395 struct rpc_pipe_client *cli,
4396 const char *_MachineName /* [in] [unique,charset(UTF16)] */,
4397 const char *_DatabaseName /* [in] [unique,charset(UTF16)] */,
4398 uint32_t _access_mask /* [in] */,
4399 struct policy_handle *_handle /* [out] [ref] */)
4401 struct tevent_req *req;
4402 struct rpccli_svcctl_OpenSCManagerA_state *state;
4403 struct tevent_req *subreq;
4405 req = tevent_req_create(mem_ctx, &state,
4406 struct rpccli_svcctl_OpenSCManagerA_state);
4407 if (req == NULL) {
4408 return NULL;
4410 state->out_mem_ctx = NULL;
4411 state->dispatch_recv = cli->dispatch_recv;
4413 /* In parameters */
4414 state->orig.in.MachineName = _MachineName;
4415 state->orig.in.DatabaseName = _DatabaseName;
4416 state->orig.in.access_mask = _access_mask;
4418 /* Out parameters */
4419 state->orig.out.handle = _handle;
4421 /* Result */
4422 ZERO_STRUCT(state->orig.out.result);
4424 state->out_mem_ctx = talloc_named_const(state, 0,
4425 "rpccli_svcctl_OpenSCManagerA_out_memory");
4426 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4427 return tevent_req_post(req, ev);
4430 /* make a temporary copy, that we pass to the dispatch function */
4431 state->tmp = state->orig;
4433 subreq = cli->dispatch_send(state, ev, cli,
4434 &ndr_table_svcctl,
4435 NDR_SVCCTL_OPENSCMANAGERA,
4436 &state->tmp);
4437 if (tevent_req_nomem(subreq, req)) {
4438 return tevent_req_post(req, ev);
4440 tevent_req_set_callback(subreq, rpccli_svcctl_OpenSCManagerA_done, req);
4441 return req;
4444 static void rpccli_svcctl_OpenSCManagerA_done(struct tevent_req *subreq)
4446 struct tevent_req *req = tevent_req_callback_data(
4447 subreq, struct tevent_req);
4448 struct rpccli_svcctl_OpenSCManagerA_state *state = tevent_req_data(
4449 req, struct rpccli_svcctl_OpenSCManagerA_state);
4450 NTSTATUS status;
4451 TALLOC_CTX *mem_ctx;
4453 if (state->out_mem_ctx) {
4454 mem_ctx = state->out_mem_ctx;
4455 } else {
4456 mem_ctx = state;
4459 status = state->dispatch_recv(subreq, mem_ctx);
4460 TALLOC_FREE(subreq);
4461 if (!NT_STATUS_IS_OK(status)) {
4462 tevent_req_nterror(req, status);
4463 return;
4466 /* Copy out parameters */
4467 *state->orig.out.handle = *state->tmp.out.handle;
4469 /* Copy result */
4470 state->orig.out.result = state->tmp.out.result;
4472 /* Reset temporary structure */
4473 ZERO_STRUCT(state->tmp);
4475 tevent_req_done(req);
4478 NTSTATUS rpccli_svcctl_OpenSCManagerA_recv(struct tevent_req *req,
4479 TALLOC_CTX *mem_ctx,
4480 WERROR *result)
4482 struct rpccli_svcctl_OpenSCManagerA_state *state = tevent_req_data(
4483 req, struct rpccli_svcctl_OpenSCManagerA_state);
4484 NTSTATUS status;
4486 if (tevent_req_is_nterror(req, &status)) {
4487 tevent_req_received(req);
4488 return status;
4491 /* Steal possbile out parameters to the callers context */
4492 talloc_steal(mem_ctx, state->out_mem_ctx);
4494 /* Return result */
4495 *result = state->orig.out.result;
4497 tevent_req_received(req);
4498 return NT_STATUS_OK;
4501 NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli,
4502 TALLOC_CTX *mem_ctx,
4503 const char *MachineName /* [in] [unique,charset(UTF16)] */,
4504 const char *DatabaseName /* [in] [unique,charset(UTF16)] */,
4505 uint32_t access_mask /* [in] */,
4506 struct policy_handle *handle /* [out] [ref] */,
4507 WERROR *werror)
4509 struct svcctl_OpenSCManagerA r;
4510 NTSTATUS status;
4512 /* In parameters */
4513 r.in.MachineName = MachineName;
4514 r.in.DatabaseName = DatabaseName;
4515 r.in.access_mask = access_mask;
4517 status = cli->dispatch(cli,
4518 mem_ctx,
4519 &ndr_table_svcctl,
4520 NDR_SVCCTL_OPENSCMANAGERA,
4521 &r);
4523 if (!NT_STATUS_IS_OK(status)) {
4524 return status;
4527 if (NT_STATUS_IS_ERR(status)) {
4528 return status;
4531 /* Return variables */
4532 *handle = *r.out.handle;
4534 /* Return result */
4535 if (werror) {
4536 *werror = r.out.result;
4539 return werror_to_ntstatus(r.out.result);
4542 struct rpccli_svcctl_OpenServiceA_state {
4543 struct svcctl_OpenServiceA orig;
4544 struct svcctl_OpenServiceA tmp;
4545 TALLOC_CTX *out_mem_ctx;
4546 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4549 static void rpccli_svcctl_OpenServiceA_done(struct tevent_req *subreq);
4551 struct tevent_req *rpccli_svcctl_OpenServiceA_send(TALLOC_CTX *mem_ctx,
4552 struct tevent_context *ev,
4553 struct rpc_pipe_client *cli,
4554 struct policy_handle *_scmanager_handle /* [in] [ref] */,
4555 const char *_ServiceName /* [in] [unique,charset(UTF16)] */,
4556 uint32_t _access_mask /* [in] */)
4558 struct tevent_req *req;
4559 struct rpccli_svcctl_OpenServiceA_state *state;
4560 struct tevent_req *subreq;
4562 req = tevent_req_create(mem_ctx, &state,
4563 struct rpccli_svcctl_OpenServiceA_state);
4564 if (req == NULL) {
4565 return NULL;
4567 state->out_mem_ctx = NULL;
4568 state->dispatch_recv = cli->dispatch_recv;
4570 /* In parameters */
4571 state->orig.in.scmanager_handle = _scmanager_handle;
4572 state->orig.in.ServiceName = _ServiceName;
4573 state->orig.in.access_mask = _access_mask;
4575 /* Out parameters */
4577 /* Result */
4578 ZERO_STRUCT(state->orig.out.result);
4580 /* make a temporary copy, that we pass to the dispatch function */
4581 state->tmp = state->orig;
4583 subreq = cli->dispatch_send(state, ev, cli,
4584 &ndr_table_svcctl,
4585 NDR_SVCCTL_OPENSERVICEA,
4586 &state->tmp);
4587 if (tevent_req_nomem(subreq, req)) {
4588 return tevent_req_post(req, ev);
4590 tevent_req_set_callback(subreq, rpccli_svcctl_OpenServiceA_done, req);
4591 return req;
4594 static void rpccli_svcctl_OpenServiceA_done(struct tevent_req *subreq)
4596 struct tevent_req *req = tevent_req_callback_data(
4597 subreq, struct tevent_req);
4598 struct rpccli_svcctl_OpenServiceA_state *state = tevent_req_data(
4599 req, struct rpccli_svcctl_OpenServiceA_state);
4600 NTSTATUS status;
4601 TALLOC_CTX *mem_ctx;
4603 if (state->out_mem_ctx) {
4604 mem_ctx = state->out_mem_ctx;
4605 } else {
4606 mem_ctx = state;
4609 status = state->dispatch_recv(subreq, mem_ctx);
4610 TALLOC_FREE(subreq);
4611 if (!NT_STATUS_IS_OK(status)) {
4612 tevent_req_nterror(req, status);
4613 return;
4616 /* Copy out parameters */
4618 /* Copy result */
4619 state->orig.out.result = state->tmp.out.result;
4621 /* Reset temporary structure */
4622 ZERO_STRUCT(state->tmp);
4624 tevent_req_done(req);
4627 NTSTATUS rpccli_svcctl_OpenServiceA_recv(struct tevent_req *req,
4628 TALLOC_CTX *mem_ctx,
4629 WERROR *result)
4631 struct rpccli_svcctl_OpenServiceA_state *state = tevent_req_data(
4632 req, struct rpccli_svcctl_OpenServiceA_state);
4633 NTSTATUS status;
4635 if (tevent_req_is_nterror(req, &status)) {
4636 tevent_req_received(req);
4637 return status;
4640 /* Steal possbile out parameters to the callers context */
4641 talloc_steal(mem_ctx, state->out_mem_ctx);
4643 /* Return result */
4644 *result = state->orig.out.result;
4646 tevent_req_received(req);
4647 return NT_STATUS_OK;
4650 NTSTATUS rpccli_svcctl_OpenServiceA(struct rpc_pipe_client *cli,
4651 TALLOC_CTX *mem_ctx,
4652 struct policy_handle *scmanager_handle /* [in] [ref] */,
4653 const char *ServiceName /* [in] [unique,charset(UTF16)] */,
4654 uint32_t access_mask /* [in] */,
4655 WERROR *werror)
4657 struct svcctl_OpenServiceA r;
4658 NTSTATUS status;
4660 /* In parameters */
4661 r.in.scmanager_handle = scmanager_handle;
4662 r.in.ServiceName = ServiceName;
4663 r.in.access_mask = access_mask;
4665 status = cli->dispatch(cli,
4666 mem_ctx,
4667 &ndr_table_svcctl,
4668 NDR_SVCCTL_OPENSERVICEA,
4669 &r);
4671 if (!NT_STATUS_IS_OK(status)) {
4672 return status;
4675 if (NT_STATUS_IS_ERR(status)) {
4676 return status;
4679 /* Return variables */
4681 /* Return result */
4682 if (werror) {
4683 *werror = r.out.result;
4686 return werror_to_ntstatus(r.out.result);
4689 struct rpccli_svcctl_QueryServiceConfigA_state {
4690 struct svcctl_QueryServiceConfigA orig;
4691 struct svcctl_QueryServiceConfigA tmp;
4692 TALLOC_CTX *out_mem_ctx;
4693 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4696 static void rpccli_svcctl_QueryServiceConfigA_done(struct tevent_req *subreq);
4698 struct tevent_req *rpccli_svcctl_QueryServiceConfigA_send(TALLOC_CTX *mem_ctx,
4699 struct tevent_context *ev,
4700 struct rpc_pipe_client *cli,
4701 struct policy_handle *_handle /* [in] [ref] */,
4702 uint8_t *_query /* [out] */,
4703 uint32_t _offered /* [in] */,
4704 uint32_t *_needed /* [out] [ref] */)
4706 struct tevent_req *req;
4707 struct rpccli_svcctl_QueryServiceConfigA_state *state;
4708 struct tevent_req *subreq;
4710 req = tevent_req_create(mem_ctx, &state,
4711 struct rpccli_svcctl_QueryServiceConfigA_state);
4712 if (req == NULL) {
4713 return NULL;
4715 state->out_mem_ctx = NULL;
4716 state->dispatch_recv = cli->dispatch_recv;
4718 /* In parameters */
4719 state->orig.in.handle = _handle;
4720 state->orig.in.offered = _offered;
4722 /* Out parameters */
4723 state->orig.out.query = _query;
4724 state->orig.out.needed = _needed;
4726 /* Result */
4727 ZERO_STRUCT(state->orig.out.result);
4729 state->out_mem_ctx = talloc_named_const(state, 0,
4730 "rpccli_svcctl_QueryServiceConfigA_out_memory");
4731 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4732 return tevent_req_post(req, ev);
4735 /* make a temporary copy, that we pass to the dispatch function */
4736 state->tmp = state->orig;
4738 subreq = cli->dispatch_send(state, ev, cli,
4739 &ndr_table_svcctl,
4740 NDR_SVCCTL_QUERYSERVICECONFIGA,
4741 &state->tmp);
4742 if (tevent_req_nomem(subreq, req)) {
4743 return tevent_req_post(req, ev);
4745 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfigA_done, req);
4746 return req;
4749 static void rpccli_svcctl_QueryServiceConfigA_done(struct tevent_req *subreq)
4751 struct tevent_req *req = tevent_req_callback_data(
4752 subreq, struct tevent_req);
4753 struct rpccli_svcctl_QueryServiceConfigA_state *state = tevent_req_data(
4754 req, struct rpccli_svcctl_QueryServiceConfigA_state);
4755 NTSTATUS status;
4756 TALLOC_CTX *mem_ctx;
4758 if (state->out_mem_ctx) {
4759 mem_ctx = state->out_mem_ctx;
4760 } else {
4761 mem_ctx = state;
4764 status = state->dispatch_recv(subreq, mem_ctx);
4765 TALLOC_FREE(subreq);
4766 if (!NT_STATUS_IS_OK(status)) {
4767 tevent_req_nterror(req, status);
4768 return;
4771 /* Copy out parameters */
4772 memcpy(state->orig.out.query, state->tmp.out.query, (state->tmp.in.offered) * sizeof(*state->orig.out.query));
4773 *state->orig.out.needed = *state->tmp.out.needed;
4775 /* Copy result */
4776 state->orig.out.result = state->tmp.out.result;
4778 /* Reset temporary structure */
4779 ZERO_STRUCT(state->tmp);
4781 tevent_req_done(req);
4784 NTSTATUS rpccli_svcctl_QueryServiceConfigA_recv(struct tevent_req *req,
4785 TALLOC_CTX *mem_ctx,
4786 WERROR *result)
4788 struct rpccli_svcctl_QueryServiceConfigA_state *state = tevent_req_data(
4789 req, struct rpccli_svcctl_QueryServiceConfigA_state);
4790 NTSTATUS status;
4792 if (tevent_req_is_nterror(req, &status)) {
4793 tevent_req_received(req);
4794 return status;
4797 /* Steal possbile out parameters to the callers context */
4798 talloc_steal(mem_ctx, state->out_mem_ctx);
4800 /* Return result */
4801 *result = state->orig.out.result;
4803 tevent_req_received(req);
4804 return NT_STATUS_OK;
4807 NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli,
4808 TALLOC_CTX *mem_ctx,
4809 struct policy_handle *handle /* [in] [ref] */,
4810 uint8_t *query /* [out] */,
4811 uint32_t offered /* [in] */,
4812 uint32_t *needed /* [out] [ref] */,
4813 WERROR *werror)
4815 struct svcctl_QueryServiceConfigA r;
4816 NTSTATUS status;
4818 /* In parameters */
4819 r.in.handle = handle;
4820 r.in.offered = offered;
4822 status = cli->dispatch(cli,
4823 mem_ctx,
4824 &ndr_table_svcctl,
4825 NDR_SVCCTL_QUERYSERVICECONFIGA,
4826 &r);
4828 if (!NT_STATUS_IS_OK(status)) {
4829 return status;
4832 if (NT_STATUS_IS_ERR(status)) {
4833 return status;
4836 /* Return variables */
4837 memcpy(query, r.out.query, (r.in.offered) * sizeof(*query));
4838 *needed = *r.out.needed;
4840 /* Return result */
4841 if (werror) {
4842 *werror = r.out.result;
4845 return werror_to_ntstatus(r.out.result);
4848 struct rpccli_svcctl_QueryServiceLockStatusA_state {
4849 struct svcctl_QueryServiceLockStatusA orig;
4850 struct svcctl_QueryServiceLockStatusA tmp;
4851 TALLOC_CTX *out_mem_ctx;
4852 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4855 static void rpccli_svcctl_QueryServiceLockStatusA_done(struct tevent_req *subreq);
4857 struct tevent_req *rpccli_svcctl_QueryServiceLockStatusA_send(TALLOC_CTX *mem_ctx,
4858 struct tevent_context *ev,
4859 struct rpc_pipe_client *cli,
4860 struct policy_handle *_handle /* [in] [ref] */,
4861 uint32_t _offered /* [in] */,
4862 struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
4863 uint32_t *_needed /* [out] [ref] */)
4865 struct tevent_req *req;
4866 struct rpccli_svcctl_QueryServiceLockStatusA_state *state;
4867 struct tevent_req *subreq;
4869 req = tevent_req_create(mem_ctx, &state,
4870 struct rpccli_svcctl_QueryServiceLockStatusA_state);
4871 if (req == NULL) {
4872 return NULL;
4874 state->out_mem_ctx = NULL;
4875 state->dispatch_recv = cli->dispatch_recv;
4877 /* In parameters */
4878 state->orig.in.handle = _handle;
4879 state->orig.in.offered = _offered;
4881 /* Out parameters */
4882 state->orig.out.lock_status = _lock_status;
4883 state->orig.out.needed = _needed;
4885 /* Result */
4886 ZERO_STRUCT(state->orig.out.result);
4888 state->out_mem_ctx = talloc_named_const(state, 0,
4889 "rpccli_svcctl_QueryServiceLockStatusA_out_memory");
4890 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4891 return tevent_req_post(req, ev);
4894 /* make a temporary copy, that we pass to the dispatch function */
4895 state->tmp = state->orig;
4897 subreq = cli->dispatch_send(state, ev, cli,
4898 &ndr_table_svcctl,
4899 NDR_SVCCTL_QUERYSERVICELOCKSTATUSA,
4900 &state->tmp);
4901 if (tevent_req_nomem(subreq, req)) {
4902 return tevent_req_post(req, ev);
4904 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceLockStatusA_done, req);
4905 return req;
4908 static void rpccli_svcctl_QueryServiceLockStatusA_done(struct tevent_req *subreq)
4910 struct tevent_req *req = tevent_req_callback_data(
4911 subreq, struct tevent_req);
4912 struct rpccli_svcctl_QueryServiceLockStatusA_state *state = tevent_req_data(
4913 req, struct rpccli_svcctl_QueryServiceLockStatusA_state);
4914 NTSTATUS status;
4915 TALLOC_CTX *mem_ctx;
4917 if (state->out_mem_ctx) {
4918 mem_ctx = state->out_mem_ctx;
4919 } else {
4920 mem_ctx = state;
4923 status = state->dispatch_recv(subreq, mem_ctx);
4924 TALLOC_FREE(subreq);
4925 if (!NT_STATUS_IS_OK(status)) {
4926 tevent_req_nterror(req, status);
4927 return;
4930 /* Copy out parameters */
4931 *state->orig.out.lock_status = *state->tmp.out.lock_status;
4932 *state->orig.out.needed = *state->tmp.out.needed;
4934 /* Copy result */
4935 state->orig.out.result = state->tmp.out.result;
4937 /* Reset temporary structure */
4938 ZERO_STRUCT(state->tmp);
4940 tevent_req_done(req);
4943 NTSTATUS rpccli_svcctl_QueryServiceLockStatusA_recv(struct tevent_req *req,
4944 TALLOC_CTX *mem_ctx,
4945 WERROR *result)
4947 struct rpccli_svcctl_QueryServiceLockStatusA_state *state = tevent_req_data(
4948 req, struct rpccli_svcctl_QueryServiceLockStatusA_state);
4949 NTSTATUS status;
4951 if (tevent_req_is_nterror(req, &status)) {
4952 tevent_req_received(req);
4953 return status;
4956 /* Steal possbile out parameters to the callers context */
4957 talloc_steal(mem_ctx, state->out_mem_ctx);
4959 /* Return result */
4960 *result = state->orig.out.result;
4962 tevent_req_received(req);
4963 return NT_STATUS_OK;
4966 NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
4967 TALLOC_CTX *mem_ctx,
4968 struct policy_handle *handle /* [in] [ref] */,
4969 uint32_t offered /* [in] */,
4970 struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
4971 uint32_t *needed /* [out] [ref] */,
4972 WERROR *werror)
4974 struct svcctl_QueryServiceLockStatusA r;
4975 NTSTATUS status;
4977 /* In parameters */
4978 r.in.handle = handle;
4979 r.in.offered = offered;
4981 status = cli->dispatch(cli,
4982 mem_ctx,
4983 &ndr_table_svcctl,
4984 NDR_SVCCTL_QUERYSERVICELOCKSTATUSA,
4985 &r);
4987 if (!NT_STATUS_IS_OK(status)) {
4988 return status;
4991 if (NT_STATUS_IS_ERR(status)) {
4992 return status;
4995 /* Return variables */
4996 *lock_status = *r.out.lock_status;
4997 *needed = *r.out.needed;
4999 /* Return result */
5000 if (werror) {
5001 *werror = r.out.result;
5004 return werror_to_ntstatus(r.out.result);
5007 struct rpccli_svcctl_StartServiceA_state {
5008 struct svcctl_StartServiceA orig;
5009 struct svcctl_StartServiceA tmp;
5010 TALLOC_CTX *out_mem_ctx;
5011 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5014 static void rpccli_svcctl_StartServiceA_done(struct tevent_req *subreq);
5016 struct tevent_req *rpccli_svcctl_StartServiceA_send(TALLOC_CTX *mem_ctx,
5017 struct tevent_context *ev,
5018 struct rpc_pipe_client *cli,
5019 struct policy_handle *_handle /* [in] [ref] */,
5020 uint32_t _NumArgs /* [in] */,
5021 const char *_Arguments /* [in] [unique,charset(UTF16)] */)
5023 struct tevent_req *req;
5024 struct rpccli_svcctl_StartServiceA_state *state;
5025 struct tevent_req *subreq;
5027 req = tevent_req_create(mem_ctx, &state,
5028 struct rpccli_svcctl_StartServiceA_state);
5029 if (req == NULL) {
5030 return NULL;
5032 state->out_mem_ctx = NULL;
5033 state->dispatch_recv = cli->dispatch_recv;
5035 /* In parameters */
5036 state->orig.in.handle = _handle;
5037 state->orig.in.NumArgs = _NumArgs;
5038 state->orig.in.Arguments = _Arguments;
5040 /* Out parameters */
5042 /* Result */
5043 ZERO_STRUCT(state->orig.out.result);
5045 /* make a temporary copy, that we pass to the dispatch function */
5046 state->tmp = state->orig;
5048 subreq = cli->dispatch_send(state, ev, cli,
5049 &ndr_table_svcctl,
5050 NDR_SVCCTL_STARTSERVICEA,
5051 &state->tmp);
5052 if (tevent_req_nomem(subreq, req)) {
5053 return tevent_req_post(req, ev);
5055 tevent_req_set_callback(subreq, rpccli_svcctl_StartServiceA_done, req);
5056 return req;
5059 static void rpccli_svcctl_StartServiceA_done(struct tevent_req *subreq)
5061 struct tevent_req *req = tevent_req_callback_data(
5062 subreq, struct tevent_req);
5063 struct rpccli_svcctl_StartServiceA_state *state = tevent_req_data(
5064 req, struct rpccli_svcctl_StartServiceA_state);
5065 NTSTATUS status;
5066 TALLOC_CTX *mem_ctx;
5068 if (state->out_mem_ctx) {
5069 mem_ctx = state->out_mem_ctx;
5070 } else {
5071 mem_ctx = state;
5074 status = state->dispatch_recv(subreq, mem_ctx);
5075 TALLOC_FREE(subreq);
5076 if (!NT_STATUS_IS_OK(status)) {
5077 tevent_req_nterror(req, status);
5078 return;
5081 /* Copy out parameters */
5083 /* Copy result */
5084 state->orig.out.result = state->tmp.out.result;
5086 /* Reset temporary structure */
5087 ZERO_STRUCT(state->tmp);
5089 tevent_req_done(req);
5092 NTSTATUS rpccli_svcctl_StartServiceA_recv(struct tevent_req *req,
5093 TALLOC_CTX *mem_ctx,
5094 WERROR *result)
5096 struct rpccli_svcctl_StartServiceA_state *state = tevent_req_data(
5097 req, struct rpccli_svcctl_StartServiceA_state);
5098 NTSTATUS status;
5100 if (tevent_req_is_nterror(req, &status)) {
5101 tevent_req_received(req);
5102 return status;
5105 /* Steal possbile out parameters to the callers context */
5106 talloc_steal(mem_ctx, state->out_mem_ctx);
5108 /* Return result */
5109 *result = state->orig.out.result;
5111 tevent_req_received(req);
5112 return NT_STATUS_OK;
5115 NTSTATUS rpccli_svcctl_StartServiceA(struct rpc_pipe_client *cli,
5116 TALLOC_CTX *mem_ctx,
5117 struct policy_handle *handle /* [in] [ref] */,
5118 uint32_t NumArgs /* [in] */,
5119 const char *Arguments /* [in] [unique,charset(UTF16)] */,
5120 WERROR *werror)
5122 struct svcctl_StartServiceA r;
5123 NTSTATUS status;
5125 /* In parameters */
5126 r.in.handle = handle;
5127 r.in.NumArgs = NumArgs;
5128 r.in.Arguments = Arguments;
5130 status = cli->dispatch(cli,
5131 mem_ctx,
5132 &ndr_table_svcctl,
5133 NDR_SVCCTL_STARTSERVICEA,
5134 &r);
5136 if (!NT_STATUS_IS_OK(status)) {
5137 return status;
5140 if (NT_STATUS_IS_ERR(status)) {
5141 return status;
5144 /* Return variables */
5146 /* Return result */
5147 if (werror) {
5148 *werror = r.out.result;
5151 return werror_to_ntstatus(r.out.result);
5154 struct rpccli_svcctl_GetServiceDisplayNameA_state {
5155 struct svcctl_GetServiceDisplayNameA orig;
5156 struct svcctl_GetServiceDisplayNameA tmp;
5157 TALLOC_CTX *out_mem_ctx;
5158 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5161 static void rpccli_svcctl_GetServiceDisplayNameA_done(struct tevent_req *subreq);
5163 struct tevent_req *rpccli_svcctl_GetServiceDisplayNameA_send(TALLOC_CTX *mem_ctx,
5164 struct tevent_context *ev,
5165 struct rpc_pipe_client *cli,
5166 struct policy_handle *_handle /* [in] [ref] */,
5167 const char *_service_name /* [in] [unique,charset(UTF16)] */,
5168 const char **_display_name /* [out] [ref,charset(UTF16)] */,
5169 uint32_t *_display_name_length /* [in,out] [unique] */)
5171 struct tevent_req *req;
5172 struct rpccli_svcctl_GetServiceDisplayNameA_state *state;
5173 struct tevent_req *subreq;
5175 req = tevent_req_create(mem_ctx, &state,
5176 struct rpccli_svcctl_GetServiceDisplayNameA_state);
5177 if (req == NULL) {
5178 return NULL;
5180 state->out_mem_ctx = NULL;
5181 state->dispatch_recv = cli->dispatch_recv;
5183 /* In parameters */
5184 state->orig.in.handle = _handle;
5185 state->orig.in.service_name = _service_name;
5186 state->orig.in.display_name_length = _display_name_length;
5188 /* Out parameters */
5189 state->orig.out.display_name = _display_name;
5190 state->orig.out.display_name_length = _display_name_length;
5192 /* Result */
5193 ZERO_STRUCT(state->orig.out.result);
5195 state->out_mem_ctx = talloc_named_const(state, 0,
5196 "rpccli_svcctl_GetServiceDisplayNameA_out_memory");
5197 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5198 return tevent_req_post(req, ev);
5201 /* make a temporary copy, that we pass to the dispatch function */
5202 state->tmp = state->orig;
5204 subreq = cli->dispatch_send(state, ev, cli,
5205 &ndr_table_svcctl,
5206 NDR_SVCCTL_GETSERVICEDISPLAYNAMEA,
5207 &state->tmp);
5208 if (tevent_req_nomem(subreq, req)) {
5209 return tevent_req_post(req, ev);
5211 tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceDisplayNameA_done, req);
5212 return req;
5215 static void rpccli_svcctl_GetServiceDisplayNameA_done(struct tevent_req *subreq)
5217 struct tevent_req *req = tevent_req_callback_data(
5218 subreq, struct tevent_req);
5219 struct rpccli_svcctl_GetServiceDisplayNameA_state *state = tevent_req_data(
5220 req, struct rpccli_svcctl_GetServiceDisplayNameA_state);
5221 NTSTATUS status;
5222 TALLOC_CTX *mem_ctx;
5224 if (state->out_mem_ctx) {
5225 mem_ctx = state->out_mem_ctx;
5226 } else {
5227 mem_ctx = state;
5230 status = state->dispatch_recv(subreq, mem_ctx);
5231 TALLOC_FREE(subreq);
5232 if (!NT_STATUS_IS_OK(status)) {
5233 tevent_req_nterror(req, status);
5234 return;
5237 /* Copy out parameters */
5238 *state->orig.out.display_name = *state->tmp.out.display_name;
5239 if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
5240 *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
5243 /* Copy result */
5244 state->orig.out.result = state->tmp.out.result;
5246 /* Reset temporary structure */
5247 ZERO_STRUCT(state->tmp);
5249 tevent_req_done(req);
5252 NTSTATUS rpccli_svcctl_GetServiceDisplayNameA_recv(struct tevent_req *req,
5253 TALLOC_CTX *mem_ctx,
5254 WERROR *result)
5256 struct rpccli_svcctl_GetServiceDisplayNameA_state *state = tevent_req_data(
5257 req, struct rpccli_svcctl_GetServiceDisplayNameA_state);
5258 NTSTATUS status;
5260 if (tevent_req_is_nterror(req, &status)) {
5261 tevent_req_received(req);
5262 return status;
5265 /* Steal possbile out parameters to the callers context */
5266 talloc_steal(mem_ctx, state->out_mem_ctx);
5268 /* Return result */
5269 *result = state->orig.out.result;
5271 tevent_req_received(req);
5272 return NT_STATUS_OK;
5275 NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
5276 TALLOC_CTX *mem_ctx,
5277 struct policy_handle *handle /* [in] [ref] */,
5278 const char *service_name /* [in] [unique,charset(UTF16)] */,
5279 const char **display_name /* [out] [ref,charset(UTF16)] */,
5280 uint32_t *display_name_length /* [in,out] [unique] */,
5281 WERROR *werror)
5283 struct svcctl_GetServiceDisplayNameA r;
5284 NTSTATUS status;
5286 /* In parameters */
5287 r.in.handle = handle;
5288 r.in.service_name = service_name;
5289 r.in.display_name_length = display_name_length;
5291 status = cli->dispatch(cli,
5292 mem_ctx,
5293 &ndr_table_svcctl,
5294 NDR_SVCCTL_GETSERVICEDISPLAYNAMEA,
5295 &r);
5297 if (!NT_STATUS_IS_OK(status)) {
5298 return status;
5301 if (NT_STATUS_IS_ERR(status)) {
5302 return status;
5305 /* Return variables */
5306 *display_name = *r.out.display_name;
5307 if (display_name_length && r.out.display_name_length) {
5308 *display_name_length = *r.out.display_name_length;
5311 /* Return result */
5312 if (werror) {
5313 *werror = r.out.result;
5316 return werror_to_ntstatus(r.out.result);
5319 struct rpccli_svcctl_GetServiceKeyNameA_state {
5320 struct svcctl_GetServiceKeyNameA orig;
5321 struct svcctl_GetServiceKeyNameA tmp;
5322 TALLOC_CTX *out_mem_ctx;
5323 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5326 static void rpccli_svcctl_GetServiceKeyNameA_done(struct tevent_req *subreq);
5328 struct tevent_req *rpccli_svcctl_GetServiceKeyNameA_send(TALLOC_CTX *mem_ctx,
5329 struct tevent_context *ev,
5330 struct rpc_pipe_client *cli,
5331 struct policy_handle *_handle /* [in] [ref] */,
5332 const char *_service_name /* [in] [unique,charset(UTF16)] */,
5333 const char **_key_name /* [out] [ref,charset(UTF16)] */,
5334 uint32_t *_display_name_length /* [in,out] [unique] */)
5336 struct tevent_req *req;
5337 struct rpccli_svcctl_GetServiceKeyNameA_state *state;
5338 struct tevent_req *subreq;
5340 req = tevent_req_create(mem_ctx, &state,
5341 struct rpccli_svcctl_GetServiceKeyNameA_state);
5342 if (req == NULL) {
5343 return NULL;
5345 state->out_mem_ctx = NULL;
5346 state->dispatch_recv = cli->dispatch_recv;
5348 /* In parameters */
5349 state->orig.in.handle = _handle;
5350 state->orig.in.service_name = _service_name;
5351 state->orig.in.display_name_length = _display_name_length;
5353 /* Out parameters */
5354 state->orig.out.key_name = _key_name;
5355 state->orig.out.display_name_length = _display_name_length;
5357 /* Result */
5358 ZERO_STRUCT(state->orig.out.result);
5360 state->out_mem_ctx = talloc_named_const(state, 0,
5361 "rpccli_svcctl_GetServiceKeyNameA_out_memory");
5362 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5363 return tevent_req_post(req, ev);
5366 /* make a temporary copy, that we pass to the dispatch function */
5367 state->tmp = state->orig;
5369 subreq = cli->dispatch_send(state, ev, cli,
5370 &ndr_table_svcctl,
5371 NDR_SVCCTL_GETSERVICEKEYNAMEA,
5372 &state->tmp);
5373 if (tevent_req_nomem(subreq, req)) {
5374 return tevent_req_post(req, ev);
5376 tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceKeyNameA_done, req);
5377 return req;
5380 static void rpccli_svcctl_GetServiceKeyNameA_done(struct tevent_req *subreq)
5382 struct tevent_req *req = tevent_req_callback_data(
5383 subreq, struct tevent_req);
5384 struct rpccli_svcctl_GetServiceKeyNameA_state *state = tevent_req_data(
5385 req, struct rpccli_svcctl_GetServiceKeyNameA_state);
5386 NTSTATUS status;
5387 TALLOC_CTX *mem_ctx;
5389 if (state->out_mem_ctx) {
5390 mem_ctx = state->out_mem_ctx;
5391 } else {
5392 mem_ctx = state;
5395 status = state->dispatch_recv(subreq, mem_ctx);
5396 TALLOC_FREE(subreq);
5397 if (!NT_STATUS_IS_OK(status)) {
5398 tevent_req_nterror(req, status);
5399 return;
5402 /* Copy out parameters */
5403 *state->orig.out.key_name = *state->tmp.out.key_name;
5404 if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
5405 *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
5408 /* Copy result */
5409 state->orig.out.result = state->tmp.out.result;
5411 /* Reset temporary structure */
5412 ZERO_STRUCT(state->tmp);
5414 tevent_req_done(req);
5417 NTSTATUS rpccli_svcctl_GetServiceKeyNameA_recv(struct tevent_req *req,
5418 TALLOC_CTX *mem_ctx,
5419 WERROR *result)
5421 struct rpccli_svcctl_GetServiceKeyNameA_state *state = tevent_req_data(
5422 req, struct rpccli_svcctl_GetServiceKeyNameA_state);
5423 NTSTATUS status;
5425 if (tevent_req_is_nterror(req, &status)) {
5426 tevent_req_received(req);
5427 return status;
5430 /* Steal possbile out parameters to the callers context */
5431 talloc_steal(mem_ctx, state->out_mem_ctx);
5433 /* Return result */
5434 *result = state->orig.out.result;
5436 tevent_req_received(req);
5437 return NT_STATUS_OK;
5440 NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli,
5441 TALLOC_CTX *mem_ctx,
5442 struct policy_handle *handle /* [in] [ref] */,
5443 const char *service_name /* [in] [unique,charset(UTF16)] */,
5444 const char **key_name /* [out] [ref,charset(UTF16)] */,
5445 uint32_t *display_name_length /* [in,out] [unique] */,
5446 WERROR *werror)
5448 struct svcctl_GetServiceKeyNameA r;
5449 NTSTATUS status;
5451 /* In parameters */
5452 r.in.handle = handle;
5453 r.in.service_name = service_name;
5454 r.in.display_name_length = display_name_length;
5456 status = cli->dispatch(cli,
5457 mem_ctx,
5458 &ndr_table_svcctl,
5459 NDR_SVCCTL_GETSERVICEKEYNAMEA,
5460 &r);
5462 if (!NT_STATUS_IS_OK(status)) {
5463 return status;
5466 if (NT_STATUS_IS_ERR(status)) {
5467 return status;
5470 /* Return variables */
5471 *key_name = *r.out.key_name;
5472 if (display_name_length && r.out.display_name_length) {
5473 *display_name_length = *r.out.display_name_length;
5476 /* Return result */
5477 if (werror) {
5478 *werror = r.out.result;
5481 return werror_to_ntstatus(r.out.result);
5484 struct rpccli_svcctl_GetCurrentGroupeStateW_state {
5485 struct svcctl_GetCurrentGroupeStateW orig;
5486 struct svcctl_GetCurrentGroupeStateW tmp;
5487 TALLOC_CTX *out_mem_ctx;
5488 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5491 static void rpccli_svcctl_GetCurrentGroupeStateW_done(struct tevent_req *subreq);
5493 struct tevent_req *rpccli_svcctl_GetCurrentGroupeStateW_send(TALLOC_CTX *mem_ctx,
5494 struct tevent_context *ev,
5495 struct rpc_pipe_client *cli)
5497 struct tevent_req *req;
5498 struct rpccli_svcctl_GetCurrentGroupeStateW_state *state;
5499 struct tevent_req *subreq;
5501 req = tevent_req_create(mem_ctx, &state,
5502 struct rpccli_svcctl_GetCurrentGroupeStateW_state);
5503 if (req == NULL) {
5504 return NULL;
5506 state->out_mem_ctx = NULL;
5507 state->dispatch_recv = cli->dispatch_recv;
5509 /* In parameters */
5511 /* Out parameters */
5513 /* Result */
5514 ZERO_STRUCT(state->orig.out.result);
5516 /* make a temporary copy, that we pass to the dispatch function */
5517 state->tmp = state->orig;
5519 subreq = cli->dispatch_send(state, ev, cli,
5520 &ndr_table_svcctl,
5521 NDR_SVCCTL_GETCURRENTGROUPESTATEW,
5522 &state->tmp);
5523 if (tevent_req_nomem(subreq, req)) {
5524 return tevent_req_post(req, ev);
5526 tevent_req_set_callback(subreq, rpccli_svcctl_GetCurrentGroupeStateW_done, req);
5527 return req;
5530 static void rpccli_svcctl_GetCurrentGroupeStateW_done(struct tevent_req *subreq)
5532 struct tevent_req *req = tevent_req_callback_data(
5533 subreq, struct tevent_req);
5534 struct rpccli_svcctl_GetCurrentGroupeStateW_state *state = tevent_req_data(
5535 req, struct rpccli_svcctl_GetCurrentGroupeStateW_state);
5536 NTSTATUS status;
5537 TALLOC_CTX *mem_ctx;
5539 if (state->out_mem_ctx) {
5540 mem_ctx = state->out_mem_ctx;
5541 } else {
5542 mem_ctx = state;
5545 status = state->dispatch_recv(subreq, mem_ctx);
5546 TALLOC_FREE(subreq);
5547 if (!NT_STATUS_IS_OK(status)) {
5548 tevent_req_nterror(req, status);
5549 return;
5552 /* Copy out parameters */
5554 /* Copy result */
5555 state->orig.out.result = state->tmp.out.result;
5557 /* Reset temporary structure */
5558 ZERO_STRUCT(state->tmp);
5560 tevent_req_done(req);
5563 NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW_recv(struct tevent_req *req,
5564 TALLOC_CTX *mem_ctx,
5565 WERROR *result)
5567 struct rpccli_svcctl_GetCurrentGroupeStateW_state *state = tevent_req_data(
5568 req, struct rpccli_svcctl_GetCurrentGroupeStateW_state);
5569 NTSTATUS status;
5571 if (tevent_req_is_nterror(req, &status)) {
5572 tevent_req_received(req);
5573 return status;
5576 /* Steal possbile out parameters to the callers context */
5577 talloc_steal(mem_ctx, state->out_mem_ctx);
5579 /* Return result */
5580 *result = state->orig.out.result;
5582 tevent_req_received(req);
5583 return NT_STATUS_OK;
5586 NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli,
5587 TALLOC_CTX *mem_ctx,
5588 WERROR *werror)
5590 struct svcctl_GetCurrentGroupeStateW r;
5591 NTSTATUS status;
5593 /* In parameters */
5595 status = cli->dispatch(cli,
5596 mem_ctx,
5597 &ndr_table_svcctl,
5598 NDR_SVCCTL_GETCURRENTGROUPESTATEW,
5599 &r);
5601 if (!NT_STATUS_IS_OK(status)) {
5602 return status;
5605 if (NT_STATUS_IS_ERR(status)) {
5606 return status;
5609 /* Return variables */
5611 /* Return result */
5612 if (werror) {
5613 *werror = r.out.result;
5616 return werror_to_ntstatus(r.out.result);
5619 struct rpccli_svcctl_EnumServiceGroupW_state {
5620 struct svcctl_EnumServiceGroupW orig;
5621 struct svcctl_EnumServiceGroupW tmp;
5622 TALLOC_CTX *out_mem_ctx;
5623 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5626 static void rpccli_svcctl_EnumServiceGroupW_done(struct tevent_req *subreq);
5628 struct tevent_req *rpccli_svcctl_EnumServiceGroupW_send(TALLOC_CTX *mem_ctx,
5629 struct tevent_context *ev,
5630 struct rpc_pipe_client *cli)
5632 struct tevent_req *req;
5633 struct rpccli_svcctl_EnumServiceGroupW_state *state;
5634 struct tevent_req *subreq;
5636 req = tevent_req_create(mem_ctx, &state,
5637 struct rpccli_svcctl_EnumServiceGroupW_state);
5638 if (req == NULL) {
5639 return NULL;
5641 state->out_mem_ctx = NULL;
5642 state->dispatch_recv = cli->dispatch_recv;
5644 /* In parameters */
5646 /* Out parameters */
5648 /* Result */
5649 ZERO_STRUCT(state->orig.out.result);
5651 /* make a temporary copy, that we pass to the dispatch function */
5652 state->tmp = state->orig;
5654 subreq = cli->dispatch_send(state, ev, cli,
5655 &ndr_table_svcctl,
5656 NDR_SVCCTL_ENUMSERVICEGROUPW,
5657 &state->tmp);
5658 if (tevent_req_nomem(subreq, req)) {
5659 return tevent_req_post(req, ev);
5661 tevent_req_set_callback(subreq, rpccli_svcctl_EnumServiceGroupW_done, req);
5662 return req;
5665 static void rpccli_svcctl_EnumServiceGroupW_done(struct tevent_req *subreq)
5667 struct tevent_req *req = tevent_req_callback_data(
5668 subreq, struct tevent_req);
5669 struct rpccli_svcctl_EnumServiceGroupW_state *state = tevent_req_data(
5670 req, struct rpccli_svcctl_EnumServiceGroupW_state);
5671 NTSTATUS status;
5672 TALLOC_CTX *mem_ctx;
5674 if (state->out_mem_ctx) {
5675 mem_ctx = state->out_mem_ctx;
5676 } else {
5677 mem_ctx = state;
5680 status = state->dispatch_recv(subreq, mem_ctx);
5681 TALLOC_FREE(subreq);
5682 if (!NT_STATUS_IS_OK(status)) {
5683 tevent_req_nterror(req, status);
5684 return;
5687 /* Copy out parameters */
5689 /* Copy result */
5690 state->orig.out.result = state->tmp.out.result;
5692 /* Reset temporary structure */
5693 ZERO_STRUCT(state->tmp);
5695 tevent_req_done(req);
5698 NTSTATUS rpccli_svcctl_EnumServiceGroupW_recv(struct tevent_req *req,
5699 TALLOC_CTX *mem_ctx,
5700 WERROR *result)
5702 struct rpccli_svcctl_EnumServiceGroupW_state *state = tevent_req_data(
5703 req, struct rpccli_svcctl_EnumServiceGroupW_state);
5704 NTSTATUS status;
5706 if (tevent_req_is_nterror(req, &status)) {
5707 tevent_req_received(req);
5708 return status;
5711 /* Steal possbile out parameters to the callers context */
5712 talloc_steal(mem_ctx, state->out_mem_ctx);
5714 /* Return result */
5715 *result = state->orig.out.result;
5717 tevent_req_received(req);
5718 return NT_STATUS_OK;
5721 NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli,
5722 TALLOC_CTX *mem_ctx,
5723 WERROR *werror)
5725 struct svcctl_EnumServiceGroupW r;
5726 NTSTATUS status;
5728 /* In parameters */
5730 status = cli->dispatch(cli,
5731 mem_ctx,
5732 &ndr_table_svcctl,
5733 NDR_SVCCTL_ENUMSERVICEGROUPW,
5734 &r);
5736 if (!NT_STATUS_IS_OK(status)) {
5737 return status;
5740 if (NT_STATUS_IS_ERR(status)) {
5741 return status;
5744 /* Return variables */
5746 /* Return result */
5747 if (werror) {
5748 *werror = r.out.result;
5751 return werror_to_ntstatus(r.out.result);
5754 struct rpccli_svcctl_ChangeServiceConfig2A_state {
5755 struct svcctl_ChangeServiceConfig2A orig;
5756 struct svcctl_ChangeServiceConfig2A tmp;
5757 TALLOC_CTX *out_mem_ctx;
5758 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5761 static void rpccli_svcctl_ChangeServiceConfig2A_done(struct tevent_req *subreq);
5763 struct tevent_req *rpccli_svcctl_ChangeServiceConfig2A_send(TALLOC_CTX *mem_ctx,
5764 struct tevent_context *ev,
5765 struct rpc_pipe_client *cli,
5766 struct policy_handle *_handle /* [in] [ref] */,
5767 uint32_t _info_level /* [in] */,
5768 uint8_t *_info /* [in] [unique] */)
5770 struct tevent_req *req;
5771 struct rpccli_svcctl_ChangeServiceConfig2A_state *state;
5772 struct tevent_req *subreq;
5774 req = tevent_req_create(mem_ctx, &state,
5775 struct rpccli_svcctl_ChangeServiceConfig2A_state);
5776 if (req == NULL) {
5777 return NULL;
5779 state->out_mem_ctx = NULL;
5780 state->dispatch_recv = cli->dispatch_recv;
5782 /* In parameters */
5783 state->orig.in.handle = _handle;
5784 state->orig.in.info_level = _info_level;
5785 state->orig.in.info = _info;
5787 /* Out parameters */
5789 /* Result */
5790 ZERO_STRUCT(state->orig.out.result);
5792 /* make a temporary copy, that we pass to the dispatch function */
5793 state->tmp = state->orig;
5795 subreq = cli->dispatch_send(state, ev, cli,
5796 &ndr_table_svcctl,
5797 NDR_SVCCTL_CHANGESERVICECONFIG2A,
5798 &state->tmp);
5799 if (tevent_req_nomem(subreq, req)) {
5800 return tevent_req_post(req, ev);
5802 tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfig2A_done, req);
5803 return req;
5806 static void rpccli_svcctl_ChangeServiceConfig2A_done(struct tevent_req *subreq)
5808 struct tevent_req *req = tevent_req_callback_data(
5809 subreq, struct tevent_req);
5810 struct rpccli_svcctl_ChangeServiceConfig2A_state *state = tevent_req_data(
5811 req, struct rpccli_svcctl_ChangeServiceConfig2A_state);
5812 NTSTATUS status;
5813 TALLOC_CTX *mem_ctx;
5815 if (state->out_mem_ctx) {
5816 mem_ctx = state->out_mem_ctx;
5817 } else {
5818 mem_ctx = state;
5821 status = state->dispatch_recv(subreq, mem_ctx);
5822 TALLOC_FREE(subreq);
5823 if (!NT_STATUS_IS_OK(status)) {
5824 tevent_req_nterror(req, status);
5825 return;
5828 /* Copy out parameters */
5830 /* Copy result */
5831 state->orig.out.result = state->tmp.out.result;
5833 /* Reset temporary structure */
5834 ZERO_STRUCT(state->tmp);
5836 tevent_req_done(req);
5839 NTSTATUS rpccli_svcctl_ChangeServiceConfig2A_recv(struct tevent_req *req,
5840 TALLOC_CTX *mem_ctx,
5841 WERROR *result)
5843 struct rpccli_svcctl_ChangeServiceConfig2A_state *state = tevent_req_data(
5844 req, struct rpccli_svcctl_ChangeServiceConfig2A_state);
5845 NTSTATUS status;
5847 if (tevent_req_is_nterror(req, &status)) {
5848 tevent_req_received(req);
5849 return status;
5852 /* Steal possbile out parameters to the callers context */
5853 talloc_steal(mem_ctx, state->out_mem_ctx);
5855 /* Return result */
5856 *result = state->orig.out.result;
5858 tevent_req_received(req);
5859 return NT_STATUS_OK;
5862 NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli,
5863 TALLOC_CTX *mem_ctx,
5864 struct policy_handle *handle /* [in] [ref] */,
5865 uint32_t info_level /* [in] */,
5866 uint8_t *info /* [in] [unique] */,
5867 WERROR *werror)
5869 struct svcctl_ChangeServiceConfig2A r;
5870 NTSTATUS status;
5872 /* In parameters */
5873 r.in.handle = handle;
5874 r.in.info_level = info_level;
5875 r.in.info = info;
5877 status = cli->dispatch(cli,
5878 mem_ctx,
5879 &ndr_table_svcctl,
5880 NDR_SVCCTL_CHANGESERVICECONFIG2A,
5881 &r);
5883 if (!NT_STATUS_IS_OK(status)) {
5884 return status;
5887 if (NT_STATUS_IS_ERR(status)) {
5888 return status;
5891 /* Return variables */
5893 /* Return result */
5894 if (werror) {
5895 *werror = r.out.result;
5898 return werror_to_ntstatus(r.out.result);
5901 struct rpccli_svcctl_ChangeServiceConfig2W_state {
5902 struct svcctl_ChangeServiceConfig2W orig;
5903 struct svcctl_ChangeServiceConfig2W tmp;
5904 TALLOC_CTX *out_mem_ctx;
5905 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5908 static void rpccli_svcctl_ChangeServiceConfig2W_done(struct tevent_req *subreq);
5910 struct tevent_req *rpccli_svcctl_ChangeServiceConfig2W_send(TALLOC_CTX *mem_ctx,
5911 struct tevent_context *ev,
5912 struct rpc_pipe_client *cli,
5913 struct policy_handle *_handle /* [in] [ref] */,
5914 uint32_t _info_level /* [in] */,
5915 uint8_t *_info /* [in] [unique] */)
5917 struct tevent_req *req;
5918 struct rpccli_svcctl_ChangeServiceConfig2W_state *state;
5919 struct tevent_req *subreq;
5921 req = tevent_req_create(mem_ctx, &state,
5922 struct rpccli_svcctl_ChangeServiceConfig2W_state);
5923 if (req == NULL) {
5924 return NULL;
5926 state->out_mem_ctx = NULL;
5927 state->dispatch_recv = cli->dispatch_recv;
5929 /* In parameters */
5930 state->orig.in.handle = _handle;
5931 state->orig.in.info_level = _info_level;
5932 state->orig.in.info = _info;
5934 /* Out parameters */
5936 /* Result */
5937 ZERO_STRUCT(state->orig.out.result);
5939 /* make a temporary copy, that we pass to the dispatch function */
5940 state->tmp = state->orig;
5942 subreq = cli->dispatch_send(state, ev, cli,
5943 &ndr_table_svcctl,
5944 NDR_SVCCTL_CHANGESERVICECONFIG2W,
5945 &state->tmp);
5946 if (tevent_req_nomem(subreq, req)) {
5947 return tevent_req_post(req, ev);
5949 tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfig2W_done, req);
5950 return req;
5953 static void rpccli_svcctl_ChangeServiceConfig2W_done(struct tevent_req *subreq)
5955 struct tevent_req *req = tevent_req_callback_data(
5956 subreq, struct tevent_req);
5957 struct rpccli_svcctl_ChangeServiceConfig2W_state *state = tevent_req_data(
5958 req, struct rpccli_svcctl_ChangeServiceConfig2W_state);
5959 NTSTATUS status;
5960 TALLOC_CTX *mem_ctx;
5962 if (state->out_mem_ctx) {
5963 mem_ctx = state->out_mem_ctx;
5964 } else {
5965 mem_ctx = state;
5968 status = state->dispatch_recv(subreq, mem_ctx);
5969 TALLOC_FREE(subreq);
5970 if (!NT_STATUS_IS_OK(status)) {
5971 tevent_req_nterror(req, status);
5972 return;
5975 /* Copy out parameters */
5977 /* Copy result */
5978 state->orig.out.result = state->tmp.out.result;
5980 /* Reset temporary structure */
5981 ZERO_STRUCT(state->tmp);
5983 tevent_req_done(req);
5986 NTSTATUS rpccli_svcctl_ChangeServiceConfig2W_recv(struct tevent_req *req,
5987 TALLOC_CTX *mem_ctx,
5988 WERROR *result)
5990 struct rpccli_svcctl_ChangeServiceConfig2W_state *state = tevent_req_data(
5991 req, struct rpccli_svcctl_ChangeServiceConfig2W_state);
5992 NTSTATUS status;
5994 if (tevent_req_is_nterror(req, &status)) {
5995 tevent_req_received(req);
5996 return status;
5999 /* Steal possbile out parameters to the callers context */
6000 talloc_steal(mem_ctx, state->out_mem_ctx);
6002 /* Return result */
6003 *result = state->orig.out.result;
6005 tevent_req_received(req);
6006 return NT_STATUS_OK;
6009 NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli,
6010 TALLOC_CTX *mem_ctx,
6011 struct policy_handle *handle /* [in] [ref] */,
6012 uint32_t info_level /* [in] */,
6013 uint8_t *info /* [in] [unique] */,
6014 WERROR *werror)
6016 struct svcctl_ChangeServiceConfig2W r;
6017 NTSTATUS status;
6019 /* In parameters */
6020 r.in.handle = handle;
6021 r.in.info_level = info_level;
6022 r.in.info = info;
6024 status = cli->dispatch(cli,
6025 mem_ctx,
6026 &ndr_table_svcctl,
6027 NDR_SVCCTL_CHANGESERVICECONFIG2W,
6028 &r);
6030 if (!NT_STATUS_IS_OK(status)) {
6031 return status;
6034 if (NT_STATUS_IS_ERR(status)) {
6035 return status;
6038 /* Return variables */
6040 /* Return result */
6041 if (werror) {
6042 *werror = r.out.result;
6045 return werror_to_ntstatus(r.out.result);
6048 struct rpccli_svcctl_QueryServiceConfig2A_state {
6049 struct svcctl_QueryServiceConfig2A orig;
6050 struct svcctl_QueryServiceConfig2A tmp;
6051 TALLOC_CTX *out_mem_ctx;
6052 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6055 static void rpccli_svcctl_QueryServiceConfig2A_done(struct tevent_req *subreq);
6057 struct tevent_req *rpccli_svcctl_QueryServiceConfig2A_send(TALLOC_CTX *mem_ctx,
6058 struct tevent_context *ev,
6059 struct rpc_pipe_client *cli,
6060 struct policy_handle *_handle /* [in] [ref] */,
6061 enum svcctl_ConfigLevel _info_level /* [in] */,
6062 uint8_t *_buffer /* [out] */,
6063 uint32_t _offered /* [in] */,
6064 uint32_t *_needed /* [out] [ref] */)
6066 struct tevent_req *req;
6067 struct rpccli_svcctl_QueryServiceConfig2A_state *state;
6068 struct tevent_req *subreq;
6070 req = tevent_req_create(mem_ctx, &state,
6071 struct rpccli_svcctl_QueryServiceConfig2A_state);
6072 if (req == NULL) {
6073 return NULL;
6075 state->out_mem_ctx = NULL;
6076 state->dispatch_recv = cli->dispatch_recv;
6078 /* In parameters */
6079 state->orig.in.handle = _handle;
6080 state->orig.in.info_level = _info_level;
6081 state->orig.in.offered = _offered;
6083 /* Out parameters */
6084 state->orig.out.buffer = _buffer;
6085 state->orig.out.needed = _needed;
6087 /* Result */
6088 ZERO_STRUCT(state->orig.out.result);
6090 state->out_mem_ctx = talloc_named_const(state, 0,
6091 "rpccli_svcctl_QueryServiceConfig2A_out_memory");
6092 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6093 return tevent_req_post(req, ev);
6096 /* make a temporary copy, that we pass to the dispatch function */
6097 state->tmp = state->orig;
6099 subreq = cli->dispatch_send(state, ev, cli,
6100 &ndr_table_svcctl,
6101 NDR_SVCCTL_QUERYSERVICECONFIG2A,
6102 &state->tmp);
6103 if (tevent_req_nomem(subreq, req)) {
6104 return tevent_req_post(req, ev);
6106 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfig2A_done, req);
6107 return req;
6110 static void rpccli_svcctl_QueryServiceConfig2A_done(struct tevent_req *subreq)
6112 struct tevent_req *req = tevent_req_callback_data(
6113 subreq, struct tevent_req);
6114 struct rpccli_svcctl_QueryServiceConfig2A_state *state = tevent_req_data(
6115 req, struct rpccli_svcctl_QueryServiceConfig2A_state);
6116 NTSTATUS status;
6117 TALLOC_CTX *mem_ctx;
6119 if (state->out_mem_ctx) {
6120 mem_ctx = state->out_mem_ctx;
6121 } else {
6122 mem_ctx = state;
6125 status = state->dispatch_recv(subreq, mem_ctx);
6126 TALLOC_FREE(subreq);
6127 if (!NT_STATUS_IS_OK(status)) {
6128 tevent_req_nterror(req, status);
6129 return;
6132 /* Copy out parameters */
6133 memcpy(state->orig.out.buffer, state->tmp.out.buffer, (state->tmp.in.offered) * sizeof(*state->orig.out.buffer));
6134 *state->orig.out.needed = *state->tmp.out.needed;
6136 /* Copy result */
6137 state->orig.out.result = state->tmp.out.result;
6139 /* Reset temporary structure */
6140 ZERO_STRUCT(state->tmp);
6142 tevent_req_done(req);
6145 NTSTATUS rpccli_svcctl_QueryServiceConfig2A_recv(struct tevent_req *req,
6146 TALLOC_CTX *mem_ctx,
6147 WERROR *result)
6149 struct rpccli_svcctl_QueryServiceConfig2A_state *state = tevent_req_data(
6150 req, struct rpccli_svcctl_QueryServiceConfig2A_state);
6151 NTSTATUS status;
6153 if (tevent_req_is_nterror(req, &status)) {
6154 tevent_req_received(req);
6155 return status;
6158 /* Steal possbile out parameters to the callers context */
6159 talloc_steal(mem_ctx, state->out_mem_ctx);
6161 /* Return result */
6162 *result = state->orig.out.result;
6164 tevent_req_received(req);
6165 return NT_STATUS_OK;
6168 NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli,
6169 TALLOC_CTX *mem_ctx,
6170 struct policy_handle *handle /* [in] [ref] */,
6171 enum svcctl_ConfigLevel info_level /* [in] */,
6172 uint8_t *buffer /* [out] */,
6173 uint32_t offered /* [in] */,
6174 uint32_t *needed /* [out] [ref] */,
6175 WERROR *werror)
6177 struct svcctl_QueryServiceConfig2A r;
6178 NTSTATUS status;
6180 /* In parameters */
6181 r.in.handle = handle;
6182 r.in.info_level = info_level;
6183 r.in.offered = offered;
6185 status = cli->dispatch(cli,
6186 mem_ctx,
6187 &ndr_table_svcctl,
6188 NDR_SVCCTL_QUERYSERVICECONFIG2A,
6189 &r);
6191 if (!NT_STATUS_IS_OK(status)) {
6192 return status;
6195 if (NT_STATUS_IS_ERR(status)) {
6196 return status;
6199 /* Return variables */
6200 memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
6201 *needed = *r.out.needed;
6203 /* Return result */
6204 if (werror) {
6205 *werror = r.out.result;
6208 return werror_to_ntstatus(r.out.result);
6211 struct rpccli_svcctl_QueryServiceConfig2W_state {
6212 struct svcctl_QueryServiceConfig2W orig;
6213 struct svcctl_QueryServiceConfig2W tmp;
6214 TALLOC_CTX *out_mem_ctx;
6215 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6218 static void rpccli_svcctl_QueryServiceConfig2W_done(struct tevent_req *subreq);
6220 struct tevent_req *rpccli_svcctl_QueryServiceConfig2W_send(TALLOC_CTX *mem_ctx,
6221 struct tevent_context *ev,
6222 struct rpc_pipe_client *cli,
6223 struct policy_handle *_handle /* [in] [ref] */,
6224 enum svcctl_ConfigLevel _info_level /* [in] */,
6225 uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
6226 uint32_t _offered /* [in] [range(0,8192)] */,
6227 uint32_t *_needed /* [out] [ref,range(0,8192)] */)
6229 struct tevent_req *req;
6230 struct rpccli_svcctl_QueryServiceConfig2W_state *state;
6231 struct tevent_req *subreq;
6233 req = tevent_req_create(mem_ctx, &state,
6234 struct rpccli_svcctl_QueryServiceConfig2W_state);
6235 if (req == NULL) {
6236 return NULL;
6238 state->out_mem_ctx = NULL;
6239 state->dispatch_recv = cli->dispatch_recv;
6241 /* In parameters */
6242 state->orig.in.handle = _handle;
6243 state->orig.in.info_level = _info_level;
6244 state->orig.in.offered = _offered;
6246 /* Out parameters */
6247 state->orig.out.buffer = _buffer;
6248 state->orig.out.needed = _needed;
6250 /* Result */
6251 ZERO_STRUCT(state->orig.out.result);
6253 state->out_mem_ctx = talloc_named_const(state, 0,
6254 "rpccli_svcctl_QueryServiceConfig2W_out_memory");
6255 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6256 return tevent_req_post(req, ev);
6259 /* make a temporary copy, that we pass to the dispatch function */
6260 state->tmp = state->orig;
6262 subreq = cli->dispatch_send(state, ev, cli,
6263 &ndr_table_svcctl,
6264 NDR_SVCCTL_QUERYSERVICECONFIG2W,
6265 &state->tmp);
6266 if (tevent_req_nomem(subreq, req)) {
6267 return tevent_req_post(req, ev);
6269 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfig2W_done, req);
6270 return req;
6273 static void rpccli_svcctl_QueryServiceConfig2W_done(struct tevent_req *subreq)
6275 struct tevent_req *req = tevent_req_callback_data(
6276 subreq, struct tevent_req);
6277 struct rpccli_svcctl_QueryServiceConfig2W_state *state = tevent_req_data(
6278 req, struct rpccli_svcctl_QueryServiceConfig2W_state);
6279 NTSTATUS status;
6280 TALLOC_CTX *mem_ctx;
6282 if (state->out_mem_ctx) {
6283 mem_ctx = state->out_mem_ctx;
6284 } else {
6285 mem_ctx = state;
6288 status = state->dispatch_recv(subreq, mem_ctx);
6289 TALLOC_FREE(subreq);
6290 if (!NT_STATUS_IS_OK(status)) {
6291 tevent_req_nterror(req, status);
6292 return;
6295 /* Copy out parameters */
6296 memcpy(state->orig.out.buffer, state->tmp.out.buffer, (state->tmp.in.offered) * sizeof(*state->orig.out.buffer));
6297 *state->orig.out.needed = *state->tmp.out.needed;
6299 /* Copy result */
6300 state->orig.out.result = state->tmp.out.result;
6302 /* Reset temporary structure */
6303 ZERO_STRUCT(state->tmp);
6305 tevent_req_done(req);
6308 NTSTATUS rpccli_svcctl_QueryServiceConfig2W_recv(struct tevent_req *req,
6309 TALLOC_CTX *mem_ctx,
6310 WERROR *result)
6312 struct rpccli_svcctl_QueryServiceConfig2W_state *state = tevent_req_data(
6313 req, struct rpccli_svcctl_QueryServiceConfig2W_state);
6314 NTSTATUS status;
6316 if (tevent_req_is_nterror(req, &status)) {
6317 tevent_req_received(req);
6318 return status;
6321 /* Steal possbile out parameters to the callers context */
6322 talloc_steal(mem_ctx, state->out_mem_ctx);
6324 /* Return result */
6325 *result = state->orig.out.result;
6327 tevent_req_received(req);
6328 return NT_STATUS_OK;
6331 NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
6332 TALLOC_CTX *mem_ctx,
6333 struct policy_handle *handle /* [in] [ref] */,
6334 enum svcctl_ConfigLevel info_level /* [in] */,
6335 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
6336 uint32_t offered /* [in] [range(0,8192)] */,
6337 uint32_t *needed /* [out] [ref,range(0,8192)] */,
6338 WERROR *werror)
6340 struct svcctl_QueryServiceConfig2W r;
6341 NTSTATUS status;
6343 /* In parameters */
6344 r.in.handle = handle;
6345 r.in.info_level = info_level;
6346 r.in.offered = offered;
6348 status = cli->dispatch(cli,
6349 mem_ctx,
6350 &ndr_table_svcctl,
6351 NDR_SVCCTL_QUERYSERVICECONFIG2W,
6352 &r);
6354 if (!NT_STATUS_IS_OK(status)) {
6355 return status;
6358 if (NT_STATUS_IS_ERR(status)) {
6359 return status;
6362 /* Return variables */
6363 memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
6364 *needed = *r.out.needed;
6366 /* Return result */
6367 if (werror) {
6368 *werror = r.out.result;
6371 return werror_to_ntstatus(r.out.result);
6374 struct rpccli_svcctl_QueryServiceStatusEx_state {
6375 struct svcctl_QueryServiceStatusEx orig;
6376 struct svcctl_QueryServiceStatusEx tmp;
6377 TALLOC_CTX *out_mem_ctx;
6378 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6381 static void rpccli_svcctl_QueryServiceStatusEx_done(struct tevent_req *subreq);
6383 struct tevent_req *rpccli_svcctl_QueryServiceStatusEx_send(TALLOC_CTX *mem_ctx,
6384 struct tevent_context *ev,
6385 struct rpc_pipe_client *cli,
6386 struct policy_handle *_handle /* [in] [ref] */,
6387 enum svcctl_StatusLevel _info_level /* [in] */,
6388 uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
6389 uint32_t _offered /* [in] [range(0,8192)] */,
6390 uint32_t *_needed /* [out] [ref,range(0,8192)] */)
6392 struct tevent_req *req;
6393 struct rpccli_svcctl_QueryServiceStatusEx_state *state;
6394 struct tevent_req *subreq;
6396 req = tevent_req_create(mem_ctx, &state,
6397 struct rpccli_svcctl_QueryServiceStatusEx_state);
6398 if (req == NULL) {
6399 return NULL;
6401 state->out_mem_ctx = NULL;
6402 state->dispatch_recv = cli->dispatch_recv;
6404 /* In parameters */
6405 state->orig.in.handle = _handle;
6406 state->orig.in.info_level = _info_level;
6407 state->orig.in.offered = _offered;
6409 /* Out parameters */
6410 state->orig.out.buffer = _buffer;
6411 state->orig.out.needed = _needed;
6413 /* Result */
6414 ZERO_STRUCT(state->orig.out.result);
6416 state->out_mem_ctx = talloc_named_const(state, 0,
6417 "rpccli_svcctl_QueryServiceStatusEx_out_memory");
6418 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6419 return tevent_req_post(req, ev);
6422 /* make a temporary copy, that we pass to the dispatch function */
6423 state->tmp = state->orig;
6425 subreq = cli->dispatch_send(state, ev, cli,
6426 &ndr_table_svcctl,
6427 NDR_SVCCTL_QUERYSERVICESTATUSEX,
6428 &state->tmp);
6429 if (tevent_req_nomem(subreq, req)) {
6430 return tevent_req_post(req, ev);
6432 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceStatusEx_done, req);
6433 return req;
6436 static void rpccli_svcctl_QueryServiceStatusEx_done(struct tevent_req *subreq)
6438 struct tevent_req *req = tevent_req_callback_data(
6439 subreq, struct tevent_req);
6440 struct rpccli_svcctl_QueryServiceStatusEx_state *state = tevent_req_data(
6441 req, struct rpccli_svcctl_QueryServiceStatusEx_state);
6442 NTSTATUS status;
6443 TALLOC_CTX *mem_ctx;
6445 if (state->out_mem_ctx) {
6446 mem_ctx = state->out_mem_ctx;
6447 } else {
6448 mem_ctx = state;
6451 status = state->dispatch_recv(subreq, mem_ctx);
6452 TALLOC_FREE(subreq);
6453 if (!NT_STATUS_IS_OK(status)) {
6454 tevent_req_nterror(req, status);
6455 return;
6458 /* Copy out parameters */
6459 memcpy(state->orig.out.buffer, state->tmp.out.buffer, (state->tmp.in.offered) * sizeof(*state->orig.out.buffer));
6460 *state->orig.out.needed = *state->tmp.out.needed;
6462 /* Copy result */
6463 state->orig.out.result = state->tmp.out.result;
6465 /* Reset temporary structure */
6466 ZERO_STRUCT(state->tmp);
6468 tevent_req_done(req);
6471 NTSTATUS rpccli_svcctl_QueryServiceStatusEx_recv(struct tevent_req *req,
6472 TALLOC_CTX *mem_ctx,
6473 WERROR *result)
6475 struct rpccli_svcctl_QueryServiceStatusEx_state *state = tevent_req_data(
6476 req, struct rpccli_svcctl_QueryServiceStatusEx_state);
6477 NTSTATUS status;
6479 if (tevent_req_is_nterror(req, &status)) {
6480 tevent_req_received(req);
6481 return status;
6484 /* Steal possbile out parameters to the callers context */
6485 talloc_steal(mem_ctx, state->out_mem_ctx);
6487 /* Return result */
6488 *result = state->orig.out.result;
6490 tevent_req_received(req);
6491 return NT_STATUS_OK;
6494 NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
6495 TALLOC_CTX *mem_ctx,
6496 struct policy_handle *handle /* [in] [ref] */,
6497 enum svcctl_StatusLevel info_level /* [in] */,
6498 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
6499 uint32_t offered /* [in] [range(0,8192)] */,
6500 uint32_t *needed /* [out] [ref,range(0,8192)] */,
6501 WERROR *werror)
6503 struct svcctl_QueryServiceStatusEx r;
6504 NTSTATUS status;
6506 /* In parameters */
6507 r.in.handle = handle;
6508 r.in.info_level = info_level;
6509 r.in.offered = offered;
6511 status = cli->dispatch(cli,
6512 mem_ctx,
6513 &ndr_table_svcctl,
6514 NDR_SVCCTL_QUERYSERVICESTATUSEX,
6515 &r);
6517 if (!NT_STATUS_IS_OK(status)) {
6518 return status;
6521 if (NT_STATUS_IS_ERR(status)) {
6522 return status;
6525 /* Return variables */
6526 memcpy(buffer, r.out.buffer, (r.in.offered) * sizeof(*buffer));
6527 *needed = *r.out.needed;
6529 /* Return result */
6530 if (werror) {
6531 *werror = r.out.result;
6534 return werror_to_ntstatus(r.out.result);
6537 struct rpccli_EnumServicesStatusExA_state {
6538 struct EnumServicesStatusExA orig;
6539 struct EnumServicesStatusExA tmp;
6540 TALLOC_CTX *out_mem_ctx;
6541 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6544 static void rpccli_EnumServicesStatusExA_done(struct tevent_req *subreq);
6546 struct tevent_req *rpccli_EnumServicesStatusExA_send(TALLOC_CTX *mem_ctx,
6547 struct tevent_context *ev,
6548 struct rpc_pipe_client *cli,
6549 struct policy_handle *_scmanager /* [in] [ref] */,
6550 uint32_t _info_level /* [in] */,
6551 uint32_t _type /* [in] */,
6552 enum svcctl_ServiceState _state /* [in] */,
6553 uint8_t *_services /* [out] */,
6554 uint32_t _offered /* [in] */,
6555 uint32_t *_needed /* [out] [ref] */,
6556 uint32_t *_service_returned /* [out] [ref] */,
6557 uint32_t *_resume_handle /* [in,out] [unique] */,
6558 const char **_group_name /* [out] [ref,charset(UTF16)] */)
6560 struct tevent_req *req;
6561 struct rpccli_EnumServicesStatusExA_state *state;
6562 struct tevent_req *subreq;
6564 req = tevent_req_create(mem_ctx, &state,
6565 struct rpccli_EnumServicesStatusExA_state);
6566 if (req == NULL) {
6567 return NULL;
6569 state->out_mem_ctx = NULL;
6570 state->dispatch_recv = cli->dispatch_recv;
6572 /* In parameters */
6573 state->orig.in.scmanager = _scmanager;
6574 state->orig.in.info_level = _info_level;
6575 state->orig.in.type = _type;
6576 state->orig.in.state = _state;
6577 state->orig.in.offered = _offered;
6578 state->orig.in.resume_handle = _resume_handle;
6580 /* Out parameters */
6581 state->orig.out.services = _services;
6582 state->orig.out.needed = _needed;
6583 state->orig.out.service_returned = _service_returned;
6584 state->orig.out.resume_handle = _resume_handle;
6585 state->orig.out.group_name = _group_name;
6587 /* Result */
6588 ZERO_STRUCT(state->orig.out.result);
6590 state->out_mem_ctx = talloc_named_const(state, 0,
6591 "rpccli_EnumServicesStatusExA_out_memory");
6592 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6593 return tevent_req_post(req, ev);
6596 /* make a temporary copy, that we pass to the dispatch function */
6597 state->tmp = state->orig;
6599 subreq = cli->dispatch_send(state, ev, cli,
6600 &ndr_table_svcctl,
6601 NDR_ENUMSERVICESSTATUSEXA,
6602 &state->tmp);
6603 if (tevent_req_nomem(subreq, req)) {
6604 return tevent_req_post(req, ev);
6606 tevent_req_set_callback(subreq, rpccli_EnumServicesStatusExA_done, req);
6607 return req;
6610 static void rpccli_EnumServicesStatusExA_done(struct tevent_req *subreq)
6612 struct tevent_req *req = tevent_req_callback_data(
6613 subreq, struct tevent_req);
6614 struct rpccli_EnumServicesStatusExA_state *state = tevent_req_data(
6615 req, struct rpccli_EnumServicesStatusExA_state);
6616 NTSTATUS status;
6617 TALLOC_CTX *mem_ctx;
6619 if (state->out_mem_ctx) {
6620 mem_ctx = state->out_mem_ctx;
6621 } else {
6622 mem_ctx = state;
6625 status = state->dispatch_recv(subreq, mem_ctx);
6626 TALLOC_FREE(subreq);
6627 if (!NT_STATUS_IS_OK(status)) {
6628 tevent_req_nterror(req, status);
6629 return;
6632 /* Copy out parameters */
6633 memcpy(state->orig.out.services, state->tmp.out.services, (state->tmp.in.offered) * sizeof(*state->orig.out.services));
6634 *state->orig.out.needed = *state->tmp.out.needed;
6635 *state->orig.out.service_returned = *state->tmp.out.service_returned;
6636 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
6637 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
6639 *state->orig.out.group_name = *state->tmp.out.group_name;
6641 /* Copy result */
6642 state->orig.out.result = state->tmp.out.result;
6644 /* Reset temporary structure */
6645 ZERO_STRUCT(state->tmp);
6647 tevent_req_done(req);
6650 NTSTATUS rpccli_EnumServicesStatusExA_recv(struct tevent_req *req,
6651 TALLOC_CTX *mem_ctx,
6652 WERROR *result)
6654 struct rpccli_EnumServicesStatusExA_state *state = tevent_req_data(
6655 req, struct rpccli_EnumServicesStatusExA_state);
6656 NTSTATUS status;
6658 if (tevent_req_is_nterror(req, &status)) {
6659 tevent_req_received(req);
6660 return status;
6663 /* Steal possbile out parameters to the callers context */
6664 talloc_steal(mem_ctx, state->out_mem_ctx);
6666 /* Return result */
6667 *result = state->orig.out.result;
6669 tevent_req_received(req);
6670 return NT_STATUS_OK;
6673 NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli,
6674 TALLOC_CTX *mem_ctx,
6675 struct policy_handle *scmanager /* [in] [ref] */,
6676 uint32_t info_level /* [in] */,
6677 uint32_t type /* [in] */,
6678 enum svcctl_ServiceState state /* [in] */,
6679 uint8_t *services /* [out] */,
6680 uint32_t offered /* [in] */,
6681 uint32_t *needed /* [out] [ref] */,
6682 uint32_t *service_returned /* [out] [ref] */,
6683 uint32_t *resume_handle /* [in,out] [unique] */,
6684 const char **group_name /* [out] [ref,charset(UTF16)] */,
6685 WERROR *werror)
6687 struct EnumServicesStatusExA r;
6688 NTSTATUS status;
6690 /* In parameters */
6691 r.in.scmanager = scmanager;
6692 r.in.info_level = info_level;
6693 r.in.type = type;
6694 r.in.state = state;
6695 r.in.offered = offered;
6696 r.in.resume_handle = resume_handle;
6698 status = cli->dispatch(cli,
6699 mem_ctx,
6700 &ndr_table_svcctl,
6701 NDR_ENUMSERVICESSTATUSEXA,
6702 &r);
6704 if (!NT_STATUS_IS_OK(status)) {
6705 return status;
6708 if (NT_STATUS_IS_ERR(status)) {
6709 return status;
6712 /* Return variables */
6713 memcpy(services, r.out.services, (r.in.offered) * sizeof(*services));
6714 *needed = *r.out.needed;
6715 *service_returned = *r.out.service_returned;
6716 if (resume_handle && r.out.resume_handle) {
6717 *resume_handle = *r.out.resume_handle;
6719 *group_name = *r.out.group_name;
6721 /* Return result */
6722 if (werror) {
6723 *werror = r.out.result;
6726 return werror_to_ntstatus(r.out.result);
6729 struct rpccli_EnumServicesStatusExW_state {
6730 struct EnumServicesStatusExW orig;
6731 struct EnumServicesStatusExW tmp;
6732 TALLOC_CTX *out_mem_ctx;
6733 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6736 static void rpccli_EnumServicesStatusExW_done(struct tevent_req *subreq);
6738 struct tevent_req *rpccli_EnumServicesStatusExW_send(TALLOC_CTX *mem_ctx,
6739 struct tevent_context *ev,
6740 struct rpc_pipe_client *cli,
6741 struct policy_handle *_scmanager /* [in] [ref] */,
6742 uint32_t _info_level /* [in] */,
6743 uint32_t _type /* [in] */,
6744 enum svcctl_ServiceState _state /* [in] */,
6745 uint8_t *_services /* [out] [ref,size_is(offered)] */,
6746 uint32_t _offered /* [in] [range(0,0x40000)] */,
6747 uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
6748 uint32_t *_service_returned /* [out] [ref,range(0,0x40000)] */,
6749 uint32_t *_resume_handle /* [in,out] [unique,range(0,0x40000)] */,
6750 const char *_group_name /* [in] [unique,charset(UTF16)] */)
6752 struct tevent_req *req;
6753 struct rpccli_EnumServicesStatusExW_state *state;
6754 struct tevent_req *subreq;
6756 req = tevent_req_create(mem_ctx, &state,
6757 struct rpccli_EnumServicesStatusExW_state);
6758 if (req == NULL) {
6759 return NULL;
6761 state->out_mem_ctx = NULL;
6762 state->dispatch_recv = cli->dispatch_recv;
6764 /* In parameters */
6765 state->orig.in.scmanager = _scmanager;
6766 state->orig.in.info_level = _info_level;
6767 state->orig.in.type = _type;
6768 state->orig.in.state = _state;
6769 state->orig.in.offered = _offered;
6770 state->orig.in.resume_handle = _resume_handle;
6771 state->orig.in.group_name = _group_name;
6773 /* Out parameters */
6774 state->orig.out.services = _services;
6775 state->orig.out.needed = _needed;
6776 state->orig.out.service_returned = _service_returned;
6777 state->orig.out.resume_handle = _resume_handle;
6779 /* Result */
6780 ZERO_STRUCT(state->orig.out.result);
6782 state->out_mem_ctx = talloc_named_const(state, 0,
6783 "rpccli_EnumServicesStatusExW_out_memory");
6784 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6785 return tevent_req_post(req, ev);
6788 /* make a temporary copy, that we pass to the dispatch function */
6789 state->tmp = state->orig;
6791 subreq = cli->dispatch_send(state, ev, cli,
6792 &ndr_table_svcctl,
6793 NDR_ENUMSERVICESSTATUSEXW,
6794 &state->tmp);
6795 if (tevent_req_nomem(subreq, req)) {
6796 return tevent_req_post(req, ev);
6798 tevent_req_set_callback(subreq, rpccli_EnumServicesStatusExW_done, req);
6799 return req;
6802 static void rpccli_EnumServicesStatusExW_done(struct tevent_req *subreq)
6804 struct tevent_req *req = tevent_req_callback_data(
6805 subreq, struct tevent_req);
6806 struct rpccli_EnumServicesStatusExW_state *state = tevent_req_data(
6807 req, struct rpccli_EnumServicesStatusExW_state);
6808 NTSTATUS status;
6809 TALLOC_CTX *mem_ctx;
6811 if (state->out_mem_ctx) {
6812 mem_ctx = state->out_mem_ctx;
6813 } else {
6814 mem_ctx = state;
6817 status = state->dispatch_recv(subreq, mem_ctx);
6818 TALLOC_FREE(subreq);
6819 if (!NT_STATUS_IS_OK(status)) {
6820 tevent_req_nterror(req, status);
6821 return;
6824 /* Copy out parameters */
6825 memcpy(state->orig.out.services, state->tmp.out.services, (state->tmp.in.offered) * sizeof(*state->orig.out.services));
6826 *state->orig.out.needed = *state->tmp.out.needed;
6827 *state->orig.out.service_returned = *state->tmp.out.service_returned;
6828 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
6829 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
6832 /* Copy result */
6833 state->orig.out.result = state->tmp.out.result;
6835 /* Reset temporary structure */
6836 ZERO_STRUCT(state->tmp);
6838 tevent_req_done(req);
6841 NTSTATUS rpccli_EnumServicesStatusExW_recv(struct tevent_req *req,
6842 TALLOC_CTX *mem_ctx,
6843 WERROR *result)
6845 struct rpccli_EnumServicesStatusExW_state *state = tevent_req_data(
6846 req, struct rpccli_EnumServicesStatusExW_state);
6847 NTSTATUS status;
6849 if (tevent_req_is_nterror(req, &status)) {
6850 tevent_req_received(req);
6851 return status;
6854 /* Steal possbile out parameters to the callers context */
6855 talloc_steal(mem_ctx, state->out_mem_ctx);
6857 /* Return result */
6858 *result = state->orig.out.result;
6860 tevent_req_received(req);
6861 return NT_STATUS_OK;
6864 NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli,
6865 TALLOC_CTX *mem_ctx,
6866 struct policy_handle *scmanager /* [in] [ref] */,
6867 uint32_t info_level /* [in] */,
6868 uint32_t type /* [in] */,
6869 enum svcctl_ServiceState state /* [in] */,
6870 uint8_t *services /* [out] [ref,size_is(offered)] */,
6871 uint32_t offered /* [in] [range(0,0x40000)] */,
6872 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
6873 uint32_t *service_returned /* [out] [ref,range(0,0x40000)] */,
6874 uint32_t *resume_handle /* [in,out] [unique,range(0,0x40000)] */,
6875 const char *group_name /* [in] [unique,charset(UTF16)] */,
6876 WERROR *werror)
6878 struct EnumServicesStatusExW r;
6879 NTSTATUS status;
6881 /* In parameters */
6882 r.in.scmanager = scmanager;
6883 r.in.info_level = info_level;
6884 r.in.type = type;
6885 r.in.state = state;
6886 r.in.offered = offered;
6887 r.in.resume_handle = resume_handle;
6888 r.in.group_name = group_name;
6890 status = cli->dispatch(cli,
6891 mem_ctx,
6892 &ndr_table_svcctl,
6893 NDR_ENUMSERVICESSTATUSEXW,
6894 &r);
6896 if (!NT_STATUS_IS_OK(status)) {
6897 return status;
6900 if (NT_STATUS_IS_ERR(status)) {
6901 return status;
6904 /* Return variables */
6905 memcpy(services, r.out.services, (r.in.offered) * sizeof(*services));
6906 *needed = *r.out.needed;
6907 *service_returned = *r.out.service_returned;
6908 if (resume_handle && r.out.resume_handle) {
6909 *resume_handle = *r.out.resume_handle;
6912 /* Return result */
6913 if (werror) {
6914 *werror = r.out.result;
6917 return werror_to_ntstatus(r.out.result);
6920 struct rpccli_svcctl_SCSendTSMessage_state {
6921 struct svcctl_SCSendTSMessage orig;
6922 struct svcctl_SCSendTSMessage tmp;
6923 TALLOC_CTX *out_mem_ctx;
6924 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6927 static void rpccli_svcctl_SCSendTSMessage_done(struct tevent_req *subreq);
6929 struct tevent_req *rpccli_svcctl_SCSendTSMessage_send(TALLOC_CTX *mem_ctx,
6930 struct tevent_context *ev,
6931 struct rpc_pipe_client *cli)
6933 struct tevent_req *req;
6934 struct rpccli_svcctl_SCSendTSMessage_state *state;
6935 struct tevent_req *subreq;
6937 req = tevent_req_create(mem_ctx, &state,
6938 struct rpccli_svcctl_SCSendTSMessage_state);
6939 if (req == NULL) {
6940 return NULL;
6942 state->out_mem_ctx = NULL;
6943 state->dispatch_recv = cli->dispatch_recv;
6945 /* In parameters */
6947 /* Out parameters */
6949 /* Result */
6950 ZERO_STRUCT(state->orig.out.result);
6952 /* make a temporary copy, that we pass to the dispatch function */
6953 state->tmp = state->orig;
6955 subreq = cli->dispatch_send(state, ev, cli,
6956 &ndr_table_svcctl,
6957 NDR_SVCCTL_SCSENDTSMESSAGE,
6958 &state->tmp);
6959 if (tevent_req_nomem(subreq, req)) {
6960 return tevent_req_post(req, ev);
6962 tevent_req_set_callback(subreq, rpccli_svcctl_SCSendTSMessage_done, req);
6963 return req;
6966 static void rpccli_svcctl_SCSendTSMessage_done(struct tevent_req *subreq)
6968 struct tevent_req *req = tevent_req_callback_data(
6969 subreq, struct tevent_req);
6970 struct rpccli_svcctl_SCSendTSMessage_state *state = tevent_req_data(
6971 req, struct rpccli_svcctl_SCSendTSMessage_state);
6972 NTSTATUS status;
6973 TALLOC_CTX *mem_ctx;
6975 if (state->out_mem_ctx) {
6976 mem_ctx = state->out_mem_ctx;
6977 } else {
6978 mem_ctx = state;
6981 status = state->dispatch_recv(subreq, mem_ctx);
6982 TALLOC_FREE(subreq);
6983 if (!NT_STATUS_IS_OK(status)) {
6984 tevent_req_nterror(req, status);
6985 return;
6988 /* Copy out parameters */
6990 /* Copy result */
6991 state->orig.out.result = state->tmp.out.result;
6993 /* Reset temporary structure */
6994 ZERO_STRUCT(state->tmp);
6996 tevent_req_done(req);
6999 NTSTATUS rpccli_svcctl_SCSendTSMessage_recv(struct tevent_req *req,
7000 TALLOC_CTX *mem_ctx,
7001 WERROR *result)
7003 struct rpccli_svcctl_SCSendTSMessage_state *state = tevent_req_data(
7004 req, struct rpccli_svcctl_SCSendTSMessage_state);
7005 NTSTATUS status;
7007 if (tevent_req_is_nterror(req, &status)) {
7008 tevent_req_received(req);
7009 return status;
7012 /* Steal possbile out parameters to the callers context */
7013 talloc_steal(mem_ctx, state->out_mem_ctx);
7015 /* Return result */
7016 *result = state->orig.out.result;
7018 tevent_req_received(req);
7019 return NT_STATUS_OK;
7022 NTSTATUS rpccli_svcctl_SCSendTSMessage(struct rpc_pipe_client *cli,
7023 TALLOC_CTX *mem_ctx,
7024 WERROR *werror)
7026 struct svcctl_SCSendTSMessage r;
7027 NTSTATUS status;
7029 /* In parameters */
7031 status = cli->dispatch(cli,
7032 mem_ctx,
7033 &ndr_table_svcctl,
7034 NDR_SVCCTL_SCSENDTSMESSAGE,
7035 &r);
7037 if (!NT_STATUS_IS_OK(status)) {
7038 return status;
7041 if (NT_STATUS_IS_ERR(status)) {
7042 return status;
7045 /* Return variables */
7047 /* Return result */
7048 if (werror) {
7049 *werror = r.out.result;
7052 return werror_to_ntstatus(r.out.result);