idl: recompile our IDL
[Samba/aatanasov.git] / librpc / gen_ndr / cli_svcctl.c
blob1f814736d9aa397c61fa16b857e9c539ce41bfc5
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 if (DEBUGLEVEL >= 10) {
45 NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, &state->orig);
48 state->out_mem_ctx = talloc_named_const(state, 0,
49 "rpccli_svcctl_CloseServiceHandle_out_memory");
50 if (tevent_req_nomem(state->out_mem_ctx, req)) {
51 return tevent_req_post(req, ev);
54 /* make a temporary copy, that we pass to the dispatch function */
55 state->tmp = state->orig;
57 subreq = cli->dispatch_send(state, ev, cli,
58 &ndr_table_svcctl,
59 NDR_SVCCTL_CLOSESERVICEHANDLE,
60 &state->tmp);
61 if (tevent_req_nomem(subreq, req)) {
62 return tevent_req_post(req, ev);
64 tevent_req_set_callback(subreq, rpccli_svcctl_CloseServiceHandle_done, req);
65 return req;
68 static void rpccli_svcctl_CloseServiceHandle_done(struct tevent_req *subreq)
70 struct tevent_req *req = tevent_req_callback_data(
71 subreq, struct tevent_req);
72 struct rpccli_svcctl_CloseServiceHandle_state *state = tevent_req_data(
73 req, struct rpccli_svcctl_CloseServiceHandle_state);
74 NTSTATUS status;
75 TALLOC_CTX *mem_ctx;
77 if (state->out_mem_ctx) {
78 mem_ctx = state->out_mem_ctx;
79 } else {
80 mem_ctx = state;
83 status = state->dispatch_recv(subreq, mem_ctx);
84 TALLOC_FREE(subreq);
85 if (!NT_STATUS_IS_OK(status)) {
86 tevent_req_nterror(req, status);
87 return;
90 /* Copy out parameters */
91 *state->orig.out.handle = *state->tmp.out.handle;
93 /* Copy result */
94 state->orig.out.result = state->tmp.out.result;
96 /* Reset temporary structure */
97 ZERO_STRUCT(state->tmp);
99 if (DEBUGLEVEL >= 10) {
100 NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, &state->orig);
103 tevent_req_done(req);
106 NTSTATUS rpccli_svcctl_CloseServiceHandle_recv(struct tevent_req *req,
107 TALLOC_CTX *mem_ctx,
108 WERROR *result)
110 struct rpccli_svcctl_CloseServiceHandle_state *state = tevent_req_data(
111 req, struct rpccli_svcctl_CloseServiceHandle_state);
112 NTSTATUS status;
114 if (tevent_req_is_nterror(req, &status)) {
115 tevent_req_received(req);
116 return status;
119 /* Steal possbile out parameters to the callers context */
120 talloc_steal(mem_ctx, state->out_mem_ctx);
122 /* Return result */
123 *result = state->orig.out.result;
125 tevent_req_received(req);
126 return NT_STATUS_OK;
129 NTSTATUS rpccli_svcctl_CloseServiceHandle(struct rpc_pipe_client *cli,
130 TALLOC_CTX *mem_ctx,
131 struct policy_handle *handle /* [in,out] [ref] */,
132 WERROR *werror)
134 struct svcctl_CloseServiceHandle r;
135 NTSTATUS status;
137 /* In parameters */
138 r.in.handle = handle;
140 if (DEBUGLEVEL >= 10) {
141 NDR_PRINT_IN_DEBUG(svcctl_CloseServiceHandle, &r);
144 status = cli->dispatch(cli,
145 mem_ctx,
146 &ndr_table_svcctl,
147 NDR_SVCCTL_CLOSESERVICEHANDLE,
148 &r);
150 if (!NT_STATUS_IS_OK(status)) {
151 return status;
154 if (DEBUGLEVEL >= 10) {
155 NDR_PRINT_OUT_DEBUG(svcctl_CloseServiceHandle, &r);
158 if (NT_STATUS_IS_ERR(status)) {
159 return status;
162 /* Return variables */
163 *handle = *r.out.handle;
165 /* Return result */
166 if (werror) {
167 *werror = r.out.result;
170 return werror_to_ntstatus(r.out.result);
173 struct rpccli_svcctl_ControlService_state {
174 struct svcctl_ControlService orig;
175 struct svcctl_ControlService tmp;
176 TALLOC_CTX *out_mem_ctx;
177 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
180 static void rpccli_svcctl_ControlService_done(struct tevent_req *subreq);
182 struct tevent_req *rpccli_svcctl_ControlService_send(TALLOC_CTX *mem_ctx,
183 struct tevent_context *ev,
184 struct rpc_pipe_client *cli,
185 struct policy_handle *_handle /* [in] [ref] */,
186 enum SERVICE_CONTROL _control /* [in] */,
187 struct SERVICE_STATUS *_service_status /* [out] [ref] */)
189 struct tevent_req *req;
190 struct rpccli_svcctl_ControlService_state *state;
191 struct tevent_req *subreq;
193 req = tevent_req_create(mem_ctx, &state,
194 struct rpccli_svcctl_ControlService_state);
195 if (req == NULL) {
196 return NULL;
198 state->out_mem_ctx = NULL;
199 state->dispatch_recv = cli->dispatch_recv;
201 /* In parameters */
202 state->orig.in.handle = _handle;
203 state->orig.in.control = _control;
205 /* Out parameters */
206 state->orig.out.service_status = _service_status;
208 /* Result */
209 ZERO_STRUCT(state->orig.out.result);
211 if (DEBUGLEVEL >= 10) {
212 NDR_PRINT_IN_DEBUG(svcctl_ControlService, &state->orig);
215 state->out_mem_ctx = talloc_named_const(state, 0,
216 "rpccli_svcctl_ControlService_out_memory");
217 if (tevent_req_nomem(state->out_mem_ctx, req)) {
218 return tevent_req_post(req, ev);
221 /* make a temporary copy, that we pass to the dispatch function */
222 state->tmp = state->orig;
224 subreq = cli->dispatch_send(state, ev, cli,
225 &ndr_table_svcctl,
226 NDR_SVCCTL_CONTROLSERVICE,
227 &state->tmp);
228 if (tevent_req_nomem(subreq, req)) {
229 return tevent_req_post(req, ev);
231 tevent_req_set_callback(subreq, rpccli_svcctl_ControlService_done, req);
232 return req;
235 static void rpccli_svcctl_ControlService_done(struct tevent_req *subreq)
237 struct tevent_req *req = tevent_req_callback_data(
238 subreq, struct tevent_req);
239 struct rpccli_svcctl_ControlService_state *state = tevent_req_data(
240 req, struct rpccli_svcctl_ControlService_state);
241 NTSTATUS status;
242 TALLOC_CTX *mem_ctx;
244 if (state->out_mem_ctx) {
245 mem_ctx = state->out_mem_ctx;
246 } else {
247 mem_ctx = state;
250 status = state->dispatch_recv(subreq, mem_ctx);
251 TALLOC_FREE(subreq);
252 if (!NT_STATUS_IS_OK(status)) {
253 tevent_req_nterror(req, status);
254 return;
257 /* Copy out parameters */
258 *state->orig.out.service_status = *state->tmp.out.service_status;
260 /* Copy result */
261 state->orig.out.result = state->tmp.out.result;
263 /* Reset temporary structure */
264 ZERO_STRUCT(state->tmp);
266 if (DEBUGLEVEL >= 10) {
267 NDR_PRINT_OUT_DEBUG(svcctl_ControlService, &state->orig);
270 tevent_req_done(req);
273 NTSTATUS rpccli_svcctl_ControlService_recv(struct tevent_req *req,
274 TALLOC_CTX *mem_ctx,
275 WERROR *result)
277 struct rpccli_svcctl_ControlService_state *state = tevent_req_data(
278 req, struct rpccli_svcctl_ControlService_state);
279 NTSTATUS status;
281 if (tevent_req_is_nterror(req, &status)) {
282 tevent_req_received(req);
283 return status;
286 /* Steal possbile out parameters to the callers context */
287 talloc_steal(mem_ctx, state->out_mem_ctx);
289 /* Return result */
290 *result = state->orig.out.result;
292 tevent_req_received(req);
293 return NT_STATUS_OK;
296 NTSTATUS rpccli_svcctl_ControlService(struct rpc_pipe_client *cli,
297 TALLOC_CTX *mem_ctx,
298 struct policy_handle *handle /* [in] [ref] */,
299 enum SERVICE_CONTROL control /* [in] */,
300 struct SERVICE_STATUS *service_status /* [out] [ref] */,
301 WERROR *werror)
303 struct svcctl_ControlService r;
304 NTSTATUS status;
306 /* In parameters */
307 r.in.handle = handle;
308 r.in.control = control;
310 if (DEBUGLEVEL >= 10) {
311 NDR_PRINT_IN_DEBUG(svcctl_ControlService, &r);
314 status = cli->dispatch(cli,
315 mem_ctx,
316 &ndr_table_svcctl,
317 NDR_SVCCTL_CONTROLSERVICE,
318 &r);
320 if (!NT_STATUS_IS_OK(status)) {
321 return status;
324 if (DEBUGLEVEL >= 10) {
325 NDR_PRINT_OUT_DEBUG(svcctl_ControlService, &r);
328 if (NT_STATUS_IS_ERR(status)) {
329 return status;
332 /* Return variables */
333 *service_status = *r.out.service_status;
335 /* Return result */
336 if (werror) {
337 *werror = r.out.result;
340 return werror_to_ntstatus(r.out.result);
343 struct rpccli_svcctl_DeleteService_state {
344 struct svcctl_DeleteService orig;
345 struct svcctl_DeleteService tmp;
346 TALLOC_CTX *out_mem_ctx;
347 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
350 static void rpccli_svcctl_DeleteService_done(struct tevent_req *subreq);
352 struct tevent_req *rpccli_svcctl_DeleteService_send(TALLOC_CTX *mem_ctx,
353 struct tevent_context *ev,
354 struct rpc_pipe_client *cli,
355 struct policy_handle *_handle /* [in] [ref] */)
357 struct tevent_req *req;
358 struct rpccli_svcctl_DeleteService_state *state;
359 struct tevent_req *subreq;
361 req = tevent_req_create(mem_ctx, &state,
362 struct rpccli_svcctl_DeleteService_state);
363 if (req == NULL) {
364 return NULL;
366 state->out_mem_ctx = NULL;
367 state->dispatch_recv = cli->dispatch_recv;
369 /* In parameters */
370 state->orig.in.handle = _handle;
372 /* Out parameters */
374 /* Result */
375 ZERO_STRUCT(state->orig.out.result);
377 if (DEBUGLEVEL >= 10) {
378 NDR_PRINT_IN_DEBUG(svcctl_DeleteService, &state->orig);
381 /* make a temporary copy, that we pass to the dispatch function */
382 state->tmp = state->orig;
384 subreq = cli->dispatch_send(state, ev, cli,
385 &ndr_table_svcctl,
386 NDR_SVCCTL_DELETESERVICE,
387 &state->tmp);
388 if (tevent_req_nomem(subreq, req)) {
389 return tevent_req_post(req, ev);
391 tevent_req_set_callback(subreq, rpccli_svcctl_DeleteService_done, req);
392 return req;
395 static void rpccli_svcctl_DeleteService_done(struct tevent_req *subreq)
397 struct tevent_req *req = tevent_req_callback_data(
398 subreq, struct tevent_req);
399 struct rpccli_svcctl_DeleteService_state *state = tevent_req_data(
400 req, struct rpccli_svcctl_DeleteService_state);
401 NTSTATUS status;
402 TALLOC_CTX *mem_ctx;
404 if (state->out_mem_ctx) {
405 mem_ctx = state->out_mem_ctx;
406 } else {
407 mem_ctx = state;
410 status = state->dispatch_recv(subreq, mem_ctx);
411 TALLOC_FREE(subreq);
412 if (!NT_STATUS_IS_OK(status)) {
413 tevent_req_nterror(req, status);
414 return;
417 /* Copy out parameters */
419 /* Copy result */
420 state->orig.out.result = state->tmp.out.result;
422 /* Reset temporary structure */
423 ZERO_STRUCT(state->tmp);
425 if (DEBUGLEVEL >= 10) {
426 NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, &state->orig);
429 tevent_req_done(req);
432 NTSTATUS rpccli_svcctl_DeleteService_recv(struct tevent_req *req,
433 TALLOC_CTX *mem_ctx,
434 WERROR *result)
436 struct rpccli_svcctl_DeleteService_state *state = tevent_req_data(
437 req, struct rpccli_svcctl_DeleteService_state);
438 NTSTATUS status;
440 if (tevent_req_is_nterror(req, &status)) {
441 tevent_req_received(req);
442 return status;
445 /* Steal possbile out parameters to the callers context */
446 talloc_steal(mem_ctx, state->out_mem_ctx);
448 /* Return result */
449 *result = state->orig.out.result;
451 tevent_req_received(req);
452 return NT_STATUS_OK;
455 NTSTATUS rpccli_svcctl_DeleteService(struct rpc_pipe_client *cli,
456 TALLOC_CTX *mem_ctx,
457 struct policy_handle *handle /* [in] [ref] */,
458 WERROR *werror)
460 struct svcctl_DeleteService r;
461 NTSTATUS status;
463 /* In parameters */
464 r.in.handle = handle;
466 if (DEBUGLEVEL >= 10) {
467 NDR_PRINT_IN_DEBUG(svcctl_DeleteService, &r);
470 status = cli->dispatch(cli,
471 mem_ctx,
472 &ndr_table_svcctl,
473 NDR_SVCCTL_DELETESERVICE,
474 &r);
476 if (!NT_STATUS_IS_OK(status)) {
477 return status;
480 if (DEBUGLEVEL >= 10) {
481 NDR_PRINT_OUT_DEBUG(svcctl_DeleteService, &r);
484 if (NT_STATUS_IS_ERR(status)) {
485 return status;
488 /* Return variables */
490 /* Return result */
491 if (werror) {
492 *werror = r.out.result;
495 return werror_to_ntstatus(r.out.result);
498 struct rpccli_svcctl_LockServiceDatabase_state {
499 struct svcctl_LockServiceDatabase orig;
500 struct svcctl_LockServiceDatabase tmp;
501 TALLOC_CTX *out_mem_ctx;
502 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
505 static void rpccli_svcctl_LockServiceDatabase_done(struct tevent_req *subreq);
507 struct tevent_req *rpccli_svcctl_LockServiceDatabase_send(TALLOC_CTX *mem_ctx,
508 struct tevent_context *ev,
509 struct rpc_pipe_client *cli,
510 struct policy_handle *_handle /* [in] [ref] */,
511 struct policy_handle *_lock /* [out] [ref] */)
513 struct tevent_req *req;
514 struct rpccli_svcctl_LockServiceDatabase_state *state;
515 struct tevent_req *subreq;
517 req = tevent_req_create(mem_ctx, &state,
518 struct rpccli_svcctl_LockServiceDatabase_state);
519 if (req == NULL) {
520 return NULL;
522 state->out_mem_ctx = NULL;
523 state->dispatch_recv = cli->dispatch_recv;
525 /* In parameters */
526 state->orig.in.handle = _handle;
528 /* Out parameters */
529 state->orig.out.lock = _lock;
531 /* Result */
532 ZERO_STRUCT(state->orig.out.result);
534 if (DEBUGLEVEL >= 10) {
535 NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, &state->orig);
538 state->out_mem_ctx = talloc_named_const(state, 0,
539 "rpccli_svcctl_LockServiceDatabase_out_memory");
540 if (tevent_req_nomem(state->out_mem_ctx, req)) {
541 return tevent_req_post(req, ev);
544 /* make a temporary copy, that we pass to the dispatch function */
545 state->tmp = state->orig;
547 subreq = cli->dispatch_send(state, ev, cli,
548 &ndr_table_svcctl,
549 NDR_SVCCTL_LOCKSERVICEDATABASE,
550 &state->tmp);
551 if (tevent_req_nomem(subreq, req)) {
552 return tevent_req_post(req, ev);
554 tevent_req_set_callback(subreq, rpccli_svcctl_LockServiceDatabase_done, req);
555 return req;
558 static void rpccli_svcctl_LockServiceDatabase_done(struct tevent_req *subreq)
560 struct tevent_req *req = tevent_req_callback_data(
561 subreq, struct tevent_req);
562 struct rpccli_svcctl_LockServiceDatabase_state *state = tevent_req_data(
563 req, struct rpccli_svcctl_LockServiceDatabase_state);
564 NTSTATUS status;
565 TALLOC_CTX *mem_ctx;
567 if (state->out_mem_ctx) {
568 mem_ctx = state->out_mem_ctx;
569 } else {
570 mem_ctx = state;
573 status = state->dispatch_recv(subreq, mem_ctx);
574 TALLOC_FREE(subreq);
575 if (!NT_STATUS_IS_OK(status)) {
576 tevent_req_nterror(req, status);
577 return;
580 /* Copy out parameters */
581 *state->orig.out.lock = *state->tmp.out.lock;
583 /* Copy result */
584 state->orig.out.result = state->tmp.out.result;
586 /* Reset temporary structure */
587 ZERO_STRUCT(state->tmp);
589 if (DEBUGLEVEL >= 10) {
590 NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, &state->orig);
593 tevent_req_done(req);
596 NTSTATUS rpccli_svcctl_LockServiceDatabase_recv(struct tevent_req *req,
597 TALLOC_CTX *mem_ctx,
598 WERROR *result)
600 struct rpccli_svcctl_LockServiceDatabase_state *state = tevent_req_data(
601 req, struct rpccli_svcctl_LockServiceDatabase_state);
602 NTSTATUS status;
604 if (tevent_req_is_nterror(req, &status)) {
605 tevent_req_received(req);
606 return status;
609 /* Steal possbile out parameters to the callers context */
610 talloc_steal(mem_ctx, state->out_mem_ctx);
612 /* Return result */
613 *result = state->orig.out.result;
615 tevent_req_received(req);
616 return NT_STATUS_OK;
619 NTSTATUS rpccli_svcctl_LockServiceDatabase(struct rpc_pipe_client *cli,
620 TALLOC_CTX *mem_ctx,
621 struct policy_handle *handle /* [in] [ref] */,
622 struct policy_handle *lock /* [out] [ref] */,
623 WERROR *werror)
625 struct svcctl_LockServiceDatabase r;
626 NTSTATUS status;
628 /* In parameters */
629 r.in.handle = handle;
631 if (DEBUGLEVEL >= 10) {
632 NDR_PRINT_IN_DEBUG(svcctl_LockServiceDatabase, &r);
635 status = cli->dispatch(cli,
636 mem_ctx,
637 &ndr_table_svcctl,
638 NDR_SVCCTL_LOCKSERVICEDATABASE,
639 &r);
641 if (!NT_STATUS_IS_OK(status)) {
642 return status;
645 if (DEBUGLEVEL >= 10) {
646 NDR_PRINT_OUT_DEBUG(svcctl_LockServiceDatabase, &r);
649 if (NT_STATUS_IS_ERR(status)) {
650 return status;
653 /* Return variables */
654 *lock = *r.out.lock;
656 /* Return result */
657 if (werror) {
658 *werror = r.out.result;
661 return werror_to_ntstatus(r.out.result);
664 struct rpccli_svcctl_QueryServiceObjectSecurity_state {
665 struct svcctl_QueryServiceObjectSecurity orig;
666 struct svcctl_QueryServiceObjectSecurity tmp;
667 TALLOC_CTX *out_mem_ctx;
668 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
671 static void rpccli_svcctl_QueryServiceObjectSecurity_done(struct tevent_req *subreq);
673 struct tevent_req *rpccli_svcctl_QueryServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
674 struct tevent_context *ev,
675 struct rpc_pipe_client *cli,
676 struct policy_handle *_handle /* [in] [ref] */,
677 uint32_t _security_flags /* [in] */,
678 uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
679 uint32_t _offered /* [in] [range(0,0x40000)] */,
680 uint32_t *_needed /* [out] [ref,range(0,0x40000)] */)
682 struct tevent_req *req;
683 struct rpccli_svcctl_QueryServiceObjectSecurity_state *state;
684 struct tevent_req *subreq;
686 req = tevent_req_create(mem_ctx, &state,
687 struct rpccli_svcctl_QueryServiceObjectSecurity_state);
688 if (req == NULL) {
689 return NULL;
691 state->out_mem_ctx = NULL;
692 state->dispatch_recv = cli->dispatch_recv;
694 /* In parameters */
695 state->orig.in.handle = _handle;
696 state->orig.in.security_flags = _security_flags;
697 state->orig.in.offered = _offered;
699 /* Out parameters */
700 state->orig.out.buffer = _buffer;
701 state->orig.out.needed = _needed;
703 /* Result */
704 ZERO_STRUCT(state->orig.out.result);
706 if (DEBUGLEVEL >= 10) {
707 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, &state->orig);
710 state->out_mem_ctx = talloc_named_const(state, 0,
711 "rpccli_svcctl_QueryServiceObjectSecurity_out_memory");
712 if (tevent_req_nomem(state->out_mem_ctx, req)) {
713 return tevent_req_post(req, ev);
716 /* make a temporary copy, that we pass to the dispatch function */
717 state->tmp = state->orig;
719 subreq = cli->dispatch_send(state, ev, cli,
720 &ndr_table_svcctl,
721 NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY,
722 &state->tmp);
723 if (tevent_req_nomem(subreq, req)) {
724 return tevent_req_post(req, ev);
726 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceObjectSecurity_done, req);
727 return req;
730 static void rpccli_svcctl_QueryServiceObjectSecurity_done(struct tevent_req *subreq)
732 struct tevent_req *req = tevent_req_callback_data(
733 subreq, struct tevent_req);
734 struct rpccli_svcctl_QueryServiceObjectSecurity_state *state = tevent_req_data(
735 req, struct rpccli_svcctl_QueryServiceObjectSecurity_state);
736 NTSTATUS status;
737 TALLOC_CTX *mem_ctx;
739 if (state->out_mem_ctx) {
740 mem_ctx = state->out_mem_ctx;
741 } else {
742 mem_ctx = state;
745 status = state->dispatch_recv(subreq, mem_ctx);
746 TALLOC_FREE(subreq);
747 if (!NT_STATUS_IS_OK(status)) {
748 tevent_req_nterror(req, status);
749 return;
752 /* Copy out parameters */
753 memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
754 *state->orig.out.needed = *state->tmp.out.needed;
756 /* Copy result */
757 state->orig.out.result = state->tmp.out.result;
759 /* Reset temporary structure */
760 ZERO_STRUCT(state->tmp);
762 if (DEBUGLEVEL >= 10) {
763 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, &state->orig);
766 tevent_req_done(req);
769 NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity_recv(struct tevent_req *req,
770 TALLOC_CTX *mem_ctx,
771 WERROR *result)
773 struct rpccli_svcctl_QueryServiceObjectSecurity_state *state = tevent_req_data(
774 req, struct rpccli_svcctl_QueryServiceObjectSecurity_state);
775 NTSTATUS status;
777 if (tevent_req_is_nterror(req, &status)) {
778 tevent_req_received(req);
779 return status;
782 /* Steal possbile out parameters to the callers context */
783 talloc_steal(mem_ctx, state->out_mem_ctx);
785 /* Return result */
786 *result = state->orig.out.result;
788 tevent_req_received(req);
789 return NT_STATUS_OK;
792 NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
793 TALLOC_CTX *mem_ctx,
794 struct policy_handle *handle /* [in] [ref] */,
795 uint32_t security_flags /* [in] */,
796 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
797 uint32_t offered /* [in] [range(0,0x40000)] */,
798 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
799 WERROR *werror)
801 struct svcctl_QueryServiceObjectSecurity r;
802 NTSTATUS status;
804 /* In parameters */
805 r.in.handle = handle;
806 r.in.security_flags = security_flags;
807 r.in.offered = offered;
809 if (DEBUGLEVEL >= 10) {
810 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, &r);
813 status = cli->dispatch(cli,
814 mem_ctx,
815 &ndr_table_svcctl,
816 NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY,
817 &r);
819 if (!NT_STATUS_IS_OK(status)) {
820 return status;
823 if (DEBUGLEVEL >= 10) {
824 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceObjectSecurity, &r);
827 if (NT_STATUS_IS_ERR(status)) {
828 return status;
831 /* Return variables */
832 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
833 *needed = *r.out.needed;
835 /* Return result */
836 if (werror) {
837 *werror = r.out.result;
840 return werror_to_ntstatus(r.out.result);
843 struct rpccli_svcctl_SetServiceObjectSecurity_state {
844 struct svcctl_SetServiceObjectSecurity orig;
845 struct svcctl_SetServiceObjectSecurity tmp;
846 TALLOC_CTX *out_mem_ctx;
847 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
850 static void rpccli_svcctl_SetServiceObjectSecurity_done(struct tevent_req *subreq);
852 struct tevent_req *rpccli_svcctl_SetServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
853 struct tevent_context *ev,
854 struct rpc_pipe_client *cli,
855 struct policy_handle *_handle /* [in] [ref] */,
856 uint32_t _security_flags /* [in] */,
857 uint8_t *_buffer /* [in] [ref,size_is(offered)] */,
858 uint32_t _offered /* [in] */)
860 struct tevent_req *req;
861 struct rpccli_svcctl_SetServiceObjectSecurity_state *state;
862 struct tevent_req *subreq;
864 req = tevent_req_create(mem_ctx, &state,
865 struct rpccli_svcctl_SetServiceObjectSecurity_state);
866 if (req == NULL) {
867 return NULL;
869 state->out_mem_ctx = NULL;
870 state->dispatch_recv = cli->dispatch_recv;
872 /* In parameters */
873 state->orig.in.handle = _handle;
874 state->orig.in.security_flags = _security_flags;
875 state->orig.in.buffer = _buffer;
876 state->orig.in.offered = _offered;
878 /* Out parameters */
880 /* Result */
881 ZERO_STRUCT(state->orig.out.result);
883 if (DEBUGLEVEL >= 10) {
884 NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &state->orig);
887 /* make a temporary copy, that we pass to the dispatch function */
888 state->tmp = state->orig;
890 subreq = cli->dispatch_send(state, ev, cli,
891 &ndr_table_svcctl,
892 NDR_SVCCTL_SETSERVICEOBJECTSECURITY,
893 &state->tmp);
894 if (tevent_req_nomem(subreq, req)) {
895 return tevent_req_post(req, ev);
897 tevent_req_set_callback(subreq, rpccli_svcctl_SetServiceObjectSecurity_done, req);
898 return req;
901 static void rpccli_svcctl_SetServiceObjectSecurity_done(struct tevent_req *subreq)
903 struct tevent_req *req = tevent_req_callback_data(
904 subreq, struct tevent_req);
905 struct rpccli_svcctl_SetServiceObjectSecurity_state *state = tevent_req_data(
906 req, struct rpccli_svcctl_SetServiceObjectSecurity_state);
907 NTSTATUS status;
908 TALLOC_CTX *mem_ctx;
910 if (state->out_mem_ctx) {
911 mem_ctx = state->out_mem_ctx;
912 } else {
913 mem_ctx = state;
916 status = state->dispatch_recv(subreq, mem_ctx);
917 TALLOC_FREE(subreq);
918 if (!NT_STATUS_IS_OK(status)) {
919 tevent_req_nterror(req, status);
920 return;
923 /* Copy out parameters */
925 /* Copy result */
926 state->orig.out.result = state->tmp.out.result;
928 /* Reset temporary structure */
929 ZERO_STRUCT(state->tmp);
931 if (DEBUGLEVEL >= 10) {
932 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &state->orig);
935 tevent_req_done(req);
938 NTSTATUS rpccli_svcctl_SetServiceObjectSecurity_recv(struct tevent_req *req,
939 TALLOC_CTX *mem_ctx,
940 WERROR *result)
942 struct rpccli_svcctl_SetServiceObjectSecurity_state *state = tevent_req_data(
943 req, struct rpccli_svcctl_SetServiceObjectSecurity_state);
944 NTSTATUS status;
946 if (tevent_req_is_nterror(req, &status)) {
947 tevent_req_received(req);
948 return status;
951 /* Steal possbile out parameters to the callers context */
952 talloc_steal(mem_ctx, state->out_mem_ctx);
954 /* Return result */
955 *result = state->orig.out.result;
957 tevent_req_received(req);
958 return NT_STATUS_OK;
961 NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
962 TALLOC_CTX *mem_ctx,
963 struct policy_handle *handle /* [in] [ref] */,
964 uint32_t security_flags /* [in] */,
965 uint8_t *buffer /* [in] [ref,size_is(offered)] */,
966 uint32_t offered /* [in] */,
967 WERROR *werror)
969 struct svcctl_SetServiceObjectSecurity r;
970 NTSTATUS status;
972 /* In parameters */
973 r.in.handle = handle;
974 r.in.security_flags = security_flags;
975 r.in.buffer = buffer;
976 r.in.offered = offered;
978 if (DEBUGLEVEL >= 10) {
979 NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &r);
982 status = cli->dispatch(cli,
983 mem_ctx,
984 &ndr_table_svcctl,
985 NDR_SVCCTL_SETSERVICEOBJECTSECURITY,
986 &r);
988 if (!NT_STATUS_IS_OK(status)) {
989 return status;
992 if (DEBUGLEVEL >= 10) {
993 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceObjectSecurity, &r);
996 if (NT_STATUS_IS_ERR(status)) {
997 return status;
1000 /* Return variables */
1002 /* Return result */
1003 if (werror) {
1004 *werror = r.out.result;
1007 return werror_to_ntstatus(r.out.result);
1010 struct rpccli_svcctl_QueryServiceStatus_state {
1011 struct svcctl_QueryServiceStatus orig;
1012 struct svcctl_QueryServiceStatus tmp;
1013 TALLOC_CTX *out_mem_ctx;
1014 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1017 static void rpccli_svcctl_QueryServiceStatus_done(struct tevent_req *subreq);
1019 struct tevent_req *rpccli_svcctl_QueryServiceStatus_send(TALLOC_CTX *mem_ctx,
1020 struct tevent_context *ev,
1021 struct rpc_pipe_client *cli,
1022 struct policy_handle *_handle /* [in] [ref] */,
1023 struct SERVICE_STATUS *_service_status /* [out] [ref] */)
1025 struct tevent_req *req;
1026 struct rpccli_svcctl_QueryServiceStatus_state *state;
1027 struct tevent_req *subreq;
1029 req = tevent_req_create(mem_ctx, &state,
1030 struct rpccli_svcctl_QueryServiceStatus_state);
1031 if (req == NULL) {
1032 return NULL;
1034 state->out_mem_ctx = NULL;
1035 state->dispatch_recv = cli->dispatch_recv;
1037 /* In parameters */
1038 state->orig.in.handle = _handle;
1040 /* Out parameters */
1041 state->orig.out.service_status = _service_status;
1043 /* Result */
1044 ZERO_STRUCT(state->orig.out.result);
1046 if (DEBUGLEVEL >= 10) {
1047 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, &state->orig);
1050 state->out_mem_ctx = talloc_named_const(state, 0,
1051 "rpccli_svcctl_QueryServiceStatus_out_memory");
1052 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1053 return tevent_req_post(req, ev);
1056 /* make a temporary copy, that we pass to the dispatch function */
1057 state->tmp = state->orig;
1059 subreq = cli->dispatch_send(state, ev, cli,
1060 &ndr_table_svcctl,
1061 NDR_SVCCTL_QUERYSERVICESTATUS,
1062 &state->tmp);
1063 if (tevent_req_nomem(subreq, req)) {
1064 return tevent_req_post(req, ev);
1066 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceStatus_done, req);
1067 return req;
1070 static void rpccli_svcctl_QueryServiceStatus_done(struct tevent_req *subreq)
1072 struct tevent_req *req = tevent_req_callback_data(
1073 subreq, struct tevent_req);
1074 struct rpccli_svcctl_QueryServiceStatus_state *state = tevent_req_data(
1075 req, struct rpccli_svcctl_QueryServiceStatus_state);
1076 NTSTATUS status;
1077 TALLOC_CTX *mem_ctx;
1079 if (state->out_mem_ctx) {
1080 mem_ctx = state->out_mem_ctx;
1081 } else {
1082 mem_ctx = state;
1085 status = state->dispatch_recv(subreq, mem_ctx);
1086 TALLOC_FREE(subreq);
1087 if (!NT_STATUS_IS_OK(status)) {
1088 tevent_req_nterror(req, status);
1089 return;
1092 /* Copy out parameters */
1093 *state->orig.out.service_status = *state->tmp.out.service_status;
1095 /* Copy result */
1096 state->orig.out.result = state->tmp.out.result;
1098 /* Reset temporary structure */
1099 ZERO_STRUCT(state->tmp);
1101 if (DEBUGLEVEL >= 10) {
1102 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, &state->orig);
1105 tevent_req_done(req);
1108 NTSTATUS rpccli_svcctl_QueryServiceStatus_recv(struct tevent_req *req,
1109 TALLOC_CTX *mem_ctx,
1110 WERROR *result)
1112 struct rpccli_svcctl_QueryServiceStatus_state *state = tevent_req_data(
1113 req, struct rpccli_svcctl_QueryServiceStatus_state);
1114 NTSTATUS status;
1116 if (tevent_req_is_nterror(req, &status)) {
1117 tevent_req_received(req);
1118 return status;
1121 /* Steal possbile out parameters to the callers context */
1122 talloc_steal(mem_ctx, state->out_mem_ctx);
1124 /* Return result */
1125 *result = state->orig.out.result;
1127 tevent_req_received(req);
1128 return NT_STATUS_OK;
1131 NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli,
1132 TALLOC_CTX *mem_ctx,
1133 struct policy_handle *handle /* [in] [ref] */,
1134 struct SERVICE_STATUS *service_status /* [out] [ref] */,
1135 WERROR *werror)
1137 struct svcctl_QueryServiceStatus r;
1138 NTSTATUS status;
1140 /* In parameters */
1141 r.in.handle = handle;
1143 if (DEBUGLEVEL >= 10) {
1144 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatus, &r);
1147 status = cli->dispatch(cli,
1148 mem_ctx,
1149 &ndr_table_svcctl,
1150 NDR_SVCCTL_QUERYSERVICESTATUS,
1151 &r);
1153 if (!NT_STATUS_IS_OK(status)) {
1154 return status;
1157 if (DEBUGLEVEL >= 10) {
1158 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatus, &r);
1161 if (NT_STATUS_IS_ERR(status)) {
1162 return status;
1165 /* Return variables */
1166 *service_status = *r.out.service_status;
1168 /* Return result */
1169 if (werror) {
1170 *werror = r.out.result;
1173 return werror_to_ntstatus(r.out.result);
1176 struct rpccli_svcctl_SetServiceStatus_state {
1177 struct svcctl_SetServiceStatus orig;
1178 struct svcctl_SetServiceStatus tmp;
1179 TALLOC_CTX *out_mem_ctx;
1180 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1183 static void rpccli_svcctl_SetServiceStatus_done(struct tevent_req *subreq);
1185 struct tevent_req *rpccli_svcctl_SetServiceStatus_send(TALLOC_CTX *mem_ctx,
1186 struct tevent_context *ev,
1187 struct rpc_pipe_client *cli)
1189 struct tevent_req *req;
1190 struct rpccli_svcctl_SetServiceStatus_state *state;
1191 struct tevent_req *subreq;
1193 req = tevent_req_create(mem_ctx, &state,
1194 struct rpccli_svcctl_SetServiceStatus_state);
1195 if (req == NULL) {
1196 return NULL;
1198 state->out_mem_ctx = NULL;
1199 state->dispatch_recv = cli->dispatch_recv;
1201 /* In parameters */
1203 /* Out parameters */
1205 /* Result */
1206 ZERO_STRUCT(state->orig.out.result);
1208 if (DEBUGLEVEL >= 10) {
1209 NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, &state->orig);
1212 /* make a temporary copy, that we pass to the dispatch function */
1213 state->tmp = state->orig;
1215 subreq = cli->dispatch_send(state, ev, cli,
1216 &ndr_table_svcctl,
1217 NDR_SVCCTL_SETSERVICESTATUS,
1218 &state->tmp);
1219 if (tevent_req_nomem(subreq, req)) {
1220 return tevent_req_post(req, ev);
1222 tevent_req_set_callback(subreq, rpccli_svcctl_SetServiceStatus_done, req);
1223 return req;
1226 static void rpccli_svcctl_SetServiceStatus_done(struct tevent_req *subreq)
1228 struct tevent_req *req = tevent_req_callback_data(
1229 subreq, struct tevent_req);
1230 struct rpccli_svcctl_SetServiceStatus_state *state = tevent_req_data(
1231 req, struct rpccli_svcctl_SetServiceStatus_state);
1232 NTSTATUS status;
1233 TALLOC_CTX *mem_ctx;
1235 if (state->out_mem_ctx) {
1236 mem_ctx = state->out_mem_ctx;
1237 } else {
1238 mem_ctx = state;
1241 status = state->dispatch_recv(subreq, mem_ctx);
1242 TALLOC_FREE(subreq);
1243 if (!NT_STATUS_IS_OK(status)) {
1244 tevent_req_nterror(req, status);
1245 return;
1248 /* Copy out parameters */
1250 /* Copy result */
1251 state->orig.out.result = state->tmp.out.result;
1253 /* Reset temporary structure */
1254 ZERO_STRUCT(state->tmp);
1256 if (DEBUGLEVEL >= 10) {
1257 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, &state->orig);
1260 tevent_req_done(req);
1263 NTSTATUS rpccli_svcctl_SetServiceStatus_recv(struct tevent_req *req,
1264 TALLOC_CTX *mem_ctx,
1265 WERROR *result)
1267 struct rpccli_svcctl_SetServiceStatus_state *state = tevent_req_data(
1268 req, struct rpccli_svcctl_SetServiceStatus_state);
1269 NTSTATUS status;
1271 if (tevent_req_is_nterror(req, &status)) {
1272 tevent_req_received(req);
1273 return status;
1276 /* Steal possbile out parameters to the callers context */
1277 talloc_steal(mem_ctx, state->out_mem_ctx);
1279 /* Return result */
1280 *result = state->orig.out.result;
1282 tevent_req_received(req);
1283 return NT_STATUS_OK;
1286 NTSTATUS rpccli_svcctl_SetServiceStatus(struct rpc_pipe_client *cli,
1287 TALLOC_CTX *mem_ctx,
1288 WERROR *werror)
1290 struct svcctl_SetServiceStatus r;
1291 NTSTATUS status;
1293 /* In parameters */
1295 if (DEBUGLEVEL >= 10) {
1296 NDR_PRINT_IN_DEBUG(svcctl_SetServiceStatus, &r);
1299 status = cli->dispatch(cli,
1300 mem_ctx,
1301 &ndr_table_svcctl,
1302 NDR_SVCCTL_SETSERVICESTATUS,
1303 &r);
1305 if (!NT_STATUS_IS_OK(status)) {
1306 return status;
1309 if (DEBUGLEVEL >= 10) {
1310 NDR_PRINT_OUT_DEBUG(svcctl_SetServiceStatus, &r);
1313 if (NT_STATUS_IS_ERR(status)) {
1314 return status;
1317 /* Return variables */
1319 /* Return result */
1320 if (werror) {
1321 *werror = r.out.result;
1324 return werror_to_ntstatus(r.out.result);
1327 struct rpccli_svcctl_UnlockServiceDatabase_state {
1328 struct svcctl_UnlockServiceDatabase orig;
1329 struct svcctl_UnlockServiceDatabase tmp;
1330 TALLOC_CTX *out_mem_ctx;
1331 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1334 static void rpccli_svcctl_UnlockServiceDatabase_done(struct tevent_req *subreq);
1336 struct tevent_req *rpccli_svcctl_UnlockServiceDatabase_send(TALLOC_CTX *mem_ctx,
1337 struct tevent_context *ev,
1338 struct rpc_pipe_client *cli,
1339 struct policy_handle *_lock /* [in,out] [ref] */)
1341 struct tevent_req *req;
1342 struct rpccli_svcctl_UnlockServiceDatabase_state *state;
1343 struct tevent_req *subreq;
1345 req = tevent_req_create(mem_ctx, &state,
1346 struct rpccli_svcctl_UnlockServiceDatabase_state);
1347 if (req == NULL) {
1348 return NULL;
1350 state->out_mem_ctx = NULL;
1351 state->dispatch_recv = cli->dispatch_recv;
1353 /* In parameters */
1354 state->orig.in.lock = _lock;
1356 /* Out parameters */
1357 state->orig.out.lock = _lock;
1359 /* Result */
1360 ZERO_STRUCT(state->orig.out.result);
1362 if (DEBUGLEVEL >= 10) {
1363 NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, &state->orig);
1366 state->out_mem_ctx = talloc_named_const(state, 0,
1367 "rpccli_svcctl_UnlockServiceDatabase_out_memory");
1368 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1369 return tevent_req_post(req, ev);
1372 /* make a temporary copy, that we pass to the dispatch function */
1373 state->tmp = state->orig;
1375 subreq = cli->dispatch_send(state, ev, cli,
1376 &ndr_table_svcctl,
1377 NDR_SVCCTL_UNLOCKSERVICEDATABASE,
1378 &state->tmp);
1379 if (tevent_req_nomem(subreq, req)) {
1380 return tevent_req_post(req, ev);
1382 tevent_req_set_callback(subreq, rpccli_svcctl_UnlockServiceDatabase_done, req);
1383 return req;
1386 static void rpccli_svcctl_UnlockServiceDatabase_done(struct tevent_req *subreq)
1388 struct tevent_req *req = tevent_req_callback_data(
1389 subreq, struct tevent_req);
1390 struct rpccli_svcctl_UnlockServiceDatabase_state *state = tevent_req_data(
1391 req, struct rpccli_svcctl_UnlockServiceDatabase_state);
1392 NTSTATUS status;
1393 TALLOC_CTX *mem_ctx;
1395 if (state->out_mem_ctx) {
1396 mem_ctx = state->out_mem_ctx;
1397 } else {
1398 mem_ctx = state;
1401 status = state->dispatch_recv(subreq, mem_ctx);
1402 TALLOC_FREE(subreq);
1403 if (!NT_STATUS_IS_OK(status)) {
1404 tevent_req_nterror(req, status);
1405 return;
1408 /* Copy out parameters */
1409 *state->orig.out.lock = *state->tmp.out.lock;
1411 /* Copy result */
1412 state->orig.out.result = state->tmp.out.result;
1414 /* Reset temporary structure */
1415 ZERO_STRUCT(state->tmp);
1417 if (DEBUGLEVEL >= 10) {
1418 NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, &state->orig);
1421 tevent_req_done(req);
1424 NTSTATUS rpccli_svcctl_UnlockServiceDatabase_recv(struct tevent_req *req,
1425 TALLOC_CTX *mem_ctx,
1426 WERROR *result)
1428 struct rpccli_svcctl_UnlockServiceDatabase_state *state = tevent_req_data(
1429 req, struct rpccli_svcctl_UnlockServiceDatabase_state);
1430 NTSTATUS status;
1432 if (tevent_req_is_nterror(req, &status)) {
1433 tevent_req_received(req);
1434 return status;
1437 /* Steal possbile out parameters to the callers context */
1438 talloc_steal(mem_ctx, state->out_mem_ctx);
1440 /* Return result */
1441 *result = state->orig.out.result;
1443 tevent_req_received(req);
1444 return NT_STATUS_OK;
1447 NTSTATUS rpccli_svcctl_UnlockServiceDatabase(struct rpc_pipe_client *cli,
1448 TALLOC_CTX *mem_ctx,
1449 struct policy_handle *lock /* [in,out] [ref] */,
1450 WERROR *werror)
1452 struct svcctl_UnlockServiceDatabase r;
1453 NTSTATUS status;
1455 /* In parameters */
1456 r.in.lock = lock;
1458 if (DEBUGLEVEL >= 10) {
1459 NDR_PRINT_IN_DEBUG(svcctl_UnlockServiceDatabase, &r);
1462 status = cli->dispatch(cli,
1463 mem_ctx,
1464 &ndr_table_svcctl,
1465 NDR_SVCCTL_UNLOCKSERVICEDATABASE,
1466 &r);
1468 if (!NT_STATUS_IS_OK(status)) {
1469 return status;
1472 if (DEBUGLEVEL >= 10) {
1473 NDR_PRINT_OUT_DEBUG(svcctl_UnlockServiceDatabase, &r);
1476 if (NT_STATUS_IS_ERR(status)) {
1477 return status;
1480 /* Return variables */
1481 *lock = *r.out.lock;
1483 /* Return result */
1484 if (werror) {
1485 *werror = r.out.result;
1488 return werror_to_ntstatus(r.out.result);
1491 struct rpccli_svcctl_NotifyBootConfigStatus_state {
1492 struct svcctl_NotifyBootConfigStatus orig;
1493 struct svcctl_NotifyBootConfigStatus tmp;
1494 TALLOC_CTX *out_mem_ctx;
1495 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1498 static void rpccli_svcctl_NotifyBootConfigStatus_done(struct tevent_req *subreq);
1500 struct tevent_req *rpccli_svcctl_NotifyBootConfigStatus_send(TALLOC_CTX *mem_ctx,
1501 struct tevent_context *ev,
1502 struct rpc_pipe_client *cli)
1504 struct tevent_req *req;
1505 struct rpccli_svcctl_NotifyBootConfigStatus_state *state;
1506 struct tevent_req *subreq;
1508 req = tevent_req_create(mem_ctx, &state,
1509 struct rpccli_svcctl_NotifyBootConfigStatus_state);
1510 if (req == NULL) {
1511 return NULL;
1513 state->out_mem_ctx = NULL;
1514 state->dispatch_recv = cli->dispatch_recv;
1516 /* In parameters */
1518 /* Out parameters */
1520 /* Result */
1521 ZERO_STRUCT(state->orig.out.result);
1523 if (DEBUGLEVEL >= 10) {
1524 NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, &state->orig);
1527 /* make a temporary copy, that we pass to the dispatch function */
1528 state->tmp = state->orig;
1530 subreq = cli->dispatch_send(state, ev, cli,
1531 &ndr_table_svcctl,
1532 NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS,
1533 &state->tmp);
1534 if (tevent_req_nomem(subreq, req)) {
1535 return tevent_req_post(req, ev);
1537 tevent_req_set_callback(subreq, rpccli_svcctl_NotifyBootConfigStatus_done, req);
1538 return req;
1541 static void rpccli_svcctl_NotifyBootConfigStatus_done(struct tevent_req *subreq)
1543 struct tevent_req *req = tevent_req_callback_data(
1544 subreq, struct tevent_req);
1545 struct rpccli_svcctl_NotifyBootConfigStatus_state *state = tevent_req_data(
1546 req, struct rpccli_svcctl_NotifyBootConfigStatus_state);
1547 NTSTATUS status;
1548 TALLOC_CTX *mem_ctx;
1550 if (state->out_mem_ctx) {
1551 mem_ctx = state->out_mem_ctx;
1552 } else {
1553 mem_ctx = state;
1556 status = state->dispatch_recv(subreq, mem_ctx);
1557 TALLOC_FREE(subreq);
1558 if (!NT_STATUS_IS_OK(status)) {
1559 tevent_req_nterror(req, status);
1560 return;
1563 /* Copy out parameters */
1565 /* Copy result */
1566 state->orig.out.result = state->tmp.out.result;
1568 /* Reset temporary structure */
1569 ZERO_STRUCT(state->tmp);
1571 if (DEBUGLEVEL >= 10) {
1572 NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, &state->orig);
1575 tevent_req_done(req);
1578 NTSTATUS rpccli_svcctl_NotifyBootConfigStatus_recv(struct tevent_req *req,
1579 TALLOC_CTX *mem_ctx,
1580 WERROR *result)
1582 struct rpccli_svcctl_NotifyBootConfigStatus_state *state = tevent_req_data(
1583 req, struct rpccli_svcctl_NotifyBootConfigStatus_state);
1584 NTSTATUS status;
1586 if (tevent_req_is_nterror(req, &status)) {
1587 tevent_req_received(req);
1588 return status;
1591 /* Steal possbile out parameters to the callers context */
1592 talloc_steal(mem_ctx, state->out_mem_ctx);
1594 /* Return result */
1595 *result = state->orig.out.result;
1597 tevent_req_received(req);
1598 return NT_STATUS_OK;
1601 NTSTATUS rpccli_svcctl_NotifyBootConfigStatus(struct rpc_pipe_client *cli,
1602 TALLOC_CTX *mem_ctx,
1603 WERROR *werror)
1605 struct svcctl_NotifyBootConfigStatus r;
1606 NTSTATUS status;
1608 /* In parameters */
1610 if (DEBUGLEVEL >= 10) {
1611 NDR_PRINT_IN_DEBUG(svcctl_NotifyBootConfigStatus, &r);
1614 status = cli->dispatch(cli,
1615 mem_ctx,
1616 &ndr_table_svcctl,
1617 NDR_SVCCTL_NOTIFYBOOTCONFIGSTATUS,
1618 &r);
1620 if (!NT_STATUS_IS_OK(status)) {
1621 return status;
1624 if (DEBUGLEVEL >= 10) {
1625 NDR_PRINT_OUT_DEBUG(svcctl_NotifyBootConfigStatus, &r);
1628 if (NT_STATUS_IS_ERR(status)) {
1629 return status;
1632 /* Return variables */
1634 /* Return result */
1635 if (werror) {
1636 *werror = r.out.result;
1639 return werror_to_ntstatus(r.out.result);
1642 struct rpccli_svcctl_SCSetServiceBitsW_state {
1643 struct svcctl_SCSetServiceBitsW orig;
1644 struct svcctl_SCSetServiceBitsW tmp;
1645 TALLOC_CTX *out_mem_ctx;
1646 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1649 static void rpccli_svcctl_SCSetServiceBitsW_done(struct tevent_req *subreq);
1651 struct tevent_req *rpccli_svcctl_SCSetServiceBitsW_send(TALLOC_CTX *mem_ctx,
1652 struct tevent_context *ev,
1653 struct rpc_pipe_client *cli,
1654 struct policy_handle *_handle /* [in] [ref] */,
1655 uint32_t _bits /* [in] */,
1656 uint32_t _bitson /* [in] */,
1657 uint32_t _immediate /* [in] */)
1659 struct tevent_req *req;
1660 struct rpccli_svcctl_SCSetServiceBitsW_state *state;
1661 struct tevent_req *subreq;
1663 req = tevent_req_create(mem_ctx, &state,
1664 struct rpccli_svcctl_SCSetServiceBitsW_state);
1665 if (req == NULL) {
1666 return NULL;
1668 state->out_mem_ctx = NULL;
1669 state->dispatch_recv = cli->dispatch_recv;
1671 /* In parameters */
1672 state->orig.in.handle = _handle;
1673 state->orig.in.bits = _bits;
1674 state->orig.in.bitson = _bitson;
1675 state->orig.in.immediate = _immediate;
1677 /* Out parameters */
1679 /* Result */
1680 ZERO_STRUCT(state->orig.out.result);
1682 if (DEBUGLEVEL >= 10) {
1683 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, &state->orig);
1686 /* make a temporary copy, that we pass to the dispatch function */
1687 state->tmp = state->orig;
1689 subreq = cli->dispatch_send(state, ev, cli,
1690 &ndr_table_svcctl,
1691 NDR_SVCCTL_SCSETSERVICEBITSW,
1692 &state->tmp);
1693 if (tevent_req_nomem(subreq, req)) {
1694 return tevent_req_post(req, ev);
1696 tevent_req_set_callback(subreq, rpccli_svcctl_SCSetServiceBitsW_done, req);
1697 return req;
1700 static void rpccli_svcctl_SCSetServiceBitsW_done(struct tevent_req *subreq)
1702 struct tevent_req *req = tevent_req_callback_data(
1703 subreq, struct tevent_req);
1704 struct rpccli_svcctl_SCSetServiceBitsW_state *state = tevent_req_data(
1705 req, struct rpccli_svcctl_SCSetServiceBitsW_state);
1706 NTSTATUS status;
1707 TALLOC_CTX *mem_ctx;
1709 if (state->out_mem_ctx) {
1710 mem_ctx = state->out_mem_ctx;
1711 } else {
1712 mem_ctx = state;
1715 status = state->dispatch_recv(subreq, mem_ctx);
1716 TALLOC_FREE(subreq);
1717 if (!NT_STATUS_IS_OK(status)) {
1718 tevent_req_nterror(req, status);
1719 return;
1722 /* Copy out parameters */
1724 /* Copy result */
1725 state->orig.out.result = state->tmp.out.result;
1727 /* Reset temporary structure */
1728 ZERO_STRUCT(state->tmp);
1730 if (DEBUGLEVEL >= 10) {
1731 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, &state->orig);
1734 tevent_req_done(req);
1737 NTSTATUS rpccli_svcctl_SCSetServiceBitsW_recv(struct tevent_req *req,
1738 TALLOC_CTX *mem_ctx,
1739 WERROR *result)
1741 struct rpccli_svcctl_SCSetServiceBitsW_state *state = tevent_req_data(
1742 req, struct rpccli_svcctl_SCSetServiceBitsW_state);
1743 NTSTATUS status;
1745 if (tevent_req_is_nterror(req, &status)) {
1746 tevent_req_received(req);
1747 return status;
1750 /* Steal possbile out parameters to the callers context */
1751 talloc_steal(mem_ctx, state->out_mem_ctx);
1753 /* Return result */
1754 *result = state->orig.out.result;
1756 tevent_req_received(req);
1757 return NT_STATUS_OK;
1760 NTSTATUS rpccli_svcctl_SCSetServiceBitsW(struct rpc_pipe_client *cli,
1761 TALLOC_CTX *mem_ctx,
1762 struct policy_handle *handle /* [in] [ref] */,
1763 uint32_t bits /* [in] */,
1764 uint32_t bitson /* [in] */,
1765 uint32_t immediate /* [in] */,
1766 WERROR *werror)
1768 struct svcctl_SCSetServiceBitsW r;
1769 NTSTATUS status;
1771 /* In parameters */
1772 r.in.handle = handle;
1773 r.in.bits = bits;
1774 r.in.bitson = bitson;
1775 r.in.immediate = immediate;
1777 if (DEBUGLEVEL >= 10) {
1778 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsW, &r);
1781 status = cli->dispatch(cli,
1782 mem_ctx,
1783 &ndr_table_svcctl,
1784 NDR_SVCCTL_SCSETSERVICEBITSW,
1785 &r);
1787 if (!NT_STATUS_IS_OK(status)) {
1788 return status;
1791 if (DEBUGLEVEL >= 10) {
1792 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsW, &r);
1795 if (NT_STATUS_IS_ERR(status)) {
1796 return status;
1799 /* Return variables */
1801 /* Return result */
1802 if (werror) {
1803 *werror = r.out.result;
1806 return werror_to_ntstatus(r.out.result);
1809 struct rpccli_svcctl_ChangeServiceConfigW_state {
1810 struct svcctl_ChangeServiceConfigW orig;
1811 struct svcctl_ChangeServiceConfigW tmp;
1812 TALLOC_CTX *out_mem_ctx;
1813 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1816 static void rpccli_svcctl_ChangeServiceConfigW_done(struct tevent_req *subreq);
1818 struct tevent_req *rpccli_svcctl_ChangeServiceConfigW_send(TALLOC_CTX *mem_ctx,
1819 struct tevent_context *ev,
1820 struct rpc_pipe_client *cli,
1821 struct policy_handle *_handle /* [in] [ref] */,
1822 uint32_t _type /* [in] */,
1823 enum svcctl_StartType _start_type /* [in] */,
1824 enum svcctl_ErrorControl _error_control /* [in] */,
1825 const char *_binary_path /* [in] [unique,charset(UTF16)] */,
1826 const char *_load_order_group /* [in] [unique,charset(UTF16)] */,
1827 uint32_t *_tag_id /* [out] [ref] */,
1828 const char *_dependencies /* [in] [unique,charset(UTF16)] */,
1829 const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
1830 const char *_password /* [in] [unique,charset(UTF16)] */,
1831 const char *_display_name /* [in] [unique,charset(UTF16)] */)
1833 struct tevent_req *req;
1834 struct rpccli_svcctl_ChangeServiceConfigW_state *state;
1835 struct tevent_req *subreq;
1837 req = tevent_req_create(mem_ctx, &state,
1838 struct rpccli_svcctl_ChangeServiceConfigW_state);
1839 if (req == NULL) {
1840 return NULL;
1842 state->out_mem_ctx = NULL;
1843 state->dispatch_recv = cli->dispatch_recv;
1845 /* In parameters */
1846 state->orig.in.handle = _handle;
1847 state->orig.in.type = _type;
1848 state->orig.in.start_type = _start_type;
1849 state->orig.in.error_control = _error_control;
1850 state->orig.in.binary_path = _binary_path;
1851 state->orig.in.load_order_group = _load_order_group;
1852 state->orig.in.dependencies = _dependencies;
1853 state->orig.in.service_start_name = _service_start_name;
1854 state->orig.in.password = _password;
1855 state->orig.in.display_name = _display_name;
1857 /* Out parameters */
1858 state->orig.out.tag_id = _tag_id;
1860 /* Result */
1861 ZERO_STRUCT(state->orig.out.result);
1863 if (DEBUGLEVEL >= 10) {
1864 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, &state->orig);
1867 state->out_mem_ctx = talloc_named_const(state, 0,
1868 "rpccli_svcctl_ChangeServiceConfigW_out_memory");
1869 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1870 return tevent_req_post(req, ev);
1873 /* make a temporary copy, that we pass to the dispatch function */
1874 state->tmp = state->orig;
1876 subreq = cli->dispatch_send(state, ev, cli,
1877 &ndr_table_svcctl,
1878 NDR_SVCCTL_CHANGESERVICECONFIGW,
1879 &state->tmp);
1880 if (tevent_req_nomem(subreq, req)) {
1881 return tevent_req_post(req, ev);
1883 tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfigW_done, req);
1884 return req;
1887 static void rpccli_svcctl_ChangeServiceConfigW_done(struct tevent_req *subreq)
1889 struct tevent_req *req = tevent_req_callback_data(
1890 subreq, struct tevent_req);
1891 struct rpccli_svcctl_ChangeServiceConfigW_state *state = tevent_req_data(
1892 req, struct rpccli_svcctl_ChangeServiceConfigW_state);
1893 NTSTATUS status;
1894 TALLOC_CTX *mem_ctx;
1896 if (state->out_mem_ctx) {
1897 mem_ctx = state->out_mem_ctx;
1898 } else {
1899 mem_ctx = state;
1902 status = state->dispatch_recv(subreq, mem_ctx);
1903 TALLOC_FREE(subreq);
1904 if (!NT_STATUS_IS_OK(status)) {
1905 tevent_req_nterror(req, status);
1906 return;
1909 /* Copy out parameters */
1910 *state->orig.out.tag_id = *state->tmp.out.tag_id;
1912 /* Copy result */
1913 state->orig.out.result = state->tmp.out.result;
1915 /* Reset temporary structure */
1916 ZERO_STRUCT(state->tmp);
1918 if (DEBUGLEVEL >= 10) {
1919 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, &state->orig);
1922 tevent_req_done(req);
1925 NTSTATUS rpccli_svcctl_ChangeServiceConfigW_recv(struct tevent_req *req,
1926 TALLOC_CTX *mem_ctx,
1927 WERROR *result)
1929 struct rpccli_svcctl_ChangeServiceConfigW_state *state = tevent_req_data(
1930 req, struct rpccli_svcctl_ChangeServiceConfigW_state);
1931 NTSTATUS status;
1933 if (tevent_req_is_nterror(req, &status)) {
1934 tevent_req_received(req);
1935 return status;
1938 /* Steal possbile out parameters to the callers context */
1939 talloc_steal(mem_ctx, state->out_mem_ctx);
1941 /* Return result */
1942 *result = state->orig.out.result;
1944 tevent_req_received(req);
1945 return NT_STATUS_OK;
1948 NTSTATUS rpccli_svcctl_ChangeServiceConfigW(struct rpc_pipe_client *cli,
1949 TALLOC_CTX *mem_ctx,
1950 struct policy_handle *handle /* [in] [ref] */,
1951 uint32_t type /* [in] */,
1952 enum svcctl_StartType start_type /* [in] */,
1953 enum svcctl_ErrorControl error_control /* [in] */,
1954 const char *binary_path /* [in] [unique,charset(UTF16)] */,
1955 const char *load_order_group /* [in] [unique,charset(UTF16)] */,
1956 uint32_t *tag_id /* [out] [ref] */,
1957 const char *dependencies /* [in] [unique,charset(UTF16)] */,
1958 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
1959 const char *password /* [in] [unique,charset(UTF16)] */,
1960 const char *display_name /* [in] [unique,charset(UTF16)] */,
1961 WERROR *werror)
1963 struct svcctl_ChangeServiceConfigW r;
1964 NTSTATUS status;
1966 /* In parameters */
1967 r.in.handle = handle;
1968 r.in.type = type;
1969 r.in.start_type = start_type;
1970 r.in.error_control = error_control;
1971 r.in.binary_path = binary_path;
1972 r.in.load_order_group = load_order_group;
1973 r.in.dependencies = dependencies;
1974 r.in.service_start_name = service_start_name;
1975 r.in.password = password;
1976 r.in.display_name = display_name;
1978 if (DEBUGLEVEL >= 10) {
1979 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigW, &r);
1982 status = cli->dispatch(cli,
1983 mem_ctx,
1984 &ndr_table_svcctl,
1985 NDR_SVCCTL_CHANGESERVICECONFIGW,
1986 &r);
1988 if (!NT_STATUS_IS_OK(status)) {
1989 return status;
1992 if (DEBUGLEVEL >= 10) {
1993 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigW, &r);
1996 if (NT_STATUS_IS_ERR(status)) {
1997 return status;
2000 /* Return variables */
2001 *tag_id = *r.out.tag_id;
2003 /* Return result */
2004 if (werror) {
2005 *werror = r.out.result;
2008 return werror_to_ntstatus(r.out.result);
2011 struct rpccli_svcctl_CreateServiceW_state {
2012 struct svcctl_CreateServiceW orig;
2013 struct svcctl_CreateServiceW tmp;
2014 TALLOC_CTX *out_mem_ctx;
2015 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2018 static void rpccli_svcctl_CreateServiceW_done(struct tevent_req *subreq);
2020 struct tevent_req *rpccli_svcctl_CreateServiceW_send(TALLOC_CTX *mem_ctx,
2021 struct tevent_context *ev,
2022 struct rpc_pipe_client *cli,
2023 struct policy_handle *_scmanager_handle /* [in] [ref] */,
2024 const char *_ServiceName /* [in] [charset(UTF16)] */,
2025 const char *_DisplayName /* [in] [unique,charset(UTF16)] */,
2026 uint32_t _desired_access /* [in] */,
2027 uint32_t _type /* [in] */,
2028 enum svcctl_StartType _start_type /* [in] */,
2029 enum svcctl_ErrorControl _error_control /* [in] */,
2030 const char *_binary_path /* [in] [charset(UTF16)] */,
2031 const char *_LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
2032 uint32_t *_TagId /* [in,out] [unique] */,
2033 uint8_t *_dependencies /* [in] [unique,size_is(dependencies_size)] */,
2034 uint32_t _dependencies_size /* [in] */,
2035 const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
2036 uint8_t *_password /* [in] [unique,size_is(password_size)] */,
2037 uint32_t _password_size /* [in] */,
2038 struct policy_handle *_handle /* [out] [ref] */)
2040 struct tevent_req *req;
2041 struct rpccli_svcctl_CreateServiceW_state *state;
2042 struct tevent_req *subreq;
2044 req = tevent_req_create(mem_ctx, &state,
2045 struct rpccli_svcctl_CreateServiceW_state);
2046 if (req == NULL) {
2047 return NULL;
2049 state->out_mem_ctx = NULL;
2050 state->dispatch_recv = cli->dispatch_recv;
2052 /* In parameters */
2053 state->orig.in.scmanager_handle = _scmanager_handle;
2054 state->orig.in.ServiceName = _ServiceName;
2055 state->orig.in.DisplayName = _DisplayName;
2056 state->orig.in.desired_access = _desired_access;
2057 state->orig.in.type = _type;
2058 state->orig.in.start_type = _start_type;
2059 state->orig.in.error_control = _error_control;
2060 state->orig.in.binary_path = _binary_path;
2061 state->orig.in.LoadOrderGroupKey = _LoadOrderGroupKey;
2062 state->orig.in.TagId = _TagId;
2063 state->orig.in.dependencies = _dependencies;
2064 state->orig.in.dependencies_size = _dependencies_size;
2065 state->orig.in.service_start_name = _service_start_name;
2066 state->orig.in.password = _password;
2067 state->orig.in.password_size = _password_size;
2069 /* Out parameters */
2070 state->orig.out.TagId = _TagId;
2071 state->orig.out.handle = _handle;
2073 /* Result */
2074 ZERO_STRUCT(state->orig.out.result);
2076 if (DEBUGLEVEL >= 10) {
2077 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, &state->orig);
2080 state->out_mem_ctx = talloc_named_const(state, 0,
2081 "rpccli_svcctl_CreateServiceW_out_memory");
2082 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2083 return tevent_req_post(req, ev);
2086 /* make a temporary copy, that we pass to the dispatch function */
2087 state->tmp = state->orig;
2089 subreq = cli->dispatch_send(state, ev, cli,
2090 &ndr_table_svcctl,
2091 NDR_SVCCTL_CREATESERVICEW,
2092 &state->tmp);
2093 if (tevent_req_nomem(subreq, req)) {
2094 return tevent_req_post(req, ev);
2096 tevent_req_set_callback(subreq, rpccli_svcctl_CreateServiceW_done, req);
2097 return req;
2100 static void rpccli_svcctl_CreateServiceW_done(struct tevent_req *subreq)
2102 struct tevent_req *req = tevent_req_callback_data(
2103 subreq, struct tevent_req);
2104 struct rpccli_svcctl_CreateServiceW_state *state = tevent_req_data(
2105 req, struct rpccli_svcctl_CreateServiceW_state);
2106 NTSTATUS status;
2107 TALLOC_CTX *mem_ctx;
2109 if (state->out_mem_ctx) {
2110 mem_ctx = state->out_mem_ctx;
2111 } else {
2112 mem_ctx = state;
2115 status = state->dispatch_recv(subreq, mem_ctx);
2116 TALLOC_FREE(subreq);
2117 if (!NT_STATUS_IS_OK(status)) {
2118 tevent_req_nterror(req, status);
2119 return;
2122 /* Copy out parameters */
2123 if (state->orig.out.TagId && state->tmp.out.TagId) {
2124 *state->orig.out.TagId = *state->tmp.out.TagId;
2126 *state->orig.out.handle = *state->tmp.out.handle;
2128 /* Copy result */
2129 state->orig.out.result = state->tmp.out.result;
2131 /* Reset temporary structure */
2132 ZERO_STRUCT(state->tmp);
2134 if (DEBUGLEVEL >= 10) {
2135 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, &state->orig);
2138 tevent_req_done(req);
2141 NTSTATUS rpccli_svcctl_CreateServiceW_recv(struct tevent_req *req,
2142 TALLOC_CTX *mem_ctx,
2143 WERROR *result)
2145 struct rpccli_svcctl_CreateServiceW_state *state = tevent_req_data(
2146 req, struct rpccli_svcctl_CreateServiceW_state);
2147 NTSTATUS status;
2149 if (tevent_req_is_nterror(req, &status)) {
2150 tevent_req_received(req);
2151 return status;
2154 /* Steal possbile out parameters to the callers context */
2155 talloc_steal(mem_ctx, state->out_mem_ctx);
2157 /* Return result */
2158 *result = state->orig.out.result;
2160 tevent_req_received(req);
2161 return NT_STATUS_OK;
2164 NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli,
2165 TALLOC_CTX *mem_ctx,
2166 struct policy_handle *scmanager_handle /* [in] [ref] */,
2167 const char *ServiceName /* [in] [charset(UTF16)] */,
2168 const char *DisplayName /* [in] [unique,charset(UTF16)] */,
2169 uint32_t desired_access /* [in] */,
2170 uint32_t type /* [in] */,
2171 enum svcctl_StartType start_type /* [in] */,
2172 enum svcctl_ErrorControl error_control /* [in] */,
2173 const char *binary_path /* [in] [charset(UTF16)] */,
2174 const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
2175 uint32_t *TagId /* [in,out] [unique] */,
2176 uint8_t *dependencies /* [in] [unique,size_is(dependencies_size)] */,
2177 uint32_t dependencies_size /* [in] */,
2178 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
2179 uint8_t *password /* [in] [unique,size_is(password_size)] */,
2180 uint32_t password_size /* [in] */,
2181 struct policy_handle *handle /* [out] [ref] */,
2182 WERROR *werror)
2184 struct svcctl_CreateServiceW r;
2185 NTSTATUS status;
2187 /* In parameters */
2188 r.in.scmanager_handle = scmanager_handle;
2189 r.in.ServiceName = ServiceName;
2190 r.in.DisplayName = DisplayName;
2191 r.in.desired_access = desired_access;
2192 r.in.type = type;
2193 r.in.start_type = start_type;
2194 r.in.error_control = error_control;
2195 r.in.binary_path = binary_path;
2196 r.in.LoadOrderGroupKey = LoadOrderGroupKey;
2197 r.in.TagId = TagId;
2198 r.in.dependencies = dependencies;
2199 r.in.dependencies_size = dependencies_size;
2200 r.in.service_start_name = service_start_name;
2201 r.in.password = password;
2202 r.in.password_size = password_size;
2204 if (DEBUGLEVEL >= 10) {
2205 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceW, &r);
2208 status = cli->dispatch(cli,
2209 mem_ctx,
2210 &ndr_table_svcctl,
2211 NDR_SVCCTL_CREATESERVICEW,
2212 &r);
2214 if (!NT_STATUS_IS_OK(status)) {
2215 return status;
2218 if (DEBUGLEVEL >= 10) {
2219 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceW, &r);
2222 if (NT_STATUS_IS_ERR(status)) {
2223 return status;
2226 /* Return variables */
2227 if (TagId && r.out.TagId) {
2228 *TagId = *r.out.TagId;
2230 *handle = *r.out.handle;
2232 /* Return result */
2233 if (werror) {
2234 *werror = r.out.result;
2237 return werror_to_ntstatus(r.out.result);
2240 struct rpccli_svcctl_EnumDependentServicesW_state {
2241 struct svcctl_EnumDependentServicesW orig;
2242 struct svcctl_EnumDependentServicesW tmp;
2243 TALLOC_CTX *out_mem_ctx;
2244 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2247 static void rpccli_svcctl_EnumDependentServicesW_done(struct tevent_req *subreq);
2249 struct tevent_req *rpccli_svcctl_EnumDependentServicesW_send(TALLOC_CTX *mem_ctx,
2250 struct tevent_context *ev,
2251 struct rpc_pipe_client *cli,
2252 struct policy_handle *_service /* [in] [ref] */,
2253 enum svcctl_ServiceState _state /* [in] */,
2254 uint8_t *_service_status /* [out] [ref,size_is(offered)] */,
2255 uint32_t _offered /* [in] [range(0,0x40000)] */,
2256 uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
2257 uint32_t *_services_returned /* [out] [ref,range(0,0x40000)] */)
2259 struct tevent_req *req;
2260 struct rpccli_svcctl_EnumDependentServicesW_state *state;
2261 struct tevent_req *subreq;
2263 req = tevent_req_create(mem_ctx, &state,
2264 struct rpccli_svcctl_EnumDependentServicesW_state);
2265 if (req == NULL) {
2266 return NULL;
2268 state->out_mem_ctx = NULL;
2269 state->dispatch_recv = cli->dispatch_recv;
2271 /* In parameters */
2272 state->orig.in.service = _service;
2273 state->orig.in.state = _state;
2274 state->orig.in.offered = _offered;
2276 /* Out parameters */
2277 state->orig.out.service_status = _service_status;
2278 state->orig.out.needed = _needed;
2279 state->orig.out.services_returned = _services_returned;
2281 /* Result */
2282 ZERO_STRUCT(state->orig.out.result);
2284 if (DEBUGLEVEL >= 10) {
2285 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, &state->orig);
2288 state->out_mem_ctx = talloc_named_const(state, 0,
2289 "rpccli_svcctl_EnumDependentServicesW_out_memory");
2290 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2291 return tevent_req_post(req, ev);
2294 /* make a temporary copy, that we pass to the dispatch function */
2295 state->tmp = state->orig;
2297 subreq = cli->dispatch_send(state, ev, cli,
2298 &ndr_table_svcctl,
2299 NDR_SVCCTL_ENUMDEPENDENTSERVICESW,
2300 &state->tmp);
2301 if (tevent_req_nomem(subreq, req)) {
2302 return tevent_req_post(req, ev);
2304 tevent_req_set_callback(subreq, rpccli_svcctl_EnumDependentServicesW_done, req);
2305 return req;
2308 static void rpccli_svcctl_EnumDependentServicesW_done(struct tevent_req *subreq)
2310 struct tevent_req *req = tevent_req_callback_data(
2311 subreq, struct tevent_req);
2312 struct rpccli_svcctl_EnumDependentServicesW_state *state = tevent_req_data(
2313 req, struct rpccli_svcctl_EnumDependentServicesW_state);
2314 NTSTATUS status;
2315 TALLOC_CTX *mem_ctx;
2317 if (state->out_mem_ctx) {
2318 mem_ctx = state->out_mem_ctx;
2319 } else {
2320 mem_ctx = state;
2323 status = state->dispatch_recv(subreq, mem_ctx);
2324 TALLOC_FREE(subreq);
2325 if (!NT_STATUS_IS_OK(status)) {
2326 tevent_req_nterror(req, status);
2327 return;
2330 /* Copy out parameters */
2331 memcpy(state->orig.out.service_status, state->tmp.out.service_status, state->tmp.in.offered * sizeof(*state->orig.out.service_status));
2332 *state->orig.out.needed = *state->tmp.out.needed;
2333 *state->orig.out.services_returned = *state->tmp.out.services_returned;
2335 /* Copy result */
2336 state->orig.out.result = state->tmp.out.result;
2338 /* Reset temporary structure */
2339 ZERO_STRUCT(state->tmp);
2341 if (DEBUGLEVEL >= 10) {
2342 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, &state->orig);
2345 tevent_req_done(req);
2348 NTSTATUS rpccli_svcctl_EnumDependentServicesW_recv(struct tevent_req *req,
2349 TALLOC_CTX *mem_ctx,
2350 WERROR *result)
2352 struct rpccli_svcctl_EnumDependentServicesW_state *state = tevent_req_data(
2353 req, struct rpccli_svcctl_EnumDependentServicesW_state);
2354 NTSTATUS status;
2356 if (tevent_req_is_nterror(req, &status)) {
2357 tevent_req_received(req);
2358 return status;
2361 /* Steal possbile out parameters to the callers context */
2362 talloc_steal(mem_ctx, state->out_mem_ctx);
2364 /* Return result */
2365 *result = state->orig.out.result;
2367 tevent_req_received(req);
2368 return NT_STATUS_OK;
2371 NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli,
2372 TALLOC_CTX *mem_ctx,
2373 struct policy_handle *service /* [in] [ref] */,
2374 enum svcctl_ServiceState state /* [in] */,
2375 uint8_t *service_status /* [out] [ref,size_is(offered)] */,
2376 uint32_t offered /* [in] [range(0,0x40000)] */,
2377 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
2378 uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */,
2379 WERROR *werror)
2381 struct svcctl_EnumDependentServicesW r;
2382 NTSTATUS status;
2384 /* In parameters */
2385 r.in.service = service;
2386 r.in.state = state;
2387 r.in.offered = offered;
2389 if (DEBUGLEVEL >= 10) {
2390 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesW, &r);
2393 status = cli->dispatch(cli,
2394 mem_ctx,
2395 &ndr_table_svcctl,
2396 NDR_SVCCTL_ENUMDEPENDENTSERVICESW,
2397 &r);
2399 if (!NT_STATUS_IS_OK(status)) {
2400 return status;
2403 if (DEBUGLEVEL >= 10) {
2404 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesW, &r);
2407 if (NT_STATUS_IS_ERR(status)) {
2408 return status;
2411 /* Return variables */
2412 memcpy(service_status, r.out.service_status, r.in.offered * sizeof(*service_status));
2413 *needed = *r.out.needed;
2414 *services_returned = *r.out.services_returned;
2416 /* Return result */
2417 if (werror) {
2418 *werror = r.out.result;
2421 return werror_to_ntstatus(r.out.result);
2424 struct rpccli_svcctl_EnumServicesStatusW_state {
2425 struct svcctl_EnumServicesStatusW orig;
2426 struct svcctl_EnumServicesStatusW tmp;
2427 TALLOC_CTX *out_mem_ctx;
2428 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2431 static void rpccli_svcctl_EnumServicesStatusW_done(struct tevent_req *subreq);
2433 struct tevent_req *rpccli_svcctl_EnumServicesStatusW_send(TALLOC_CTX *mem_ctx,
2434 struct tevent_context *ev,
2435 struct rpc_pipe_client *cli,
2436 struct policy_handle *_handle /* [in] [ref] */,
2437 uint32_t _type /* [in] */,
2438 enum svcctl_ServiceState _state /* [in] */,
2439 uint8_t *_service /* [out] [ref,size_is(offered)] */,
2440 uint32_t _offered /* [in] [range(0,0x40000)] */,
2441 uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
2442 uint32_t *_services_returned /* [out] [ref,range(0,0x40000)] */,
2443 uint32_t *_resume_handle /* [in,out] [unique] */)
2445 struct tevent_req *req;
2446 struct rpccli_svcctl_EnumServicesStatusW_state *state;
2447 struct tevent_req *subreq;
2449 req = tevent_req_create(mem_ctx, &state,
2450 struct rpccli_svcctl_EnumServicesStatusW_state);
2451 if (req == NULL) {
2452 return NULL;
2454 state->out_mem_ctx = NULL;
2455 state->dispatch_recv = cli->dispatch_recv;
2457 /* In parameters */
2458 state->orig.in.handle = _handle;
2459 state->orig.in.type = _type;
2460 state->orig.in.state = _state;
2461 state->orig.in.offered = _offered;
2462 state->orig.in.resume_handle = _resume_handle;
2464 /* Out parameters */
2465 state->orig.out.service = _service;
2466 state->orig.out.needed = _needed;
2467 state->orig.out.services_returned = _services_returned;
2468 state->orig.out.resume_handle = _resume_handle;
2470 /* Result */
2471 ZERO_STRUCT(state->orig.out.result);
2473 if (DEBUGLEVEL >= 10) {
2474 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, &state->orig);
2477 state->out_mem_ctx = talloc_named_const(state, 0,
2478 "rpccli_svcctl_EnumServicesStatusW_out_memory");
2479 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2480 return tevent_req_post(req, ev);
2483 /* make a temporary copy, that we pass to the dispatch function */
2484 state->tmp = state->orig;
2486 subreq = cli->dispatch_send(state, ev, cli,
2487 &ndr_table_svcctl,
2488 NDR_SVCCTL_ENUMSERVICESSTATUSW,
2489 &state->tmp);
2490 if (tevent_req_nomem(subreq, req)) {
2491 return tevent_req_post(req, ev);
2493 tevent_req_set_callback(subreq, rpccli_svcctl_EnumServicesStatusW_done, req);
2494 return req;
2497 static void rpccli_svcctl_EnumServicesStatusW_done(struct tevent_req *subreq)
2499 struct tevent_req *req = tevent_req_callback_data(
2500 subreq, struct tevent_req);
2501 struct rpccli_svcctl_EnumServicesStatusW_state *state = tevent_req_data(
2502 req, struct rpccli_svcctl_EnumServicesStatusW_state);
2503 NTSTATUS status;
2504 TALLOC_CTX *mem_ctx;
2506 if (state->out_mem_ctx) {
2507 mem_ctx = state->out_mem_ctx;
2508 } else {
2509 mem_ctx = state;
2512 status = state->dispatch_recv(subreq, mem_ctx);
2513 TALLOC_FREE(subreq);
2514 if (!NT_STATUS_IS_OK(status)) {
2515 tevent_req_nterror(req, status);
2516 return;
2519 /* Copy out parameters */
2520 memcpy(state->orig.out.service, state->tmp.out.service, state->tmp.in.offered * sizeof(*state->orig.out.service));
2521 *state->orig.out.needed = *state->tmp.out.needed;
2522 *state->orig.out.services_returned = *state->tmp.out.services_returned;
2523 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
2524 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2527 /* Copy result */
2528 state->orig.out.result = state->tmp.out.result;
2530 /* Reset temporary structure */
2531 ZERO_STRUCT(state->tmp);
2533 if (DEBUGLEVEL >= 10) {
2534 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, &state->orig);
2537 tevent_req_done(req);
2540 NTSTATUS rpccli_svcctl_EnumServicesStatusW_recv(struct tevent_req *req,
2541 TALLOC_CTX *mem_ctx,
2542 WERROR *result)
2544 struct rpccli_svcctl_EnumServicesStatusW_state *state = tevent_req_data(
2545 req, struct rpccli_svcctl_EnumServicesStatusW_state);
2546 NTSTATUS status;
2548 if (tevent_req_is_nterror(req, &status)) {
2549 tevent_req_received(req);
2550 return status;
2553 /* Steal possbile out parameters to the callers context */
2554 talloc_steal(mem_ctx, state->out_mem_ctx);
2556 /* Return result */
2557 *result = state->orig.out.result;
2559 tevent_req_received(req);
2560 return NT_STATUS_OK;
2563 NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli,
2564 TALLOC_CTX *mem_ctx,
2565 struct policy_handle *handle /* [in] [ref] */,
2566 uint32_t type /* [in] */,
2567 enum svcctl_ServiceState state /* [in] */,
2568 uint8_t *service /* [out] [ref,size_is(offered)] */,
2569 uint32_t offered /* [in] [range(0,0x40000)] */,
2570 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
2571 uint32_t *services_returned /* [out] [ref,range(0,0x40000)] */,
2572 uint32_t *resume_handle /* [in,out] [unique] */,
2573 WERROR *werror)
2575 struct svcctl_EnumServicesStatusW r;
2576 NTSTATUS status;
2578 /* In parameters */
2579 r.in.handle = handle;
2580 r.in.type = type;
2581 r.in.state = state;
2582 r.in.offered = offered;
2583 r.in.resume_handle = resume_handle;
2585 if (DEBUGLEVEL >= 10) {
2586 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusW, &r);
2589 status = cli->dispatch(cli,
2590 mem_ctx,
2591 &ndr_table_svcctl,
2592 NDR_SVCCTL_ENUMSERVICESSTATUSW,
2593 &r);
2595 if (!NT_STATUS_IS_OK(status)) {
2596 return status;
2599 if (DEBUGLEVEL >= 10) {
2600 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusW, &r);
2603 if (NT_STATUS_IS_ERR(status)) {
2604 return status;
2607 /* Return variables */
2608 memcpy(service, r.out.service, r.in.offered * sizeof(*service));
2609 *needed = *r.out.needed;
2610 *services_returned = *r.out.services_returned;
2611 if (resume_handle && r.out.resume_handle) {
2612 *resume_handle = *r.out.resume_handle;
2615 /* Return result */
2616 if (werror) {
2617 *werror = r.out.result;
2620 return werror_to_ntstatus(r.out.result);
2623 struct rpccli_svcctl_OpenSCManagerW_state {
2624 struct svcctl_OpenSCManagerW orig;
2625 struct svcctl_OpenSCManagerW tmp;
2626 TALLOC_CTX *out_mem_ctx;
2627 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2630 static void rpccli_svcctl_OpenSCManagerW_done(struct tevent_req *subreq);
2632 struct tevent_req *rpccli_svcctl_OpenSCManagerW_send(TALLOC_CTX *mem_ctx,
2633 struct tevent_context *ev,
2634 struct rpc_pipe_client *cli,
2635 const char *_MachineName /* [in] [unique,charset(UTF16)] */,
2636 const char *_DatabaseName /* [in] [unique,charset(UTF16)] */,
2637 uint32_t _access_mask /* [in] */,
2638 struct policy_handle *_handle /* [out] [ref] */)
2640 struct tevent_req *req;
2641 struct rpccli_svcctl_OpenSCManagerW_state *state;
2642 struct tevent_req *subreq;
2644 req = tevent_req_create(mem_ctx, &state,
2645 struct rpccli_svcctl_OpenSCManagerW_state);
2646 if (req == NULL) {
2647 return NULL;
2649 state->out_mem_ctx = NULL;
2650 state->dispatch_recv = cli->dispatch_recv;
2652 /* In parameters */
2653 state->orig.in.MachineName = _MachineName;
2654 state->orig.in.DatabaseName = _DatabaseName;
2655 state->orig.in.access_mask = _access_mask;
2657 /* Out parameters */
2658 state->orig.out.handle = _handle;
2660 /* Result */
2661 ZERO_STRUCT(state->orig.out.result);
2663 if (DEBUGLEVEL >= 10) {
2664 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, &state->orig);
2667 state->out_mem_ctx = talloc_named_const(state, 0,
2668 "rpccli_svcctl_OpenSCManagerW_out_memory");
2669 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2670 return tevent_req_post(req, ev);
2673 /* make a temporary copy, that we pass to the dispatch function */
2674 state->tmp = state->orig;
2676 subreq = cli->dispatch_send(state, ev, cli,
2677 &ndr_table_svcctl,
2678 NDR_SVCCTL_OPENSCMANAGERW,
2679 &state->tmp);
2680 if (tevent_req_nomem(subreq, req)) {
2681 return tevent_req_post(req, ev);
2683 tevent_req_set_callback(subreq, rpccli_svcctl_OpenSCManagerW_done, req);
2684 return req;
2687 static void rpccli_svcctl_OpenSCManagerW_done(struct tevent_req *subreq)
2689 struct tevent_req *req = tevent_req_callback_data(
2690 subreq, struct tevent_req);
2691 struct rpccli_svcctl_OpenSCManagerW_state *state = tevent_req_data(
2692 req, struct rpccli_svcctl_OpenSCManagerW_state);
2693 NTSTATUS status;
2694 TALLOC_CTX *mem_ctx;
2696 if (state->out_mem_ctx) {
2697 mem_ctx = state->out_mem_ctx;
2698 } else {
2699 mem_ctx = state;
2702 status = state->dispatch_recv(subreq, mem_ctx);
2703 TALLOC_FREE(subreq);
2704 if (!NT_STATUS_IS_OK(status)) {
2705 tevent_req_nterror(req, status);
2706 return;
2709 /* Copy out parameters */
2710 *state->orig.out.handle = *state->tmp.out.handle;
2712 /* Copy result */
2713 state->orig.out.result = state->tmp.out.result;
2715 /* Reset temporary structure */
2716 ZERO_STRUCT(state->tmp);
2718 if (DEBUGLEVEL >= 10) {
2719 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &state->orig);
2722 tevent_req_done(req);
2725 NTSTATUS rpccli_svcctl_OpenSCManagerW_recv(struct tevent_req *req,
2726 TALLOC_CTX *mem_ctx,
2727 WERROR *result)
2729 struct rpccli_svcctl_OpenSCManagerW_state *state = tevent_req_data(
2730 req, struct rpccli_svcctl_OpenSCManagerW_state);
2731 NTSTATUS status;
2733 if (tevent_req_is_nterror(req, &status)) {
2734 tevent_req_received(req);
2735 return status;
2738 /* Steal possbile out parameters to the callers context */
2739 talloc_steal(mem_ctx, state->out_mem_ctx);
2741 /* Return result */
2742 *result = state->orig.out.result;
2744 tevent_req_received(req);
2745 return NT_STATUS_OK;
2748 NTSTATUS rpccli_svcctl_OpenSCManagerW(struct rpc_pipe_client *cli,
2749 TALLOC_CTX *mem_ctx,
2750 const char *MachineName /* [in] [unique,charset(UTF16)] */,
2751 const char *DatabaseName /* [in] [unique,charset(UTF16)] */,
2752 uint32_t access_mask /* [in] */,
2753 struct policy_handle *handle /* [out] [ref] */,
2754 WERROR *werror)
2756 struct svcctl_OpenSCManagerW r;
2757 NTSTATUS status;
2759 /* In parameters */
2760 r.in.MachineName = MachineName;
2761 r.in.DatabaseName = DatabaseName;
2762 r.in.access_mask = access_mask;
2764 if (DEBUGLEVEL >= 10) {
2765 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerW, &r);
2768 status = cli->dispatch(cli,
2769 mem_ctx,
2770 &ndr_table_svcctl,
2771 NDR_SVCCTL_OPENSCMANAGERW,
2772 &r);
2774 if (!NT_STATUS_IS_OK(status)) {
2775 return status;
2778 if (DEBUGLEVEL >= 10) {
2779 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerW, &r);
2782 if (NT_STATUS_IS_ERR(status)) {
2783 return status;
2786 /* Return variables */
2787 *handle = *r.out.handle;
2789 /* Return result */
2790 if (werror) {
2791 *werror = r.out.result;
2794 return werror_to_ntstatus(r.out.result);
2797 struct rpccli_svcctl_OpenServiceW_state {
2798 struct svcctl_OpenServiceW orig;
2799 struct svcctl_OpenServiceW tmp;
2800 TALLOC_CTX *out_mem_ctx;
2801 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2804 static void rpccli_svcctl_OpenServiceW_done(struct tevent_req *subreq);
2806 struct tevent_req *rpccli_svcctl_OpenServiceW_send(TALLOC_CTX *mem_ctx,
2807 struct tevent_context *ev,
2808 struct rpc_pipe_client *cli,
2809 struct policy_handle *_scmanager_handle /* [in] [ref] */,
2810 const char *_ServiceName /* [in] [charset(UTF16)] */,
2811 uint32_t _access_mask /* [in] */,
2812 struct policy_handle *_handle /* [out] [ref] */)
2814 struct tevent_req *req;
2815 struct rpccli_svcctl_OpenServiceW_state *state;
2816 struct tevent_req *subreq;
2818 req = tevent_req_create(mem_ctx, &state,
2819 struct rpccli_svcctl_OpenServiceW_state);
2820 if (req == NULL) {
2821 return NULL;
2823 state->out_mem_ctx = NULL;
2824 state->dispatch_recv = cli->dispatch_recv;
2826 /* In parameters */
2827 state->orig.in.scmanager_handle = _scmanager_handle;
2828 state->orig.in.ServiceName = _ServiceName;
2829 state->orig.in.access_mask = _access_mask;
2831 /* Out parameters */
2832 state->orig.out.handle = _handle;
2834 /* Result */
2835 ZERO_STRUCT(state->orig.out.result);
2837 if (DEBUGLEVEL >= 10) {
2838 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, &state->orig);
2841 state->out_mem_ctx = talloc_named_const(state, 0,
2842 "rpccli_svcctl_OpenServiceW_out_memory");
2843 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2844 return tevent_req_post(req, ev);
2847 /* make a temporary copy, that we pass to the dispatch function */
2848 state->tmp = state->orig;
2850 subreq = cli->dispatch_send(state, ev, cli,
2851 &ndr_table_svcctl,
2852 NDR_SVCCTL_OPENSERVICEW,
2853 &state->tmp);
2854 if (tevent_req_nomem(subreq, req)) {
2855 return tevent_req_post(req, ev);
2857 tevent_req_set_callback(subreq, rpccli_svcctl_OpenServiceW_done, req);
2858 return req;
2861 static void rpccli_svcctl_OpenServiceW_done(struct tevent_req *subreq)
2863 struct tevent_req *req = tevent_req_callback_data(
2864 subreq, struct tevent_req);
2865 struct rpccli_svcctl_OpenServiceW_state *state = tevent_req_data(
2866 req, struct rpccli_svcctl_OpenServiceW_state);
2867 NTSTATUS status;
2868 TALLOC_CTX *mem_ctx;
2870 if (state->out_mem_ctx) {
2871 mem_ctx = state->out_mem_ctx;
2872 } else {
2873 mem_ctx = state;
2876 status = state->dispatch_recv(subreq, mem_ctx);
2877 TALLOC_FREE(subreq);
2878 if (!NT_STATUS_IS_OK(status)) {
2879 tevent_req_nterror(req, status);
2880 return;
2883 /* Copy out parameters */
2884 *state->orig.out.handle = *state->tmp.out.handle;
2886 /* Copy result */
2887 state->orig.out.result = state->tmp.out.result;
2889 /* Reset temporary structure */
2890 ZERO_STRUCT(state->tmp);
2892 if (DEBUGLEVEL >= 10) {
2893 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, &state->orig);
2896 tevent_req_done(req);
2899 NTSTATUS rpccli_svcctl_OpenServiceW_recv(struct tevent_req *req,
2900 TALLOC_CTX *mem_ctx,
2901 WERROR *result)
2903 struct rpccli_svcctl_OpenServiceW_state *state = tevent_req_data(
2904 req, struct rpccli_svcctl_OpenServiceW_state);
2905 NTSTATUS status;
2907 if (tevent_req_is_nterror(req, &status)) {
2908 tevent_req_received(req);
2909 return status;
2912 /* Steal possbile out parameters to the callers context */
2913 talloc_steal(mem_ctx, state->out_mem_ctx);
2915 /* Return result */
2916 *result = state->orig.out.result;
2918 tevent_req_received(req);
2919 return NT_STATUS_OK;
2922 NTSTATUS rpccli_svcctl_OpenServiceW(struct rpc_pipe_client *cli,
2923 TALLOC_CTX *mem_ctx,
2924 struct policy_handle *scmanager_handle /* [in] [ref] */,
2925 const char *ServiceName /* [in] [charset(UTF16)] */,
2926 uint32_t access_mask /* [in] */,
2927 struct policy_handle *handle /* [out] [ref] */,
2928 WERROR *werror)
2930 struct svcctl_OpenServiceW r;
2931 NTSTATUS status;
2933 /* In parameters */
2934 r.in.scmanager_handle = scmanager_handle;
2935 r.in.ServiceName = ServiceName;
2936 r.in.access_mask = access_mask;
2938 if (DEBUGLEVEL >= 10) {
2939 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceW, &r);
2942 status = cli->dispatch(cli,
2943 mem_ctx,
2944 &ndr_table_svcctl,
2945 NDR_SVCCTL_OPENSERVICEW,
2946 &r);
2948 if (!NT_STATUS_IS_OK(status)) {
2949 return status;
2952 if (DEBUGLEVEL >= 10) {
2953 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceW, &r);
2956 if (NT_STATUS_IS_ERR(status)) {
2957 return status;
2960 /* Return variables */
2961 *handle = *r.out.handle;
2963 /* Return result */
2964 if (werror) {
2965 *werror = r.out.result;
2968 return werror_to_ntstatus(r.out.result);
2971 struct rpccli_svcctl_QueryServiceConfigW_state {
2972 struct svcctl_QueryServiceConfigW orig;
2973 struct svcctl_QueryServiceConfigW tmp;
2974 TALLOC_CTX *out_mem_ctx;
2975 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2978 static void rpccli_svcctl_QueryServiceConfigW_done(struct tevent_req *subreq);
2980 struct tevent_req *rpccli_svcctl_QueryServiceConfigW_send(TALLOC_CTX *mem_ctx,
2981 struct tevent_context *ev,
2982 struct rpc_pipe_client *cli,
2983 struct policy_handle *_handle /* [in] [ref] */,
2984 struct QUERY_SERVICE_CONFIG *_query /* [out] [ref] */,
2985 uint32_t _offered /* [in] [range(0,8192)] */,
2986 uint32_t *_needed /* [out] [ref,range(0,8192)] */)
2988 struct tevent_req *req;
2989 struct rpccli_svcctl_QueryServiceConfigW_state *state;
2990 struct tevent_req *subreq;
2992 req = tevent_req_create(mem_ctx, &state,
2993 struct rpccli_svcctl_QueryServiceConfigW_state);
2994 if (req == NULL) {
2995 return NULL;
2997 state->out_mem_ctx = NULL;
2998 state->dispatch_recv = cli->dispatch_recv;
3000 /* In parameters */
3001 state->orig.in.handle = _handle;
3002 state->orig.in.offered = _offered;
3004 /* Out parameters */
3005 state->orig.out.query = _query;
3006 state->orig.out.needed = _needed;
3008 /* Result */
3009 ZERO_STRUCT(state->orig.out.result);
3011 if (DEBUGLEVEL >= 10) {
3012 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, &state->orig);
3015 state->out_mem_ctx = talloc_named_const(state, 0,
3016 "rpccli_svcctl_QueryServiceConfigW_out_memory");
3017 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3018 return tevent_req_post(req, ev);
3021 /* make a temporary copy, that we pass to the dispatch function */
3022 state->tmp = state->orig;
3024 subreq = cli->dispatch_send(state, ev, cli,
3025 &ndr_table_svcctl,
3026 NDR_SVCCTL_QUERYSERVICECONFIGW,
3027 &state->tmp);
3028 if (tevent_req_nomem(subreq, req)) {
3029 return tevent_req_post(req, ev);
3031 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfigW_done, req);
3032 return req;
3035 static void rpccli_svcctl_QueryServiceConfigW_done(struct tevent_req *subreq)
3037 struct tevent_req *req = tevent_req_callback_data(
3038 subreq, struct tevent_req);
3039 struct rpccli_svcctl_QueryServiceConfigW_state *state = tevent_req_data(
3040 req, struct rpccli_svcctl_QueryServiceConfigW_state);
3041 NTSTATUS status;
3042 TALLOC_CTX *mem_ctx;
3044 if (state->out_mem_ctx) {
3045 mem_ctx = state->out_mem_ctx;
3046 } else {
3047 mem_ctx = state;
3050 status = state->dispatch_recv(subreq, mem_ctx);
3051 TALLOC_FREE(subreq);
3052 if (!NT_STATUS_IS_OK(status)) {
3053 tevent_req_nterror(req, status);
3054 return;
3057 /* Copy out parameters */
3058 *state->orig.out.query = *state->tmp.out.query;
3059 *state->orig.out.needed = *state->tmp.out.needed;
3061 /* Copy result */
3062 state->orig.out.result = state->tmp.out.result;
3064 /* Reset temporary structure */
3065 ZERO_STRUCT(state->tmp);
3067 if (DEBUGLEVEL >= 10) {
3068 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, &state->orig);
3071 tevent_req_done(req);
3074 NTSTATUS rpccli_svcctl_QueryServiceConfigW_recv(struct tevent_req *req,
3075 TALLOC_CTX *mem_ctx,
3076 WERROR *result)
3078 struct rpccli_svcctl_QueryServiceConfigW_state *state = tevent_req_data(
3079 req, struct rpccli_svcctl_QueryServiceConfigW_state);
3080 NTSTATUS status;
3082 if (tevent_req_is_nterror(req, &status)) {
3083 tevent_req_received(req);
3084 return status;
3087 /* Steal possbile out parameters to the callers context */
3088 talloc_steal(mem_ctx, state->out_mem_ctx);
3090 /* Return result */
3091 *result = state->orig.out.result;
3093 tevent_req_received(req);
3094 return NT_STATUS_OK;
3097 NTSTATUS rpccli_svcctl_QueryServiceConfigW(struct rpc_pipe_client *cli,
3098 TALLOC_CTX *mem_ctx,
3099 struct policy_handle *handle /* [in] [ref] */,
3100 struct QUERY_SERVICE_CONFIG *query /* [out] [ref] */,
3101 uint32_t offered /* [in] [range(0,8192)] */,
3102 uint32_t *needed /* [out] [ref,range(0,8192)] */,
3103 WERROR *werror)
3105 struct svcctl_QueryServiceConfigW r;
3106 NTSTATUS status;
3108 /* In parameters */
3109 r.in.handle = handle;
3110 r.in.offered = offered;
3112 if (DEBUGLEVEL >= 10) {
3113 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigW, &r);
3116 status = cli->dispatch(cli,
3117 mem_ctx,
3118 &ndr_table_svcctl,
3119 NDR_SVCCTL_QUERYSERVICECONFIGW,
3120 &r);
3122 if (!NT_STATUS_IS_OK(status)) {
3123 return status;
3126 if (DEBUGLEVEL >= 10) {
3127 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigW, &r);
3130 if (NT_STATUS_IS_ERR(status)) {
3131 return status;
3134 /* Return variables */
3135 *query = *r.out.query;
3136 *needed = *r.out.needed;
3138 /* Return result */
3139 if (werror) {
3140 *werror = r.out.result;
3143 return werror_to_ntstatus(r.out.result);
3146 struct rpccli_svcctl_QueryServiceLockStatusW_state {
3147 struct svcctl_QueryServiceLockStatusW orig;
3148 struct svcctl_QueryServiceLockStatusW tmp;
3149 TALLOC_CTX *out_mem_ctx;
3150 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3153 static void rpccli_svcctl_QueryServiceLockStatusW_done(struct tevent_req *subreq);
3155 struct tevent_req *rpccli_svcctl_QueryServiceLockStatusW_send(TALLOC_CTX *mem_ctx,
3156 struct tevent_context *ev,
3157 struct rpc_pipe_client *cli,
3158 struct policy_handle *_handle /* [in] [ref] */,
3159 uint32_t _offered /* [in] */,
3160 struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
3161 uint32_t *_needed /* [out] [ref] */)
3163 struct tevent_req *req;
3164 struct rpccli_svcctl_QueryServiceLockStatusW_state *state;
3165 struct tevent_req *subreq;
3167 req = tevent_req_create(mem_ctx, &state,
3168 struct rpccli_svcctl_QueryServiceLockStatusW_state);
3169 if (req == NULL) {
3170 return NULL;
3172 state->out_mem_ctx = NULL;
3173 state->dispatch_recv = cli->dispatch_recv;
3175 /* In parameters */
3176 state->orig.in.handle = _handle;
3177 state->orig.in.offered = _offered;
3179 /* Out parameters */
3180 state->orig.out.lock_status = _lock_status;
3181 state->orig.out.needed = _needed;
3183 /* Result */
3184 ZERO_STRUCT(state->orig.out.result);
3186 if (DEBUGLEVEL >= 10) {
3187 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, &state->orig);
3190 state->out_mem_ctx = talloc_named_const(state, 0,
3191 "rpccli_svcctl_QueryServiceLockStatusW_out_memory");
3192 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3193 return tevent_req_post(req, ev);
3196 /* make a temporary copy, that we pass to the dispatch function */
3197 state->tmp = state->orig;
3199 subreq = cli->dispatch_send(state, ev, cli,
3200 &ndr_table_svcctl,
3201 NDR_SVCCTL_QUERYSERVICELOCKSTATUSW,
3202 &state->tmp);
3203 if (tevent_req_nomem(subreq, req)) {
3204 return tevent_req_post(req, ev);
3206 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceLockStatusW_done, req);
3207 return req;
3210 static void rpccli_svcctl_QueryServiceLockStatusW_done(struct tevent_req *subreq)
3212 struct tevent_req *req = tevent_req_callback_data(
3213 subreq, struct tevent_req);
3214 struct rpccli_svcctl_QueryServiceLockStatusW_state *state = tevent_req_data(
3215 req, struct rpccli_svcctl_QueryServiceLockStatusW_state);
3216 NTSTATUS status;
3217 TALLOC_CTX *mem_ctx;
3219 if (state->out_mem_ctx) {
3220 mem_ctx = state->out_mem_ctx;
3221 } else {
3222 mem_ctx = state;
3225 status = state->dispatch_recv(subreq, mem_ctx);
3226 TALLOC_FREE(subreq);
3227 if (!NT_STATUS_IS_OK(status)) {
3228 tevent_req_nterror(req, status);
3229 return;
3232 /* Copy out parameters */
3233 *state->orig.out.lock_status = *state->tmp.out.lock_status;
3234 *state->orig.out.needed = *state->tmp.out.needed;
3236 /* Copy result */
3237 state->orig.out.result = state->tmp.out.result;
3239 /* Reset temporary structure */
3240 ZERO_STRUCT(state->tmp);
3242 if (DEBUGLEVEL >= 10) {
3243 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, &state->orig);
3246 tevent_req_done(req);
3249 NTSTATUS rpccli_svcctl_QueryServiceLockStatusW_recv(struct tevent_req *req,
3250 TALLOC_CTX *mem_ctx,
3251 WERROR *result)
3253 struct rpccli_svcctl_QueryServiceLockStatusW_state *state = tevent_req_data(
3254 req, struct rpccli_svcctl_QueryServiceLockStatusW_state);
3255 NTSTATUS status;
3257 if (tevent_req_is_nterror(req, &status)) {
3258 tevent_req_received(req);
3259 return status;
3262 /* Steal possbile out parameters to the callers context */
3263 talloc_steal(mem_ctx, state->out_mem_ctx);
3265 /* Return result */
3266 *result = state->orig.out.result;
3268 tevent_req_received(req);
3269 return NT_STATUS_OK;
3272 NTSTATUS rpccli_svcctl_QueryServiceLockStatusW(struct rpc_pipe_client *cli,
3273 TALLOC_CTX *mem_ctx,
3274 struct policy_handle *handle /* [in] [ref] */,
3275 uint32_t offered /* [in] */,
3276 struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
3277 uint32_t *needed /* [out] [ref] */,
3278 WERROR *werror)
3280 struct svcctl_QueryServiceLockStatusW r;
3281 NTSTATUS status;
3283 /* In parameters */
3284 r.in.handle = handle;
3285 r.in.offered = offered;
3287 if (DEBUGLEVEL >= 10) {
3288 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusW, &r);
3291 status = cli->dispatch(cli,
3292 mem_ctx,
3293 &ndr_table_svcctl,
3294 NDR_SVCCTL_QUERYSERVICELOCKSTATUSW,
3295 &r);
3297 if (!NT_STATUS_IS_OK(status)) {
3298 return status;
3301 if (DEBUGLEVEL >= 10) {
3302 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusW, &r);
3305 if (NT_STATUS_IS_ERR(status)) {
3306 return status;
3309 /* Return variables */
3310 *lock_status = *r.out.lock_status;
3311 *needed = *r.out.needed;
3313 /* Return result */
3314 if (werror) {
3315 *werror = r.out.result;
3318 return werror_to_ntstatus(r.out.result);
3321 struct rpccli_svcctl_StartServiceW_state {
3322 struct svcctl_StartServiceW orig;
3323 struct svcctl_StartServiceW tmp;
3324 TALLOC_CTX *out_mem_ctx;
3325 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3328 static void rpccli_svcctl_StartServiceW_done(struct tevent_req *subreq);
3330 struct tevent_req *rpccli_svcctl_StartServiceW_send(TALLOC_CTX *mem_ctx,
3331 struct tevent_context *ev,
3332 struct rpc_pipe_client *cli,
3333 struct policy_handle *_handle /* [in] [ref] */,
3334 uint32_t _NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
3335 struct svcctl_ArgumentString *_Arguments /* [in] [unique,size_is(NumArgs)] */)
3337 struct tevent_req *req;
3338 struct rpccli_svcctl_StartServiceW_state *state;
3339 struct tevent_req *subreq;
3341 req = tevent_req_create(mem_ctx, &state,
3342 struct rpccli_svcctl_StartServiceW_state);
3343 if (req == NULL) {
3344 return NULL;
3346 state->out_mem_ctx = NULL;
3347 state->dispatch_recv = cli->dispatch_recv;
3349 /* In parameters */
3350 state->orig.in.handle = _handle;
3351 state->orig.in.NumArgs = _NumArgs;
3352 state->orig.in.Arguments = _Arguments;
3354 /* Out parameters */
3356 /* Result */
3357 ZERO_STRUCT(state->orig.out.result);
3359 if (DEBUGLEVEL >= 10) {
3360 NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, &state->orig);
3363 /* make a temporary copy, that we pass to the dispatch function */
3364 state->tmp = state->orig;
3366 subreq = cli->dispatch_send(state, ev, cli,
3367 &ndr_table_svcctl,
3368 NDR_SVCCTL_STARTSERVICEW,
3369 &state->tmp);
3370 if (tevent_req_nomem(subreq, req)) {
3371 return tevent_req_post(req, ev);
3373 tevent_req_set_callback(subreq, rpccli_svcctl_StartServiceW_done, req);
3374 return req;
3377 static void rpccli_svcctl_StartServiceW_done(struct tevent_req *subreq)
3379 struct tevent_req *req = tevent_req_callback_data(
3380 subreq, struct tevent_req);
3381 struct rpccli_svcctl_StartServiceW_state *state = tevent_req_data(
3382 req, struct rpccli_svcctl_StartServiceW_state);
3383 NTSTATUS status;
3384 TALLOC_CTX *mem_ctx;
3386 if (state->out_mem_ctx) {
3387 mem_ctx = state->out_mem_ctx;
3388 } else {
3389 mem_ctx = state;
3392 status = state->dispatch_recv(subreq, mem_ctx);
3393 TALLOC_FREE(subreq);
3394 if (!NT_STATUS_IS_OK(status)) {
3395 tevent_req_nterror(req, status);
3396 return;
3399 /* Copy out parameters */
3401 /* Copy result */
3402 state->orig.out.result = state->tmp.out.result;
3404 /* Reset temporary structure */
3405 ZERO_STRUCT(state->tmp);
3407 if (DEBUGLEVEL >= 10) {
3408 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, &state->orig);
3411 tevent_req_done(req);
3414 NTSTATUS rpccli_svcctl_StartServiceW_recv(struct tevent_req *req,
3415 TALLOC_CTX *mem_ctx,
3416 WERROR *result)
3418 struct rpccli_svcctl_StartServiceW_state *state = tevent_req_data(
3419 req, struct rpccli_svcctl_StartServiceW_state);
3420 NTSTATUS status;
3422 if (tevent_req_is_nterror(req, &status)) {
3423 tevent_req_received(req);
3424 return status;
3427 /* Steal possbile out parameters to the callers context */
3428 talloc_steal(mem_ctx, state->out_mem_ctx);
3430 /* Return result */
3431 *result = state->orig.out.result;
3433 tevent_req_received(req);
3434 return NT_STATUS_OK;
3437 NTSTATUS rpccli_svcctl_StartServiceW(struct rpc_pipe_client *cli,
3438 TALLOC_CTX *mem_ctx,
3439 struct policy_handle *handle /* [in] [ref] */,
3440 uint32_t NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
3441 struct svcctl_ArgumentString *Arguments /* [in] [unique,size_is(NumArgs)] */,
3442 WERROR *werror)
3444 struct svcctl_StartServiceW r;
3445 NTSTATUS status;
3447 /* In parameters */
3448 r.in.handle = handle;
3449 r.in.NumArgs = NumArgs;
3450 r.in.Arguments = Arguments;
3452 if (DEBUGLEVEL >= 10) {
3453 NDR_PRINT_IN_DEBUG(svcctl_StartServiceW, &r);
3456 status = cli->dispatch(cli,
3457 mem_ctx,
3458 &ndr_table_svcctl,
3459 NDR_SVCCTL_STARTSERVICEW,
3460 &r);
3462 if (!NT_STATUS_IS_OK(status)) {
3463 return status;
3466 if (DEBUGLEVEL >= 10) {
3467 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceW, &r);
3470 if (NT_STATUS_IS_ERR(status)) {
3471 return status;
3474 /* Return variables */
3476 /* Return result */
3477 if (werror) {
3478 *werror = r.out.result;
3481 return werror_to_ntstatus(r.out.result);
3484 struct rpccli_svcctl_GetServiceDisplayNameW_state {
3485 struct svcctl_GetServiceDisplayNameW orig;
3486 struct svcctl_GetServiceDisplayNameW tmp;
3487 TALLOC_CTX *out_mem_ctx;
3488 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3491 static void rpccli_svcctl_GetServiceDisplayNameW_done(struct tevent_req *subreq);
3493 struct tevent_req *rpccli_svcctl_GetServiceDisplayNameW_send(TALLOC_CTX *mem_ctx,
3494 struct tevent_context *ev,
3495 struct rpc_pipe_client *cli,
3496 struct policy_handle *_handle /* [in] [ref] */,
3497 const char *_service_name /* [in] [unique,charset(UTF16)] */,
3498 const char **_display_name /* [out] [ref,charset(UTF16)] */,
3499 uint32_t *_display_name_length /* [in,out] [unique] */)
3501 struct tevent_req *req;
3502 struct rpccli_svcctl_GetServiceDisplayNameW_state *state;
3503 struct tevent_req *subreq;
3505 req = tevent_req_create(mem_ctx, &state,
3506 struct rpccli_svcctl_GetServiceDisplayNameW_state);
3507 if (req == NULL) {
3508 return NULL;
3510 state->out_mem_ctx = NULL;
3511 state->dispatch_recv = cli->dispatch_recv;
3513 /* In parameters */
3514 state->orig.in.handle = _handle;
3515 state->orig.in.service_name = _service_name;
3516 state->orig.in.display_name_length = _display_name_length;
3518 /* Out parameters */
3519 state->orig.out.display_name = _display_name;
3520 state->orig.out.display_name_length = _display_name_length;
3522 /* Result */
3523 ZERO_STRUCT(state->orig.out.result);
3525 if (DEBUGLEVEL >= 10) {
3526 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, &state->orig);
3529 state->out_mem_ctx = talloc_named_const(state, 0,
3530 "rpccli_svcctl_GetServiceDisplayNameW_out_memory");
3531 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3532 return tevent_req_post(req, ev);
3535 /* make a temporary copy, that we pass to the dispatch function */
3536 state->tmp = state->orig;
3538 subreq = cli->dispatch_send(state, ev, cli,
3539 &ndr_table_svcctl,
3540 NDR_SVCCTL_GETSERVICEDISPLAYNAMEW,
3541 &state->tmp);
3542 if (tevent_req_nomem(subreq, req)) {
3543 return tevent_req_post(req, ev);
3545 tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceDisplayNameW_done, req);
3546 return req;
3549 static void rpccli_svcctl_GetServiceDisplayNameW_done(struct tevent_req *subreq)
3551 struct tevent_req *req = tevent_req_callback_data(
3552 subreq, struct tevent_req);
3553 struct rpccli_svcctl_GetServiceDisplayNameW_state *state = tevent_req_data(
3554 req, struct rpccli_svcctl_GetServiceDisplayNameW_state);
3555 NTSTATUS status;
3556 TALLOC_CTX *mem_ctx;
3558 if (state->out_mem_ctx) {
3559 mem_ctx = state->out_mem_ctx;
3560 } else {
3561 mem_ctx = state;
3564 status = state->dispatch_recv(subreq, mem_ctx);
3565 TALLOC_FREE(subreq);
3566 if (!NT_STATUS_IS_OK(status)) {
3567 tevent_req_nterror(req, status);
3568 return;
3571 /* Copy out parameters */
3572 *state->orig.out.display_name = *state->tmp.out.display_name;
3573 if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
3574 *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
3577 /* Copy result */
3578 state->orig.out.result = state->tmp.out.result;
3580 /* Reset temporary structure */
3581 ZERO_STRUCT(state->tmp);
3583 if (DEBUGLEVEL >= 10) {
3584 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, &state->orig);
3587 tevent_req_done(req);
3590 NTSTATUS rpccli_svcctl_GetServiceDisplayNameW_recv(struct tevent_req *req,
3591 TALLOC_CTX *mem_ctx,
3592 WERROR *result)
3594 struct rpccli_svcctl_GetServiceDisplayNameW_state *state = tevent_req_data(
3595 req, struct rpccli_svcctl_GetServiceDisplayNameW_state);
3596 NTSTATUS status;
3598 if (tevent_req_is_nterror(req, &status)) {
3599 tevent_req_received(req);
3600 return status;
3603 /* Steal possbile out parameters to the callers context */
3604 talloc_steal(mem_ctx, state->out_mem_ctx);
3606 /* Return result */
3607 *result = state->orig.out.result;
3609 tevent_req_received(req);
3610 return NT_STATUS_OK;
3613 NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli,
3614 TALLOC_CTX *mem_ctx,
3615 struct policy_handle *handle /* [in] [ref] */,
3616 const char *service_name /* [in] [unique,charset(UTF16)] */,
3617 const char **display_name /* [out] [ref,charset(UTF16)] */,
3618 uint32_t *display_name_length /* [in,out] [unique] */,
3619 WERROR *werror)
3621 struct svcctl_GetServiceDisplayNameW r;
3622 NTSTATUS status;
3624 /* In parameters */
3625 r.in.handle = handle;
3626 r.in.service_name = service_name;
3627 r.in.display_name_length = display_name_length;
3629 if (DEBUGLEVEL >= 10) {
3630 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameW, &r);
3633 status = cli->dispatch(cli,
3634 mem_ctx,
3635 &ndr_table_svcctl,
3636 NDR_SVCCTL_GETSERVICEDISPLAYNAMEW,
3637 &r);
3639 if (!NT_STATUS_IS_OK(status)) {
3640 return status;
3643 if (DEBUGLEVEL >= 10) {
3644 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameW, &r);
3647 if (NT_STATUS_IS_ERR(status)) {
3648 return status;
3651 /* Return variables */
3652 *display_name = *r.out.display_name;
3653 if (display_name_length && r.out.display_name_length) {
3654 *display_name_length = *r.out.display_name_length;
3657 /* Return result */
3658 if (werror) {
3659 *werror = r.out.result;
3662 return werror_to_ntstatus(r.out.result);
3665 struct rpccli_svcctl_GetServiceKeyNameW_state {
3666 struct svcctl_GetServiceKeyNameW orig;
3667 struct svcctl_GetServiceKeyNameW tmp;
3668 TALLOC_CTX *out_mem_ctx;
3669 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3672 static void rpccli_svcctl_GetServiceKeyNameW_done(struct tevent_req *subreq);
3674 struct tevent_req *rpccli_svcctl_GetServiceKeyNameW_send(TALLOC_CTX *mem_ctx,
3675 struct tevent_context *ev,
3676 struct rpc_pipe_client *cli,
3677 struct policy_handle *_handle /* [in] [ref] */,
3678 const char *_service_name /* [in] [unique,charset(UTF16)] */,
3679 const char **_key_name /* [out] [ref,charset(UTF16)] */,
3680 uint32_t *_display_name_length /* [in,out] [unique] */)
3682 struct tevent_req *req;
3683 struct rpccli_svcctl_GetServiceKeyNameW_state *state;
3684 struct tevent_req *subreq;
3686 req = tevent_req_create(mem_ctx, &state,
3687 struct rpccli_svcctl_GetServiceKeyNameW_state);
3688 if (req == NULL) {
3689 return NULL;
3691 state->out_mem_ctx = NULL;
3692 state->dispatch_recv = cli->dispatch_recv;
3694 /* In parameters */
3695 state->orig.in.handle = _handle;
3696 state->orig.in.service_name = _service_name;
3697 state->orig.in.display_name_length = _display_name_length;
3699 /* Out parameters */
3700 state->orig.out.key_name = _key_name;
3701 state->orig.out.display_name_length = _display_name_length;
3703 /* Result */
3704 ZERO_STRUCT(state->orig.out.result);
3706 if (DEBUGLEVEL >= 10) {
3707 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, &state->orig);
3710 state->out_mem_ctx = talloc_named_const(state, 0,
3711 "rpccli_svcctl_GetServiceKeyNameW_out_memory");
3712 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3713 return tevent_req_post(req, ev);
3716 /* make a temporary copy, that we pass to the dispatch function */
3717 state->tmp = state->orig;
3719 subreq = cli->dispatch_send(state, ev, cli,
3720 &ndr_table_svcctl,
3721 NDR_SVCCTL_GETSERVICEKEYNAMEW,
3722 &state->tmp);
3723 if (tevent_req_nomem(subreq, req)) {
3724 return tevent_req_post(req, ev);
3726 tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceKeyNameW_done, req);
3727 return req;
3730 static void rpccli_svcctl_GetServiceKeyNameW_done(struct tevent_req *subreq)
3732 struct tevent_req *req = tevent_req_callback_data(
3733 subreq, struct tevent_req);
3734 struct rpccli_svcctl_GetServiceKeyNameW_state *state = tevent_req_data(
3735 req, struct rpccli_svcctl_GetServiceKeyNameW_state);
3736 NTSTATUS status;
3737 TALLOC_CTX *mem_ctx;
3739 if (state->out_mem_ctx) {
3740 mem_ctx = state->out_mem_ctx;
3741 } else {
3742 mem_ctx = state;
3745 status = state->dispatch_recv(subreq, mem_ctx);
3746 TALLOC_FREE(subreq);
3747 if (!NT_STATUS_IS_OK(status)) {
3748 tevent_req_nterror(req, status);
3749 return;
3752 /* Copy out parameters */
3753 *state->orig.out.key_name = *state->tmp.out.key_name;
3754 if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
3755 *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
3758 /* Copy result */
3759 state->orig.out.result = state->tmp.out.result;
3761 /* Reset temporary structure */
3762 ZERO_STRUCT(state->tmp);
3764 if (DEBUGLEVEL >= 10) {
3765 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, &state->orig);
3768 tevent_req_done(req);
3771 NTSTATUS rpccli_svcctl_GetServiceKeyNameW_recv(struct tevent_req *req,
3772 TALLOC_CTX *mem_ctx,
3773 WERROR *result)
3775 struct rpccli_svcctl_GetServiceKeyNameW_state *state = tevent_req_data(
3776 req, struct rpccli_svcctl_GetServiceKeyNameW_state);
3777 NTSTATUS status;
3779 if (tevent_req_is_nterror(req, &status)) {
3780 tevent_req_received(req);
3781 return status;
3784 /* Steal possbile out parameters to the callers context */
3785 talloc_steal(mem_ctx, state->out_mem_ctx);
3787 /* Return result */
3788 *result = state->orig.out.result;
3790 tevent_req_received(req);
3791 return NT_STATUS_OK;
3794 NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli,
3795 TALLOC_CTX *mem_ctx,
3796 struct policy_handle *handle /* [in] [ref] */,
3797 const char *service_name /* [in] [unique,charset(UTF16)] */,
3798 const char **key_name /* [out] [ref,charset(UTF16)] */,
3799 uint32_t *display_name_length /* [in,out] [unique] */,
3800 WERROR *werror)
3802 struct svcctl_GetServiceKeyNameW r;
3803 NTSTATUS status;
3805 /* In parameters */
3806 r.in.handle = handle;
3807 r.in.service_name = service_name;
3808 r.in.display_name_length = display_name_length;
3810 if (DEBUGLEVEL >= 10) {
3811 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameW, &r);
3814 status = cli->dispatch(cli,
3815 mem_ctx,
3816 &ndr_table_svcctl,
3817 NDR_SVCCTL_GETSERVICEKEYNAMEW,
3818 &r);
3820 if (!NT_STATUS_IS_OK(status)) {
3821 return status;
3824 if (DEBUGLEVEL >= 10) {
3825 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameW, &r);
3828 if (NT_STATUS_IS_ERR(status)) {
3829 return status;
3832 /* Return variables */
3833 *key_name = *r.out.key_name;
3834 if (display_name_length && r.out.display_name_length) {
3835 *display_name_length = *r.out.display_name_length;
3838 /* Return result */
3839 if (werror) {
3840 *werror = r.out.result;
3843 return werror_to_ntstatus(r.out.result);
3846 struct rpccli_svcctl_SCSetServiceBitsA_state {
3847 struct svcctl_SCSetServiceBitsA orig;
3848 struct svcctl_SCSetServiceBitsA tmp;
3849 TALLOC_CTX *out_mem_ctx;
3850 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3853 static void rpccli_svcctl_SCSetServiceBitsA_done(struct tevent_req *subreq);
3855 struct tevent_req *rpccli_svcctl_SCSetServiceBitsA_send(TALLOC_CTX *mem_ctx,
3856 struct tevent_context *ev,
3857 struct rpc_pipe_client *cli,
3858 struct policy_handle *_handle /* [in] [ref] */,
3859 uint32_t _bits /* [in] */,
3860 uint32_t _bitson /* [in] */,
3861 uint32_t _immediate /* [in] */)
3863 struct tevent_req *req;
3864 struct rpccli_svcctl_SCSetServiceBitsA_state *state;
3865 struct tevent_req *subreq;
3867 req = tevent_req_create(mem_ctx, &state,
3868 struct rpccli_svcctl_SCSetServiceBitsA_state);
3869 if (req == NULL) {
3870 return NULL;
3872 state->out_mem_ctx = NULL;
3873 state->dispatch_recv = cli->dispatch_recv;
3875 /* In parameters */
3876 state->orig.in.handle = _handle;
3877 state->orig.in.bits = _bits;
3878 state->orig.in.bitson = _bitson;
3879 state->orig.in.immediate = _immediate;
3881 /* Out parameters */
3883 /* Result */
3884 ZERO_STRUCT(state->orig.out.result);
3886 if (DEBUGLEVEL >= 10) {
3887 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, &state->orig);
3890 /* make a temporary copy, that we pass to the dispatch function */
3891 state->tmp = state->orig;
3893 subreq = cli->dispatch_send(state, ev, cli,
3894 &ndr_table_svcctl,
3895 NDR_SVCCTL_SCSETSERVICEBITSA,
3896 &state->tmp);
3897 if (tevent_req_nomem(subreq, req)) {
3898 return tevent_req_post(req, ev);
3900 tevent_req_set_callback(subreq, rpccli_svcctl_SCSetServiceBitsA_done, req);
3901 return req;
3904 static void rpccli_svcctl_SCSetServiceBitsA_done(struct tevent_req *subreq)
3906 struct tevent_req *req = tevent_req_callback_data(
3907 subreq, struct tevent_req);
3908 struct rpccli_svcctl_SCSetServiceBitsA_state *state = tevent_req_data(
3909 req, struct rpccli_svcctl_SCSetServiceBitsA_state);
3910 NTSTATUS status;
3911 TALLOC_CTX *mem_ctx;
3913 if (state->out_mem_ctx) {
3914 mem_ctx = state->out_mem_ctx;
3915 } else {
3916 mem_ctx = state;
3919 status = state->dispatch_recv(subreq, mem_ctx);
3920 TALLOC_FREE(subreq);
3921 if (!NT_STATUS_IS_OK(status)) {
3922 tevent_req_nterror(req, status);
3923 return;
3926 /* Copy out parameters */
3928 /* Copy result */
3929 state->orig.out.result = state->tmp.out.result;
3931 /* Reset temporary structure */
3932 ZERO_STRUCT(state->tmp);
3934 if (DEBUGLEVEL >= 10) {
3935 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, &state->orig);
3938 tevent_req_done(req);
3941 NTSTATUS rpccli_svcctl_SCSetServiceBitsA_recv(struct tevent_req *req,
3942 TALLOC_CTX *mem_ctx,
3943 WERROR *result)
3945 struct rpccli_svcctl_SCSetServiceBitsA_state *state = tevent_req_data(
3946 req, struct rpccli_svcctl_SCSetServiceBitsA_state);
3947 NTSTATUS status;
3949 if (tevent_req_is_nterror(req, &status)) {
3950 tevent_req_received(req);
3951 return status;
3954 /* Steal possbile out parameters to the callers context */
3955 talloc_steal(mem_ctx, state->out_mem_ctx);
3957 /* Return result */
3958 *result = state->orig.out.result;
3960 tevent_req_received(req);
3961 return NT_STATUS_OK;
3964 NTSTATUS rpccli_svcctl_SCSetServiceBitsA(struct rpc_pipe_client *cli,
3965 TALLOC_CTX *mem_ctx,
3966 struct policy_handle *handle /* [in] [ref] */,
3967 uint32_t bits /* [in] */,
3968 uint32_t bitson /* [in] */,
3969 uint32_t immediate /* [in] */,
3970 WERROR *werror)
3972 struct svcctl_SCSetServiceBitsA r;
3973 NTSTATUS status;
3975 /* In parameters */
3976 r.in.handle = handle;
3977 r.in.bits = bits;
3978 r.in.bitson = bitson;
3979 r.in.immediate = immediate;
3981 if (DEBUGLEVEL >= 10) {
3982 NDR_PRINT_IN_DEBUG(svcctl_SCSetServiceBitsA, &r);
3985 status = cli->dispatch(cli,
3986 mem_ctx,
3987 &ndr_table_svcctl,
3988 NDR_SVCCTL_SCSETSERVICEBITSA,
3989 &r);
3991 if (!NT_STATUS_IS_OK(status)) {
3992 return status;
3995 if (DEBUGLEVEL >= 10) {
3996 NDR_PRINT_OUT_DEBUG(svcctl_SCSetServiceBitsA, &r);
3999 if (NT_STATUS_IS_ERR(status)) {
4000 return status;
4003 /* Return variables */
4005 /* Return result */
4006 if (werror) {
4007 *werror = r.out.result;
4010 return werror_to_ntstatus(r.out.result);
4013 struct rpccli_svcctl_ChangeServiceConfigA_state {
4014 struct svcctl_ChangeServiceConfigA orig;
4015 struct svcctl_ChangeServiceConfigA tmp;
4016 TALLOC_CTX *out_mem_ctx;
4017 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4020 static void rpccli_svcctl_ChangeServiceConfigA_done(struct tevent_req *subreq);
4022 struct tevent_req *rpccli_svcctl_ChangeServiceConfigA_send(TALLOC_CTX *mem_ctx,
4023 struct tevent_context *ev,
4024 struct rpc_pipe_client *cli,
4025 struct policy_handle *_handle /* [in] [ref] */,
4026 uint32_t _type /* [in] */,
4027 enum svcctl_StartType _start_type /* [in] */,
4028 enum svcctl_ErrorControl _error_control /* [in] */,
4029 const char *_binary_path /* [in] [unique,charset(UTF16)] */,
4030 const char *_load_order_group /* [in] [unique,charset(UTF16)] */,
4031 uint32_t *_tag_id /* [out] [ref] */,
4032 const char *_dependencies /* [in] [unique,charset(UTF16)] */,
4033 const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
4034 const char *_password /* [in] [unique,charset(UTF16)] */,
4035 const char *_display_name /* [in] [unique,charset(UTF16)] */)
4037 struct tevent_req *req;
4038 struct rpccli_svcctl_ChangeServiceConfigA_state *state;
4039 struct tevent_req *subreq;
4041 req = tevent_req_create(mem_ctx, &state,
4042 struct rpccli_svcctl_ChangeServiceConfigA_state);
4043 if (req == NULL) {
4044 return NULL;
4046 state->out_mem_ctx = NULL;
4047 state->dispatch_recv = cli->dispatch_recv;
4049 /* In parameters */
4050 state->orig.in.handle = _handle;
4051 state->orig.in.type = _type;
4052 state->orig.in.start_type = _start_type;
4053 state->orig.in.error_control = _error_control;
4054 state->orig.in.binary_path = _binary_path;
4055 state->orig.in.load_order_group = _load_order_group;
4056 state->orig.in.dependencies = _dependencies;
4057 state->orig.in.service_start_name = _service_start_name;
4058 state->orig.in.password = _password;
4059 state->orig.in.display_name = _display_name;
4061 /* Out parameters */
4062 state->orig.out.tag_id = _tag_id;
4064 /* Result */
4065 ZERO_STRUCT(state->orig.out.result);
4067 if (DEBUGLEVEL >= 10) {
4068 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, &state->orig);
4071 state->out_mem_ctx = talloc_named_const(state, 0,
4072 "rpccli_svcctl_ChangeServiceConfigA_out_memory");
4073 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4074 return tevent_req_post(req, ev);
4077 /* make a temporary copy, that we pass to the dispatch function */
4078 state->tmp = state->orig;
4080 subreq = cli->dispatch_send(state, ev, cli,
4081 &ndr_table_svcctl,
4082 NDR_SVCCTL_CHANGESERVICECONFIGA,
4083 &state->tmp);
4084 if (tevent_req_nomem(subreq, req)) {
4085 return tevent_req_post(req, ev);
4087 tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfigA_done, req);
4088 return req;
4091 static void rpccli_svcctl_ChangeServiceConfigA_done(struct tevent_req *subreq)
4093 struct tevent_req *req = tevent_req_callback_data(
4094 subreq, struct tevent_req);
4095 struct rpccli_svcctl_ChangeServiceConfigA_state *state = tevent_req_data(
4096 req, struct rpccli_svcctl_ChangeServiceConfigA_state);
4097 NTSTATUS status;
4098 TALLOC_CTX *mem_ctx;
4100 if (state->out_mem_ctx) {
4101 mem_ctx = state->out_mem_ctx;
4102 } else {
4103 mem_ctx = state;
4106 status = state->dispatch_recv(subreq, mem_ctx);
4107 TALLOC_FREE(subreq);
4108 if (!NT_STATUS_IS_OK(status)) {
4109 tevent_req_nterror(req, status);
4110 return;
4113 /* Copy out parameters */
4114 *state->orig.out.tag_id = *state->tmp.out.tag_id;
4116 /* Copy result */
4117 state->orig.out.result = state->tmp.out.result;
4119 /* Reset temporary structure */
4120 ZERO_STRUCT(state->tmp);
4122 if (DEBUGLEVEL >= 10) {
4123 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, &state->orig);
4126 tevent_req_done(req);
4129 NTSTATUS rpccli_svcctl_ChangeServiceConfigA_recv(struct tevent_req *req,
4130 TALLOC_CTX *mem_ctx,
4131 WERROR *result)
4133 struct rpccli_svcctl_ChangeServiceConfigA_state *state = tevent_req_data(
4134 req, struct rpccli_svcctl_ChangeServiceConfigA_state);
4135 NTSTATUS status;
4137 if (tevent_req_is_nterror(req, &status)) {
4138 tevent_req_received(req);
4139 return status;
4142 /* Steal possbile out parameters to the callers context */
4143 talloc_steal(mem_ctx, state->out_mem_ctx);
4145 /* Return result */
4146 *result = state->orig.out.result;
4148 tevent_req_received(req);
4149 return NT_STATUS_OK;
4152 NTSTATUS rpccli_svcctl_ChangeServiceConfigA(struct rpc_pipe_client *cli,
4153 TALLOC_CTX *mem_ctx,
4154 struct policy_handle *handle /* [in] [ref] */,
4155 uint32_t type /* [in] */,
4156 enum svcctl_StartType start_type /* [in] */,
4157 enum svcctl_ErrorControl error_control /* [in] */,
4158 const char *binary_path /* [in] [unique,charset(UTF16)] */,
4159 const char *load_order_group /* [in] [unique,charset(UTF16)] */,
4160 uint32_t *tag_id /* [out] [ref] */,
4161 const char *dependencies /* [in] [unique,charset(UTF16)] */,
4162 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
4163 const char *password /* [in] [unique,charset(UTF16)] */,
4164 const char *display_name /* [in] [unique,charset(UTF16)] */,
4165 WERROR *werror)
4167 struct svcctl_ChangeServiceConfigA r;
4168 NTSTATUS status;
4170 /* In parameters */
4171 r.in.handle = handle;
4172 r.in.type = type;
4173 r.in.start_type = start_type;
4174 r.in.error_control = error_control;
4175 r.in.binary_path = binary_path;
4176 r.in.load_order_group = load_order_group;
4177 r.in.dependencies = dependencies;
4178 r.in.service_start_name = service_start_name;
4179 r.in.password = password;
4180 r.in.display_name = display_name;
4182 if (DEBUGLEVEL >= 10) {
4183 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfigA, &r);
4186 status = cli->dispatch(cli,
4187 mem_ctx,
4188 &ndr_table_svcctl,
4189 NDR_SVCCTL_CHANGESERVICECONFIGA,
4190 &r);
4192 if (!NT_STATUS_IS_OK(status)) {
4193 return status;
4196 if (DEBUGLEVEL >= 10) {
4197 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfigA, &r);
4200 if (NT_STATUS_IS_ERR(status)) {
4201 return status;
4204 /* Return variables */
4205 *tag_id = *r.out.tag_id;
4207 /* Return result */
4208 if (werror) {
4209 *werror = r.out.result;
4212 return werror_to_ntstatus(r.out.result);
4215 struct rpccli_svcctl_CreateServiceA_state {
4216 struct svcctl_CreateServiceA orig;
4217 struct svcctl_CreateServiceA tmp;
4218 TALLOC_CTX *out_mem_ctx;
4219 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4222 static void rpccli_svcctl_CreateServiceA_done(struct tevent_req *subreq);
4224 struct tevent_req *rpccli_svcctl_CreateServiceA_send(TALLOC_CTX *mem_ctx,
4225 struct tevent_context *ev,
4226 struct rpc_pipe_client *cli,
4227 struct policy_handle *_handle /* [in] [ref] */,
4228 const char *_ServiceName /* [in] [unique,charset(UTF16)] */,
4229 const char *_DisplayName /* [in] [unique,charset(UTF16)] */,
4230 uint32_t _desired_access /* [in] */,
4231 uint32_t _type /* [in] */,
4232 enum svcctl_StartType _start_type /* [in] */,
4233 enum svcctl_ErrorControl _error_control /* [in] */,
4234 const char *_binary_path /* [in] [unique,charset(UTF16)] */,
4235 const char *_LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
4236 uint32_t *_TagId /* [out] [unique] */,
4237 const char *_dependencies /* [in] [unique,charset(UTF16)] */,
4238 const char *_service_start_name /* [in] [unique,charset(UTF16)] */,
4239 const char *_password /* [in] [unique,charset(UTF16)] */)
4241 struct tevent_req *req;
4242 struct rpccli_svcctl_CreateServiceA_state *state;
4243 struct tevent_req *subreq;
4245 req = tevent_req_create(mem_ctx, &state,
4246 struct rpccli_svcctl_CreateServiceA_state);
4247 if (req == NULL) {
4248 return NULL;
4250 state->out_mem_ctx = NULL;
4251 state->dispatch_recv = cli->dispatch_recv;
4253 /* In parameters */
4254 state->orig.in.handle = _handle;
4255 state->orig.in.ServiceName = _ServiceName;
4256 state->orig.in.DisplayName = _DisplayName;
4257 state->orig.in.desired_access = _desired_access;
4258 state->orig.in.type = _type;
4259 state->orig.in.start_type = _start_type;
4260 state->orig.in.error_control = _error_control;
4261 state->orig.in.binary_path = _binary_path;
4262 state->orig.in.LoadOrderGroupKey = _LoadOrderGroupKey;
4263 state->orig.in.dependencies = _dependencies;
4264 state->orig.in.service_start_name = _service_start_name;
4265 state->orig.in.password = _password;
4267 /* Out parameters */
4268 state->orig.out.TagId = _TagId;
4270 /* Result */
4271 ZERO_STRUCT(state->orig.out.result);
4273 if (DEBUGLEVEL >= 10) {
4274 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, &state->orig);
4277 state->out_mem_ctx = talloc_named_const(state, 0,
4278 "rpccli_svcctl_CreateServiceA_out_memory");
4279 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4280 return tevent_req_post(req, ev);
4283 /* make a temporary copy, that we pass to the dispatch function */
4284 state->tmp = state->orig;
4286 subreq = cli->dispatch_send(state, ev, cli,
4287 &ndr_table_svcctl,
4288 NDR_SVCCTL_CREATESERVICEA,
4289 &state->tmp);
4290 if (tevent_req_nomem(subreq, req)) {
4291 return tevent_req_post(req, ev);
4293 tevent_req_set_callback(subreq, rpccli_svcctl_CreateServiceA_done, req);
4294 return req;
4297 static void rpccli_svcctl_CreateServiceA_done(struct tevent_req *subreq)
4299 struct tevent_req *req = tevent_req_callback_data(
4300 subreq, struct tevent_req);
4301 struct rpccli_svcctl_CreateServiceA_state *state = tevent_req_data(
4302 req, struct rpccli_svcctl_CreateServiceA_state);
4303 NTSTATUS status;
4304 TALLOC_CTX *mem_ctx;
4306 if (state->out_mem_ctx) {
4307 mem_ctx = state->out_mem_ctx;
4308 } else {
4309 mem_ctx = state;
4312 status = state->dispatch_recv(subreq, mem_ctx);
4313 TALLOC_FREE(subreq);
4314 if (!NT_STATUS_IS_OK(status)) {
4315 tevent_req_nterror(req, status);
4316 return;
4319 /* Copy out parameters */
4320 if (state->orig.out.TagId && state->tmp.out.TagId) {
4321 *state->orig.out.TagId = *state->tmp.out.TagId;
4324 /* Copy result */
4325 state->orig.out.result = state->tmp.out.result;
4327 /* Reset temporary structure */
4328 ZERO_STRUCT(state->tmp);
4330 if (DEBUGLEVEL >= 10) {
4331 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, &state->orig);
4334 tevent_req_done(req);
4337 NTSTATUS rpccli_svcctl_CreateServiceA_recv(struct tevent_req *req,
4338 TALLOC_CTX *mem_ctx,
4339 WERROR *result)
4341 struct rpccli_svcctl_CreateServiceA_state *state = tevent_req_data(
4342 req, struct rpccli_svcctl_CreateServiceA_state);
4343 NTSTATUS status;
4345 if (tevent_req_is_nterror(req, &status)) {
4346 tevent_req_received(req);
4347 return status;
4350 /* Steal possbile out parameters to the callers context */
4351 talloc_steal(mem_ctx, state->out_mem_ctx);
4353 /* Return result */
4354 *result = state->orig.out.result;
4356 tevent_req_received(req);
4357 return NT_STATUS_OK;
4360 NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli,
4361 TALLOC_CTX *mem_ctx,
4362 struct policy_handle *handle /* [in] [ref] */,
4363 const char *ServiceName /* [in] [unique,charset(UTF16)] */,
4364 const char *DisplayName /* [in] [unique,charset(UTF16)] */,
4365 uint32_t desired_access /* [in] */,
4366 uint32_t type /* [in] */,
4367 enum svcctl_StartType start_type /* [in] */,
4368 enum svcctl_ErrorControl error_control /* [in] */,
4369 const char *binary_path /* [in] [unique,charset(UTF16)] */,
4370 const char *LoadOrderGroupKey /* [in] [unique,charset(UTF16)] */,
4371 uint32_t *TagId /* [out] [unique] */,
4372 const char *dependencies /* [in] [unique,charset(UTF16)] */,
4373 const char *service_start_name /* [in] [unique,charset(UTF16)] */,
4374 const char *password /* [in] [unique,charset(UTF16)] */,
4375 WERROR *werror)
4377 struct svcctl_CreateServiceA r;
4378 NTSTATUS status;
4380 /* In parameters */
4381 r.in.handle = handle;
4382 r.in.ServiceName = ServiceName;
4383 r.in.DisplayName = DisplayName;
4384 r.in.desired_access = desired_access;
4385 r.in.type = type;
4386 r.in.start_type = start_type;
4387 r.in.error_control = error_control;
4388 r.in.binary_path = binary_path;
4389 r.in.LoadOrderGroupKey = LoadOrderGroupKey;
4390 r.in.dependencies = dependencies;
4391 r.in.service_start_name = service_start_name;
4392 r.in.password = password;
4394 if (DEBUGLEVEL >= 10) {
4395 NDR_PRINT_IN_DEBUG(svcctl_CreateServiceA, &r);
4398 status = cli->dispatch(cli,
4399 mem_ctx,
4400 &ndr_table_svcctl,
4401 NDR_SVCCTL_CREATESERVICEA,
4402 &r);
4404 if (!NT_STATUS_IS_OK(status)) {
4405 return status;
4408 if (DEBUGLEVEL >= 10) {
4409 NDR_PRINT_OUT_DEBUG(svcctl_CreateServiceA, &r);
4412 if (NT_STATUS_IS_ERR(status)) {
4413 return status;
4416 /* Return variables */
4417 if (TagId && r.out.TagId) {
4418 *TagId = *r.out.TagId;
4421 /* Return result */
4422 if (werror) {
4423 *werror = r.out.result;
4426 return werror_to_ntstatus(r.out.result);
4429 struct rpccli_svcctl_EnumDependentServicesA_state {
4430 struct svcctl_EnumDependentServicesA orig;
4431 struct svcctl_EnumDependentServicesA tmp;
4432 TALLOC_CTX *out_mem_ctx;
4433 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4436 static void rpccli_svcctl_EnumDependentServicesA_done(struct tevent_req *subreq);
4438 struct tevent_req *rpccli_svcctl_EnumDependentServicesA_send(TALLOC_CTX *mem_ctx,
4439 struct tevent_context *ev,
4440 struct rpc_pipe_client *cli,
4441 struct policy_handle *_service /* [in] [ref] */,
4442 enum svcctl_ServiceState _state /* [in] */,
4443 struct ENUM_SERVICE_STATUSA *_service_status /* [out] [unique] */,
4444 uint32_t _offered /* [in] */,
4445 uint32_t *_needed /* [out] [ref] */,
4446 uint32_t *_services_returned /* [out] [ref] */)
4448 struct tevent_req *req;
4449 struct rpccli_svcctl_EnumDependentServicesA_state *state;
4450 struct tevent_req *subreq;
4452 req = tevent_req_create(mem_ctx, &state,
4453 struct rpccli_svcctl_EnumDependentServicesA_state);
4454 if (req == NULL) {
4455 return NULL;
4457 state->out_mem_ctx = NULL;
4458 state->dispatch_recv = cli->dispatch_recv;
4460 /* In parameters */
4461 state->orig.in.service = _service;
4462 state->orig.in.state = _state;
4463 state->orig.in.offered = _offered;
4465 /* Out parameters */
4466 state->orig.out.service_status = _service_status;
4467 state->orig.out.needed = _needed;
4468 state->orig.out.services_returned = _services_returned;
4470 /* Result */
4471 ZERO_STRUCT(state->orig.out.result);
4473 if (DEBUGLEVEL >= 10) {
4474 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, &state->orig);
4477 state->out_mem_ctx = talloc_named_const(state, 0,
4478 "rpccli_svcctl_EnumDependentServicesA_out_memory");
4479 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4480 return tevent_req_post(req, ev);
4483 /* make a temporary copy, that we pass to the dispatch function */
4484 state->tmp = state->orig;
4486 subreq = cli->dispatch_send(state, ev, cli,
4487 &ndr_table_svcctl,
4488 NDR_SVCCTL_ENUMDEPENDENTSERVICESA,
4489 &state->tmp);
4490 if (tevent_req_nomem(subreq, req)) {
4491 return tevent_req_post(req, ev);
4493 tevent_req_set_callback(subreq, rpccli_svcctl_EnumDependentServicesA_done, req);
4494 return req;
4497 static void rpccli_svcctl_EnumDependentServicesA_done(struct tevent_req *subreq)
4499 struct tevent_req *req = tevent_req_callback_data(
4500 subreq, struct tevent_req);
4501 struct rpccli_svcctl_EnumDependentServicesA_state *state = tevent_req_data(
4502 req, struct rpccli_svcctl_EnumDependentServicesA_state);
4503 NTSTATUS status;
4504 TALLOC_CTX *mem_ctx;
4506 if (state->out_mem_ctx) {
4507 mem_ctx = state->out_mem_ctx;
4508 } else {
4509 mem_ctx = state;
4512 status = state->dispatch_recv(subreq, mem_ctx);
4513 TALLOC_FREE(subreq);
4514 if (!NT_STATUS_IS_OK(status)) {
4515 tevent_req_nterror(req, status);
4516 return;
4519 /* Copy out parameters */
4520 if (state->orig.out.service_status && state->tmp.out.service_status) {
4521 *state->orig.out.service_status = *state->tmp.out.service_status;
4523 *state->orig.out.needed = *state->tmp.out.needed;
4524 *state->orig.out.services_returned = *state->tmp.out.services_returned;
4526 /* Copy result */
4527 state->orig.out.result = state->tmp.out.result;
4529 /* Reset temporary structure */
4530 ZERO_STRUCT(state->tmp);
4532 if (DEBUGLEVEL >= 10) {
4533 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, &state->orig);
4536 tevent_req_done(req);
4539 NTSTATUS rpccli_svcctl_EnumDependentServicesA_recv(struct tevent_req *req,
4540 TALLOC_CTX *mem_ctx,
4541 WERROR *result)
4543 struct rpccli_svcctl_EnumDependentServicesA_state *state = tevent_req_data(
4544 req, struct rpccli_svcctl_EnumDependentServicesA_state);
4545 NTSTATUS status;
4547 if (tevent_req_is_nterror(req, &status)) {
4548 tevent_req_received(req);
4549 return status;
4552 /* Steal possbile out parameters to the callers context */
4553 talloc_steal(mem_ctx, state->out_mem_ctx);
4555 /* Return result */
4556 *result = state->orig.out.result;
4558 tevent_req_received(req);
4559 return NT_STATUS_OK;
4562 NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli,
4563 TALLOC_CTX *mem_ctx,
4564 struct policy_handle *service /* [in] [ref] */,
4565 enum svcctl_ServiceState state /* [in] */,
4566 struct ENUM_SERVICE_STATUSA *service_status /* [out] [unique] */,
4567 uint32_t offered /* [in] */,
4568 uint32_t *needed /* [out] [ref] */,
4569 uint32_t *services_returned /* [out] [ref] */,
4570 WERROR *werror)
4572 struct svcctl_EnumDependentServicesA r;
4573 NTSTATUS status;
4575 /* In parameters */
4576 r.in.service = service;
4577 r.in.state = state;
4578 r.in.offered = offered;
4580 if (DEBUGLEVEL >= 10) {
4581 NDR_PRINT_IN_DEBUG(svcctl_EnumDependentServicesA, &r);
4584 status = cli->dispatch(cli,
4585 mem_ctx,
4586 &ndr_table_svcctl,
4587 NDR_SVCCTL_ENUMDEPENDENTSERVICESA,
4588 &r);
4590 if (!NT_STATUS_IS_OK(status)) {
4591 return status;
4594 if (DEBUGLEVEL >= 10) {
4595 NDR_PRINT_OUT_DEBUG(svcctl_EnumDependentServicesA, &r);
4598 if (NT_STATUS_IS_ERR(status)) {
4599 return status;
4602 /* Return variables */
4603 if (service_status && r.out.service_status) {
4604 *service_status = *r.out.service_status;
4606 *needed = *r.out.needed;
4607 *services_returned = *r.out.services_returned;
4609 /* Return result */
4610 if (werror) {
4611 *werror = r.out.result;
4614 return werror_to_ntstatus(r.out.result);
4617 struct rpccli_svcctl_EnumServicesStatusA_state {
4618 struct svcctl_EnumServicesStatusA orig;
4619 struct svcctl_EnumServicesStatusA tmp;
4620 TALLOC_CTX *out_mem_ctx;
4621 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4624 static void rpccli_svcctl_EnumServicesStatusA_done(struct tevent_req *subreq);
4626 struct tevent_req *rpccli_svcctl_EnumServicesStatusA_send(TALLOC_CTX *mem_ctx,
4627 struct tevent_context *ev,
4628 struct rpc_pipe_client *cli,
4629 struct policy_handle *_handle /* [in] [ref] */,
4630 uint32_t _type /* [in] */,
4631 enum svcctl_ServiceState _state /* [in] */,
4632 uint32_t _offered /* [in] */,
4633 uint8_t *_service /* [out] [size_is(offered)] */,
4634 uint32_t *_needed /* [out] [ref] */,
4635 uint32_t *_services_returned /* [out] [ref] */,
4636 uint32_t *_resume_handle /* [in,out] [unique] */)
4638 struct tevent_req *req;
4639 struct rpccli_svcctl_EnumServicesStatusA_state *state;
4640 struct tevent_req *subreq;
4642 req = tevent_req_create(mem_ctx, &state,
4643 struct rpccli_svcctl_EnumServicesStatusA_state);
4644 if (req == NULL) {
4645 return NULL;
4647 state->out_mem_ctx = NULL;
4648 state->dispatch_recv = cli->dispatch_recv;
4650 /* In parameters */
4651 state->orig.in.handle = _handle;
4652 state->orig.in.type = _type;
4653 state->orig.in.state = _state;
4654 state->orig.in.offered = _offered;
4655 state->orig.in.resume_handle = _resume_handle;
4657 /* Out parameters */
4658 state->orig.out.service = _service;
4659 state->orig.out.needed = _needed;
4660 state->orig.out.services_returned = _services_returned;
4661 state->orig.out.resume_handle = _resume_handle;
4663 /* Result */
4664 ZERO_STRUCT(state->orig.out.result);
4666 if (DEBUGLEVEL >= 10) {
4667 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, &state->orig);
4670 state->out_mem_ctx = talloc_named_const(state, 0,
4671 "rpccli_svcctl_EnumServicesStatusA_out_memory");
4672 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4673 return tevent_req_post(req, ev);
4676 /* make a temporary copy, that we pass to the dispatch function */
4677 state->tmp = state->orig;
4679 subreq = cli->dispatch_send(state, ev, cli,
4680 &ndr_table_svcctl,
4681 NDR_SVCCTL_ENUMSERVICESSTATUSA,
4682 &state->tmp);
4683 if (tevent_req_nomem(subreq, req)) {
4684 return tevent_req_post(req, ev);
4686 tevent_req_set_callback(subreq, rpccli_svcctl_EnumServicesStatusA_done, req);
4687 return req;
4690 static void rpccli_svcctl_EnumServicesStatusA_done(struct tevent_req *subreq)
4692 struct tevent_req *req = tevent_req_callback_data(
4693 subreq, struct tevent_req);
4694 struct rpccli_svcctl_EnumServicesStatusA_state *state = tevent_req_data(
4695 req, struct rpccli_svcctl_EnumServicesStatusA_state);
4696 NTSTATUS status;
4697 TALLOC_CTX *mem_ctx;
4699 if (state->out_mem_ctx) {
4700 mem_ctx = state->out_mem_ctx;
4701 } else {
4702 mem_ctx = state;
4705 status = state->dispatch_recv(subreq, mem_ctx);
4706 TALLOC_FREE(subreq);
4707 if (!NT_STATUS_IS_OK(status)) {
4708 tevent_req_nterror(req, status);
4709 return;
4712 /* Copy out parameters */
4713 memcpy(state->orig.out.service, state->tmp.out.service, state->tmp.in.offered * sizeof(*state->orig.out.service));
4714 *state->orig.out.needed = *state->tmp.out.needed;
4715 *state->orig.out.services_returned = *state->tmp.out.services_returned;
4716 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
4717 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
4720 /* Copy result */
4721 state->orig.out.result = state->tmp.out.result;
4723 /* Reset temporary structure */
4724 ZERO_STRUCT(state->tmp);
4726 if (DEBUGLEVEL >= 10) {
4727 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, &state->orig);
4730 tevent_req_done(req);
4733 NTSTATUS rpccli_svcctl_EnumServicesStatusA_recv(struct tevent_req *req,
4734 TALLOC_CTX *mem_ctx,
4735 WERROR *result)
4737 struct rpccli_svcctl_EnumServicesStatusA_state *state = tevent_req_data(
4738 req, struct rpccli_svcctl_EnumServicesStatusA_state);
4739 NTSTATUS status;
4741 if (tevent_req_is_nterror(req, &status)) {
4742 tevent_req_received(req);
4743 return status;
4746 /* Steal possbile out parameters to the callers context */
4747 talloc_steal(mem_ctx, state->out_mem_ctx);
4749 /* Return result */
4750 *result = state->orig.out.result;
4752 tevent_req_received(req);
4753 return NT_STATUS_OK;
4756 NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli,
4757 TALLOC_CTX *mem_ctx,
4758 struct policy_handle *handle /* [in] [ref] */,
4759 uint32_t type /* [in] */,
4760 enum svcctl_ServiceState state /* [in] */,
4761 uint32_t offered /* [in] */,
4762 uint8_t *service /* [out] [size_is(offered)] */,
4763 uint32_t *needed /* [out] [ref] */,
4764 uint32_t *services_returned /* [out] [ref] */,
4765 uint32_t *resume_handle /* [in,out] [unique] */,
4766 WERROR *werror)
4768 struct svcctl_EnumServicesStatusA r;
4769 NTSTATUS status;
4771 /* In parameters */
4772 r.in.handle = handle;
4773 r.in.type = type;
4774 r.in.state = state;
4775 r.in.offered = offered;
4776 r.in.resume_handle = resume_handle;
4778 if (DEBUGLEVEL >= 10) {
4779 NDR_PRINT_IN_DEBUG(svcctl_EnumServicesStatusA, &r);
4782 status = cli->dispatch(cli,
4783 mem_ctx,
4784 &ndr_table_svcctl,
4785 NDR_SVCCTL_ENUMSERVICESSTATUSA,
4786 &r);
4788 if (!NT_STATUS_IS_OK(status)) {
4789 return status;
4792 if (DEBUGLEVEL >= 10) {
4793 NDR_PRINT_OUT_DEBUG(svcctl_EnumServicesStatusA, &r);
4796 if (NT_STATUS_IS_ERR(status)) {
4797 return status;
4800 /* Return variables */
4801 memcpy(service, r.out.service, r.in.offered * sizeof(*service));
4802 *needed = *r.out.needed;
4803 *services_returned = *r.out.services_returned;
4804 if (resume_handle && r.out.resume_handle) {
4805 *resume_handle = *r.out.resume_handle;
4808 /* Return result */
4809 if (werror) {
4810 *werror = r.out.result;
4813 return werror_to_ntstatus(r.out.result);
4816 struct rpccli_svcctl_OpenSCManagerA_state {
4817 struct svcctl_OpenSCManagerA orig;
4818 struct svcctl_OpenSCManagerA tmp;
4819 TALLOC_CTX *out_mem_ctx;
4820 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4823 static void rpccli_svcctl_OpenSCManagerA_done(struct tevent_req *subreq);
4825 struct tevent_req *rpccli_svcctl_OpenSCManagerA_send(TALLOC_CTX *mem_ctx,
4826 struct tevent_context *ev,
4827 struct rpc_pipe_client *cli,
4828 const char *_MachineName /* [in] [unique,charset(UTF16)] */,
4829 const char *_DatabaseName /* [in] [unique,charset(UTF16)] */,
4830 uint32_t _access_mask /* [in] */,
4831 struct policy_handle *_handle /* [out] [ref] */)
4833 struct tevent_req *req;
4834 struct rpccli_svcctl_OpenSCManagerA_state *state;
4835 struct tevent_req *subreq;
4837 req = tevent_req_create(mem_ctx, &state,
4838 struct rpccli_svcctl_OpenSCManagerA_state);
4839 if (req == NULL) {
4840 return NULL;
4842 state->out_mem_ctx = NULL;
4843 state->dispatch_recv = cli->dispatch_recv;
4845 /* In parameters */
4846 state->orig.in.MachineName = _MachineName;
4847 state->orig.in.DatabaseName = _DatabaseName;
4848 state->orig.in.access_mask = _access_mask;
4850 /* Out parameters */
4851 state->orig.out.handle = _handle;
4853 /* Result */
4854 ZERO_STRUCT(state->orig.out.result);
4856 if (DEBUGLEVEL >= 10) {
4857 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, &state->orig);
4860 state->out_mem_ctx = talloc_named_const(state, 0,
4861 "rpccli_svcctl_OpenSCManagerA_out_memory");
4862 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4863 return tevent_req_post(req, ev);
4866 /* make a temporary copy, that we pass to the dispatch function */
4867 state->tmp = state->orig;
4869 subreq = cli->dispatch_send(state, ev, cli,
4870 &ndr_table_svcctl,
4871 NDR_SVCCTL_OPENSCMANAGERA,
4872 &state->tmp);
4873 if (tevent_req_nomem(subreq, req)) {
4874 return tevent_req_post(req, ev);
4876 tevent_req_set_callback(subreq, rpccli_svcctl_OpenSCManagerA_done, req);
4877 return req;
4880 static void rpccli_svcctl_OpenSCManagerA_done(struct tevent_req *subreq)
4882 struct tevent_req *req = tevent_req_callback_data(
4883 subreq, struct tevent_req);
4884 struct rpccli_svcctl_OpenSCManagerA_state *state = tevent_req_data(
4885 req, struct rpccli_svcctl_OpenSCManagerA_state);
4886 NTSTATUS status;
4887 TALLOC_CTX *mem_ctx;
4889 if (state->out_mem_ctx) {
4890 mem_ctx = state->out_mem_ctx;
4891 } else {
4892 mem_ctx = state;
4895 status = state->dispatch_recv(subreq, mem_ctx);
4896 TALLOC_FREE(subreq);
4897 if (!NT_STATUS_IS_OK(status)) {
4898 tevent_req_nterror(req, status);
4899 return;
4902 /* Copy out parameters */
4903 *state->orig.out.handle = *state->tmp.out.handle;
4905 /* Copy result */
4906 state->orig.out.result = state->tmp.out.result;
4908 /* Reset temporary structure */
4909 ZERO_STRUCT(state->tmp);
4911 if (DEBUGLEVEL >= 10) {
4912 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, &state->orig);
4915 tevent_req_done(req);
4918 NTSTATUS rpccli_svcctl_OpenSCManagerA_recv(struct tevent_req *req,
4919 TALLOC_CTX *mem_ctx,
4920 WERROR *result)
4922 struct rpccli_svcctl_OpenSCManagerA_state *state = tevent_req_data(
4923 req, struct rpccli_svcctl_OpenSCManagerA_state);
4924 NTSTATUS status;
4926 if (tevent_req_is_nterror(req, &status)) {
4927 tevent_req_received(req);
4928 return status;
4931 /* Steal possbile out parameters to the callers context */
4932 talloc_steal(mem_ctx, state->out_mem_ctx);
4934 /* Return result */
4935 *result = state->orig.out.result;
4937 tevent_req_received(req);
4938 return NT_STATUS_OK;
4941 NTSTATUS rpccli_svcctl_OpenSCManagerA(struct rpc_pipe_client *cli,
4942 TALLOC_CTX *mem_ctx,
4943 const char *MachineName /* [in] [unique,charset(UTF16)] */,
4944 const char *DatabaseName /* [in] [unique,charset(UTF16)] */,
4945 uint32_t access_mask /* [in] */,
4946 struct policy_handle *handle /* [out] [ref] */,
4947 WERROR *werror)
4949 struct svcctl_OpenSCManagerA r;
4950 NTSTATUS status;
4952 /* In parameters */
4953 r.in.MachineName = MachineName;
4954 r.in.DatabaseName = DatabaseName;
4955 r.in.access_mask = access_mask;
4957 if (DEBUGLEVEL >= 10) {
4958 NDR_PRINT_IN_DEBUG(svcctl_OpenSCManagerA, &r);
4961 status = cli->dispatch(cli,
4962 mem_ctx,
4963 &ndr_table_svcctl,
4964 NDR_SVCCTL_OPENSCMANAGERA,
4965 &r);
4967 if (!NT_STATUS_IS_OK(status)) {
4968 return status;
4971 if (DEBUGLEVEL >= 10) {
4972 NDR_PRINT_OUT_DEBUG(svcctl_OpenSCManagerA, &r);
4975 if (NT_STATUS_IS_ERR(status)) {
4976 return status;
4979 /* Return variables */
4980 *handle = *r.out.handle;
4982 /* Return result */
4983 if (werror) {
4984 *werror = r.out.result;
4987 return werror_to_ntstatus(r.out.result);
4990 struct rpccli_svcctl_OpenServiceA_state {
4991 struct svcctl_OpenServiceA orig;
4992 struct svcctl_OpenServiceA tmp;
4993 TALLOC_CTX *out_mem_ctx;
4994 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4997 static void rpccli_svcctl_OpenServiceA_done(struct tevent_req *subreq);
4999 struct tevent_req *rpccli_svcctl_OpenServiceA_send(TALLOC_CTX *mem_ctx,
5000 struct tevent_context *ev,
5001 struct rpc_pipe_client *cli,
5002 struct policy_handle *_scmanager_handle /* [in] [ref] */,
5003 const char *_ServiceName /* [in] [unique,charset(UTF16)] */,
5004 uint32_t _access_mask /* [in] */)
5006 struct tevent_req *req;
5007 struct rpccli_svcctl_OpenServiceA_state *state;
5008 struct tevent_req *subreq;
5010 req = tevent_req_create(mem_ctx, &state,
5011 struct rpccli_svcctl_OpenServiceA_state);
5012 if (req == NULL) {
5013 return NULL;
5015 state->out_mem_ctx = NULL;
5016 state->dispatch_recv = cli->dispatch_recv;
5018 /* In parameters */
5019 state->orig.in.scmanager_handle = _scmanager_handle;
5020 state->orig.in.ServiceName = _ServiceName;
5021 state->orig.in.access_mask = _access_mask;
5023 /* Out parameters */
5025 /* Result */
5026 ZERO_STRUCT(state->orig.out.result);
5028 if (DEBUGLEVEL >= 10) {
5029 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, &state->orig);
5032 /* make a temporary copy, that we pass to the dispatch function */
5033 state->tmp = state->orig;
5035 subreq = cli->dispatch_send(state, ev, cli,
5036 &ndr_table_svcctl,
5037 NDR_SVCCTL_OPENSERVICEA,
5038 &state->tmp);
5039 if (tevent_req_nomem(subreq, req)) {
5040 return tevent_req_post(req, ev);
5042 tevent_req_set_callback(subreq, rpccli_svcctl_OpenServiceA_done, req);
5043 return req;
5046 static void rpccli_svcctl_OpenServiceA_done(struct tevent_req *subreq)
5048 struct tevent_req *req = tevent_req_callback_data(
5049 subreq, struct tevent_req);
5050 struct rpccli_svcctl_OpenServiceA_state *state = tevent_req_data(
5051 req, struct rpccli_svcctl_OpenServiceA_state);
5052 NTSTATUS status;
5053 TALLOC_CTX *mem_ctx;
5055 if (state->out_mem_ctx) {
5056 mem_ctx = state->out_mem_ctx;
5057 } else {
5058 mem_ctx = state;
5061 status = state->dispatch_recv(subreq, mem_ctx);
5062 TALLOC_FREE(subreq);
5063 if (!NT_STATUS_IS_OK(status)) {
5064 tevent_req_nterror(req, status);
5065 return;
5068 /* Copy out parameters */
5070 /* Copy result */
5071 state->orig.out.result = state->tmp.out.result;
5073 /* Reset temporary structure */
5074 ZERO_STRUCT(state->tmp);
5076 if (DEBUGLEVEL >= 10) {
5077 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, &state->orig);
5080 tevent_req_done(req);
5083 NTSTATUS rpccli_svcctl_OpenServiceA_recv(struct tevent_req *req,
5084 TALLOC_CTX *mem_ctx,
5085 WERROR *result)
5087 struct rpccli_svcctl_OpenServiceA_state *state = tevent_req_data(
5088 req, struct rpccli_svcctl_OpenServiceA_state);
5089 NTSTATUS status;
5091 if (tevent_req_is_nterror(req, &status)) {
5092 tevent_req_received(req);
5093 return status;
5096 /* Steal possbile out parameters to the callers context */
5097 talloc_steal(mem_ctx, state->out_mem_ctx);
5099 /* Return result */
5100 *result = state->orig.out.result;
5102 tevent_req_received(req);
5103 return NT_STATUS_OK;
5106 NTSTATUS rpccli_svcctl_OpenServiceA(struct rpc_pipe_client *cli,
5107 TALLOC_CTX *mem_ctx,
5108 struct policy_handle *scmanager_handle /* [in] [ref] */,
5109 const char *ServiceName /* [in] [unique,charset(UTF16)] */,
5110 uint32_t access_mask /* [in] */,
5111 WERROR *werror)
5113 struct svcctl_OpenServiceA r;
5114 NTSTATUS status;
5116 /* In parameters */
5117 r.in.scmanager_handle = scmanager_handle;
5118 r.in.ServiceName = ServiceName;
5119 r.in.access_mask = access_mask;
5121 if (DEBUGLEVEL >= 10) {
5122 NDR_PRINT_IN_DEBUG(svcctl_OpenServiceA, &r);
5125 status = cli->dispatch(cli,
5126 mem_ctx,
5127 &ndr_table_svcctl,
5128 NDR_SVCCTL_OPENSERVICEA,
5129 &r);
5131 if (!NT_STATUS_IS_OK(status)) {
5132 return status;
5135 if (DEBUGLEVEL >= 10) {
5136 NDR_PRINT_OUT_DEBUG(svcctl_OpenServiceA, &r);
5139 if (NT_STATUS_IS_ERR(status)) {
5140 return status;
5143 /* Return variables */
5145 /* Return result */
5146 if (werror) {
5147 *werror = r.out.result;
5150 return werror_to_ntstatus(r.out.result);
5153 struct rpccli_svcctl_QueryServiceConfigA_state {
5154 struct svcctl_QueryServiceConfigA orig;
5155 struct svcctl_QueryServiceConfigA tmp;
5156 TALLOC_CTX *out_mem_ctx;
5157 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5160 static void rpccli_svcctl_QueryServiceConfigA_done(struct tevent_req *subreq);
5162 struct tevent_req *rpccli_svcctl_QueryServiceConfigA_send(TALLOC_CTX *mem_ctx,
5163 struct tevent_context *ev,
5164 struct rpc_pipe_client *cli,
5165 struct policy_handle *_handle /* [in] [ref] */,
5166 uint8_t *_query /* [out] */,
5167 uint32_t _offered /* [in] */,
5168 uint32_t *_needed /* [out] [ref] */)
5170 struct tevent_req *req;
5171 struct rpccli_svcctl_QueryServiceConfigA_state *state;
5172 struct tevent_req *subreq;
5174 req = tevent_req_create(mem_ctx, &state,
5175 struct rpccli_svcctl_QueryServiceConfigA_state);
5176 if (req == NULL) {
5177 return NULL;
5179 state->out_mem_ctx = NULL;
5180 state->dispatch_recv = cli->dispatch_recv;
5182 /* In parameters */
5183 state->orig.in.handle = _handle;
5184 state->orig.in.offered = _offered;
5186 /* Out parameters */
5187 state->orig.out.query = _query;
5188 state->orig.out.needed = _needed;
5190 /* Result */
5191 ZERO_STRUCT(state->orig.out.result);
5193 if (DEBUGLEVEL >= 10) {
5194 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, &state->orig);
5197 state->out_mem_ctx = talloc_named_const(state, 0,
5198 "rpccli_svcctl_QueryServiceConfigA_out_memory");
5199 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5200 return tevent_req_post(req, ev);
5203 /* make a temporary copy, that we pass to the dispatch function */
5204 state->tmp = state->orig;
5206 subreq = cli->dispatch_send(state, ev, cli,
5207 &ndr_table_svcctl,
5208 NDR_SVCCTL_QUERYSERVICECONFIGA,
5209 &state->tmp);
5210 if (tevent_req_nomem(subreq, req)) {
5211 return tevent_req_post(req, ev);
5213 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfigA_done, req);
5214 return req;
5217 static void rpccli_svcctl_QueryServiceConfigA_done(struct tevent_req *subreq)
5219 struct tevent_req *req = tevent_req_callback_data(
5220 subreq, struct tevent_req);
5221 struct rpccli_svcctl_QueryServiceConfigA_state *state = tevent_req_data(
5222 req, struct rpccli_svcctl_QueryServiceConfigA_state);
5223 NTSTATUS status;
5224 TALLOC_CTX *mem_ctx;
5226 if (state->out_mem_ctx) {
5227 mem_ctx = state->out_mem_ctx;
5228 } else {
5229 mem_ctx = state;
5232 status = state->dispatch_recv(subreq, mem_ctx);
5233 TALLOC_FREE(subreq);
5234 if (!NT_STATUS_IS_OK(status)) {
5235 tevent_req_nterror(req, status);
5236 return;
5239 /* Copy out parameters */
5240 memcpy(state->orig.out.query, state->tmp.out.query, state->tmp.in.offered * sizeof(*state->orig.out.query));
5241 *state->orig.out.needed = *state->tmp.out.needed;
5243 /* Copy result */
5244 state->orig.out.result = state->tmp.out.result;
5246 /* Reset temporary structure */
5247 ZERO_STRUCT(state->tmp);
5249 if (DEBUGLEVEL >= 10) {
5250 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &state->orig);
5253 tevent_req_done(req);
5256 NTSTATUS rpccli_svcctl_QueryServiceConfigA_recv(struct tevent_req *req,
5257 TALLOC_CTX *mem_ctx,
5258 WERROR *result)
5260 struct rpccli_svcctl_QueryServiceConfigA_state *state = tevent_req_data(
5261 req, struct rpccli_svcctl_QueryServiceConfigA_state);
5262 NTSTATUS status;
5264 if (tevent_req_is_nterror(req, &status)) {
5265 tevent_req_received(req);
5266 return status;
5269 /* Steal possbile out parameters to the callers context */
5270 talloc_steal(mem_ctx, state->out_mem_ctx);
5272 /* Return result */
5273 *result = state->orig.out.result;
5275 tevent_req_received(req);
5276 return NT_STATUS_OK;
5279 NTSTATUS rpccli_svcctl_QueryServiceConfigA(struct rpc_pipe_client *cli,
5280 TALLOC_CTX *mem_ctx,
5281 struct policy_handle *handle /* [in] [ref] */,
5282 uint8_t *query /* [out] */,
5283 uint32_t offered /* [in] */,
5284 uint32_t *needed /* [out] [ref] */,
5285 WERROR *werror)
5287 struct svcctl_QueryServiceConfigA r;
5288 NTSTATUS status;
5290 /* In parameters */
5291 r.in.handle = handle;
5292 r.in.offered = offered;
5294 if (DEBUGLEVEL >= 10) {
5295 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfigA, &r);
5298 status = cli->dispatch(cli,
5299 mem_ctx,
5300 &ndr_table_svcctl,
5301 NDR_SVCCTL_QUERYSERVICECONFIGA,
5302 &r);
5304 if (!NT_STATUS_IS_OK(status)) {
5305 return status;
5308 if (DEBUGLEVEL >= 10) {
5309 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfigA, &r);
5312 if (NT_STATUS_IS_ERR(status)) {
5313 return status;
5316 /* Return variables */
5317 memcpy(query, r.out.query, r.in.offered * sizeof(*query));
5318 *needed = *r.out.needed;
5320 /* Return result */
5321 if (werror) {
5322 *werror = r.out.result;
5325 return werror_to_ntstatus(r.out.result);
5328 struct rpccli_svcctl_QueryServiceLockStatusA_state {
5329 struct svcctl_QueryServiceLockStatusA orig;
5330 struct svcctl_QueryServiceLockStatusA tmp;
5331 TALLOC_CTX *out_mem_ctx;
5332 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5335 static void rpccli_svcctl_QueryServiceLockStatusA_done(struct tevent_req *subreq);
5337 struct tevent_req *rpccli_svcctl_QueryServiceLockStatusA_send(TALLOC_CTX *mem_ctx,
5338 struct tevent_context *ev,
5339 struct rpc_pipe_client *cli,
5340 struct policy_handle *_handle /* [in] [ref] */,
5341 uint32_t _offered /* [in] */,
5342 struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
5343 uint32_t *_needed /* [out] [ref] */)
5345 struct tevent_req *req;
5346 struct rpccli_svcctl_QueryServiceLockStatusA_state *state;
5347 struct tevent_req *subreq;
5349 req = tevent_req_create(mem_ctx, &state,
5350 struct rpccli_svcctl_QueryServiceLockStatusA_state);
5351 if (req == NULL) {
5352 return NULL;
5354 state->out_mem_ctx = NULL;
5355 state->dispatch_recv = cli->dispatch_recv;
5357 /* In parameters */
5358 state->orig.in.handle = _handle;
5359 state->orig.in.offered = _offered;
5361 /* Out parameters */
5362 state->orig.out.lock_status = _lock_status;
5363 state->orig.out.needed = _needed;
5365 /* Result */
5366 ZERO_STRUCT(state->orig.out.result);
5368 if (DEBUGLEVEL >= 10) {
5369 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, &state->orig);
5372 state->out_mem_ctx = talloc_named_const(state, 0,
5373 "rpccli_svcctl_QueryServiceLockStatusA_out_memory");
5374 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5375 return tevent_req_post(req, ev);
5378 /* make a temporary copy, that we pass to the dispatch function */
5379 state->tmp = state->orig;
5381 subreq = cli->dispatch_send(state, ev, cli,
5382 &ndr_table_svcctl,
5383 NDR_SVCCTL_QUERYSERVICELOCKSTATUSA,
5384 &state->tmp);
5385 if (tevent_req_nomem(subreq, req)) {
5386 return tevent_req_post(req, ev);
5388 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceLockStatusA_done, req);
5389 return req;
5392 static void rpccli_svcctl_QueryServiceLockStatusA_done(struct tevent_req *subreq)
5394 struct tevent_req *req = tevent_req_callback_data(
5395 subreq, struct tevent_req);
5396 struct rpccli_svcctl_QueryServiceLockStatusA_state *state = tevent_req_data(
5397 req, struct rpccli_svcctl_QueryServiceLockStatusA_state);
5398 NTSTATUS status;
5399 TALLOC_CTX *mem_ctx;
5401 if (state->out_mem_ctx) {
5402 mem_ctx = state->out_mem_ctx;
5403 } else {
5404 mem_ctx = state;
5407 status = state->dispatch_recv(subreq, mem_ctx);
5408 TALLOC_FREE(subreq);
5409 if (!NT_STATUS_IS_OK(status)) {
5410 tevent_req_nterror(req, status);
5411 return;
5414 /* Copy out parameters */
5415 *state->orig.out.lock_status = *state->tmp.out.lock_status;
5416 *state->orig.out.needed = *state->tmp.out.needed;
5418 /* Copy result */
5419 state->orig.out.result = state->tmp.out.result;
5421 /* Reset temporary structure */
5422 ZERO_STRUCT(state->tmp);
5424 if (DEBUGLEVEL >= 10) {
5425 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &state->orig);
5428 tevent_req_done(req);
5431 NTSTATUS rpccli_svcctl_QueryServiceLockStatusA_recv(struct tevent_req *req,
5432 TALLOC_CTX *mem_ctx,
5433 WERROR *result)
5435 struct rpccli_svcctl_QueryServiceLockStatusA_state *state = tevent_req_data(
5436 req, struct rpccli_svcctl_QueryServiceLockStatusA_state);
5437 NTSTATUS status;
5439 if (tevent_req_is_nterror(req, &status)) {
5440 tevent_req_received(req);
5441 return status;
5444 /* Steal possbile out parameters to the callers context */
5445 talloc_steal(mem_ctx, state->out_mem_ctx);
5447 /* Return result */
5448 *result = state->orig.out.result;
5450 tevent_req_received(req);
5451 return NT_STATUS_OK;
5454 NTSTATUS rpccli_svcctl_QueryServiceLockStatusA(struct rpc_pipe_client *cli,
5455 TALLOC_CTX *mem_ctx,
5456 struct policy_handle *handle /* [in] [ref] */,
5457 uint32_t offered /* [in] */,
5458 struct SERVICE_LOCK_STATUS *lock_status /* [out] [ref] */,
5459 uint32_t *needed /* [out] [ref] */,
5460 WERROR *werror)
5462 struct svcctl_QueryServiceLockStatusA r;
5463 NTSTATUS status;
5465 /* In parameters */
5466 r.in.handle = handle;
5467 r.in.offered = offered;
5469 if (DEBUGLEVEL >= 10) {
5470 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceLockStatusA, &r);
5473 status = cli->dispatch(cli,
5474 mem_ctx,
5475 &ndr_table_svcctl,
5476 NDR_SVCCTL_QUERYSERVICELOCKSTATUSA,
5477 &r);
5479 if (!NT_STATUS_IS_OK(status)) {
5480 return status;
5483 if (DEBUGLEVEL >= 10) {
5484 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceLockStatusA, &r);
5487 if (NT_STATUS_IS_ERR(status)) {
5488 return status;
5491 /* Return variables */
5492 *lock_status = *r.out.lock_status;
5493 *needed = *r.out.needed;
5495 /* Return result */
5496 if (werror) {
5497 *werror = r.out.result;
5500 return werror_to_ntstatus(r.out.result);
5503 struct rpccli_svcctl_StartServiceA_state {
5504 struct svcctl_StartServiceA orig;
5505 struct svcctl_StartServiceA tmp;
5506 TALLOC_CTX *out_mem_ctx;
5507 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5510 static void rpccli_svcctl_StartServiceA_done(struct tevent_req *subreq);
5512 struct tevent_req *rpccli_svcctl_StartServiceA_send(TALLOC_CTX *mem_ctx,
5513 struct tevent_context *ev,
5514 struct rpc_pipe_client *cli,
5515 struct policy_handle *_handle /* [in] [ref] */,
5516 uint32_t _NumArgs /* [in] */,
5517 const char *_Arguments /* [in] [unique,charset(UTF16)] */)
5519 struct tevent_req *req;
5520 struct rpccli_svcctl_StartServiceA_state *state;
5521 struct tevent_req *subreq;
5523 req = tevent_req_create(mem_ctx, &state,
5524 struct rpccli_svcctl_StartServiceA_state);
5525 if (req == NULL) {
5526 return NULL;
5528 state->out_mem_ctx = NULL;
5529 state->dispatch_recv = cli->dispatch_recv;
5531 /* In parameters */
5532 state->orig.in.handle = _handle;
5533 state->orig.in.NumArgs = _NumArgs;
5534 state->orig.in.Arguments = _Arguments;
5536 /* Out parameters */
5538 /* Result */
5539 ZERO_STRUCT(state->orig.out.result);
5541 if (DEBUGLEVEL >= 10) {
5542 NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, &state->orig);
5545 /* make a temporary copy, that we pass to the dispatch function */
5546 state->tmp = state->orig;
5548 subreq = cli->dispatch_send(state, ev, cli,
5549 &ndr_table_svcctl,
5550 NDR_SVCCTL_STARTSERVICEA,
5551 &state->tmp);
5552 if (tevent_req_nomem(subreq, req)) {
5553 return tevent_req_post(req, ev);
5555 tevent_req_set_callback(subreq, rpccli_svcctl_StartServiceA_done, req);
5556 return req;
5559 static void rpccli_svcctl_StartServiceA_done(struct tevent_req *subreq)
5561 struct tevent_req *req = tevent_req_callback_data(
5562 subreq, struct tevent_req);
5563 struct rpccli_svcctl_StartServiceA_state *state = tevent_req_data(
5564 req, struct rpccli_svcctl_StartServiceA_state);
5565 NTSTATUS status;
5566 TALLOC_CTX *mem_ctx;
5568 if (state->out_mem_ctx) {
5569 mem_ctx = state->out_mem_ctx;
5570 } else {
5571 mem_ctx = state;
5574 status = state->dispatch_recv(subreq, mem_ctx);
5575 TALLOC_FREE(subreq);
5576 if (!NT_STATUS_IS_OK(status)) {
5577 tevent_req_nterror(req, status);
5578 return;
5581 /* Copy out parameters */
5583 /* Copy result */
5584 state->orig.out.result = state->tmp.out.result;
5586 /* Reset temporary structure */
5587 ZERO_STRUCT(state->tmp);
5589 if (DEBUGLEVEL >= 10) {
5590 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &state->orig);
5593 tevent_req_done(req);
5596 NTSTATUS rpccli_svcctl_StartServiceA_recv(struct tevent_req *req,
5597 TALLOC_CTX *mem_ctx,
5598 WERROR *result)
5600 struct rpccli_svcctl_StartServiceA_state *state = tevent_req_data(
5601 req, struct rpccli_svcctl_StartServiceA_state);
5602 NTSTATUS status;
5604 if (tevent_req_is_nterror(req, &status)) {
5605 tevent_req_received(req);
5606 return status;
5609 /* Steal possbile out parameters to the callers context */
5610 talloc_steal(mem_ctx, state->out_mem_ctx);
5612 /* Return result */
5613 *result = state->orig.out.result;
5615 tevent_req_received(req);
5616 return NT_STATUS_OK;
5619 NTSTATUS rpccli_svcctl_StartServiceA(struct rpc_pipe_client *cli,
5620 TALLOC_CTX *mem_ctx,
5621 struct policy_handle *handle /* [in] [ref] */,
5622 uint32_t NumArgs /* [in] */,
5623 const char *Arguments /* [in] [unique,charset(UTF16)] */,
5624 WERROR *werror)
5626 struct svcctl_StartServiceA r;
5627 NTSTATUS status;
5629 /* In parameters */
5630 r.in.handle = handle;
5631 r.in.NumArgs = NumArgs;
5632 r.in.Arguments = Arguments;
5634 if (DEBUGLEVEL >= 10) {
5635 NDR_PRINT_IN_DEBUG(svcctl_StartServiceA, &r);
5638 status = cli->dispatch(cli,
5639 mem_ctx,
5640 &ndr_table_svcctl,
5641 NDR_SVCCTL_STARTSERVICEA,
5642 &r);
5644 if (!NT_STATUS_IS_OK(status)) {
5645 return status;
5648 if (DEBUGLEVEL >= 10) {
5649 NDR_PRINT_OUT_DEBUG(svcctl_StartServiceA, &r);
5652 if (NT_STATUS_IS_ERR(status)) {
5653 return status;
5656 /* Return variables */
5658 /* Return result */
5659 if (werror) {
5660 *werror = r.out.result;
5663 return werror_to_ntstatus(r.out.result);
5666 struct rpccli_svcctl_GetServiceDisplayNameA_state {
5667 struct svcctl_GetServiceDisplayNameA orig;
5668 struct svcctl_GetServiceDisplayNameA tmp;
5669 TALLOC_CTX *out_mem_ctx;
5670 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5673 static void rpccli_svcctl_GetServiceDisplayNameA_done(struct tevent_req *subreq);
5675 struct tevent_req *rpccli_svcctl_GetServiceDisplayNameA_send(TALLOC_CTX *mem_ctx,
5676 struct tevent_context *ev,
5677 struct rpc_pipe_client *cli,
5678 struct policy_handle *_handle /* [in] [ref] */,
5679 const char *_service_name /* [in] [unique,charset(UTF16)] */,
5680 const char **_display_name /* [out] [ref,charset(UTF16)] */,
5681 uint32_t *_display_name_length /* [in,out] [unique] */)
5683 struct tevent_req *req;
5684 struct rpccli_svcctl_GetServiceDisplayNameA_state *state;
5685 struct tevent_req *subreq;
5687 req = tevent_req_create(mem_ctx, &state,
5688 struct rpccli_svcctl_GetServiceDisplayNameA_state);
5689 if (req == NULL) {
5690 return NULL;
5692 state->out_mem_ctx = NULL;
5693 state->dispatch_recv = cli->dispatch_recv;
5695 /* In parameters */
5696 state->orig.in.handle = _handle;
5697 state->orig.in.service_name = _service_name;
5698 state->orig.in.display_name_length = _display_name_length;
5700 /* Out parameters */
5701 state->orig.out.display_name = _display_name;
5702 state->orig.out.display_name_length = _display_name_length;
5704 /* Result */
5705 ZERO_STRUCT(state->orig.out.result);
5707 if (DEBUGLEVEL >= 10) {
5708 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, &state->orig);
5711 state->out_mem_ctx = talloc_named_const(state, 0,
5712 "rpccli_svcctl_GetServiceDisplayNameA_out_memory");
5713 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5714 return tevent_req_post(req, ev);
5717 /* make a temporary copy, that we pass to the dispatch function */
5718 state->tmp = state->orig;
5720 subreq = cli->dispatch_send(state, ev, cli,
5721 &ndr_table_svcctl,
5722 NDR_SVCCTL_GETSERVICEDISPLAYNAMEA,
5723 &state->tmp);
5724 if (tevent_req_nomem(subreq, req)) {
5725 return tevent_req_post(req, ev);
5727 tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceDisplayNameA_done, req);
5728 return req;
5731 static void rpccli_svcctl_GetServiceDisplayNameA_done(struct tevent_req *subreq)
5733 struct tevent_req *req = tevent_req_callback_data(
5734 subreq, struct tevent_req);
5735 struct rpccli_svcctl_GetServiceDisplayNameA_state *state = tevent_req_data(
5736 req, struct rpccli_svcctl_GetServiceDisplayNameA_state);
5737 NTSTATUS status;
5738 TALLOC_CTX *mem_ctx;
5740 if (state->out_mem_ctx) {
5741 mem_ctx = state->out_mem_ctx;
5742 } else {
5743 mem_ctx = state;
5746 status = state->dispatch_recv(subreq, mem_ctx);
5747 TALLOC_FREE(subreq);
5748 if (!NT_STATUS_IS_OK(status)) {
5749 tevent_req_nterror(req, status);
5750 return;
5753 /* Copy out parameters */
5754 *state->orig.out.display_name = *state->tmp.out.display_name;
5755 if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
5756 *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
5759 /* Copy result */
5760 state->orig.out.result = state->tmp.out.result;
5762 /* Reset temporary structure */
5763 ZERO_STRUCT(state->tmp);
5765 if (DEBUGLEVEL >= 10) {
5766 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &state->orig);
5769 tevent_req_done(req);
5772 NTSTATUS rpccli_svcctl_GetServiceDisplayNameA_recv(struct tevent_req *req,
5773 TALLOC_CTX *mem_ctx,
5774 WERROR *result)
5776 struct rpccli_svcctl_GetServiceDisplayNameA_state *state = tevent_req_data(
5777 req, struct rpccli_svcctl_GetServiceDisplayNameA_state);
5778 NTSTATUS status;
5780 if (tevent_req_is_nterror(req, &status)) {
5781 tevent_req_received(req);
5782 return status;
5785 /* Steal possbile out parameters to the callers context */
5786 talloc_steal(mem_ctx, state->out_mem_ctx);
5788 /* Return result */
5789 *result = state->orig.out.result;
5791 tevent_req_received(req);
5792 return NT_STATUS_OK;
5795 NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli,
5796 TALLOC_CTX *mem_ctx,
5797 struct policy_handle *handle /* [in] [ref] */,
5798 const char *service_name /* [in] [unique,charset(UTF16)] */,
5799 const char **display_name /* [out] [ref,charset(UTF16)] */,
5800 uint32_t *display_name_length /* [in,out] [unique] */,
5801 WERROR *werror)
5803 struct svcctl_GetServiceDisplayNameA r;
5804 NTSTATUS status;
5806 /* In parameters */
5807 r.in.handle = handle;
5808 r.in.service_name = service_name;
5809 r.in.display_name_length = display_name_length;
5811 if (DEBUGLEVEL >= 10) {
5812 NDR_PRINT_IN_DEBUG(svcctl_GetServiceDisplayNameA, &r);
5815 status = cli->dispatch(cli,
5816 mem_ctx,
5817 &ndr_table_svcctl,
5818 NDR_SVCCTL_GETSERVICEDISPLAYNAMEA,
5819 &r);
5821 if (!NT_STATUS_IS_OK(status)) {
5822 return status;
5825 if (DEBUGLEVEL >= 10) {
5826 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceDisplayNameA, &r);
5829 if (NT_STATUS_IS_ERR(status)) {
5830 return status;
5833 /* Return variables */
5834 *display_name = *r.out.display_name;
5835 if (display_name_length && r.out.display_name_length) {
5836 *display_name_length = *r.out.display_name_length;
5839 /* Return result */
5840 if (werror) {
5841 *werror = r.out.result;
5844 return werror_to_ntstatus(r.out.result);
5847 struct rpccli_svcctl_GetServiceKeyNameA_state {
5848 struct svcctl_GetServiceKeyNameA orig;
5849 struct svcctl_GetServiceKeyNameA tmp;
5850 TALLOC_CTX *out_mem_ctx;
5851 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5854 static void rpccli_svcctl_GetServiceKeyNameA_done(struct tevent_req *subreq);
5856 struct tevent_req *rpccli_svcctl_GetServiceKeyNameA_send(TALLOC_CTX *mem_ctx,
5857 struct tevent_context *ev,
5858 struct rpc_pipe_client *cli,
5859 struct policy_handle *_handle /* [in] [ref] */,
5860 const char *_service_name /* [in] [unique,charset(UTF16)] */,
5861 const char **_key_name /* [out] [ref,charset(UTF16)] */,
5862 uint32_t *_display_name_length /* [in,out] [unique] */)
5864 struct tevent_req *req;
5865 struct rpccli_svcctl_GetServiceKeyNameA_state *state;
5866 struct tevent_req *subreq;
5868 req = tevent_req_create(mem_ctx, &state,
5869 struct rpccli_svcctl_GetServiceKeyNameA_state);
5870 if (req == NULL) {
5871 return NULL;
5873 state->out_mem_ctx = NULL;
5874 state->dispatch_recv = cli->dispatch_recv;
5876 /* In parameters */
5877 state->orig.in.handle = _handle;
5878 state->orig.in.service_name = _service_name;
5879 state->orig.in.display_name_length = _display_name_length;
5881 /* Out parameters */
5882 state->orig.out.key_name = _key_name;
5883 state->orig.out.display_name_length = _display_name_length;
5885 /* Result */
5886 ZERO_STRUCT(state->orig.out.result);
5888 if (DEBUGLEVEL >= 10) {
5889 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, &state->orig);
5892 state->out_mem_ctx = talloc_named_const(state, 0,
5893 "rpccli_svcctl_GetServiceKeyNameA_out_memory");
5894 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5895 return tevent_req_post(req, ev);
5898 /* make a temporary copy, that we pass to the dispatch function */
5899 state->tmp = state->orig;
5901 subreq = cli->dispatch_send(state, ev, cli,
5902 &ndr_table_svcctl,
5903 NDR_SVCCTL_GETSERVICEKEYNAMEA,
5904 &state->tmp);
5905 if (tevent_req_nomem(subreq, req)) {
5906 return tevent_req_post(req, ev);
5908 tevent_req_set_callback(subreq, rpccli_svcctl_GetServiceKeyNameA_done, req);
5909 return req;
5912 static void rpccli_svcctl_GetServiceKeyNameA_done(struct tevent_req *subreq)
5914 struct tevent_req *req = tevent_req_callback_data(
5915 subreq, struct tevent_req);
5916 struct rpccli_svcctl_GetServiceKeyNameA_state *state = tevent_req_data(
5917 req, struct rpccli_svcctl_GetServiceKeyNameA_state);
5918 NTSTATUS status;
5919 TALLOC_CTX *mem_ctx;
5921 if (state->out_mem_ctx) {
5922 mem_ctx = state->out_mem_ctx;
5923 } else {
5924 mem_ctx = state;
5927 status = state->dispatch_recv(subreq, mem_ctx);
5928 TALLOC_FREE(subreq);
5929 if (!NT_STATUS_IS_OK(status)) {
5930 tevent_req_nterror(req, status);
5931 return;
5934 /* Copy out parameters */
5935 *state->orig.out.key_name = *state->tmp.out.key_name;
5936 if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
5937 *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
5940 /* Copy result */
5941 state->orig.out.result = state->tmp.out.result;
5943 /* Reset temporary structure */
5944 ZERO_STRUCT(state->tmp);
5946 if (DEBUGLEVEL >= 10) {
5947 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &state->orig);
5950 tevent_req_done(req);
5953 NTSTATUS rpccli_svcctl_GetServiceKeyNameA_recv(struct tevent_req *req,
5954 TALLOC_CTX *mem_ctx,
5955 WERROR *result)
5957 struct rpccli_svcctl_GetServiceKeyNameA_state *state = tevent_req_data(
5958 req, struct rpccli_svcctl_GetServiceKeyNameA_state);
5959 NTSTATUS status;
5961 if (tevent_req_is_nterror(req, &status)) {
5962 tevent_req_received(req);
5963 return status;
5966 /* Steal possbile out parameters to the callers context */
5967 talloc_steal(mem_ctx, state->out_mem_ctx);
5969 /* Return result */
5970 *result = state->orig.out.result;
5972 tevent_req_received(req);
5973 return NT_STATUS_OK;
5976 NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli,
5977 TALLOC_CTX *mem_ctx,
5978 struct policy_handle *handle /* [in] [ref] */,
5979 const char *service_name /* [in] [unique,charset(UTF16)] */,
5980 const char **key_name /* [out] [ref,charset(UTF16)] */,
5981 uint32_t *display_name_length /* [in,out] [unique] */,
5982 WERROR *werror)
5984 struct svcctl_GetServiceKeyNameA r;
5985 NTSTATUS status;
5987 /* In parameters */
5988 r.in.handle = handle;
5989 r.in.service_name = service_name;
5990 r.in.display_name_length = display_name_length;
5992 if (DEBUGLEVEL >= 10) {
5993 NDR_PRINT_IN_DEBUG(svcctl_GetServiceKeyNameA, &r);
5996 status = cli->dispatch(cli,
5997 mem_ctx,
5998 &ndr_table_svcctl,
5999 NDR_SVCCTL_GETSERVICEKEYNAMEA,
6000 &r);
6002 if (!NT_STATUS_IS_OK(status)) {
6003 return status;
6006 if (DEBUGLEVEL >= 10) {
6007 NDR_PRINT_OUT_DEBUG(svcctl_GetServiceKeyNameA, &r);
6010 if (NT_STATUS_IS_ERR(status)) {
6011 return status;
6014 /* Return variables */
6015 *key_name = *r.out.key_name;
6016 if (display_name_length && r.out.display_name_length) {
6017 *display_name_length = *r.out.display_name_length;
6020 /* Return result */
6021 if (werror) {
6022 *werror = r.out.result;
6025 return werror_to_ntstatus(r.out.result);
6028 struct rpccli_svcctl_GetCurrentGroupeStateW_state {
6029 struct svcctl_GetCurrentGroupeStateW orig;
6030 struct svcctl_GetCurrentGroupeStateW tmp;
6031 TALLOC_CTX *out_mem_ctx;
6032 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6035 static void rpccli_svcctl_GetCurrentGroupeStateW_done(struct tevent_req *subreq);
6037 struct tevent_req *rpccli_svcctl_GetCurrentGroupeStateW_send(TALLOC_CTX *mem_ctx,
6038 struct tevent_context *ev,
6039 struct rpc_pipe_client *cli)
6041 struct tevent_req *req;
6042 struct rpccli_svcctl_GetCurrentGroupeStateW_state *state;
6043 struct tevent_req *subreq;
6045 req = tevent_req_create(mem_ctx, &state,
6046 struct rpccli_svcctl_GetCurrentGroupeStateW_state);
6047 if (req == NULL) {
6048 return NULL;
6050 state->out_mem_ctx = NULL;
6051 state->dispatch_recv = cli->dispatch_recv;
6053 /* In parameters */
6055 /* Out parameters */
6057 /* Result */
6058 ZERO_STRUCT(state->orig.out.result);
6060 if (DEBUGLEVEL >= 10) {
6061 NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, &state->orig);
6064 /* make a temporary copy, that we pass to the dispatch function */
6065 state->tmp = state->orig;
6067 subreq = cli->dispatch_send(state, ev, cli,
6068 &ndr_table_svcctl,
6069 NDR_SVCCTL_GETCURRENTGROUPESTATEW,
6070 &state->tmp);
6071 if (tevent_req_nomem(subreq, req)) {
6072 return tevent_req_post(req, ev);
6074 tevent_req_set_callback(subreq, rpccli_svcctl_GetCurrentGroupeStateW_done, req);
6075 return req;
6078 static void rpccli_svcctl_GetCurrentGroupeStateW_done(struct tevent_req *subreq)
6080 struct tevent_req *req = tevent_req_callback_data(
6081 subreq, struct tevent_req);
6082 struct rpccli_svcctl_GetCurrentGroupeStateW_state *state = tevent_req_data(
6083 req, struct rpccli_svcctl_GetCurrentGroupeStateW_state);
6084 NTSTATUS status;
6085 TALLOC_CTX *mem_ctx;
6087 if (state->out_mem_ctx) {
6088 mem_ctx = state->out_mem_ctx;
6089 } else {
6090 mem_ctx = state;
6093 status = state->dispatch_recv(subreq, mem_ctx);
6094 TALLOC_FREE(subreq);
6095 if (!NT_STATUS_IS_OK(status)) {
6096 tevent_req_nterror(req, status);
6097 return;
6100 /* Copy out parameters */
6102 /* Copy result */
6103 state->orig.out.result = state->tmp.out.result;
6105 /* Reset temporary structure */
6106 ZERO_STRUCT(state->tmp);
6108 if (DEBUGLEVEL >= 10) {
6109 NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &state->orig);
6112 tevent_req_done(req);
6115 NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW_recv(struct tevent_req *req,
6116 TALLOC_CTX *mem_ctx,
6117 WERROR *result)
6119 struct rpccli_svcctl_GetCurrentGroupeStateW_state *state = tevent_req_data(
6120 req, struct rpccli_svcctl_GetCurrentGroupeStateW_state);
6121 NTSTATUS status;
6123 if (tevent_req_is_nterror(req, &status)) {
6124 tevent_req_received(req);
6125 return status;
6128 /* Steal possbile out parameters to the callers context */
6129 talloc_steal(mem_ctx, state->out_mem_ctx);
6131 /* Return result */
6132 *result = state->orig.out.result;
6134 tevent_req_received(req);
6135 return NT_STATUS_OK;
6138 NTSTATUS rpccli_svcctl_GetCurrentGroupeStateW(struct rpc_pipe_client *cli,
6139 TALLOC_CTX *mem_ctx,
6140 WERROR *werror)
6142 struct svcctl_GetCurrentGroupeStateW r;
6143 NTSTATUS status;
6145 /* In parameters */
6147 if (DEBUGLEVEL >= 10) {
6148 NDR_PRINT_IN_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
6151 status = cli->dispatch(cli,
6152 mem_ctx,
6153 &ndr_table_svcctl,
6154 NDR_SVCCTL_GETCURRENTGROUPESTATEW,
6155 &r);
6157 if (!NT_STATUS_IS_OK(status)) {
6158 return status;
6161 if (DEBUGLEVEL >= 10) {
6162 NDR_PRINT_OUT_DEBUG(svcctl_GetCurrentGroupeStateW, &r);
6165 if (NT_STATUS_IS_ERR(status)) {
6166 return status;
6169 /* Return variables */
6171 /* Return result */
6172 if (werror) {
6173 *werror = r.out.result;
6176 return werror_to_ntstatus(r.out.result);
6179 struct rpccli_svcctl_EnumServiceGroupW_state {
6180 struct svcctl_EnumServiceGroupW orig;
6181 struct svcctl_EnumServiceGroupW tmp;
6182 TALLOC_CTX *out_mem_ctx;
6183 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6186 static void rpccli_svcctl_EnumServiceGroupW_done(struct tevent_req *subreq);
6188 struct tevent_req *rpccli_svcctl_EnumServiceGroupW_send(TALLOC_CTX *mem_ctx,
6189 struct tevent_context *ev,
6190 struct rpc_pipe_client *cli)
6192 struct tevent_req *req;
6193 struct rpccli_svcctl_EnumServiceGroupW_state *state;
6194 struct tevent_req *subreq;
6196 req = tevent_req_create(mem_ctx, &state,
6197 struct rpccli_svcctl_EnumServiceGroupW_state);
6198 if (req == NULL) {
6199 return NULL;
6201 state->out_mem_ctx = NULL;
6202 state->dispatch_recv = cli->dispatch_recv;
6204 /* In parameters */
6206 /* Out parameters */
6208 /* Result */
6209 ZERO_STRUCT(state->orig.out.result);
6211 if (DEBUGLEVEL >= 10) {
6212 NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, &state->orig);
6215 /* make a temporary copy, that we pass to the dispatch function */
6216 state->tmp = state->orig;
6218 subreq = cli->dispatch_send(state, ev, cli,
6219 &ndr_table_svcctl,
6220 NDR_SVCCTL_ENUMSERVICEGROUPW,
6221 &state->tmp);
6222 if (tevent_req_nomem(subreq, req)) {
6223 return tevent_req_post(req, ev);
6225 tevent_req_set_callback(subreq, rpccli_svcctl_EnumServiceGroupW_done, req);
6226 return req;
6229 static void rpccli_svcctl_EnumServiceGroupW_done(struct tevent_req *subreq)
6231 struct tevent_req *req = tevent_req_callback_data(
6232 subreq, struct tevent_req);
6233 struct rpccli_svcctl_EnumServiceGroupW_state *state = tevent_req_data(
6234 req, struct rpccli_svcctl_EnumServiceGroupW_state);
6235 NTSTATUS status;
6236 TALLOC_CTX *mem_ctx;
6238 if (state->out_mem_ctx) {
6239 mem_ctx = state->out_mem_ctx;
6240 } else {
6241 mem_ctx = state;
6244 status = state->dispatch_recv(subreq, mem_ctx);
6245 TALLOC_FREE(subreq);
6246 if (!NT_STATUS_IS_OK(status)) {
6247 tevent_req_nterror(req, status);
6248 return;
6251 /* Copy out parameters */
6253 /* Copy result */
6254 state->orig.out.result = state->tmp.out.result;
6256 /* Reset temporary structure */
6257 ZERO_STRUCT(state->tmp);
6259 if (DEBUGLEVEL >= 10) {
6260 NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &state->orig);
6263 tevent_req_done(req);
6266 NTSTATUS rpccli_svcctl_EnumServiceGroupW_recv(struct tevent_req *req,
6267 TALLOC_CTX *mem_ctx,
6268 WERROR *result)
6270 struct rpccli_svcctl_EnumServiceGroupW_state *state = tevent_req_data(
6271 req, struct rpccli_svcctl_EnumServiceGroupW_state);
6272 NTSTATUS status;
6274 if (tevent_req_is_nterror(req, &status)) {
6275 tevent_req_received(req);
6276 return status;
6279 /* Steal possbile out parameters to the callers context */
6280 talloc_steal(mem_ctx, state->out_mem_ctx);
6282 /* Return result */
6283 *result = state->orig.out.result;
6285 tevent_req_received(req);
6286 return NT_STATUS_OK;
6289 NTSTATUS rpccli_svcctl_EnumServiceGroupW(struct rpc_pipe_client *cli,
6290 TALLOC_CTX *mem_ctx,
6291 WERROR *werror)
6293 struct svcctl_EnumServiceGroupW r;
6294 NTSTATUS status;
6296 /* In parameters */
6298 if (DEBUGLEVEL >= 10) {
6299 NDR_PRINT_IN_DEBUG(svcctl_EnumServiceGroupW, &r);
6302 status = cli->dispatch(cli,
6303 mem_ctx,
6304 &ndr_table_svcctl,
6305 NDR_SVCCTL_ENUMSERVICEGROUPW,
6306 &r);
6308 if (!NT_STATUS_IS_OK(status)) {
6309 return status;
6312 if (DEBUGLEVEL >= 10) {
6313 NDR_PRINT_OUT_DEBUG(svcctl_EnumServiceGroupW, &r);
6316 if (NT_STATUS_IS_ERR(status)) {
6317 return status;
6320 /* Return variables */
6322 /* Return result */
6323 if (werror) {
6324 *werror = r.out.result;
6327 return werror_to_ntstatus(r.out.result);
6330 struct rpccli_svcctl_ChangeServiceConfig2A_state {
6331 struct svcctl_ChangeServiceConfig2A orig;
6332 struct svcctl_ChangeServiceConfig2A tmp;
6333 TALLOC_CTX *out_mem_ctx;
6334 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6337 static void rpccli_svcctl_ChangeServiceConfig2A_done(struct tevent_req *subreq);
6339 struct tevent_req *rpccli_svcctl_ChangeServiceConfig2A_send(TALLOC_CTX *mem_ctx,
6340 struct tevent_context *ev,
6341 struct rpc_pipe_client *cli,
6342 struct policy_handle *_handle /* [in] [ref] */,
6343 uint32_t _info_level /* [in] */,
6344 uint8_t *_info /* [in] [unique] */)
6346 struct tevent_req *req;
6347 struct rpccli_svcctl_ChangeServiceConfig2A_state *state;
6348 struct tevent_req *subreq;
6350 req = tevent_req_create(mem_ctx, &state,
6351 struct rpccli_svcctl_ChangeServiceConfig2A_state);
6352 if (req == NULL) {
6353 return NULL;
6355 state->out_mem_ctx = NULL;
6356 state->dispatch_recv = cli->dispatch_recv;
6358 /* In parameters */
6359 state->orig.in.handle = _handle;
6360 state->orig.in.info_level = _info_level;
6361 state->orig.in.info = _info;
6363 /* Out parameters */
6365 /* Result */
6366 ZERO_STRUCT(state->orig.out.result);
6368 if (DEBUGLEVEL >= 10) {
6369 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, &state->orig);
6372 /* make a temporary copy, that we pass to the dispatch function */
6373 state->tmp = state->orig;
6375 subreq = cli->dispatch_send(state, ev, cli,
6376 &ndr_table_svcctl,
6377 NDR_SVCCTL_CHANGESERVICECONFIG2A,
6378 &state->tmp);
6379 if (tevent_req_nomem(subreq, req)) {
6380 return tevent_req_post(req, ev);
6382 tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfig2A_done, req);
6383 return req;
6386 static void rpccli_svcctl_ChangeServiceConfig2A_done(struct tevent_req *subreq)
6388 struct tevent_req *req = tevent_req_callback_data(
6389 subreq, struct tevent_req);
6390 struct rpccli_svcctl_ChangeServiceConfig2A_state *state = tevent_req_data(
6391 req, struct rpccli_svcctl_ChangeServiceConfig2A_state);
6392 NTSTATUS status;
6393 TALLOC_CTX *mem_ctx;
6395 if (state->out_mem_ctx) {
6396 mem_ctx = state->out_mem_ctx;
6397 } else {
6398 mem_ctx = state;
6401 status = state->dispatch_recv(subreq, mem_ctx);
6402 TALLOC_FREE(subreq);
6403 if (!NT_STATUS_IS_OK(status)) {
6404 tevent_req_nterror(req, status);
6405 return;
6408 /* Copy out parameters */
6410 /* Copy result */
6411 state->orig.out.result = state->tmp.out.result;
6413 /* Reset temporary structure */
6414 ZERO_STRUCT(state->tmp);
6416 if (DEBUGLEVEL >= 10) {
6417 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &state->orig);
6420 tevent_req_done(req);
6423 NTSTATUS rpccli_svcctl_ChangeServiceConfig2A_recv(struct tevent_req *req,
6424 TALLOC_CTX *mem_ctx,
6425 WERROR *result)
6427 struct rpccli_svcctl_ChangeServiceConfig2A_state *state = tevent_req_data(
6428 req, struct rpccli_svcctl_ChangeServiceConfig2A_state);
6429 NTSTATUS status;
6431 if (tevent_req_is_nterror(req, &status)) {
6432 tevent_req_received(req);
6433 return status;
6436 /* Steal possbile out parameters to the callers context */
6437 talloc_steal(mem_ctx, state->out_mem_ctx);
6439 /* Return result */
6440 *result = state->orig.out.result;
6442 tevent_req_received(req);
6443 return NT_STATUS_OK;
6446 NTSTATUS rpccli_svcctl_ChangeServiceConfig2A(struct rpc_pipe_client *cli,
6447 TALLOC_CTX *mem_ctx,
6448 struct policy_handle *handle /* [in] [ref] */,
6449 uint32_t info_level /* [in] */,
6450 uint8_t *info /* [in] [unique] */,
6451 WERROR *werror)
6453 struct svcctl_ChangeServiceConfig2A r;
6454 NTSTATUS status;
6456 /* In parameters */
6457 r.in.handle = handle;
6458 r.in.info_level = info_level;
6459 r.in.info = info;
6461 if (DEBUGLEVEL >= 10) {
6462 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2A, &r);
6465 status = cli->dispatch(cli,
6466 mem_ctx,
6467 &ndr_table_svcctl,
6468 NDR_SVCCTL_CHANGESERVICECONFIG2A,
6469 &r);
6471 if (!NT_STATUS_IS_OK(status)) {
6472 return status;
6475 if (DEBUGLEVEL >= 10) {
6476 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2A, &r);
6479 if (NT_STATUS_IS_ERR(status)) {
6480 return status;
6483 /* Return variables */
6485 /* Return result */
6486 if (werror) {
6487 *werror = r.out.result;
6490 return werror_to_ntstatus(r.out.result);
6493 struct rpccli_svcctl_ChangeServiceConfig2W_state {
6494 struct svcctl_ChangeServiceConfig2W orig;
6495 struct svcctl_ChangeServiceConfig2W tmp;
6496 TALLOC_CTX *out_mem_ctx;
6497 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6500 static void rpccli_svcctl_ChangeServiceConfig2W_done(struct tevent_req *subreq);
6502 struct tevent_req *rpccli_svcctl_ChangeServiceConfig2W_send(TALLOC_CTX *mem_ctx,
6503 struct tevent_context *ev,
6504 struct rpc_pipe_client *cli,
6505 struct policy_handle *_handle /* [in] [ref] */,
6506 uint32_t _info_level /* [in] */,
6507 uint8_t *_info /* [in] [unique] */)
6509 struct tevent_req *req;
6510 struct rpccli_svcctl_ChangeServiceConfig2W_state *state;
6511 struct tevent_req *subreq;
6513 req = tevent_req_create(mem_ctx, &state,
6514 struct rpccli_svcctl_ChangeServiceConfig2W_state);
6515 if (req == NULL) {
6516 return NULL;
6518 state->out_mem_ctx = NULL;
6519 state->dispatch_recv = cli->dispatch_recv;
6521 /* In parameters */
6522 state->orig.in.handle = _handle;
6523 state->orig.in.info_level = _info_level;
6524 state->orig.in.info = _info;
6526 /* Out parameters */
6528 /* Result */
6529 ZERO_STRUCT(state->orig.out.result);
6531 if (DEBUGLEVEL >= 10) {
6532 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, &state->orig);
6535 /* make a temporary copy, that we pass to the dispatch function */
6536 state->tmp = state->orig;
6538 subreq = cli->dispatch_send(state, ev, cli,
6539 &ndr_table_svcctl,
6540 NDR_SVCCTL_CHANGESERVICECONFIG2W,
6541 &state->tmp);
6542 if (tevent_req_nomem(subreq, req)) {
6543 return tevent_req_post(req, ev);
6545 tevent_req_set_callback(subreq, rpccli_svcctl_ChangeServiceConfig2W_done, req);
6546 return req;
6549 static void rpccli_svcctl_ChangeServiceConfig2W_done(struct tevent_req *subreq)
6551 struct tevent_req *req = tevent_req_callback_data(
6552 subreq, struct tevent_req);
6553 struct rpccli_svcctl_ChangeServiceConfig2W_state *state = tevent_req_data(
6554 req, struct rpccli_svcctl_ChangeServiceConfig2W_state);
6555 NTSTATUS status;
6556 TALLOC_CTX *mem_ctx;
6558 if (state->out_mem_ctx) {
6559 mem_ctx = state->out_mem_ctx;
6560 } else {
6561 mem_ctx = state;
6564 status = state->dispatch_recv(subreq, mem_ctx);
6565 TALLOC_FREE(subreq);
6566 if (!NT_STATUS_IS_OK(status)) {
6567 tevent_req_nterror(req, status);
6568 return;
6571 /* Copy out parameters */
6573 /* Copy result */
6574 state->orig.out.result = state->tmp.out.result;
6576 /* Reset temporary structure */
6577 ZERO_STRUCT(state->tmp);
6579 if (DEBUGLEVEL >= 10) {
6580 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &state->orig);
6583 tevent_req_done(req);
6586 NTSTATUS rpccli_svcctl_ChangeServiceConfig2W_recv(struct tevent_req *req,
6587 TALLOC_CTX *mem_ctx,
6588 WERROR *result)
6590 struct rpccli_svcctl_ChangeServiceConfig2W_state *state = tevent_req_data(
6591 req, struct rpccli_svcctl_ChangeServiceConfig2W_state);
6592 NTSTATUS status;
6594 if (tevent_req_is_nterror(req, &status)) {
6595 tevent_req_received(req);
6596 return status;
6599 /* Steal possbile out parameters to the callers context */
6600 talloc_steal(mem_ctx, state->out_mem_ctx);
6602 /* Return result */
6603 *result = state->orig.out.result;
6605 tevent_req_received(req);
6606 return NT_STATUS_OK;
6609 NTSTATUS rpccli_svcctl_ChangeServiceConfig2W(struct rpc_pipe_client *cli,
6610 TALLOC_CTX *mem_ctx,
6611 struct policy_handle *handle /* [in] [ref] */,
6612 uint32_t info_level /* [in] */,
6613 uint8_t *info /* [in] [unique] */,
6614 WERROR *werror)
6616 struct svcctl_ChangeServiceConfig2W r;
6617 NTSTATUS status;
6619 /* In parameters */
6620 r.in.handle = handle;
6621 r.in.info_level = info_level;
6622 r.in.info = info;
6624 if (DEBUGLEVEL >= 10) {
6625 NDR_PRINT_IN_DEBUG(svcctl_ChangeServiceConfig2W, &r);
6628 status = cli->dispatch(cli,
6629 mem_ctx,
6630 &ndr_table_svcctl,
6631 NDR_SVCCTL_CHANGESERVICECONFIG2W,
6632 &r);
6634 if (!NT_STATUS_IS_OK(status)) {
6635 return status;
6638 if (DEBUGLEVEL >= 10) {
6639 NDR_PRINT_OUT_DEBUG(svcctl_ChangeServiceConfig2W, &r);
6642 if (NT_STATUS_IS_ERR(status)) {
6643 return status;
6646 /* Return variables */
6648 /* Return result */
6649 if (werror) {
6650 *werror = r.out.result;
6653 return werror_to_ntstatus(r.out.result);
6656 struct rpccli_svcctl_QueryServiceConfig2A_state {
6657 struct svcctl_QueryServiceConfig2A orig;
6658 struct svcctl_QueryServiceConfig2A tmp;
6659 TALLOC_CTX *out_mem_ctx;
6660 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6663 static void rpccli_svcctl_QueryServiceConfig2A_done(struct tevent_req *subreq);
6665 struct tevent_req *rpccli_svcctl_QueryServiceConfig2A_send(TALLOC_CTX *mem_ctx,
6666 struct tevent_context *ev,
6667 struct rpc_pipe_client *cli,
6668 struct policy_handle *_handle /* [in] [ref] */,
6669 enum svcctl_ConfigLevel _info_level /* [in] */,
6670 uint8_t *_buffer /* [out] */,
6671 uint32_t _offered /* [in] */,
6672 uint32_t *_needed /* [out] [ref] */)
6674 struct tevent_req *req;
6675 struct rpccli_svcctl_QueryServiceConfig2A_state *state;
6676 struct tevent_req *subreq;
6678 req = tevent_req_create(mem_ctx, &state,
6679 struct rpccli_svcctl_QueryServiceConfig2A_state);
6680 if (req == NULL) {
6681 return NULL;
6683 state->out_mem_ctx = NULL;
6684 state->dispatch_recv = cli->dispatch_recv;
6686 /* In parameters */
6687 state->orig.in.handle = _handle;
6688 state->orig.in.info_level = _info_level;
6689 state->orig.in.offered = _offered;
6691 /* Out parameters */
6692 state->orig.out.buffer = _buffer;
6693 state->orig.out.needed = _needed;
6695 /* Result */
6696 ZERO_STRUCT(state->orig.out.result);
6698 if (DEBUGLEVEL >= 10) {
6699 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, &state->orig);
6702 state->out_mem_ctx = talloc_named_const(state, 0,
6703 "rpccli_svcctl_QueryServiceConfig2A_out_memory");
6704 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6705 return tevent_req_post(req, ev);
6708 /* make a temporary copy, that we pass to the dispatch function */
6709 state->tmp = state->orig;
6711 subreq = cli->dispatch_send(state, ev, cli,
6712 &ndr_table_svcctl,
6713 NDR_SVCCTL_QUERYSERVICECONFIG2A,
6714 &state->tmp);
6715 if (tevent_req_nomem(subreq, req)) {
6716 return tevent_req_post(req, ev);
6718 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfig2A_done, req);
6719 return req;
6722 static void rpccli_svcctl_QueryServiceConfig2A_done(struct tevent_req *subreq)
6724 struct tevent_req *req = tevent_req_callback_data(
6725 subreq, struct tevent_req);
6726 struct rpccli_svcctl_QueryServiceConfig2A_state *state = tevent_req_data(
6727 req, struct rpccli_svcctl_QueryServiceConfig2A_state);
6728 NTSTATUS status;
6729 TALLOC_CTX *mem_ctx;
6731 if (state->out_mem_ctx) {
6732 mem_ctx = state->out_mem_ctx;
6733 } else {
6734 mem_ctx = state;
6737 status = state->dispatch_recv(subreq, mem_ctx);
6738 TALLOC_FREE(subreq);
6739 if (!NT_STATUS_IS_OK(status)) {
6740 tevent_req_nterror(req, status);
6741 return;
6744 /* Copy out parameters */
6745 memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
6746 *state->orig.out.needed = *state->tmp.out.needed;
6748 /* Copy result */
6749 state->orig.out.result = state->tmp.out.result;
6751 /* Reset temporary structure */
6752 ZERO_STRUCT(state->tmp);
6754 if (DEBUGLEVEL >= 10) {
6755 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, &state->orig);
6758 tevent_req_done(req);
6761 NTSTATUS rpccli_svcctl_QueryServiceConfig2A_recv(struct tevent_req *req,
6762 TALLOC_CTX *mem_ctx,
6763 WERROR *result)
6765 struct rpccli_svcctl_QueryServiceConfig2A_state *state = tevent_req_data(
6766 req, struct rpccli_svcctl_QueryServiceConfig2A_state);
6767 NTSTATUS status;
6769 if (tevent_req_is_nterror(req, &status)) {
6770 tevent_req_received(req);
6771 return status;
6774 /* Steal possbile out parameters to the callers context */
6775 talloc_steal(mem_ctx, state->out_mem_ctx);
6777 /* Return result */
6778 *result = state->orig.out.result;
6780 tevent_req_received(req);
6781 return NT_STATUS_OK;
6784 NTSTATUS rpccli_svcctl_QueryServiceConfig2A(struct rpc_pipe_client *cli,
6785 TALLOC_CTX *mem_ctx,
6786 struct policy_handle *handle /* [in] [ref] */,
6787 enum svcctl_ConfigLevel info_level /* [in] */,
6788 uint8_t *buffer /* [out] */,
6789 uint32_t offered /* [in] */,
6790 uint32_t *needed /* [out] [ref] */,
6791 WERROR *werror)
6793 struct svcctl_QueryServiceConfig2A r;
6794 NTSTATUS status;
6796 /* In parameters */
6797 r.in.handle = handle;
6798 r.in.info_level = info_level;
6799 r.in.offered = offered;
6801 if (DEBUGLEVEL >= 10) {
6802 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2A, &r);
6805 status = cli->dispatch(cli,
6806 mem_ctx,
6807 &ndr_table_svcctl,
6808 NDR_SVCCTL_QUERYSERVICECONFIG2A,
6809 &r);
6811 if (!NT_STATUS_IS_OK(status)) {
6812 return status;
6815 if (DEBUGLEVEL >= 10) {
6816 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2A, &r);
6819 if (NT_STATUS_IS_ERR(status)) {
6820 return status;
6823 /* Return variables */
6824 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
6825 *needed = *r.out.needed;
6827 /* Return result */
6828 if (werror) {
6829 *werror = r.out.result;
6832 return werror_to_ntstatus(r.out.result);
6835 struct rpccli_svcctl_QueryServiceConfig2W_state {
6836 struct svcctl_QueryServiceConfig2W orig;
6837 struct svcctl_QueryServiceConfig2W tmp;
6838 TALLOC_CTX *out_mem_ctx;
6839 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6842 static void rpccli_svcctl_QueryServiceConfig2W_done(struct tevent_req *subreq);
6844 struct tevent_req *rpccli_svcctl_QueryServiceConfig2W_send(TALLOC_CTX *mem_ctx,
6845 struct tevent_context *ev,
6846 struct rpc_pipe_client *cli,
6847 struct policy_handle *_handle /* [in] [ref] */,
6848 enum svcctl_ConfigLevel _info_level /* [in] */,
6849 uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
6850 uint32_t _offered /* [in] [range(0,8192)] */,
6851 uint32_t *_needed /* [out] [ref,range(0,8192)] */)
6853 struct tevent_req *req;
6854 struct rpccli_svcctl_QueryServiceConfig2W_state *state;
6855 struct tevent_req *subreq;
6857 req = tevent_req_create(mem_ctx, &state,
6858 struct rpccli_svcctl_QueryServiceConfig2W_state);
6859 if (req == NULL) {
6860 return NULL;
6862 state->out_mem_ctx = NULL;
6863 state->dispatch_recv = cli->dispatch_recv;
6865 /* In parameters */
6866 state->orig.in.handle = _handle;
6867 state->orig.in.info_level = _info_level;
6868 state->orig.in.offered = _offered;
6870 /* Out parameters */
6871 state->orig.out.buffer = _buffer;
6872 state->orig.out.needed = _needed;
6874 /* Result */
6875 ZERO_STRUCT(state->orig.out.result);
6877 if (DEBUGLEVEL >= 10) {
6878 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, &state->orig);
6881 state->out_mem_ctx = talloc_named_const(state, 0,
6882 "rpccli_svcctl_QueryServiceConfig2W_out_memory");
6883 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6884 return tevent_req_post(req, ev);
6887 /* make a temporary copy, that we pass to the dispatch function */
6888 state->tmp = state->orig;
6890 subreq = cli->dispatch_send(state, ev, cli,
6891 &ndr_table_svcctl,
6892 NDR_SVCCTL_QUERYSERVICECONFIG2W,
6893 &state->tmp);
6894 if (tevent_req_nomem(subreq, req)) {
6895 return tevent_req_post(req, ev);
6897 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceConfig2W_done, req);
6898 return req;
6901 static void rpccli_svcctl_QueryServiceConfig2W_done(struct tevent_req *subreq)
6903 struct tevent_req *req = tevent_req_callback_data(
6904 subreq, struct tevent_req);
6905 struct rpccli_svcctl_QueryServiceConfig2W_state *state = tevent_req_data(
6906 req, struct rpccli_svcctl_QueryServiceConfig2W_state);
6907 NTSTATUS status;
6908 TALLOC_CTX *mem_ctx;
6910 if (state->out_mem_ctx) {
6911 mem_ctx = state->out_mem_ctx;
6912 } else {
6913 mem_ctx = state;
6916 status = state->dispatch_recv(subreq, mem_ctx);
6917 TALLOC_FREE(subreq);
6918 if (!NT_STATUS_IS_OK(status)) {
6919 tevent_req_nterror(req, status);
6920 return;
6923 /* Copy out parameters */
6924 memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
6925 *state->orig.out.needed = *state->tmp.out.needed;
6927 /* Copy result */
6928 state->orig.out.result = state->tmp.out.result;
6930 /* Reset temporary structure */
6931 ZERO_STRUCT(state->tmp);
6933 if (DEBUGLEVEL >= 10) {
6934 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, &state->orig);
6937 tevent_req_done(req);
6940 NTSTATUS rpccli_svcctl_QueryServiceConfig2W_recv(struct tevent_req *req,
6941 TALLOC_CTX *mem_ctx,
6942 WERROR *result)
6944 struct rpccli_svcctl_QueryServiceConfig2W_state *state = tevent_req_data(
6945 req, struct rpccli_svcctl_QueryServiceConfig2W_state);
6946 NTSTATUS status;
6948 if (tevent_req_is_nterror(req, &status)) {
6949 tevent_req_received(req);
6950 return status;
6953 /* Steal possbile out parameters to the callers context */
6954 talloc_steal(mem_ctx, state->out_mem_ctx);
6956 /* Return result */
6957 *result = state->orig.out.result;
6959 tevent_req_received(req);
6960 return NT_STATUS_OK;
6963 NTSTATUS rpccli_svcctl_QueryServiceConfig2W(struct rpc_pipe_client *cli,
6964 TALLOC_CTX *mem_ctx,
6965 struct policy_handle *handle /* [in] [ref] */,
6966 enum svcctl_ConfigLevel info_level /* [in] */,
6967 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
6968 uint32_t offered /* [in] [range(0,8192)] */,
6969 uint32_t *needed /* [out] [ref,range(0,8192)] */,
6970 WERROR *werror)
6972 struct svcctl_QueryServiceConfig2W r;
6973 NTSTATUS status;
6975 /* In parameters */
6976 r.in.handle = handle;
6977 r.in.info_level = info_level;
6978 r.in.offered = offered;
6980 if (DEBUGLEVEL >= 10) {
6981 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceConfig2W, &r);
6984 status = cli->dispatch(cli,
6985 mem_ctx,
6986 &ndr_table_svcctl,
6987 NDR_SVCCTL_QUERYSERVICECONFIG2W,
6988 &r);
6990 if (!NT_STATUS_IS_OK(status)) {
6991 return status;
6994 if (DEBUGLEVEL >= 10) {
6995 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceConfig2W, &r);
6998 if (NT_STATUS_IS_ERR(status)) {
6999 return status;
7002 /* Return variables */
7003 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
7004 *needed = *r.out.needed;
7006 /* Return result */
7007 if (werror) {
7008 *werror = r.out.result;
7011 return werror_to_ntstatus(r.out.result);
7014 struct rpccli_svcctl_QueryServiceStatusEx_state {
7015 struct svcctl_QueryServiceStatusEx orig;
7016 struct svcctl_QueryServiceStatusEx tmp;
7017 TALLOC_CTX *out_mem_ctx;
7018 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7021 static void rpccli_svcctl_QueryServiceStatusEx_done(struct tevent_req *subreq);
7023 struct tevent_req *rpccli_svcctl_QueryServiceStatusEx_send(TALLOC_CTX *mem_ctx,
7024 struct tevent_context *ev,
7025 struct rpc_pipe_client *cli,
7026 struct policy_handle *_handle /* [in] [ref] */,
7027 enum svcctl_StatusLevel _info_level /* [in] */,
7028 uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
7029 uint32_t _offered /* [in] [range(0,8192)] */,
7030 uint32_t *_needed /* [out] [ref,range(0,8192)] */)
7032 struct tevent_req *req;
7033 struct rpccli_svcctl_QueryServiceStatusEx_state *state;
7034 struct tevent_req *subreq;
7036 req = tevent_req_create(mem_ctx, &state,
7037 struct rpccli_svcctl_QueryServiceStatusEx_state);
7038 if (req == NULL) {
7039 return NULL;
7041 state->out_mem_ctx = NULL;
7042 state->dispatch_recv = cli->dispatch_recv;
7044 /* In parameters */
7045 state->orig.in.handle = _handle;
7046 state->orig.in.info_level = _info_level;
7047 state->orig.in.offered = _offered;
7049 /* Out parameters */
7050 state->orig.out.buffer = _buffer;
7051 state->orig.out.needed = _needed;
7053 /* Result */
7054 ZERO_STRUCT(state->orig.out.result);
7056 if (DEBUGLEVEL >= 10) {
7057 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, &state->orig);
7060 state->out_mem_ctx = talloc_named_const(state, 0,
7061 "rpccli_svcctl_QueryServiceStatusEx_out_memory");
7062 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7063 return tevent_req_post(req, ev);
7066 /* make a temporary copy, that we pass to the dispatch function */
7067 state->tmp = state->orig;
7069 subreq = cli->dispatch_send(state, ev, cli,
7070 &ndr_table_svcctl,
7071 NDR_SVCCTL_QUERYSERVICESTATUSEX,
7072 &state->tmp);
7073 if (tevent_req_nomem(subreq, req)) {
7074 return tevent_req_post(req, ev);
7076 tevent_req_set_callback(subreq, rpccli_svcctl_QueryServiceStatusEx_done, req);
7077 return req;
7080 static void rpccli_svcctl_QueryServiceStatusEx_done(struct tevent_req *subreq)
7082 struct tevent_req *req = tevent_req_callback_data(
7083 subreq, struct tevent_req);
7084 struct rpccli_svcctl_QueryServiceStatusEx_state *state = tevent_req_data(
7085 req, struct rpccli_svcctl_QueryServiceStatusEx_state);
7086 NTSTATUS status;
7087 TALLOC_CTX *mem_ctx;
7089 if (state->out_mem_ctx) {
7090 mem_ctx = state->out_mem_ctx;
7091 } else {
7092 mem_ctx = state;
7095 status = state->dispatch_recv(subreq, mem_ctx);
7096 TALLOC_FREE(subreq);
7097 if (!NT_STATUS_IS_OK(status)) {
7098 tevent_req_nterror(req, status);
7099 return;
7102 /* Copy out parameters */
7103 memcpy(state->orig.out.buffer, state->tmp.out.buffer, state->tmp.in.offered * sizeof(*state->orig.out.buffer));
7104 *state->orig.out.needed = *state->tmp.out.needed;
7106 /* Copy result */
7107 state->orig.out.result = state->tmp.out.result;
7109 /* Reset temporary structure */
7110 ZERO_STRUCT(state->tmp);
7112 if (DEBUGLEVEL >= 10) {
7113 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, &state->orig);
7116 tevent_req_done(req);
7119 NTSTATUS rpccli_svcctl_QueryServiceStatusEx_recv(struct tevent_req *req,
7120 TALLOC_CTX *mem_ctx,
7121 WERROR *result)
7123 struct rpccli_svcctl_QueryServiceStatusEx_state *state = tevent_req_data(
7124 req, struct rpccli_svcctl_QueryServiceStatusEx_state);
7125 NTSTATUS status;
7127 if (tevent_req_is_nterror(req, &status)) {
7128 tevent_req_received(req);
7129 return status;
7132 /* Steal possbile out parameters to the callers context */
7133 talloc_steal(mem_ctx, state->out_mem_ctx);
7135 /* Return result */
7136 *result = state->orig.out.result;
7138 tevent_req_received(req);
7139 return NT_STATUS_OK;
7142 NTSTATUS rpccli_svcctl_QueryServiceStatusEx(struct rpc_pipe_client *cli,
7143 TALLOC_CTX *mem_ctx,
7144 struct policy_handle *handle /* [in] [ref] */,
7145 enum svcctl_StatusLevel info_level /* [in] */,
7146 uint8_t *buffer /* [out] [ref,size_is(offered)] */,
7147 uint32_t offered /* [in] [range(0,8192)] */,
7148 uint32_t *needed /* [out] [ref,range(0,8192)] */,
7149 WERROR *werror)
7151 struct svcctl_QueryServiceStatusEx r;
7152 NTSTATUS status;
7154 /* In parameters */
7155 r.in.handle = handle;
7156 r.in.info_level = info_level;
7157 r.in.offered = offered;
7159 if (DEBUGLEVEL >= 10) {
7160 NDR_PRINT_IN_DEBUG(svcctl_QueryServiceStatusEx, &r);
7163 status = cli->dispatch(cli,
7164 mem_ctx,
7165 &ndr_table_svcctl,
7166 NDR_SVCCTL_QUERYSERVICESTATUSEX,
7167 &r);
7169 if (!NT_STATUS_IS_OK(status)) {
7170 return status;
7173 if (DEBUGLEVEL >= 10) {
7174 NDR_PRINT_OUT_DEBUG(svcctl_QueryServiceStatusEx, &r);
7177 if (NT_STATUS_IS_ERR(status)) {
7178 return status;
7181 /* Return variables */
7182 memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
7183 *needed = *r.out.needed;
7185 /* Return result */
7186 if (werror) {
7187 *werror = r.out.result;
7190 return werror_to_ntstatus(r.out.result);
7193 struct rpccli_EnumServicesStatusExA_state {
7194 struct EnumServicesStatusExA orig;
7195 struct EnumServicesStatusExA tmp;
7196 TALLOC_CTX *out_mem_ctx;
7197 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7200 static void rpccli_EnumServicesStatusExA_done(struct tevent_req *subreq);
7202 struct tevent_req *rpccli_EnumServicesStatusExA_send(TALLOC_CTX *mem_ctx,
7203 struct tevent_context *ev,
7204 struct rpc_pipe_client *cli,
7205 struct policy_handle *_scmanager /* [in] [ref] */,
7206 uint32_t _info_level /* [in] */,
7207 uint32_t _type /* [in] */,
7208 enum svcctl_ServiceState _state /* [in] */,
7209 uint8_t *_services /* [out] */,
7210 uint32_t _offered /* [in] */,
7211 uint32_t *_needed /* [out] [ref] */,
7212 uint32_t *_service_returned /* [out] [ref] */,
7213 uint32_t *_resume_handle /* [in,out] [unique] */,
7214 const char **_group_name /* [out] [ref,charset(UTF16)] */)
7216 struct tevent_req *req;
7217 struct rpccli_EnumServicesStatusExA_state *state;
7218 struct tevent_req *subreq;
7220 req = tevent_req_create(mem_ctx, &state,
7221 struct rpccli_EnumServicesStatusExA_state);
7222 if (req == NULL) {
7223 return NULL;
7225 state->out_mem_ctx = NULL;
7226 state->dispatch_recv = cli->dispatch_recv;
7228 /* In parameters */
7229 state->orig.in.scmanager = _scmanager;
7230 state->orig.in.info_level = _info_level;
7231 state->orig.in.type = _type;
7232 state->orig.in.state = _state;
7233 state->orig.in.offered = _offered;
7234 state->orig.in.resume_handle = _resume_handle;
7236 /* Out parameters */
7237 state->orig.out.services = _services;
7238 state->orig.out.needed = _needed;
7239 state->orig.out.service_returned = _service_returned;
7240 state->orig.out.resume_handle = _resume_handle;
7241 state->orig.out.group_name = _group_name;
7243 /* Result */
7244 ZERO_STRUCT(state->orig.out.result);
7246 if (DEBUGLEVEL >= 10) {
7247 NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, &state->orig);
7250 state->out_mem_ctx = talloc_named_const(state, 0,
7251 "rpccli_EnumServicesStatusExA_out_memory");
7252 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7253 return tevent_req_post(req, ev);
7256 /* make a temporary copy, that we pass to the dispatch function */
7257 state->tmp = state->orig;
7259 subreq = cli->dispatch_send(state, ev, cli,
7260 &ndr_table_svcctl,
7261 NDR_ENUMSERVICESSTATUSEXA,
7262 &state->tmp);
7263 if (tevent_req_nomem(subreq, req)) {
7264 return tevent_req_post(req, ev);
7266 tevent_req_set_callback(subreq, rpccli_EnumServicesStatusExA_done, req);
7267 return req;
7270 static void rpccli_EnumServicesStatusExA_done(struct tevent_req *subreq)
7272 struct tevent_req *req = tevent_req_callback_data(
7273 subreq, struct tevent_req);
7274 struct rpccli_EnumServicesStatusExA_state *state = tevent_req_data(
7275 req, struct rpccli_EnumServicesStatusExA_state);
7276 NTSTATUS status;
7277 TALLOC_CTX *mem_ctx;
7279 if (state->out_mem_ctx) {
7280 mem_ctx = state->out_mem_ctx;
7281 } else {
7282 mem_ctx = state;
7285 status = state->dispatch_recv(subreq, mem_ctx);
7286 TALLOC_FREE(subreq);
7287 if (!NT_STATUS_IS_OK(status)) {
7288 tevent_req_nterror(req, status);
7289 return;
7292 /* Copy out parameters */
7293 memcpy(state->orig.out.services, state->tmp.out.services, state->tmp.in.offered * sizeof(*state->orig.out.services));
7294 *state->orig.out.needed = *state->tmp.out.needed;
7295 *state->orig.out.service_returned = *state->tmp.out.service_returned;
7296 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
7297 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
7299 *state->orig.out.group_name = *state->tmp.out.group_name;
7301 /* Copy result */
7302 state->orig.out.result = state->tmp.out.result;
7304 /* Reset temporary structure */
7305 ZERO_STRUCT(state->tmp);
7307 if (DEBUGLEVEL >= 10) {
7308 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, &state->orig);
7311 tevent_req_done(req);
7314 NTSTATUS rpccli_EnumServicesStatusExA_recv(struct tevent_req *req,
7315 TALLOC_CTX *mem_ctx,
7316 WERROR *result)
7318 struct rpccli_EnumServicesStatusExA_state *state = tevent_req_data(
7319 req, struct rpccli_EnumServicesStatusExA_state);
7320 NTSTATUS status;
7322 if (tevent_req_is_nterror(req, &status)) {
7323 tevent_req_received(req);
7324 return status;
7327 /* Steal possbile out parameters to the callers context */
7328 talloc_steal(mem_ctx, state->out_mem_ctx);
7330 /* Return result */
7331 *result = state->orig.out.result;
7333 tevent_req_received(req);
7334 return NT_STATUS_OK;
7337 NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli,
7338 TALLOC_CTX *mem_ctx,
7339 struct policy_handle *scmanager /* [in] [ref] */,
7340 uint32_t info_level /* [in] */,
7341 uint32_t type /* [in] */,
7342 enum svcctl_ServiceState state /* [in] */,
7343 uint8_t *services /* [out] */,
7344 uint32_t offered /* [in] */,
7345 uint32_t *needed /* [out] [ref] */,
7346 uint32_t *service_returned /* [out] [ref] */,
7347 uint32_t *resume_handle /* [in,out] [unique] */,
7348 const char **group_name /* [out] [ref,charset(UTF16)] */,
7349 WERROR *werror)
7351 struct EnumServicesStatusExA r;
7352 NTSTATUS status;
7354 /* In parameters */
7355 r.in.scmanager = scmanager;
7356 r.in.info_level = info_level;
7357 r.in.type = type;
7358 r.in.state = state;
7359 r.in.offered = offered;
7360 r.in.resume_handle = resume_handle;
7362 if (DEBUGLEVEL >= 10) {
7363 NDR_PRINT_IN_DEBUG(EnumServicesStatusExA, &r);
7366 status = cli->dispatch(cli,
7367 mem_ctx,
7368 &ndr_table_svcctl,
7369 NDR_ENUMSERVICESSTATUSEXA,
7370 &r);
7372 if (!NT_STATUS_IS_OK(status)) {
7373 return status;
7376 if (DEBUGLEVEL >= 10) {
7377 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExA, &r);
7380 if (NT_STATUS_IS_ERR(status)) {
7381 return status;
7384 /* Return variables */
7385 memcpy(services, r.out.services, r.in.offered * sizeof(*services));
7386 *needed = *r.out.needed;
7387 *service_returned = *r.out.service_returned;
7388 if (resume_handle && r.out.resume_handle) {
7389 *resume_handle = *r.out.resume_handle;
7391 *group_name = *r.out.group_name;
7393 /* Return result */
7394 if (werror) {
7395 *werror = r.out.result;
7398 return werror_to_ntstatus(r.out.result);
7401 struct rpccli_EnumServicesStatusExW_state {
7402 struct EnumServicesStatusExW orig;
7403 struct EnumServicesStatusExW tmp;
7404 TALLOC_CTX *out_mem_ctx;
7405 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7408 static void rpccli_EnumServicesStatusExW_done(struct tevent_req *subreq);
7410 struct tevent_req *rpccli_EnumServicesStatusExW_send(TALLOC_CTX *mem_ctx,
7411 struct tevent_context *ev,
7412 struct rpc_pipe_client *cli,
7413 struct policy_handle *_scmanager /* [in] [ref] */,
7414 uint32_t _info_level /* [in] */,
7415 uint32_t _type /* [in] */,
7416 enum svcctl_ServiceState _state /* [in] */,
7417 uint8_t *_services /* [out] [ref,size_is(offered)] */,
7418 uint32_t _offered /* [in] [range(0,0x40000)] */,
7419 uint32_t *_needed /* [out] [ref,range(0,0x40000)] */,
7420 uint32_t *_service_returned /* [out] [ref,range(0,0x40000)] */,
7421 uint32_t *_resume_handle /* [in,out] [unique,range(0,0x40000)] */,
7422 const char *_group_name /* [in] [unique,charset(UTF16)] */)
7424 struct tevent_req *req;
7425 struct rpccli_EnumServicesStatusExW_state *state;
7426 struct tevent_req *subreq;
7428 req = tevent_req_create(mem_ctx, &state,
7429 struct rpccli_EnumServicesStatusExW_state);
7430 if (req == NULL) {
7431 return NULL;
7433 state->out_mem_ctx = NULL;
7434 state->dispatch_recv = cli->dispatch_recv;
7436 /* In parameters */
7437 state->orig.in.scmanager = _scmanager;
7438 state->orig.in.info_level = _info_level;
7439 state->orig.in.type = _type;
7440 state->orig.in.state = _state;
7441 state->orig.in.offered = _offered;
7442 state->orig.in.resume_handle = _resume_handle;
7443 state->orig.in.group_name = _group_name;
7445 /* Out parameters */
7446 state->orig.out.services = _services;
7447 state->orig.out.needed = _needed;
7448 state->orig.out.service_returned = _service_returned;
7449 state->orig.out.resume_handle = _resume_handle;
7451 /* Result */
7452 ZERO_STRUCT(state->orig.out.result);
7454 if (DEBUGLEVEL >= 10) {
7455 NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, &state->orig);
7458 state->out_mem_ctx = talloc_named_const(state, 0,
7459 "rpccli_EnumServicesStatusExW_out_memory");
7460 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7461 return tevent_req_post(req, ev);
7464 /* make a temporary copy, that we pass to the dispatch function */
7465 state->tmp = state->orig;
7467 subreq = cli->dispatch_send(state, ev, cli,
7468 &ndr_table_svcctl,
7469 NDR_ENUMSERVICESSTATUSEXW,
7470 &state->tmp);
7471 if (tevent_req_nomem(subreq, req)) {
7472 return tevent_req_post(req, ev);
7474 tevent_req_set_callback(subreq, rpccli_EnumServicesStatusExW_done, req);
7475 return req;
7478 static void rpccli_EnumServicesStatusExW_done(struct tevent_req *subreq)
7480 struct tevent_req *req = tevent_req_callback_data(
7481 subreq, struct tevent_req);
7482 struct rpccli_EnumServicesStatusExW_state *state = tevent_req_data(
7483 req, struct rpccli_EnumServicesStatusExW_state);
7484 NTSTATUS status;
7485 TALLOC_CTX *mem_ctx;
7487 if (state->out_mem_ctx) {
7488 mem_ctx = state->out_mem_ctx;
7489 } else {
7490 mem_ctx = state;
7493 status = state->dispatch_recv(subreq, mem_ctx);
7494 TALLOC_FREE(subreq);
7495 if (!NT_STATUS_IS_OK(status)) {
7496 tevent_req_nterror(req, status);
7497 return;
7500 /* Copy out parameters */
7501 memcpy(state->orig.out.services, state->tmp.out.services, state->tmp.in.offered * sizeof(*state->orig.out.services));
7502 *state->orig.out.needed = *state->tmp.out.needed;
7503 *state->orig.out.service_returned = *state->tmp.out.service_returned;
7504 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
7505 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
7508 /* Copy result */
7509 state->orig.out.result = state->tmp.out.result;
7511 /* Reset temporary structure */
7512 ZERO_STRUCT(state->tmp);
7514 if (DEBUGLEVEL >= 10) {
7515 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, &state->orig);
7518 tevent_req_done(req);
7521 NTSTATUS rpccli_EnumServicesStatusExW_recv(struct tevent_req *req,
7522 TALLOC_CTX *mem_ctx,
7523 WERROR *result)
7525 struct rpccli_EnumServicesStatusExW_state *state = tevent_req_data(
7526 req, struct rpccli_EnumServicesStatusExW_state);
7527 NTSTATUS status;
7529 if (tevent_req_is_nterror(req, &status)) {
7530 tevent_req_received(req);
7531 return status;
7534 /* Steal possbile out parameters to the callers context */
7535 talloc_steal(mem_ctx, state->out_mem_ctx);
7537 /* Return result */
7538 *result = state->orig.out.result;
7540 tevent_req_received(req);
7541 return NT_STATUS_OK;
7544 NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli,
7545 TALLOC_CTX *mem_ctx,
7546 struct policy_handle *scmanager /* [in] [ref] */,
7547 uint32_t info_level /* [in] */,
7548 uint32_t type /* [in] */,
7549 enum svcctl_ServiceState state /* [in] */,
7550 uint8_t *services /* [out] [ref,size_is(offered)] */,
7551 uint32_t offered /* [in] [range(0,0x40000)] */,
7552 uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
7553 uint32_t *service_returned /* [out] [ref,range(0,0x40000)] */,
7554 uint32_t *resume_handle /* [in,out] [unique,range(0,0x40000)] */,
7555 const char *group_name /* [in] [unique,charset(UTF16)] */,
7556 WERROR *werror)
7558 struct EnumServicesStatusExW r;
7559 NTSTATUS status;
7561 /* In parameters */
7562 r.in.scmanager = scmanager;
7563 r.in.info_level = info_level;
7564 r.in.type = type;
7565 r.in.state = state;
7566 r.in.offered = offered;
7567 r.in.resume_handle = resume_handle;
7568 r.in.group_name = group_name;
7570 if (DEBUGLEVEL >= 10) {
7571 NDR_PRINT_IN_DEBUG(EnumServicesStatusExW, &r);
7574 status = cli->dispatch(cli,
7575 mem_ctx,
7576 &ndr_table_svcctl,
7577 NDR_ENUMSERVICESSTATUSEXW,
7578 &r);
7580 if (!NT_STATUS_IS_OK(status)) {
7581 return status;
7584 if (DEBUGLEVEL >= 10) {
7585 NDR_PRINT_OUT_DEBUG(EnumServicesStatusExW, &r);
7588 if (NT_STATUS_IS_ERR(status)) {
7589 return status;
7592 /* Return variables */
7593 memcpy(services, r.out.services, r.in.offered * sizeof(*services));
7594 *needed = *r.out.needed;
7595 *service_returned = *r.out.service_returned;
7596 if (resume_handle && r.out.resume_handle) {
7597 *resume_handle = *r.out.resume_handle;
7600 /* Return result */
7601 if (werror) {
7602 *werror = r.out.result;
7605 return werror_to_ntstatus(r.out.result);
7608 struct rpccli_svcctl_SCSendTSMessage_state {
7609 struct svcctl_SCSendTSMessage orig;
7610 struct svcctl_SCSendTSMessage tmp;
7611 TALLOC_CTX *out_mem_ctx;
7612 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7615 static void rpccli_svcctl_SCSendTSMessage_done(struct tevent_req *subreq);
7617 struct tevent_req *rpccli_svcctl_SCSendTSMessage_send(TALLOC_CTX *mem_ctx,
7618 struct tevent_context *ev,
7619 struct rpc_pipe_client *cli)
7621 struct tevent_req *req;
7622 struct rpccli_svcctl_SCSendTSMessage_state *state;
7623 struct tevent_req *subreq;
7625 req = tevent_req_create(mem_ctx, &state,
7626 struct rpccli_svcctl_SCSendTSMessage_state);
7627 if (req == NULL) {
7628 return NULL;
7630 state->out_mem_ctx = NULL;
7631 state->dispatch_recv = cli->dispatch_recv;
7633 /* In parameters */
7635 /* Out parameters */
7637 /* Result */
7638 ZERO_STRUCT(state->orig.out.result);
7640 if (DEBUGLEVEL >= 10) {
7641 NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, &state->orig);
7644 /* make a temporary copy, that we pass to the dispatch function */
7645 state->tmp = state->orig;
7647 subreq = cli->dispatch_send(state, ev, cli,
7648 &ndr_table_svcctl,
7649 NDR_SVCCTL_SCSENDTSMESSAGE,
7650 &state->tmp);
7651 if (tevent_req_nomem(subreq, req)) {
7652 return tevent_req_post(req, ev);
7654 tevent_req_set_callback(subreq, rpccli_svcctl_SCSendTSMessage_done, req);
7655 return req;
7658 static void rpccli_svcctl_SCSendTSMessage_done(struct tevent_req *subreq)
7660 struct tevent_req *req = tevent_req_callback_data(
7661 subreq, struct tevent_req);
7662 struct rpccli_svcctl_SCSendTSMessage_state *state = tevent_req_data(
7663 req, struct rpccli_svcctl_SCSendTSMessage_state);
7664 NTSTATUS status;
7665 TALLOC_CTX *mem_ctx;
7667 if (state->out_mem_ctx) {
7668 mem_ctx = state->out_mem_ctx;
7669 } else {
7670 mem_ctx = state;
7673 status = state->dispatch_recv(subreq, mem_ctx);
7674 TALLOC_FREE(subreq);
7675 if (!NT_STATUS_IS_OK(status)) {
7676 tevent_req_nterror(req, status);
7677 return;
7680 /* Copy out parameters */
7682 /* Copy result */
7683 state->orig.out.result = state->tmp.out.result;
7685 /* Reset temporary structure */
7686 ZERO_STRUCT(state->tmp);
7688 if (DEBUGLEVEL >= 10) {
7689 NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, &state->orig);
7692 tevent_req_done(req);
7695 NTSTATUS rpccli_svcctl_SCSendTSMessage_recv(struct tevent_req *req,
7696 TALLOC_CTX *mem_ctx,
7697 WERROR *result)
7699 struct rpccli_svcctl_SCSendTSMessage_state *state = tevent_req_data(
7700 req, struct rpccli_svcctl_SCSendTSMessage_state);
7701 NTSTATUS status;
7703 if (tevent_req_is_nterror(req, &status)) {
7704 tevent_req_received(req);
7705 return status;
7708 /* Steal possbile out parameters to the callers context */
7709 talloc_steal(mem_ctx, state->out_mem_ctx);
7711 /* Return result */
7712 *result = state->orig.out.result;
7714 tevent_req_received(req);
7715 return NT_STATUS_OK;
7718 NTSTATUS rpccli_svcctl_SCSendTSMessage(struct rpc_pipe_client *cli,
7719 TALLOC_CTX *mem_ctx,
7720 WERROR *werror)
7722 struct svcctl_SCSendTSMessage r;
7723 NTSTATUS status;
7725 /* In parameters */
7727 if (DEBUGLEVEL >= 10) {
7728 NDR_PRINT_IN_DEBUG(svcctl_SCSendTSMessage, &r);
7731 status = cli->dispatch(cli,
7732 mem_ctx,
7733 &ndr_table_svcctl,
7734 NDR_SVCCTL_SCSENDTSMESSAGE,
7735 &r);
7737 if (!NT_STATUS_IS_OK(status)) {
7738 return status;
7741 if (DEBUGLEVEL >= 10) {
7742 NDR_PRINT_OUT_DEBUG(svcctl_SCSendTSMessage, &r);
7745 if (NT_STATUS_IS_ERR(status)) {
7746 return status;
7749 /* Return variables */
7751 /* Return result */
7752 if (werror) {
7753 *werror = r.out.result;
7756 return werror_to_ntstatus(r.out.result);