Line data Source code
1 : /* client functions auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include <tevent.h>
5 : #include "lib/util/tevent_ntstatus.h"
6 : #include "bin/default/librpc/gen_ndr/ndr_svcctl.h"
7 : #include "bin/default/librpc/gen_ndr/ndr_svcctl_c.h"
8 :
9 : /* svcctl - client functions generated by pidl */
10 :
11 : struct dcerpc_svcctl_CloseServiceHandle_r_state {
12 : TALLOC_CTX *out_mem_ctx;
13 : };
14 :
15 : static void dcerpc_svcctl_CloseServiceHandle_r_done(struct tevent_req *subreq);
16 :
17 0 : struct tevent_req *dcerpc_svcctl_CloseServiceHandle_r_send(TALLOC_CTX *mem_ctx,
18 : struct tevent_context *ev,
19 : struct dcerpc_binding_handle *h,
20 : struct svcctl_CloseServiceHandle *r)
21 : {
22 : struct tevent_req *req;
23 : struct dcerpc_svcctl_CloseServiceHandle_r_state *state;
24 : struct tevent_req *subreq;
25 :
26 0 : req = tevent_req_create(mem_ctx, &state,
27 : struct dcerpc_svcctl_CloseServiceHandle_r_state);
28 0 : if (req == NULL) {
29 0 : return NULL;
30 : }
31 :
32 0 : state->out_mem_ctx = talloc_new(state);
33 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
34 0 : return tevent_req_post(req, ev);
35 : }
36 :
37 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
38 : NULL, &ndr_table_svcctl,
39 0 : NDR_SVCCTL_CLOSESERVICEHANDLE, state->out_mem_ctx, r);
40 0 : if (tevent_req_nomem(subreq, req)) {
41 0 : return tevent_req_post(req, ev);
42 : }
43 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_CloseServiceHandle_r_done, req);
44 :
45 0 : return req;
46 : }
47 :
48 0 : static void dcerpc_svcctl_CloseServiceHandle_r_done(struct tevent_req *subreq)
49 : {
50 0 : struct tevent_req *req =
51 0 : tevent_req_callback_data(subreq,
52 : struct tevent_req);
53 : NTSTATUS status;
54 :
55 0 : status = dcerpc_binding_handle_call_recv(subreq);
56 0 : TALLOC_FREE(subreq);
57 0 : if (tevent_req_nterror(req, status)) {
58 0 : return;
59 : }
60 :
61 0 : tevent_req_done(req);
62 : }
63 :
64 0 : NTSTATUS dcerpc_svcctl_CloseServiceHandle_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
65 : {
66 0 : struct dcerpc_svcctl_CloseServiceHandle_r_state *state =
67 0 : tevent_req_data(req,
68 : struct dcerpc_svcctl_CloseServiceHandle_r_state);
69 : NTSTATUS status;
70 :
71 0 : if (tevent_req_is_nterror(req, &status)) {
72 0 : tevent_req_received(req);
73 0 : return status;
74 : }
75 :
76 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
77 :
78 0 : tevent_req_received(req);
79 0 : return NT_STATUS_OK;
80 : }
81 :
82 0 : NTSTATUS dcerpc_svcctl_CloseServiceHandle_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_CloseServiceHandle *r)
83 : {
84 : NTSTATUS status;
85 :
86 0 : status = dcerpc_binding_handle_call(h,
87 : NULL, &ndr_table_svcctl,
88 : NDR_SVCCTL_CLOSESERVICEHANDLE, mem_ctx, r);
89 :
90 0 : return status;
91 : }
92 :
93 : struct dcerpc_svcctl_CloseServiceHandle_state {
94 : struct svcctl_CloseServiceHandle orig;
95 : struct svcctl_CloseServiceHandle tmp;
96 : TALLOC_CTX *out_mem_ctx;
97 : };
98 :
99 : static void dcerpc_svcctl_CloseServiceHandle_done(struct tevent_req *subreq);
100 :
101 0 : struct tevent_req *dcerpc_svcctl_CloseServiceHandle_send(TALLOC_CTX *mem_ctx,
102 : struct tevent_context *ev,
103 : struct dcerpc_binding_handle *h,
104 : struct policy_handle *_handle /* [in,out] [ref] */)
105 : {
106 : struct tevent_req *req;
107 : struct dcerpc_svcctl_CloseServiceHandle_state *state;
108 : struct tevent_req *subreq;
109 :
110 0 : req = tevent_req_create(mem_ctx, &state,
111 : struct dcerpc_svcctl_CloseServiceHandle_state);
112 0 : if (req == NULL) {
113 0 : return NULL;
114 : }
115 0 : state->out_mem_ctx = NULL;
116 :
117 : /* In parameters */
118 0 : state->orig.in.handle = _handle;
119 :
120 : /* Out parameters */
121 0 : state->orig.out.handle = _handle;
122 :
123 : /* Result */
124 0 : NDR_ZERO_STRUCT(state->orig.out.result);
125 :
126 0 : state->out_mem_ctx = talloc_named_const(state, 0,
127 : "dcerpc_svcctl_CloseServiceHandle_out_memory");
128 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
129 0 : return tevent_req_post(req, ev);
130 : }
131 :
132 : /* make a temporary copy, that we pass to the dispatch function */
133 0 : state->tmp = state->orig;
134 :
135 0 : subreq = dcerpc_svcctl_CloseServiceHandle_r_send(state, ev, h, &state->tmp);
136 0 : if (tevent_req_nomem(subreq, req)) {
137 0 : return tevent_req_post(req, ev);
138 : }
139 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_CloseServiceHandle_done, req);
140 0 : return req;
141 : }
142 :
143 0 : static void dcerpc_svcctl_CloseServiceHandle_done(struct tevent_req *subreq)
144 : {
145 0 : struct tevent_req *req = tevent_req_callback_data(
146 : subreq, struct tevent_req);
147 0 : struct dcerpc_svcctl_CloseServiceHandle_state *state = tevent_req_data(
148 : req, struct dcerpc_svcctl_CloseServiceHandle_state);
149 : NTSTATUS status;
150 : TALLOC_CTX *mem_ctx;
151 :
152 0 : if (state->out_mem_ctx) {
153 0 : mem_ctx = state->out_mem_ctx;
154 : } else {
155 0 : mem_ctx = state;
156 : }
157 :
158 0 : status = dcerpc_svcctl_CloseServiceHandle_r_recv(subreq, mem_ctx);
159 0 : TALLOC_FREE(subreq);
160 0 : if (tevent_req_nterror(req, status)) {
161 0 : return;
162 : }
163 :
164 : /* Copy out parameters */
165 0 : *state->orig.out.handle = *state->tmp.out.handle;
166 :
167 : /* Copy result */
168 0 : state->orig.out.result = state->tmp.out.result;
169 :
170 : /* Reset temporary structure */
171 0 : NDR_ZERO_STRUCT(state->tmp);
172 :
173 0 : tevent_req_done(req);
174 : }
175 :
176 0 : NTSTATUS dcerpc_svcctl_CloseServiceHandle_recv(struct tevent_req *req,
177 : TALLOC_CTX *mem_ctx,
178 : WERROR *result)
179 : {
180 0 : struct dcerpc_svcctl_CloseServiceHandle_state *state = tevent_req_data(
181 : req, struct dcerpc_svcctl_CloseServiceHandle_state);
182 : NTSTATUS status;
183 :
184 0 : if (tevent_req_is_nterror(req, &status)) {
185 0 : tevent_req_received(req);
186 0 : return status;
187 : }
188 :
189 : /* Steal possible out parameters to the callers context */
190 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
191 :
192 : /* Return result */
193 0 : *result = state->orig.out.result;
194 :
195 0 : tevent_req_received(req);
196 0 : return NT_STATUS_OK;
197 : }
198 :
199 0 : NTSTATUS dcerpc_svcctl_CloseServiceHandle(struct dcerpc_binding_handle *h,
200 : TALLOC_CTX *mem_ctx,
201 : struct policy_handle *_handle /* [in,out] [ref] */,
202 : WERROR *result)
203 : {
204 : struct svcctl_CloseServiceHandle r;
205 : NTSTATUS status;
206 :
207 : /* In parameters */
208 0 : r.in.handle = _handle;
209 :
210 : /* Out parameters */
211 0 : r.out.handle = _handle;
212 :
213 : /* Result */
214 0 : NDR_ZERO_STRUCT(r.out.result);
215 :
216 0 : status = dcerpc_svcctl_CloseServiceHandle_r(h, mem_ctx, &r);
217 0 : if (!NT_STATUS_IS_OK(status)) {
218 0 : return status;
219 : }
220 :
221 : /* Return variables */
222 0 : *_handle = *r.out.handle;
223 :
224 : /* Return result */
225 0 : *result = r.out.result;
226 :
227 0 : return NT_STATUS_OK;
228 : }
229 :
230 : struct dcerpc_svcctl_ControlService_r_state {
231 : TALLOC_CTX *out_mem_ctx;
232 : };
233 :
234 : static void dcerpc_svcctl_ControlService_r_done(struct tevent_req *subreq);
235 :
236 0 : struct tevent_req *dcerpc_svcctl_ControlService_r_send(TALLOC_CTX *mem_ctx,
237 : struct tevent_context *ev,
238 : struct dcerpc_binding_handle *h,
239 : struct svcctl_ControlService *r)
240 : {
241 : struct tevent_req *req;
242 : struct dcerpc_svcctl_ControlService_r_state *state;
243 : struct tevent_req *subreq;
244 :
245 0 : req = tevent_req_create(mem_ctx, &state,
246 : struct dcerpc_svcctl_ControlService_r_state);
247 0 : if (req == NULL) {
248 0 : return NULL;
249 : }
250 :
251 0 : state->out_mem_ctx = talloc_new(state);
252 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
253 0 : return tevent_req_post(req, ev);
254 : }
255 :
256 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
257 : NULL, &ndr_table_svcctl,
258 0 : NDR_SVCCTL_CONTROLSERVICE, state->out_mem_ctx, r);
259 0 : if (tevent_req_nomem(subreq, req)) {
260 0 : return tevent_req_post(req, ev);
261 : }
262 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ControlService_r_done, req);
263 :
264 0 : return req;
265 : }
266 :
267 0 : static void dcerpc_svcctl_ControlService_r_done(struct tevent_req *subreq)
268 : {
269 0 : struct tevent_req *req =
270 0 : tevent_req_callback_data(subreq,
271 : struct tevent_req);
272 : NTSTATUS status;
273 :
274 0 : status = dcerpc_binding_handle_call_recv(subreq);
275 0 : TALLOC_FREE(subreq);
276 0 : if (tevent_req_nterror(req, status)) {
277 0 : return;
278 : }
279 :
280 0 : tevent_req_done(req);
281 : }
282 :
283 0 : NTSTATUS dcerpc_svcctl_ControlService_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
284 : {
285 0 : struct dcerpc_svcctl_ControlService_r_state *state =
286 0 : tevent_req_data(req,
287 : struct dcerpc_svcctl_ControlService_r_state);
288 : NTSTATUS status;
289 :
290 0 : if (tevent_req_is_nterror(req, &status)) {
291 0 : tevent_req_received(req);
292 0 : return status;
293 : }
294 :
295 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
296 :
297 0 : tevent_req_received(req);
298 0 : return NT_STATUS_OK;
299 : }
300 :
301 0 : NTSTATUS dcerpc_svcctl_ControlService_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_ControlService *r)
302 : {
303 : NTSTATUS status;
304 :
305 0 : status = dcerpc_binding_handle_call(h,
306 : NULL, &ndr_table_svcctl,
307 : NDR_SVCCTL_CONTROLSERVICE, mem_ctx, r);
308 :
309 0 : return status;
310 : }
311 :
312 : struct dcerpc_svcctl_ControlService_state {
313 : struct svcctl_ControlService orig;
314 : struct svcctl_ControlService tmp;
315 : TALLOC_CTX *out_mem_ctx;
316 : };
317 :
318 : static void dcerpc_svcctl_ControlService_done(struct tevent_req *subreq);
319 :
320 0 : struct tevent_req *dcerpc_svcctl_ControlService_send(TALLOC_CTX *mem_ctx,
321 : struct tevent_context *ev,
322 : struct dcerpc_binding_handle *h,
323 : struct policy_handle *_handle /* [in] [ref] */,
324 : enum SERVICE_CONTROL _control /* [in] */,
325 : struct SERVICE_STATUS *_service_status /* [out] [ref] */)
326 : {
327 : struct tevent_req *req;
328 : struct dcerpc_svcctl_ControlService_state *state;
329 : struct tevent_req *subreq;
330 :
331 0 : req = tevent_req_create(mem_ctx, &state,
332 : struct dcerpc_svcctl_ControlService_state);
333 0 : if (req == NULL) {
334 0 : return NULL;
335 : }
336 0 : state->out_mem_ctx = NULL;
337 :
338 : /* In parameters */
339 0 : state->orig.in.handle = _handle;
340 0 : state->orig.in.control = _control;
341 :
342 : /* Out parameters */
343 0 : state->orig.out.service_status = _service_status;
344 :
345 : /* Result */
346 0 : NDR_ZERO_STRUCT(state->orig.out.result);
347 :
348 0 : state->out_mem_ctx = talloc_named_const(state, 0,
349 : "dcerpc_svcctl_ControlService_out_memory");
350 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
351 0 : return tevent_req_post(req, ev);
352 : }
353 :
354 : /* make a temporary copy, that we pass to the dispatch function */
355 0 : state->tmp = state->orig;
356 :
357 0 : subreq = dcerpc_svcctl_ControlService_r_send(state, ev, h, &state->tmp);
358 0 : if (tevent_req_nomem(subreq, req)) {
359 0 : return tevent_req_post(req, ev);
360 : }
361 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ControlService_done, req);
362 0 : return req;
363 : }
364 :
365 0 : static void dcerpc_svcctl_ControlService_done(struct tevent_req *subreq)
366 : {
367 0 : struct tevent_req *req = tevent_req_callback_data(
368 : subreq, struct tevent_req);
369 0 : struct dcerpc_svcctl_ControlService_state *state = tevent_req_data(
370 : req, struct dcerpc_svcctl_ControlService_state);
371 : NTSTATUS status;
372 : TALLOC_CTX *mem_ctx;
373 :
374 0 : if (state->out_mem_ctx) {
375 0 : mem_ctx = state->out_mem_ctx;
376 : } else {
377 0 : mem_ctx = state;
378 : }
379 :
380 0 : status = dcerpc_svcctl_ControlService_r_recv(subreq, mem_ctx);
381 0 : TALLOC_FREE(subreq);
382 0 : if (tevent_req_nterror(req, status)) {
383 0 : return;
384 : }
385 :
386 : /* Copy out parameters */
387 0 : *state->orig.out.service_status = *state->tmp.out.service_status;
388 :
389 : /* Copy result */
390 0 : state->orig.out.result = state->tmp.out.result;
391 :
392 : /* Reset temporary structure */
393 0 : NDR_ZERO_STRUCT(state->tmp);
394 :
395 0 : tevent_req_done(req);
396 : }
397 :
398 0 : NTSTATUS dcerpc_svcctl_ControlService_recv(struct tevent_req *req,
399 : TALLOC_CTX *mem_ctx,
400 : WERROR *result)
401 : {
402 0 : struct dcerpc_svcctl_ControlService_state *state = tevent_req_data(
403 : req, struct dcerpc_svcctl_ControlService_state);
404 : NTSTATUS status;
405 :
406 0 : if (tevent_req_is_nterror(req, &status)) {
407 0 : tevent_req_received(req);
408 0 : return status;
409 : }
410 :
411 : /* Steal possible out parameters to the callers context */
412 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
413 :
414 : /* Return result */
415 0 : *result = state->orig.out.result;
416 :
417 0 : tevent_req_received(req);
418 0 : return NT_STATUS_OK;
419 : }
420 :
421 0 : NTSTATUS dcerpc_svcctl_ControlService(struct dcerpc_binding_handle *h,
422 : TALLOC_CTX *mem_ctx,
423 : struct policy_handle *_handle /* [in] [ref] */,
424 : enum SERVICE_CONTROL _control /* [in] */,
425 : struct SERVICE_STATUS *_service_status /* [out] [ref] */,
426 : WERROR *result)
427 : {
428 : struct svcctl_ControlService r;
429 : NTSTATUS status;
430 :
431 : /* In parameters */
432 0 : r.in.handle = _handle;
433 0 : r.in.control = _control;
434 :
435 : /* Out parameters */
436 0 : r.out.service_status = _service_status;
437 :
438 : /* Result */
439 0 : NDR_ZERO_STRUCT(r.out.result);
440 :
441 0 : status = dcerpc_svcctl_ControlService_r(h, mem_ctx, &r);
442 0 : if (!NT_STATUS_IS_OK(status)) {
443 0 : return status;
444 : }
445 :
446 : /* Return variables */
447 0 : *_service_status = *r.out.service_status;
448 :
449 : /* Return result */
450 0 : *result = r.out.result;
451 :
452 0 : return NT_STATUS_OK;
453 : }
454 :
455 : struct dcerpc_svcctl_DeleteService_r_state {
456 : TALLOC_CTX *out_mem_ctx;
457 : };
458 :
459 : static void dcerpc_svcctl_DeleteService_r_done(struct tevent_req *subreq);
460 :
461 0 : struct tevent_req *dcerpc_svcctl_DeleteService_r_send(TALLOC_CTX *mem_ctx,
462 : struct tevent_context *ev,
463 : struct dcerpc_binding_handle *h,
464 : struct svcctl_DeleteService *r)
465 : {
466 : struct tevent_req *req;
467 : struct dcerpc_svcctl_DeleteService_r_state *state;
468 : struct tevent_req *subreq;
469 :
470 0 : req = tevent_req_create(mem_ctx, &state,
471 : struct dcerpc_svcctl_DeleteService_r_state);
472 0 : if (req == NULL) {
473 0 : return NULL;
474 : }
475 :
476 0 : state->out_mem_ctx = NULL;
477 :
478 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
479 : NULL, &ndr_table_svcctl,
480 : NDR_SVCCTL_DELETESERVICE, state, r);
481 0 : if (tevent_req_nomem(subreq, req)) {
482 0 : return tevent_req_post(req, ev);
483 : }
484 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_DeleteService_r_done, req);
485 :
486 0 : return req;
487 : }
488 :
489 0 : static void dcerpc_svcctl_DeleteService_r_done(struct tevent_req *subreq)
490 : {
491 0 : struct tevent_req *req =
492 0 : tevent_req_callback_data(subreq,
493 : struct tevent_req);
494 : NTSTATUS status;
495 :
496 0 : status = dcerpc_binding_handle_call_recv(subreq);
497 0 : TALLOC_FREE(subreq);
498 0 : if (tevent_req_nterror(req, status)) {
499 0 : return;
500 : }
501 :
502 0 : tevent_req_done(req);
503 : }
504 :
505 0 : NTSTATUS dcerpc_svcctl_DeleteService_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
506 : {
507 0 : struct dcerpc_svcctl_DeleteService_r_state *state =
508 0 : tevent_req_data(req,
509 : struct dcerpc_svcctl_DeleteService_r_state);
510 : NTSTATUS status;
511 :
512 0 : if (tevent_req_is_nterror(req, &status)) {
513 0 : tevent_req_received(req);
514 0 : return status;
515 : }
516 :
517 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
518 :
519 0 : tevent_req_received(req);
520 0 : return NT_STATUS_OK;
521 : }
522 :
523 0 : NTSTATUS dcerpc_svcctl_DeleteService_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_DeleteService *r)
524 : {
525 : NTSTATUS status;
526 :
527 0 : status = dcerpc_binding_handle_call(h,
528 : NULL, &ndr_table_svcctl,
529 : NDR_SVCCTL_DELETESERVICE, mem_ctx, r);
530 :
531 0 : return status;
532 : }
533 :
534 : struct dcerpc_svcctl_DeleteService_state {
535 : struct svcctl_DeleteService orig;
536 : struct svcctl_DeleteService tmp;
537 : TALLOC_CTX *out_mem_ctx;
538 : };
539 :
540 : static void dcerpc_svcctl_DeleteService_done(struct tevent_req *subreq);
541 :
542 0 : struct tevent_req *dcerpc_svcctl_DeleteService_send(TALLOC_CTX *mem_ctx,
543 : struct tevent_context *ev,
544 : struct dcerpc_binding_handle *h,
545 : struct policy_handle *_handle /* [in] [ref] */)
546 : {
547 : struct tevent_req *req;
548 : struct dcerpc_svcctl_DeleteService_state *state;
549 : struct tevent_req *subreq;
550 :
551 0 : req = tevent_req_create(mem_ctx, &state,
552 : struct dcerpc_svcctl_DeleteService_state);
553 0 : if (req == NULL) {
554 0 : return NULL;
555 : }
556 0 : state->out_mem_ctx = NULL;
557 :
558 : /* In parameters */
559 0 : state->orig.in.handle = _handle;
560 :
561 : /* Out parameters */
562 :
563 : /* Result */
564 0 : NDR_ZERO_STRUCT(state->orig.out.result);
565 :
566 : /* make a temporary copy, that we pass to the dispatch function */
567 0 : state->tmp = state->orig;
568 :
569 0 : subreq = dcerpc_svcctl_DeleteService_r_send(state, ev, h, &state->tmp);
570 0 : if (tevent_req_nomem(subreq, req)) {
571 0 : return tevent_req_post(req, ev);
572 : }
573 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_DeleteService_done, req);
574 0 : return req;
575 : }
576 :
577 0 : static void dcerpc_svcctl_DeleteService_done(struct tevent_req *subreq)
578 : {
579 0 : struct tevent_req *req = tevent_req_callback_data(
580 : subreq, struct tevent_req);
581 0 : struct dcerpc_svcctl_DeleteService_state *state = tevent_req_data(
582 : req, struct dcerpc_svcctl_DeleteService_state);
583 : NTSTATUS status;
584 : TALLOC_CTX *mem_ctx;
585 :
586 0 : if (state->out_mem_ctx) {
587 0 : mem_ctx = state->out_mem_ctx;
588 : } else {
589 0 : mem_ctx = state;
590 : }
591 :
592 0 : status = dcerpc_svcctl_DeleteService_r_recv(subreq, mem_ctx);
593 0 : TALLOC_FREE(subreq);
594 0 : if (tevent_req_nterror(req, status)) {
595 0 : return;
596 : }
597 :
598 : /* Copy out parameters */
599 :
600 : /* Copy result */
601 0 : state->orig.out.result = state->tmp.out.result;
602 :
603 : /* Reset temporary structure */
604 0 : NDR_ZERO_STRUCT(state->tmp);
605 :
606 0 : tevent_req_done(req);
607 : }
608 :
609 0 : NTSTATUS dcerpc_svcctl_DeleteService_recv(struct tevent_req *req,
610 : TALLOC_CTX *mem_ctx,
611 : WERROR *result)
612 : {
613 0 : struct dcerpc_svcctl_DeleteService_state *state = tevent_req_data(
614 : req, struct dcerpc_svcctl_DeleteService_state);
615 : NTSTATUS status;
616 :
617 0 : if (tevent_req_is_nterror(req, &status)) {
618 0 : tevent_req_received(req);
619 0 : return status;
620 : }
621 :
622 : /* Steal possible out parameters to the callers context */
623 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
624 :
625 : /* Return result */
626 0 : *result = state->orig.out.result;
627 :
628 0 : tevent_req_received(req);
629 0 : return NT_STATUS_OK;
630 : }
631 :
632 0 : NTSTATUS dcerpc_svcctl_DeleteService(struct dcerpc_binding_handle *h,
633 : TALLOC_CTX *mem_ctx,
634 : struct policy_handle *_handle /* [in] [ref] */,
635 : WERROR *result)
636 : {
637 : struct svcctl_DeleteService r;
638 : NTSTATUS status;
639 :
640 : /* In parameters */
641 0 : r.in.handle = _handle;
642 :
643 : /* Out parameters */
644 :
645 : /* Result */
646 0 : NDR_ZERO_STRUCT(r.out.result);
647 :
648 0 : status = dcerpc_svcctl_DeleteService_r(h, mem_ctx, &r);
649 0 : if (!NT_STATUS_IS_OK(status)) {
650 0 : return status;
651 : }
652 :
653 : /* Return variables */
654 :
655 : /* Return result */
656 0 : *result = r.out.result;
657 :
658 0 : return NT_STATUS_OK;
659 : }
660 :
661 : struct dcerpc_svcctl_LockServiceDatabase_r_state {
662 : TALLOC_CTX *out_mem_ctx;
663 : };
664 :
665 : static void dcerpc_svcctl_LockServiceDatabase_r_done(struct tevent_req *subreq);
666 :
667 0 : struct tevent_req *dcerpc_svcctl_LockServiceDatabase_r_send(TALLOC_CTX *mem_ctx,
668 : struct tevent_context *ev,
669 : struct dcerpc_binding_handle *h,
670 : struct svcctl_LockServiceDatabase *r)
671 : {
672 : struct tevent_req *req;
673 : struct dcerpc_svcctl_LockServiceDatabase_r_state *state;
674 : struct tevent_req *subreq;
675 :
676 0 : req = tevent_req_create(mem_ctx, &state,
677 : struct dcerpc_svcctl_LockServiceDatabase_r_state);
678 0 : if (req == NULL) {
679 0 : return NULL;
680 : }
681 :
682 0 : state->out_mem_ctx = talloc_new(state);
683 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
684 0 : return tevent_req_post(req, ev);
685 : }
686 :
687 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
688 : NULL, &ndr_table_svcctl,
689 0 : NDR_SVCCTL_LOCKSERVICEDATABASE, state->out_mem_ctx, r);
690 0 : if (tevent_req_nomem(subreq, req)) {
691 0 : return tevent_req_post(req, ev);
692 : }
693 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_LockServiceDatabase_r_done, req);
694 :
695 0 : return req;
696 : }
697 :
698 0 : static void dcerpc_svcctl_LockServiceDatabase_r_done(struct tevent_req *subreq)
699 : {
700 0 : struct tevent_req *req =
701 0 : tevent_req_callback_data(subreq,
702 : struct tevent_req);
703 : NTSTATUS status;
704 :
705 0 : status = dcerpc_binding_handle_call_recv(subreq);
706 0 : TALLOC_FREE(subreq);
707 0 : if (tevent_req_nterror(req, status)) {
708 0 : return;
709 : }
710 :
711 0 : tevent_req_done(req);
712 : }
713 :
714 0 : NTSTATUS dcerpc_svcctl_LockServiceDatabase_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
715 : {
716 0 : struct dcerpc_svcctl_LockServiceDatabase_r_state *state =
717 0 : tevent_req_data(req,
718 : struct dcerpc_svcctl_LockServiceDatabase_r_state);
719 : NTSTATUS status;
720 :
721 0 : if (tevent_req_is_nterror(req, &status)) {
722 0 : tevent_req_received(req);
723 0 : return status;
724 : }
725 :
726 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
727 :
728 0 : tevent_req_received(req);
729 0 : return NT_STATUS_OK;
730 : }
731 :
732 0 : NTSTATUS dcerpc_svcctl_LockServiceDatabase_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_LockServiceDatabase *r)
733 : {
734 : NTSTATUS status;
735 :
736 0 : status = dcerpc_binding_handle_call(h,
737 : NULL, &ndr_table_svcctl,
738 : NDR_SVCCTL_LOCKSERVICEDATABASE, mem_ctx, r);
739 :
740 0 : return status;
741 : }
742 :
743 : struct dcerpc_svcctl_LockServiceDatabase_state {
744 : struct svcctl_LockServiceDatabase orig;
745 : struct svcctl_LockServiceDatabase tmp;
746 : TALLOC_CTX *out_mem_ctx;
747 : };
748 :
749 : static void dcerpc_svcctl_LockServiceDatabase_done(struct tevent_req *subreq);
750 :
751 0 : struct tevent_req *dcerpc_svcctl_LockServiceDatabase_send(TALLOC_CTX *mem_ctx,
752 : struct tevent_context *ev,
753 : struct dcerpc_binding_handle *h,
754 : struct policy_handle *_handle /* [in] [ref] */,
755 : struct policy_handle *_lock /* [out] [ref] */)
756 : {
757 : struct tevent_req *req;
758 : struct dcerpc_svcctl_LockServiceDatabase_state *state;
759 : struct tevent_req *subreq;
760 :
761 0 : req = tevent_req_create(mem_ctx, &state,
762 : struct dcerpc_svcctl_LockServiceDatabase_state);
763 0 : if (req == NULL) {
764 0 : return NULL;
765 : }
766 0 : state->out_mem_ctx = NULL;
767 :
768 : /* In parameters */
769 0 : state->orig.in.handle = _handle;
770 :
771 : /* Out parameters */
772 0 : state->orig.out.lock = _lock;
773 :
774 : /* Result */
775 0 : NDR_ZERO_STRUCT(state->orig.out.result);
776 :
777 0 : state->out_mem_ctx = talloc_named_const(state, 0,
778 : "dcerpc_svcctl_LockServiceDatabase_out_memory");
779 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
780 0 : return tevent_req_post(req, ev);
781 : }
782 :
783 : /* make a temporary copy, that we pass to the dispatch function */
784 0 : state->tmp = state->orig;
785 :
786 0 : subreq = dcerpc_svcctl_LockServiceDatabase_r_send(state, ev, h, &state->tmp);
787 0 : if (tevent_req_nomem(subreq, req)) {
788 0 : return tevent_req_post(req, ev);
789 : }
790 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_LockServiceDatabase_done, req);
791 0 : return req;
792 : }
793 :
794 0 : static void dcerpc_svcctl_LockServiceDatabase_done(struct tevent_req *subreq)
795 : {
796 0 : struct tevent_req *req = tevent_req_callback_data(
797 : subreq, struct tevent_req);
798 0 : struct dcerpc_svcctl_LockServiceDatabase_state *state = tevent_req_data(
799 : req, struct dcerpc_svcctl_LockServiceDatabase_state);
800 : NTSTATUS status;
801 : TALLOC_CTX *mem_ctx;
802 :
803 0 : if (state->out_mem_ctx) {
804 0 : mem_ctx = state->out_mem_ctx;
805 : } else {
806 0 : mem_ctx = state;
807 : }
808 :
809 0 : status = dcerpc_svcctl_LockServiceDatabase_r_recv(subreq, mem_ctx);
810 0 : TALLOC_FREE(subreq);
811 0 : if (tevent_req_nterror(req, status)) {
812 0 : return;
813 : }
814 :
815 : /* Copy out parameters */
816 0 : *state->orig.out.lock = *state->tmp.out.lock;
817 :
818 : /* Copy result */
819 0 : state->orig.out.result = state->tmp.out.result;
820 :
821 : /* Reset temporary structure */
822 0 : NDR_ZERO_STRUCT(state->tmp);
823 :
824 0 : tevent_req_done(req);
825 : }
826 :
827 0 : NTSTATUS dcerpc_svcctl_LockServiceDatabase_recv(struct tevent_req *req,
828 : TALLOC_CTX *mem_ctx,
829 : WERROR *result)
830 : {
831 0 : struct dcerpc_svcctl_LockServiceDatabase_state *state = tevent_req_data(
832 : req, struct dcerpc_svcctl_LockServiceDatabase_state);
833 : NTSTATUS status;
834 :
835 0 : if (tevent_req_is_nterror(req, &status)) {
836 0 : tevent_req_received(req);
837 0 : return status;
838 : }
839 :
840 : /* Steal possible out parameters to the callers context */
841 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
842 :
843 : /* Return result */
844 0 : *result = state->orig.out.result;
845 :
846 0 : tevent_req_received(req);
847 0 : return NT_STATUS_OK;
848 : }
849 :
850 0 : NTSTATUS dcerpc_svcctl_LockServiceDatabase(struct dcerpc_binding_handle *h,
851 : TALLOC_CTX *mem_ctx,
852 : struct policy_handle *_handle /* [in] [ref] */,
853 : struct policy_handle *_lock /* [out] [ref] */,
854 : WERROR *result)
855 : {
856 : struct svcctl_LockServiceDatabase r;
857 : NTSTATUS status;
858 :
859 : /* In parameters */
860 0 : r.in.handle = _handle;
861 :
862 : /* Out parameters */
863 0 : r.out.lock = _lock;
864 :
865 : /* Result */
866 0 : NDR_ZERO_STRUCT(r.out.result);
867 :
868 0 : status = dcerpc_svcctl_LockServiceDatabase_r(h, mem_ctx, &r);
869 0 : if (!NT_STATUS_IS_OK(status)) {
870 0 : return status;
871 : }
872 :
873 : /* Return variables */
874 0 : *_lock = *r.out.lock;
875 :
876 : /* Return result */
877 0 : *result = r.out.result;
878 :
879 0 : return NT_STATUS_OK;
880 : }
881 :
882 : struct dcerpc_svcctl_QueryServiceObjectSecurity_r_state {
883 : TALLOC_CTX *out_mem_ctx;
884 : };
885 :
886 : static void dcerpc_svcctl_QueryServiceObjectSecurity_r_done(struct tevent_req *subreq);
887 :
888 0 : struct tevent_req *dcerpc_svcctl_QueryServiceObjectSecurity_r_send(TALLOC_CTX *mem_ctx,
889 : struct tevent_context *ev,
890 : struct dcerpc_binding_handle *h,
891 : struct svcctl_QueryServiceObjectSecurity *r)
892 : {
893 : struct tevent_req *req;
894 : struct dcerpc_svcctl_QueryServiceObjectSecurity_r_state *state;
895 : struct tevent_req *subreq;
896 :
897 0 : req = tevent_req_create(mem_ctx, &state,
898 : struct dcerpc_svcctl_QueryServiceObjectSecurity_r_state);
899 0 : if (req == NULL) {
900 0 : return NULL;
901 : }
902 :
903 0 : state->out_mem_ctx = talloc_new(state);
904 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
905 0 : return tevent_req_post(req, ev);
906 : }
907 :
908 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
909 : NULL, &ndr_table_svcctl,
910 0 : NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY, state->out_mem_ctx, r);
911 0 : if (tevent_req_nomem(subreq, req)) {
912 0 : return tevent_req_post(req, ev);
913 : }
914 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceObjectSecurity_r_done, req);
915 :
916 0 : return req;
917 : }
918 :
919 0 : static void dcerpc_svcctl_QueryServiceObjectSecurity_r_done(struct tevent_req *subreq)
920 : {
921 0 : struct tevent_req *req =
922 0 : tevent_req_callback_data(subreq,
923 : struct tevent_req);
924 : NTSTATUS status;
925 :
926 0 : status = dcerpc_binding_handle_call_recv(subreq);
927 0 : TALLOC_FREE(subreq);
928 0 : if (tevent_req_nterror(req, status)) {
929 0 : return;
930 : }
931 :
932 0 : tevent_req_done(req);
933 : }
934 :
935 0 : NTSTATUS dcerpc_svcctl_QueryServiceObjectSecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
936 : {
937 0 : struct dcerpc_svcctl_QueryServiceObjectSecurity_r_state *state =
938 0 : tevent_req_data(req,
939 : struct dcerpc_svcctl_QueryServiceObjectSecurity_r_state);
940 : NTSTATUS status;
941 :
942 0 : if (tevent_req_is_nterror(req, &status)) {
943 0 : tevent_req_received(req);
944 0 : return status;
945 : }
946 :
947 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
948 :
949 0 : tevent_req_received(req);
950 0 : return NT_STATUS_OK;
951 : }
952 :
953 0 : NTSTATUS dcerpc_svcctl_QueryServiceObjectSecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_QueryServiceObjectSecurity *r)
954 : {
955 : NTSTATUS status;
956 :
957 0 : status = dcerpc_binding_handle_call(h,
958 : NULL, &ndr_table_svcctl,
959 : NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY, mem_ctx, r);
960 :
961 0 : return status;
962 : }
963 :
964 : struct dcerpc_svcctl_QueryServiceObjectSecurity_state {
965 : struct svcctl_QueryServiceObjectSecurity orig;
966 : struct svcctl_QueryServiceObjectSecurity tmp;
967 : TALLOC_CTX *out_mem_ctx;
968 : };
969 :
970 : static void dcerpc_svcctl_QueryServiceObjectSecurity_done(struct tevent_req *subreq);
971 :
972 0 : struct tevent_req *dcerpc_svcctl_QueryServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
973 : struct tevent_context *ev,
974 : struct dcerpc_binding_handle *h,
975 : struct policy_handle *_handle /* [in] [ref] */,
976 : uint32_t _security_flags /* [in] */,
977 : uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
978 : uint32_t _offered /* [in] [range(0,0x40000)] */,
979 : uint32_t *_needed /* [out] [range(0,0x40000),ref] */)
980 : {
981 : struct tevent_req *req;
982 : struct dcerpc_svcctl_QueryServiceObjectSecurity_state *state;
983 : struct tevent_req *subreq;
984 :
985 0 : req = tevent_req_create(mem_ctx, &state,
986 : struct dcerpc_svcctl_QueryServiceObjectSecurity_state);
987 0 : if (req == NULL) {
988 0 : return NULL;
989 : }
990 0 : state->out_mem_ctx = NULL;
991 :
992 : /* In parameters */
993 0 : state->orig.in.handle = _handle;
994 0 : state->orig.in.security_flags = _security_flags;
995 0 : state->orig.in.offered = _offered;
996 :
997 : /* Out parameters */
998 0 : state->orig.out.buffer = _buffer;
999 0 : state->orig.out.needed = _needed;
1000 :
1001 : /* Result */
1002 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1003 :
1004 0 : state->out_mem_ctx = talloc_named_const(state, 0,
1005 : "dcerpc_svcctl_QueryServiceObjectSecurity_out_memory");
1006 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1007 0 : return tevent_req_post(req, ev);
1008 : }
1009 :
1010 : /* make a temporary copy, that we pass to the dispatch function */
1011 0 : state->tmp = state->orig;
1012 :
1013 0 : subreq = dcerpc_svcctl_QueryServiceObjectSecurity_r_send(state, ev, h, &state->tmp);
1014 0 : if (tevent_req_nomem(subreq, req)) {
1015 0 : return tevent_req_post(req, ev);
1016 : }
1017 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceObjectSecurity_done, req);
1018 0 : return req;
1019 : }
1020 :
1021 0 : static void dcerpc_svcctl_QueryServiceObjectSecurity_done(struct tevent_req *subreq)
1022 : {
1023 0 : struct tevent_req *req = tevent_req_callback_data(
1024 : subreq, struct tevent_req);
1025 0 : struct dcerpc_svcctl_QueryServiceObjectSecurity_state *state = tevent_req_data(
1026 : req, struct dcerpc_svcctl_QueryServiceObjectSecurity_state);
1027 : NTSTATUS status;
1028 : TALLOC_CTX *mem_ctx;
1029 :
1030 0 : if (state->out_mem_ctx) {
1031 0 : mem_ctx = state->out_mem_ctx;
1032 : } else {
1033 0 : mem_ctx = state;
1034 : }
1035 :
1036 0 : status = dcerpc_svcctl_QueryServiceObjectSecurity_r_recv(subreq, mem_ctx);
1037 0 : TALLOC_FREE(subreq);
1038 0 : if (tevent_req_nterror(req, status)) {
1039 0 : return;
1040 : }
1041 :
1042 : /* Copy out parameters */
1043 : {
1044 : size_t _copy_len_buffer;
1045 0 : _copy_len_buffer = state->tmp.in.offered;
1046 0 : if (state->orig.out.buffer != state->tmp.out.buffer) {
1047 0 : memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
1048 : }
1049 : }
1050 0 : *state->orig.out.needed = *state->tmp.out.needed;
1051 :
1052 : /* Copy result */
1053 0 : state->orig.out.result = state->tmp.out.result;
1054 :
1055 : /* Reset temporary structure */
1056 0 : NDR_ZERO_STRUCT(state->tmp);
1057 :
1058 0 : tevent_req_done(req);
1059 : }
1060 :
1061 0 : NTSTATUS dcerpc_svcctl_QueryServiceObjectSecurity_recv(struct tevent_req *req,
1062 : TALLOC_CTX *mem_ctx,
1063 : WERROR *result)
1064 : {
1065 0 : struct dcerpc_svcctl_QueryServiceObjectSecurity_state *state = tevent_req_data(
1066 : req, struct dcerpc_svcctl_QueryServiceObjectSecurity_state);
1067 : NTSTATUS status;
1068 :
1069 0 : if (tevent_req_is_nterror(req, &status)) {
1070 0 : tevent_req_received(req);
1071 0 : return status;
1072 : }
1073 :
1074 : /* Steal possible out parameters to the callers context */
1075 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1076 :
1077 : /* Return result */
1078 0 : *result = state->orig.out.result;
1079 :
1080 0 : tevent_req_received(req);
1081 0 : return NT_STATUS_OK;
1082 : }
1083 :
1084 0 : NTSTATUS dcerpc_svcctl_QueryServiceObjectSecurity(struct dcerpc_binding_handle *h,
1085 : TALLOC_CTX *mem_ctx,
1086 : struct policy_handle *_handle /* [in] [ref] */,
1087 : uint32_t _security_flags /* [in] */,
1088 : uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
1089 : uint32_t _offered /* [in] [range(0,0x40000)] */,
1090 : uint32_t *_needed /* [out] [range(0,0x40000),ref] */,
1091 : WERROR *result)
1092 : {
1093 : struct svcctl_QueryServiceObjectSecurity r;
1094 : NTSTATUS status;
1095 :
1096 : /* In parameters */
1097 0 : r.in.handle = _handle;
1098 0 : r.in.security_flags = _security_flags;
1099 0 : r.in.offered = _offered;
1100 :
1101 : /* Out parameters */
1102 0 : r.out.buffer = _buffer;
1103 0 : r.out.needed = _needed;
1104 :
1105 : /* Result */
1106 0 : NDR_ZERO_STRUCT(r.out.result);
1107 :
1108 0 : status = dcerpc_svcctl_QueryServiceObjectSecurity_r(h, mem_ctx, &r);
1109 0 : if (!NT_STATUS_IS_OK(status)) {
1110 0 : return status;
1111 : }
1112 :
1113 : /* Return variables */
1114 : {
1115 : size_t _copy_len_buffer;
1116 0 : _copy_len_buffer = r.in.offered;
1117 0 : if (_buffer != r.out.buffer) {
1118 0 : memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
1119 : }
1120 : }
1121 0 : *_needed = *r.out.needed;
1122 :
1123 : /* Return result */
1124 0 : *result = r.out.result;
1125 :
1126 0 : return NT_STATUS_OK;
1127 : }
1128 :
1129 : struct dcerpc_svcctl_SetServiceObjectSecurity_r_state {
1130 : TALLOC_CTX *out_mem_ctx;
1131 : };
1132 :
1133 : static void dcerpc_svcctl_SetServiceObjectSecurity_r_done(struct tevent_req *subreq);
1134 :
1135 0 : struct tevent_req *dcerpc_svcctl_SetServiceObjectSecurity_r_send(TALLOC_CTX *mem_ctx,
1136 : struct tevent_context *ev,
1137 : struct dcerpc_binding_handle *h,
1138 : struct svcctl_SetServiceObjectSecurity *r)
1139 : {
1140 : struct tevent_req *req;
1141 : struct dcerpc_svcctl_SetServiceObjectSecurity_r_state *state;
1142 : struct tevent_req *subreq;
1143 :
1144 0 : req = tevent_req_create(mem_ctx, &state,
1145 : struct dcerpc_svcctl_SetServiceObjectSecurity_r_state);
1146 0 : if (req == NULL) {
1147 0 : return NULL;
1148 : }
1149 :
1150 0 : state->out_mem_ctx = NULL;
1151 :
1152 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1153 : NULL, &ndr_table_svcctl,
1154 : NDR_SVCCTL_SETSERVICEOBJECTSECURITY, state, r);
1155 0 : if (tevent_req_nomem(subreq, req)) {
1156 0 : return tevent_req_post(req, ev);
1157 : }
1158 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_SetServiceObjectSecurity_r_done, req);
1159 :
1160 0 : return req;
1161 : }
1162 :
1163 0 : static void dcerpc_svcctl_SetServiceObjectSecurity_r_done(struct tevent_req *subreq)
1164 : {
1165 0 : struct tevent_req *req =
1166 0 : tevent_req_callback_data(subreq,
1167 : struct tevent_req);
1168 : NTSTATUS status;
1169 :
1170 0 : status = dcerpc_binding_handle_call_recv(subreq);
1171 0 : TALLOC_FREE(subreq);
1172 0 : if (tevent_req_nterror(req, status)) {
1173 0 : return;
1174 : }
1175 :
1176 0 : tevent_req_done(req);
1177 : }
1178 :
1179 0 : NTSTATUS dcerpc_svcctl_SetServiceObjectSecurity_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1180 : {
1181 0 : struct dcerpc_svcctl_SetServiceObjectSecurity_r_state *state =
1182 0 : tevent_req_data(req,
1183 : struct dcerpc_svcctl_SetServiceObjectSecurity_r_state);
1184 : NTSTATUS status;
1185 :
1186 0 : if (tevent_req_is_nterror(req, &status)) {
1187 0 : tevent_req_received(req);
1188 0 : return status;
1189 : }
1190 :
1191 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1192 :
1193 0 : tevent_req_received(req);
1194 0 : return NT_STATUS_OK;
1195 : }
1196 :
1197 0 : NTSTATUS dcerpc_svcctl_SetServiceObjectSecurity_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_SetServiceObjectSecurity *r)
1198 : {
1199 : NTSTATUS status;
1200 :
1201 0 : status = dcerpc_binding_handle_call(h,
1202 : NULL, &ndr_table_svcctl,
1203 : NDR_SVCCTL_SETSERVICEOBJECTSECURITY, mem_ctx, r);
1204 :
1205 0 : return status;
1206 : }
1207 :
1208 : struct dcerpc_svcctl_SetServiceObjectSecurity_state {
1209 : struct svcctl_SetServiceObjectSecurity orig;
1210 : struct svcctl_SetServiceObjectSecurity tmp;
1211 : TALLOC_CTX *out_mem_ctx;
1212 : };
1213 :
1214 : static void dcerpc_svcctl_SetServiceObjectSecurity_done(struct tevent_req *subreq);
1215 :
1216 0 : struct tevent_req *dcerpc_svcctl_SetServiceObjectSecurity_send(TALLOC_CTX *mem_ctx,
1217 : struct tevent_context *ev,
1218 : struct dcerpc_binding_handle *h,
1219 : struct policy_handle *_handle /* [in] [ref] */,
1220 : uint32_t _security_flags /* [in] */,
1221 : uint8_t *_buffer /* [in] [ref,size_is(offered)] */,
1222 : uint32_t _offered /* [in] */)
1223 : {
1224 : struct tevent_req *req;
1225 : struct dcerpc_svcctl_SetServiceObjectSecurity_state *state;
1226 : struct tevent_req *subreq;
1227 :
1228 0 : req = tevent_req_create(mem_ctx, &state,
1229 : struct dcerpc_svcctl_SetServiceObjectSecurity_state);
1230 0 : if (req == NULL) {
1231 0 : return NULL;
1232 : }
1233 0 : state->out_mem_ctx = NULL;
1234 :
1235 : /* In parameters */
1236 0 : state->orig.in.handle = _handle;
1237 0 : state->orig.in.security_flags = _security_flags;
1238 0 : state->orig.in.buffer = _buffer;
1239 0 : state->orig.in.offered = _offered;
1240 :
1241 : /* Out parameters */
1242 :
1243 : /* Result */
1244 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1245 :
1246 : /* make a temporary copy, that we pass to the dispatch function */
1247 0 : state->tmp = state->orig;
1248 :
1249 0 : subreq = dcerpc_svcctl_SetServiceObjectSecurity_r_send(state, ev, h, &state->tmp);
1250 0 : if (tevent_req_nomem(subreq, req)) {
1251 0 : return tevent_req_post(req, ev);
1252 : }
1253 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_SetServiceObjectSecurity_done, req);
1254 0 : return req;
1255 : }
1256 :
1257 0 : static void dcerpc_svcctl_SetServiceObjectSecurity_done(struct tevent_req *subreq)
1258 : {
1259 0 : struct tevent_req *req = tevent_req_callback_data(
1260 : subreq, struct tevent_req);
1261 0 : struct dcerpc_svcctl_SetServiceObjectSecurity_state *state = tevent_req_data(
1262 : req, struct dcerpc_svcctl_SetServiceObjectSecurity_state);
1263 : NTSTATUS status;
1264 : TALLOC_CTX *mem_ctx;
1265 :
1266 0 : if (state->out_mem_ctx) {
1267 0 : mem_ctx = state->out_mem_ctx;
1268 : } else {
1269 0 : mem_ctx = state;
1270 : }
1271 :
1272 0 : status = dcerpc_svcctl_SetServiceObjectSecurity_r_recv(subreq, mem_ctx);
1273 0 : TALLOC_FREE(subreq);
1274 0 : if (tevent_req_nterror(req, status)) {
1275 0 : return;
1276 : }
1277 :
1278 : /* Copy out parameters */
1279 :
1280 : /* Copy result */
1281 0 : state->orig.out.result = state->tmp.out.result;
1282 :
1283 : /* Reset temporary structure */
1284 0 : NDR_ZERO_STRUCT(state->tmp);
1285 :
1286 0 : tevent_req_done(req);
1287 : }
1288 :
1289 0 : NTSTATUS dcerpc_svcctl_SetServiceObjectSecurity_recv(struct tevent_req *req,
1290 : TALLOC_CTX *mem_ctx,
1291 : WERROR *result)
1292 : {
1293 0 : struct dcerpc_svcctl_SetServiceObjectSecurity_state *state = tevent_req_data(
1294 : req, struct dcerpc_svcctl_SetServiceObjectSecurity_state);
1295 : NTSTATUS status;
1296 :
1297 0 : if (tevent_req_is_nterror(req, &status)) {
1298 0 : tevent_req_received(req);
1299 0 : return status;
1300 : }
1301 :
1302 : /* Steal possible out parameters to the callers context */
1303 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1304 :
1305 : /* Return result */
1306 0 : *result = state->orig.out.result;
1307 :
1308 0 : tevent_req_received(req);
1309 0 : return NT_STATUS_OK;
1310 : }
1311 :
1312 0 : NTSTATUS dcerpc_svcctl_SetServiceObjectSecurity(struct dcerpc_binding_handle *h,
1313 : TALLOC_CTX *mem_ctx,
1314 : struct policy_handle *_handle /* [in] [ref] */,
1315 : uint32_t _security_flags /* [in] */,
1316 : uint8_t *_buffer /* [in] [ref,size_is(offered)] */,
1317 : uint32_t _offered /* [in] */,
1318 : WERROR *result)
1319 : {
1320 : struct svcctl_SetServiceObjectSecurity r;
1321 : NTSTATUS status;
1322 :
1323 : /* In parameters */
1324 0 : r.in.handle = _handle;
1325 0 : r.in.security_flags = _security_flags;
1326 0 : r.in.buffer = _buffer;
1327 0 : r.in.offered = _offered;
1328 :
1329 : /* Out parameters */
1330 :
1331 : /* Result */
1332 0 : NDR_ZERO_STRUCT(r.out.result);
1333 :
1334 0 : status = dcerpc_svcctl_SetServiceObjectSecurity_r(h, mem_ctx, &r);
1335 0 : if (!NT_STATUS_IS_OK(status)) {
1336 0 : return status;
1337 : }
1338 :
1339 : /* Return variables */
1340 :
1341 : /* Return result */
1342 0 : *result = r.out.result;
1343 :
1344 0 : return NT_STATUS_OK;
1345 : }
1346 :
1347 : struct dcerpc_svcctl_QueryServiceStatus_r_state {
1348 : TALLOC_CTX *out_mem_ctx;
1349 : };
1350 :
1351 : static void dcerpc_svcctl_QueryServiceStatus_r_done(struct tevent_req *subreq);
1352 :
1353 0 : struct tevent_req *dcerpc_svcctl_QueryServiceStatus_r_send(TALLOC_CTX *mem_ctx,
1354 : struct tevent_context *ev,
1355 : struct dcerpc_binding_handle *h,
1356 : struct svcctl_QueryServiceStatus *r)
1357 : {
1358 : struct tevent_req *req;
1359 : struct dcerpc_svcctl_QueryServiceStatus_r_state *state;
1360 : struct tevent_req *subreq;
1361 :
1362 0 : req = tevent_req_create(mem_ctx, &state,
1363 : struct dcerpc_svcctl_QueryServiceStatus_r_state);
1364 0 : if (req == NULL) {
1365 0 : return NULL;
1366 : }
1367 :
1368 0 : state->out_mem_ctx = talloc_new(state);
1369 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1370 0 : return tevent_req_post(req, ev);
1371 : }
1372 :
1373 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1374 : NULL, &ndr_table_svcctl,
1375 0 : NDR_SVCCTL_QUERYSERVICESTATUS, state->out_mem_ctx, r);
1376 0 : if (tevent_req_nomem(subreq, req)) {
1377 0 : return tevent_req_post(req, ev);
1378 : }
1379 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceStatus_r_done, req);
1380 :
1381 0 : return req;
1382 : }
1383 :
1384 0 : static void dcerpc_svcctl_QueryServiceStatus_r_done(struct tevent_req *subreq)
1385 : {
1386 0 : struct tevent_req *req =
1387 0 : tevent_req_callback_data(subreq,
1388 : struct tevent_req);
1389 : NTSTATUS status;
1390 :
1391 0 : status = dcerpc_binding_handle_call_recv(subreq);
1392 0 : TALLOC_FREE(subreq);
1393 0 : if (tevent_req_nterror(req, status)) {
1394 0 : return;
1395 : }
1396 :
1397 0 : tevent_req_done(req);
1398 : }
1399 :
1400 0 : NTSTATUS dcerpc_svcctl_QueryServiceStatus_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1401 : {
1402 0 : struct dcerpc_svcctl_QueryServiceStatus_r_state *state =
1403 0 : tevent_req_data(req,
1404 : struct dcerpc_svcctl_QueryServiceStatus_r_state);
1405 : NTSTATUS status;
1406 :
1407 0 : if (tevent_req_is_nterror(req, &status)) {
1408 0 : tevent_req_received(req);
1409 0 : return status;
1410 : }
1411 :
1412 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1413 :
1414 0 : tevent_req_received(req);
1415 0 : return NT_STATUS_OK;
1416 : }
1417 :
1418 0 : NTSTATUS dcerpc_svcctl_QueryServiceStatus_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_QueryServiceStatus *r)
1419 : {
1420 : NTSTATUS status;
1421 :
1422 0 : status = dcerpc_binding_handle_call(h,
1423 : NULL, &ndr_table_svcctl,
1424 : NDR_SVCCTL_QUERYSERVICESTATUS, mem_ctx, r);
1425 :
1426 0 : return status;
1427 : }
1428 :
1429 : struct dcerpc_svcctl_QueryServiceStatus_state {
1430 : struct svcctl_QueryServiceStatus orig;
1431 : struct svcctl_QueryServiceStatus tmp;
1432 : TALLOC_CTX *out_mem_ctx;
1433 : };
1434 :
1435 : static void dcerpc_svcctl_QueryServiceStatus_done(struct tevent_req *subreq);
1436 :
1437 0 : struct tevent_req *dcerpc_svcctl_QueryServiceStatus_send(TALLOC_CTX *mem_ctx,
1438 : struct tevent_context *ev,
1439 : struct dcerpc_binding_handle *h,
1440 : struct policy_handle *_handle /* [in] [ref] */,
1441 : struct SERVICE_STATUS *_service_status /* [out] [ref] */)
1442 : {
1443 : struct tevent_req *req;
1444 : struct dcerpc_svcctl_QueryServiceStatus_state *state;
1445 : struct tevent_req *subreq;
1446 :
1447 0 : req = tevent_req_create(mem_ctx, &state,
1448 : struct dcerpc_svcctl_QueryServiceStatus_state);
1449 0 : if (req == NULL) {
1450 0 : return NULL;
1451 : }
1452 0 : state->out_mem_ctx = NULL;
1453 :
1454 : /* In parameters */
1455 0 : state->orig.in.handle = _handle;
1456 :
1457 : /* Out parameters */
1458 0 : state->orig.out.service_status = _service_status;
1459 :
1460 : /* Result */
1461 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1462 :
1463 0 : state->out_mem_ctx = talloc_named_const(state, 0,
1464 : "dcerpc_svcctl_QueryServiceStatus_out_memory");
1465 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1466 0 : return tevent_req_post(req, ev);
1467 : }
1468 :
1469 : /* make a temporary copy, that we pass to the dispatch function */
1470 0 : state->tmp = state->orig;
1471 :
1472 0 : subreq = dcerpc_svcctl_QueryServiceStatus_r_send(state, ev, h, &state->tmp);
1473 0 : if (tevent_req_nomem(subreq, req)) {
1474 0 : return tevent_req_post(req, ev);
1475 : }
1476 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceStatus_done, req);
1477 0 : return req;
1478 : }
1479 :
1480 0 : static void dcerpc_svcctl_QueryServiceStatus_done(struct tevent_req *subreq)
1481 : {
1482 0 : struct tevent_req *req = tevent_req_callback_data(
1483 : subreq, struct tevent_req);
1484 0 : struct dcerpc_svcctl_QueryServiceStatus_state *state = tevent_req_data(
1485 : req, struct dcerpc_svcctl_QueryServiceStatus_state);
1486 : NTSTATUS status;
1487 : TALLOC_CTX *mem_ctx;
1488 :
1489 0 : if (state->out_mem_ctx) {
1490 0 : mem_ctx = state->out_mem_ctx;
1491 : } else {
1492 0 : mem_ctx = state;
1493 : }
1494 :
1495 0 : status = dcerpc_svcctl_QueryServiceStatus_r_recv(subreq, mem_ctx);
1496 0 : TALLOC_FREE(subreq);
1497 0 : if (tevent_req_nterror(req, status)) {
1498 0 : return;
1499 : }
1500 :
1501 : /* Copy out parameters */
1502 0 : *state->orig.out.service_status = *state->tmp.out.service_status;
1503 :
1504 : /* Copy result */
1505 0 : state->orig.out.result = state->tmp.out.result;
1506 :
1507 : /* Reset temporary structure */
1508 0 : NDR_ZERO_STRUCT(state->tmp);
1509 :
1510 0 : tevent_req_done(req);
1511 : }
1512 :
1513 0 : NTSTATUS dcerpc_svcctl_QueryServiceStatus_recv(struct tevent_req *req,
1514 : TALLOC_CTX *mem_ctx,
1515 : WERROR *result)
1516 : {
1517 0 : struct dcerpc_svcctl_QueryServiceStatus_state *state = tevent_req_data(
1518 : req, struct dcerpc_svcctl_QueryServiceStatus_state);
1519 : NTSTATUS status;
1520 :
1521 0 : if (tevent_req_is_nterror(req, &status)) {
1522 0 : tevent_req_received(req);
1523 0 : return status;
1524 : }
1525 :
1526 : /* Steal possible out parameters to the callers context */
1527 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1528 :
1529 : /* Return result */
1530 0 : *result = state->orig.out.result;
1531 :
1532 0 : tevent_req_received(req);
1533 0 : return NT_STATUS_OK;
1534 : }
1535 :
1536 0 : NTSTATUS dcerpc_svcctl_QueryServiceStatus(struct dcerpc_binding_handle *h,
1537 : TALLOC_CTX *mem_ctx,
1538 : struct policy_handle *_handle /* [in] [ref] */,
1539 : struct SERVICE_STATUS *_service_status /* [out] [ref] */,
1540 : WERROR *result)
1541 : {
1542 : struct svcctl_QueryServiceStatus r;
1543 : NTSTATUS status;
1544 :
1545 : /* In parameters */
1546 0 : r.in.handle = _handle;
1547 :
1548 : /* Out parameters */
1549 0 : r.out.service_status = _service_status;
1550 :
1551 : /* Result */
1552 0 : NDR_ZERO_STRUCT(r.out.result);
1553 :
1554 0 : status = dcerpc_svcctl_QueryServiceStatus_r(h, mem_ctx, &r);
1555 0 : if (!NT_STATUS_IS_OK(status)) {
1556 0 : return status;
1557 : }
1558 :
1559 : /* Return variables */
1560 0 : *_service_status = *r.out.service_status;
1561 :
1562 : /* Return result */
1563 0 : *result = r.out.result;
1564 :
1565 0 : return NT_STATUS_OK;
1566 : }
1567 :
1568 : struct dcerpc_svcctl_UnlockServiceDatabase_r_state {
1569 : TALLOC_CTX *out_mem_ctx;
1570 : };
1571 :
1572 : static void dcerpc_svcctl_UnlockServiceDatabase_r_done(struct tevent_req *subreq);
1573 :
1574 0 : struct tevent_req *dcerpc_svcctl_UnlockServiceDatabase_r_send(TALLOC_CTX *mem_ctx,
1575 : struct tevent_context *ev,
1576 : struct dcerpc_binding_handle *h,
1577 : struct svcctl_UnlockServiceDatabase *r)
1578 : {
1579 : struct tevent_req *req;
1580 : struct dcerpc_svcctl_UnlockServiceDatabase_r_state *state;
1581 : struct tevent_req *subreq;
1582 :
1583 0 : req = tevent_req_create(mem_ctx, &state,
1584 : struct dcerpc_svcctl_UnlockServiceDatabase_r_state);
1585 0 : if (req == NULL) {
1586 0 : return NULL;
1587 : }
1588 :
1589 0 : state->out_mem_ctx = talloc_new(state);
1590 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1591 0 : return tevent_req_post(req, ev);
1592 : }
1593 :
1594 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1595 : NULL, &ndr_table_svcctl,
1596 0 : NDR_SVCCTL_UNLOCKSERVICEDATABASE, state->out_mem_ctx, r);
1597 0 : if (tevent_req_nomem(subreq, req)) {
1598 0 : return tevent_req_post(req, ev);
1599 : }
1600 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_UnlockServiceDatabase_r_done, req);
1601 :
1602 0 : return req;
1603 : }
1604 :
1605 0 : static void dcerpc_svcctl_UnlockServiceDatabase_r_done(struct tevent_req *subreq)
1606 : {
1607 0 : struct tevent_req *req =
1608 0 : tevent_req_callback_data(subreq,
1609 : struct tevent_req);
1610 : NTSTATUS status;
1611 :
1612 0 : status = dcerpc_binding_handle_call_recv(subreq);
1613 0 : TALLOC_FREE(subreq);
1614 0 : if (tevent_req_nterror(req, status)) {
1615 0 : return;
1616 : }
1617 :
1618 0 : tevent_req_done(req);
1619 : }
1620 :
1621 0 : NTSTATUS dcerpc_svcctl_UnlockServiceDatabase_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1622 : {
1623 0 : struct dcerpc_svcctl_UnlockServiceDatabase_r_state *state =
1624 0 : tevent_req_data(req,
1625 : struct dcerpc_svcctl_UnlockServiceDatabase_r_state);
1626 : NTSTATUS status;
1627 :
1628 0 : if (tevent_req_is_nterror(req, &status)) {
1629 0 : tevent_req_received(req);
1630 0 : return status;
1631 : }
1632 :
1633 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1634 :
1635 0 : tevent_req_received(req);
1636 0 : return NT_STATUS_OK;
1637 : }
1638 :
1639 0 : NTSTATUS dcerpc_svcctl_UnlockServiceDatabase_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_UnlockServiceDatabase *r)
1640 : {
1641 : NTSTATUS status;
1642 :
1643 0 : status = dcerpc_binding_handle_call(h,
1644 : NULL, &ndr_table_svcctl,
1645 : NDR_SVCCTL_UNLOCKSERVICEDATABASE, mem_ctx, r);
1646 :
1647 0 : return status;
1648 : }
1649 :
1650 : struct dcerpc_svcctl_UnlockServiceDatabase_state {
1651 : struct svcctl_UnlockServiceDatabase orig;
1652 : struct svcctl_UnlockServiceDatabase tmp;
1653 : TALLOC_CTX *out_mem_ctx;
1654 : };
1655 :
1656 : static void dcerpc_svcctl_UnlockServiceDatabase_done(struct tevent_req *subreq);
1657 :
1658 0 : struct tevent_req *dcerpc_svcctl_UnlockServiceDatabase_send(TALLOC_CTX *mem_ctx,
1659 : struct tevent_context *ev,
1660 : struct dcerpc_binding_handle *h,
1661 : struct policy_handle *_lock /* [in,out] [ref] */)
1662 : {
1663 : struct tevent_req *req;
1664 : struct dcerpc_svcctl_UnlockServiceDatabase_state *state;
1665 : struct tevent_req *subreq;
1666 :
1667 0 : req = tevent_req_create(mem_ctx, &state,
1668 : struct dcerpc_svcctl_UnlockServiceDatabase_state);
1669 0 : if (req == NULL) {
1670 0 : return NULL;
1671 : }
1672 0 : state->out_mem_ctx = NULL;
1673 :
1674 : /* In parameters */
1675 0 : state->orig.in.lock = _lock;
1676 :
1677 : /* Out parameters */
1678 0 : state->orig.out.lock = _lock;
1679 :
1680 : /* Result */
1681 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1682 :
1683 0 : state->out_mem_ctx = talloc_named_const(state, 0,
1684 : "dcerpc_svcctl_UnlockServiceDatabase_out_memory");
1685 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
1686 0 : return tevent_req_post(req, ev);
1687 : }
1688 :
1689 : /* make a temporary copy, that we pass to the dispatch function */
1690 0 : state->tmp = state->orig;
1691 :
1692 0 : subreq = dcerpc_svcctl_UnlockServiceDatabase_r_send(state, ev, h, &state->tmp);
1693 0 : if (tevent_req_nomem(subreq, req)) {
1694 0 : return tevent_req_post(req, ev);
1695 : }
1696 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_UnlockServiceDatabase_done, req);
1697 0 : return req;
1698 : }
1699 :
1700 0 : static void dcerpc_svcctl_UnlockServiceDatabase_done(struct tevent_req *subreq)
1701 : {
1702 0 : struct tevent_req *req = tevent_req_callback_data(
1703 : subreq, struct tevent_req);
1704 0 : struct dcerpc_svcctl_UnlockServiceDatabase_state *state = tevent_req_data(
1705 : req, struct dcerpc_svcctl_UnlockServiceDatabase_state);
1706 : NTSTATUS status;
1707 : TALLOC_CTX *mem_ctx;
1708 :
1709 0 : if (state->out_mem_ctx) {
1710 0 : mem_ctx = state->out_mem_ctx;
1711 : } else {
1712 0 : mem_ctx = state;
1713 : }
1714 :
1715 0 : status = dcerpc_svcctl_UnlockServiceDatabase_r_recv(subreq, mem_ctx);
1716 0 : TALLOC_FREE(subreq);
1717 0 : if (tevent_req_nterror(req, status)) {
1718 0 : return;
1719 : }
1720 :
1721 : /* Copy out parameters */
1722 0 : *state->orig.out.lock = *state->tmp.out.lock;
1723 :
1724 : /* Copy result */
1725 0 : state->orig.out.result = state->tmp.out.result;
1726 :
1727 : /* Reset temporary structure */
1728 0 : NDR_ZERO_STRUCT(state->tmp);
1729 :
1730 0 : tevent_req_done(req);
1731 : }
1732 :
1733 0 : NTSTATUS dcerpc_svcctl_UnlockServiceDatabase_recv(struct tevent_req *req,
1734 : TALLOC_CTX *mem_ctx,
1735 : WERROR *result)
1736 : {
1737 0 : struct dcerpc_svcctl_UnlockServiceDatabase_state *state = tevent_req_data(
1738 : req, struct dcerpc_svcctl_UnlockServiceDatabase_state);
1739 : NTSTATUS status;
1740 :
1741 0 : if (tevent_req_is_nterror(req, &status)) {
1742 0 : tevent_req_received(req);
1743 0 : return status;
1744 : }
1745 :
1746 : /* Steal possible out parameters to the callers context */
1747 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1748 :
1749 : /* Return result */
1750 0 : *result = state->orig.out.result;
1751 :
1752 0 : tevent_req_received(req);
1753 0 : return NT_STATUS_OK;
1754 : }
1755 :
1756 0 : NTSTATUS dcerpc_svcctl_UnlockServiceDatabase(struct dcerpc_binding_handle *h,
1757 : TALLOC_CTX *mem_ctx,
1758 : struct policy_handle *_lock /* [in,out] [ref] */,
1759 : WERROR *result)
1760 : {
1761 : struct svcctl_UnlockServiceDatabase r;
1762 : NTSTATUS status;
1763 :
1764 : /* In parameters */
1765 0 : r.in.lock = _lock;
1766 :
1767 : /* Out parameters */
1768 0 : r.out.lock = _lock;
1769 :
1770 : /* Result */
1771 0 : NDR_ZERO_STRUCT(r.out.result);
1772 :
1773 0 : status = dcerpc_svcctl_UnlockServiceDatabase_r(h, mem_ctx, &r);
1774 0 : if (!NT_STATUS_IS_OK(status)) {
1775 0 : return status;
1776 : }
1777 :
1778 : /* Return variables */
1779 0 : *_lock = *r.out.lock;
1780 :
1781 : /* Return result */
1782 0 : *result = r.out.result;
1783 :
1784 0 : return NT_STATUS_OK;
1785 : }
1786 :
1787 : struct dcerpc_svcctl_SCSetServiceBitsW_r_state {
1788 : TALLOC_CTX *out_mem_ctx;
1789 : };
1790 :
1791 : static void dcerpc_svcctl_SCSetServiceBitsW_r_done(struct tevent_req *subreq);
1792 :
1793 0 : struct tevent_req *dcerpc_svcctl_SCSetServiceBitsW_r_send(TALLOC_CTX *mem_ctx,
1794 : struct tevent_context *ev,
1795 : struct dcerpc_binding_handle *h,
1796 : struct svcctl_SCSetServiceBitsW *r)
1797 : {
1798 : struct tevent_req *req;
1799 : struct dcerpc_svcctl_SCSetServiceBitsW_r_state *state;
1800 : struct tevent_req *subreq;
1801 :
1802 0 : req = tevent_req_create(mem_ctx, &state,
1803 : struct dcerpc_svcctl_SCSetServiceBitsW_r_state);
1804 0 : if (req == NULL) {
1805 0 : return NULL;
1806 : }
1807 :
1808 0 : state->out_mem_ctx = NULL;
1809 :
1810 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
1811 : NULL, &ndr_table_svcctl,
1812 : NDR_SVCCTL_SCSETSERVICEBITSW, state, r);
1813 0 : if (tevent_req_nomem(subreq, req)) {
1814 0 : return tevent_req_post(req, ev);
1815 : }
1816 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_SCSetServiceBitsW_r_done, req);
1817 :
1818 0 : return req;
1819 : }
1820 :
1821 0 : static void dcerpc_svcctl_SCSetServiceBitsW_r_done(struct tevent_req *subreq)
1822 : {
1823 0 : struct tevent_req *req =
1824 0 : tevent_req_callback_data(subreq,
1825 : struct tevent_req);
1826 : NTSTATUS status;
1827 :
1828 0 : status = dcerpc_binding_handle_call_recv(subreq);
1829 0 : TALLOC_FREE(subreq);
1830 0 : if (tevent_req_nterror(req, status)) {
1831 0 : return;
1832 : }
1833 :
1834 0 : tevent_req_done(req);
1835 : }
1836 :
1837 0 : NTSTATUS dcerpc_svcctl_SCSetServiceBitsW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1838 : {
1839 0 : struct dcerpc_svcctl_SCSetServiceBitsW_r_state *state =
1840 0 : tevent_req_data(req,
1841 : struct dcerpc_svcctl_SCSetServiceBitsW_r_state);
1842 : NTSTATUS status;
1843 :
1844 0 : if (tevent_req_is_nterror(req, &status)) {
1845 0 : tevent_req_received(req);
1846 0 : return status;
1847 : }
1848 :
1849 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1850 :
1851 0 : tevent_req_received(req);
1852 0 : return NT_STATUS_OK;
1853 : }
1854 :
1855 0 : NTSTATUS dcerpc_svcctl_SCSetServiceBitsW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_SCSetServiceBitsW *r)
1856 : {
1857 : NTSTATUS status;
1858 :
1859 0 : status = dcerpc_binding_handle_call(h,
1860 : NULL, &ndr_table_svcctl,
1861 : NDR_SVCCTL_SCSETSERVICEBITSW, mem_ctx, r);
1862 :
1863 0 : return status;
1864 : }
1865 :
1866 : struct dcerpc_svcctl_SCSetServiceBitsW_state {
1867 : struct svcctl_SCSetServiceBitsW orig;
1868 : struct svcctl_SCSetServiceBitsW tmp;
1869 : TALLOC_CTX *out_mem_ctx;
1870 : };
1871 :
1872 : static void dcerpc_svcctl_SCSetServiceBitsW_done(struct tevent_req *subreq);
1873 :
1874 0 : struct tevent_req *dcerpc_svcctl_SCSetServiceBitsW_send(TALLOC_CTX *mem_ctx,
1875 : struct tevent_context *ev,
1876 : struct dcerpc_binding_handle *h,
1877 : struct policy_handle *_handle /* [in] [ref] */,
1878 : uint32_t _bits /* [in] */,
1879 : uint32_t _bitson /* [in] */,
1880 : uint32_t _immediate /* [in] */)
1881 : {
1882 : struct tevent_req *req;
1883 : struct dcerpc_svcctl_SCSetServiceBitsW_state *state;
1884 : struct tevent_req *subreq;
1885 :
1886 0 : req = tevent_req_create(mem_ctx, &state,
1887 : struct dcerpc_svcctl_SCSetServiceBitsW_state);
1888 0 : if (req == NULL) {
1889 0 : return NULL;
1890 : }
1891 0 : state->out_mem_ctx = NULL;
1892 :
1893 : /* In parameters */
1894 0 : state->orig.in.handle = _handle;
1895 0 : state->orig.in.bits = _bits;
1896 0 : state->orig.in.bitson = _bitson;
1897 0 : state->orig.in.immediate = _immediate;
1898 :
1899 : /* Out parameters */
1900 :
1901 : /* Result */
1902 0 : NDR_ZERO_STRUCT(state->orig.out.result);
1903 :
1904 : /* make a temporary copy, that we pass to the dispatch function */
1905 0 : state->tmp = state->orig;
1906 :
1907 0 : subreq = dcerpc_svcctl_SCSetServiceBitsW_r_send(state, ev, h, &state->tmp);
1908 0 : if (tevent_req_nomem(subreq, req)) {
1909 0 : return tevent_req_post(req, ev);
1910 : }
1911 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_SCSetServiceBitsW_done, req);
1912 0 : return req;
1913 : }
1914 :
1915 0 : static void dcerpc_svcctl_SCSetServiceBitsW_done(struct tevent_req *subreq)
1916 : {
1917 0 : struct tevent_req *req = tevent_req_callback_data(
1918 : subreq, struct tevent_req);
1919 0 : struct dcerpc_svcctl_SCSetServiceBitsW_state *state = tevent_req_data(
1920 : req, struct dcerpc_svcctl_SCSetServiceBitsW_state);
1921 : NTSTATUS status;
1922 : TALLOC_CTX *mem_ctx;
1923 :
1924 0 : if (state->out_mem_ctx) {
1925 0 : mem_ctx = state->out_mem_ctx;
1926 : } else {
1927 0 : mem_ctx = state;
1928 : }
1929 :
1930 0 : status = dcerpc_svcctl_SCSetServiceBitsW_r_recv(subreq, mem_ctx);
1931 0 : TALLOC_FREE(subreq);
1932 0 : if (tevent_req_nterror(req, status)) {
1933 0 : return;
1934 : }
1935 :
1936 : /* Copy out parameters */
1937 :
1938 : /* Copy result */
1939 0 : state->orig.out.result = state->tmp.out.result;
1940 :
1941 : /* Reset temporary structure */
1942 0 : NDR_ZERO_STRUCT(state->tmp);
1943 :
1944 0 : tevent_req_done(req);
1945 : }
1946 :
1947 0 : NTSTATUS dcerpc_svcctl_SCSetServiceBitsW_recv(struct tevent_req *req,
1948 : TALLOC_CTX *mem_ctx,
1949 : WERROR *result)
1950 : {
1951 0 : struct dcerpc_svcctl_SCSetServiceBitsW_state *state = tevent_req_data(
1952 : req, struct dcerpc_svcctl_SCSetServiceBitsW_state);
1953 : NTSTATUS status;
1954 :
1955 0 : if (tevent_req_is_nterror(req, &status)) {
1956 0 : tevent_req_received(req);
1957 0 : return status;
1958 : }
1959 :
1960 : /* Steal possible out parameters to the callers context */
1961 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
1962 :
1963 : /* Return result */
1964 0 : *result = state->orig.out.result;
1965 :
1966 0 : tevent_req_received(req);
1967 0 : return NT_STATUS_OK;
1968 : }
1969 :
1970 0 : NTSTATUS dcerpc_svcctl_SCSetServiceBitsW(struct dcerpc_binding_handle *h,
1971 : TALLOC_CTX *mem_ctx,
1972 : struct policy_handle *_handle /* [in] [ref] */,
1973 : uint32_t _bits /* [in] */,
1974 : uint32_t _bitson /* [in] */,
1975 : uint32_t _immediate /* [in] */,
1976 : WERROR *result)
1977 : {
1978 : struct svcctl_SCSetServiceBitsW r;
1979 : NTSTATUS status;
1980 :
1981 : /* In parameters */
1982 0 : r.in.handle = _handle;
1983 0 : r.in.bits = _bits;
1984 0 : r.in.bitson = _bitson;
1985 0 : r.in.immediate = _immediate;
1986 :
1987 : /* Out parameters */
1988 :
1989 : /* Result */
1990 0 : NDR_ZERO_STRUCT(r.out.result);
1991 :
1992 0 : status = dcerpc_svcctl_SCSetServiceBitsW_r(h, mem_ctx, &r);
1993 0 : if (!NT_STATUS_IS_OK(status)) {
1994 0 : return status;
1995 : }
1996 :
1997 : /* Return variables */
1998 :
1999 : /* Return result */
2000 0 : *result = r.out.result;
2001 :
2002 0 : return NT_STATUS_OK;
2003 : }
2004 :
2005 : struct dcerpc_svcctl_ChangeServiceConfigW_r_state {
2006 : TALLOC_CTX *out_mem_ctx;
2007 : };
2008 :
2009 : static void dcerpc_svcctl_ChangeServiceConfigW_r_done(struct tevent_req *subreq);
2010 :
2011 0 : struct tevent_req *dcerpc_svcctl_ChangeServiceConfigW_r_send(TALLOC_CTX *mem_ctx,
2012 : struct tevent_context *ev,
2013 : struct dcerpc_binding_handle *h,
2014 : struct svcctl_ChangeServiceConfigW *r)
2015 : {
2016 : struct tevent_req *req;
2017 : struct dcerpc_svcctl_ChangeServiceConfigW_r_state *state;
2018 : struct tevent_req *subreq;
2019 :
2020 0 : req = tevent_req_create(mem_ctx, &state,
2021 : struct dcerpc_svcctl_ChangeServiceConfigW_r_state);
2022 0 : if (req == NULL) {
2023 0 : return NULL;
2024 : }
2025 :
2026 0 : state->out_mem_ctx = talloc_new(state);
2027 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
2028 0 : return tevent_req_post(req, ev);
2029 : }
2030 :
2031 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
2032 : NULL, &ndr_table_svcctl,
2033 0 : NDR_SVCCTL_CHANGESERVICECONFIGW, state->out_mem_ctx, r);
2034 0 : if (tevent_req_nomem(subreq, req)) {
2035 0 : return tevent_req_post(req, ev);
2036 : }
2037 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ChangeServiceConfigW_r_done, req);
2038 :
2039 0 : return req;
2040 : }
2041 :
2042 0 : static void dcerpc_svcctl_ChangeServiceConfigW_r_done(struct tevent_req *subreq)
2043 : {
2044 0 : struct tevent_req *req =
2045 0 : tevent_req_callback_data(subreq,
2046 : struct tevent_req);
2047 : NTSTATUS status;
2048 :
2049 0 : status = dcerpc_binding_handle_call_recv(subreq);
2050 0 : TALLOC_FREE(subreq);
2051 0 : if (tevent_req_nterror(req, status)) {
2052 0 : return;
2053 : }
2054 :
2055 0 : tevent_req_done(req);
2056 : }
2057 :
2058 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfigW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2059 : {
2060 0 : struct dcerpc_svcctl_ChangeServiceConfigW_r_state *state =
2061 0 : tevent_req_data(req,
2062 : struct dcerpc_svcctl_ChangeServiceConfigW_r_state);
2063 : NTSTATUS status;
2064 :
2065 0 : if (tevent_req_is_nterror(req, &status)) {
2066 0 : tevent_req_received(req);
2067 0 : return status;
2068 : }
2069 :
2070 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2071 :
2072 0 : tevent_req_received(req);
2073 0 : return NT_STATUS_OK;
2074 : }
2075 :
2076 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfigW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_ChangeServiceConfigW *r)
2077 : {
2078 : NTSTATUS status;
2079 :
2080 0 : status = dcerpc_binding_handle_call(h,
2081 : NULL, &ndr_table_svcctl,
2082 : NDR_SVCCTL_CHANGESERVICECONFIGW, mem_ctx, r);
2083 :
2084 0 : return status;
2085 : }
2086 :
2087 : struct dcerpc_svcctl_ChangeServiceConfigW_state {
2088 : struct svcctl_ChangeServiceConfigW orig;
2089 : struct svcctl_ChangeServiceConfigW tmp;
2090 : TALLOC_CTX *out_mem_ctx;
2091 : };
2092 :
2093 : static void dcerpc_svcctl_ChangeServiceConfigW_done(struct tevent_req *subreq);
2094 :
2095 0 : struct tevent_req *dcerpc_svcctl_ChangeServiceConfigW_send(TALLOC_CTX *mem_ctx,
2096 : struct tevent_context *ev,
2097 : struct dcerpc_binding_handle *h,
2098 : struct policy_handle *_handle /* [in] [ref] */,
2099 : uint32_t _type /* [in] */,
2100 : enum svcctl_StartType _start_type /* [in] */,
2101 : enum svcctl_ErrorControl _error_control /* [in] */,
2102 : const char *_binary_path /* [in] [charset(UTF16),unique] */,
2103 : const char *_load_order_group /* [in] [charset(UTF16),unique] */,
2104 : uint32_t *_tag_id /* [in,out] [unique] */,
2105 : const char *_dependencies /* [in] [charset(UTF16),size_is(dwDependSize),unique] */,
2106 : uint32_t _dwDependSize /* [in] [range(0,SC_MAX_DEPEND_SIZE)] */,
2107 : const char *_service_start_name /* [in] [charset(UTF16),range(0,SC_MAX_ACCOUNT_NAME_LENGTH),unique] */,
2108 : const char *_password /* [in] [charset(UTF16),size_is(dwPwSize),unique] */,
2109 : uint32_t _dwPwSize /* [in] [range(0,SC_MAX_PWD_SIZE)] */,
2110 : const char *_display_name /* [in] [charset(UTF16),range(0,SC_MAX_NAME_LENGTH),unique] */)
2111 : {
2112 : struct tevent_req *req;
2113 : struct dcerpc_svcctl_ChangeServiceConfigW_state *state;
2114 : struct tevent_req *subreq;
2115 :
2116 0 : req = tevent_req_create(mem_ctx, &state,
2117 : struct dcerpc_svcctl_ChangeServiceConfigW_state);
2118 0 : if (req == NULL) {
2119 0 : return NULL;
2120 : }
2121 0 : state->out_mem_ctx = NULL;
2122 :
2123 : /* In parameters */
2124 0 : state->orig.in.handle = _handle;
2125 0 : state->orig.in.type = _type;
2126 0 : state->orig.in.start_type = _start_type;
2127 0 : state->orig.in.error_control = _error_control;
2128 0 : state->orig.in.binary_path = _binary_path;
2129 0 : state->orig.in.load_order_group = _load_order_group;
2130 0 : state->orig.in.tag_id = _tag_id;
2131 0 : state->orig.in.dependencies = _dependencies;
2132 0 : state->orig.in.dwDependSize = _dwDependSize;
2133 0 : state->orig.in.service_start_name = _service_start_name;
2134 0 : state->orig.in.password = _password;
2135 0 : state->orig.in.dwPwSize = _dwPwSize;
2136 0 : state->orig.in.display_name = _display_name;
2137 :
2138 : /* Out parameters */
2139 0 : state->orig.out.tag_id = _tag_id;
2140 :
2141 : /* Result */
2142 0 : NDR_ZERO_STRUCT(state->orig.out.result);
2143 :
2144 0 : state->out_mem_ctx = talloc_named_const(state, 0,
2145 : "dcerpc_svcctl_ChangeServiceConfigW_out_memory");
2146 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
2147 0 : return tevent_req_post(req, ev);
2148 : }
2149 :
2150 : /* make a temporary copy, that we pass to the dispatch function */
2151 0 : state->tmp = state->orig;
2152 :
2153 0 : subreq = dcerpc_svcctl_ChangeServiceConfigW_r_send(state, ev, h, &state->tmp);
2154 0 : if (tevent_req_nomem(subreq, req)) {
2155 0 : return tevent_req_post(req, ev);
2156 : }
2157 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ChangeServiceConfigW_done, req);
2158 0 : return req;
2159 : }
2160 :
2161 0 : static void dcerpc_svcctl_ChangeServiceConfigW_done(struct tevent_req *subreq)
2162 : {
2163 0 : struct tevent_req *req = tevent_req_callback_data(
2164 : subreq, struct tevent_req);
2165 0 : struct dcerpc_svcctl_ChangeServiceConfigW_state *state = tevent_req_data(
2166 : req, struct dcerpc_svcctl_ChangeServiceConfigW_state);
2167 : NTSTATUS status;
2168 : TALLOC_CTX *mem_ctx;
2169 :
2170 0 : if (state->out_mem_ctx) {
2171 0 : mem_ctx = state->out_mem_ctx;
2172 : } else {
2173 0 : mem_ctx = state;
2174 : }
2175 :
2176 0 : status = dcerpc_svcctl_ChangeServiceConfigW_r_recv(subreq, mem_ctx);
2177 0 : TALLOC_FREE(subreq);
2178 0 : if (tevent_req_nterror(req, status)) {
2179 0 : return;
2180 : }
2181 :
2182 : /* Copy out parameters */
2183 0 : if (state->orig.out.tag_id && state->tmp.out.tag_id) {
2184 0 : *state->orig.out.tag_id = *state->tmp.out.tag_id;
2185 : }
2186 :
2187 : /* Copy result */
2188 0 : state->orig.out.result = state->tmp.out.result;
2189 :
2190 : /* Reset temporary structure */
2191 0 : NDR_ZERO_STRUCT(state->tmp);
2192 :
2193 0 : tevent_req_done(req);
2194 : }
2195 :
2196 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfigW_recv(struct tevent_req *req,
2197 : TALLOC_CTX *mem_ctx,
2198 : WERROR *result)
2199 : {
2200 0 : struct dcerpc_svcctl_ChangeServiceConfigW_state *state = tevent_req_data(
2201 : req, struct dcerpc_svcctl_ChangeServiceConfigW_state);
2202 : NTSTATUS status;
2203 :
2204 0 : if (tevent_req_is_nterror(req, &status)) {
2205 0 : tevent_req_received(req);
2206 0 : return status;
2207 : }
2208 :
2209 : /* Steal possible out parameters to the callers context */
2210 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2211 :
2212 : /* Return result */
2213 0 : *result = state->orig.out.result;
2214 :
2215 0 : tevent_req_received(req);
2216 0 : return NT_STATUS_OK;
2217 : }
2218 :
2219 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfigW(struct dcerpc_binding_handle *h,
2220 : TALLOC_CTX *mem_ctx,
2221 : struct policy_handle *_handle /* [in] [ref] */,
2222 : uint32_t _type /* [in] */,
2223 : enum svcctl_StartType _start_type /* [in] */,
2224 : enum svcctl_ErrorControl _error_control /* [in] */,
2225 : const char *_binary_path /* [in] [charset(UTF16),unique] */,
2226 : const char *_load_order_group /* [in] [charset(UTF16),unique] */,
2227 : uint32_t *_tag_id /* [in,out] [unique] */,
2228 : const char *_dependencies /* [in] [charset(UTF16),size_is(dwDependSize),unique] */,
2229 : uint32_t _dwDependSize /* [in] [range(0,SC_MAX_DEPEND_SIZE)] */,
2230 : const char *_service_start_name /* [in] [charset(UTF16),range(0,SC_MAX_ACCOUNT_NAME_LENGTH),unique] */,
2231 : const char *_password /* [in] [charset(UTF16),size_is(dwPwSize),unique] */,
2232 : uint32_t _dwPwSize /* [in] [range(0,SC_MAX_PWD_SIZE)] */,
2233 : const char *_display_name /* [in] [charset(UTF16),range(0,SC_MAX_NAME_LENGTH),unique] */,
2234 : WERROR *result)
2235 : {
2236 : struct svcctl_ChangeServiceConfigW r;
2237 : NTSTATUS status;
2238 :
2239 : /* In parameters */
2240 0 : r.in.handle = _handle;
2241 0 : r.in.type = _type;
2242 0 : r.in.start_type = _start_type;
2243 0 : r.in.error_control = _error_control;
2244 0 : r.in.binary_path = _binary_path;
2245 0 : r.in.load_order_group = _load_order_group;
2246 0 : r.in.tag_id = _tag_id;
2247 0 : r.in.dependencies = _dependencies;
2248 0 : r.in.dwDependSize = _dwDependSize;
2249 0 : r.in.service_start_name = _service_start_name;
2250 0 : r.in.password = _password;
2251 0 : r.in.dwPwSize = _dwPwSize;
2252 0 : r.in.display_name = _display_name;
2253 :
2254 : /* Out parameters */
2255 0 : r.out.tag_id = _tag_id;
2256 :
2257 : /* Result */
2258 0 : NDR_ZERO_STRUCT(r.out.result);
2259 :
2260 0 : status = dcerpc_svcctl_ChangeServiceConfigW_r(h, mem_ctx, &r);
2261 0 : if (!NT_STATUS_IS_OK(status)) {
2262 0 : return status;
2263 : }
2264 :
2265 : /* Return variables */
2266 0 : if (_tag_id && r.out.tag_id) {
2267 0 : *_tag_id = *r.out.tag_id;
2268 : }
2269 :
2270 : /* Return result */
2271 0 : *result = r.out.result;
2272 :
2273 0 : return NT_STATUS_OK;
2274 : }
2275 :
2276 : struct dcerpc_svcctl_CreateServiceW_r_state {
2277 : TALLOC_CTX *out_mem_ctx;
2278 : };
2279 :
2280 : static void dcerpc_svcctl_CreateServiceW_r_done(struct tevent_req *subreq);
2281 :
2282 0 : struct tevent_req *dcerpc_svcctl_CreateServiceW_r_send(TALLOC_CTX *mem_ctx,
2283 : struct tevent_context *ev,
2284 : struct dcerpc_binding_handle *h,
2285 : struct svcctl_CreateServiceW *r)
2286 : {
2287 : struct tevent_req *req;
2288 : struct dcerpc_svcctl_CreateServiceW_r_state *state;
2289 : struct tevent_req *subreq;
2290 :
2291 0 : req = tevent_req_create(mem_ctx, &state,
2292 : struct dcerpc_svcctl_CreateServiceW_r_state);
2293 0 : if (req == NULL) {
2294 0 : return NULL;
2295 : }
2296 :
2297 0 : state->out_mem_ctx = talloc_new(state);
2298 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
2299 0 : return tevent_req_post(req, ev);
2300 : }
2301 :
2302 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
2303 : NULL, &ndr_table_svcctl,
2304 0 : NDR_SVCCTL_CREATESERVICEW, state->out_mem_ctx, r);
2305 0 : if (tevent_req_nomem(subreq, req)) {
2306 0 : return tevent_req_post(req, ev);
2307 : }
2308 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_CreateServiceW_r_done, req);
2309 :
2310 0 : return req;
2311 : }
2312 :
2313 0 : static void dcerpc_svcctl_CreateServiceW_r_done(struct tevent_req *subreq)
2314 : {
2315 0 : struct tevent_req *req =
2316 0 : tevent_req_callback_data(subreq,
2317 : struct tevent_req);
2318 : NTSTATUS status;
2319 :
2320 0 : status = dcerpc_binding_handle_call_recv(subreq);
2321 0 : TALLOC_FREE(subreq);
2322 0 : if (tevent_req_nterror(req, status)) {
2323 0 : return;
2324 : }
2325 :
2326 0 : tevent_req_done(req);
2327 : }
2328 :
2329 0 : NTSTATUS dcerpc_svcctl_CreateServiceW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2330 : {
2331 0 : struct dcerpc_svcctl_CreateServiceW_r_state *state =
2332 0 : tevent_req_data(req,
2333 : struct dcerpc_svcctl_CreateServiceW_r_state);
2334 : NTSTATUS status;
2335 :
2336 0 : if (tevent_req_is_nterror(req, &status)) {
2337 0 : tevent_req_received(req);
2338 0 : return status;
2339 : }
2340 :
2341 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2342 :
2343 0 : tevent_req_received(req);
2344 0 : return NT_STATUS_OK;
2345 : }
2346 :
2347 0 : NTSTATUS dcerpc_svcctl_CreateServiceW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_CreateServiceW *r)
2348 : {
2349 : NTSTATUS status;
2350 :
2351 0 : status = dcerpc_binding_handle_call(h,
2352 : NULL, &ndr_table_svcctl,
2353 : NDR_SVCCTL_CREATESERVICEW, mem_ctx, r);
2354 :
2355 0 : return status;
2356 : }
2357 :
2358 : struct dcerpc_svcctl_CreateServiceW_state {
2359 : struct svcctl_CreateServiceW orig;
2360 : struct svcctl_CreateServiceW tmp;
2361 : TALLOC_CTX *out_mem_ctx;
2362 : };
2363 :
2364 : static void dcerpc_svcctl_CreateServiceW_done(struct tevent_req *subreq);
2365 :
2366 0 : struct tevent_req *dcerpc_svcctl_CreateServiceW_send(TALLOC_CTX *mem_ctx,
2367 : struct tevent_context *ev,
2368 : struct dcerpc_binding_handle *h,
2369 : struct policy_handle *_scmanager_handle /* [in] [ref] */,
2370 : const char *_ServiceName /* [in] [charset(UTF16)] */,
2371 : const char *_DisplayName /* [in] [charset(UTF16),unique] */,
2372 : uint32_t _desired_access /* [in] */,
2373 : uint32_t _type /* [in] */,
2374 : enum svcctl_StartType _start_type /* [in] */,
2375 : enum svcctl_ErrorControl _error_control /* [in] */,
2376 : const char *_binary_path /* [in] [charset(UTF16)] */,
2377 : const char *_LoadOrderGroupKey /* [in] [charset(UTF16),unique] */,
2378 : uint32_t *_TagId /* [in,out] [unique] */,
2379 : uint8_t *_dependencies /* [in] [size_is(dependencies_size),unique] */,
2380 : uint32_t _dependencies_size /* [in] */,
2381 : const char *_service_start_name /* [in] [charset(UTF16),unique] */,
2382 : uint8_t *_password /* [in] [size_is(password_size),unique] */,
2383 : uint32_t _password_size /* [in] */,
2384 : struct policy_handle *_handle /* [out] [ref] */)
2385 : {
2386 : struct tevent_req *req;
2387 : struct dcerpc_svcctl_CreateServiceW_state *state;
2388 : struct tevent_req *subreq;
2389 :
2390 0 : req = tevent_req_create(mem_ctx, &state,
2391 : struct dcerpc_svcctl_CreateServiceW_state);
2392 0 : if (req == NULL) {
2393 0 : return NULL;
2394 : }
2395 0 : state->out_mem_ctx = NULL;
2396 :
2397 : /* In parameters */
2398 0 : state->orig.in.scmanager_handle = _scmanager_handle;
2399 0 : state->orig.in.ServiceName = _ServiceName;
2400 0 : state->orig.in.DisplayName = _DisplayName;
2401 0 : state->orig.in.desired_access = _desired_access;
2402 0 : state->orig.in.type = _type;
2403 0 : state->orig.in.start_type = _start_type;
2404 0 : state->orig.in.error_control = _error_control;
2405 0 : state->orig.in.binary_path = _binary_path;
2406 0 : state->orig.in.LoadOrderGroupKey = _LoadOrderGroupKey;
2407 0 : state->orig.in.TagId = _TagId;
2408 0 : state->orig.in.dependencies = _dependencies;
2409 0 : state->orig.in.dependencies_size = _dependencies_size;
2410 0 : state->orig.in.service_start_name = _service_start_name;
2411 0 : state->orig.in.password = _password;
2412 0 : state->orig.in.password_size = _password_size;
2413 :
2414 : /* Out parameters */
2415 0 : state->orig.out.TagId = _TagId;
2416 0 : state->orig.out.handle = _handle;
2417 :
2418 : /* Result */
2419 0 : NDR_ZERO_STRUCT(state->orig.out.result);
2420 :
2421 0 : state->out_mem_ctx = talloc_named_const(state, 0,
2422 : "dcerpc_svcctl_CreateServiceW_out_memory");
2423 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
2424 0 : return tevent_req_post(req, ev);
2425 : }
2426 :
2427 : /* make a temporary copy, that we pass to the dispatch function */
2428 0 : state->tmp = state->orig;
2429 :
2430 0 : subreq = dcerpc_svcctl_CreateServiceW_r_send(state, ev, h, &state->tmp);
2431 0 : if (tevent_req_nomem(subreq, req)) {
2432 0 : return tevent_req_post(req, ev);
2433 : }
2434 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_CreateServiceW_done, req);
2435 0 : return req;
2436 : }
2437 :
2438 0 : static void dcerpc_svcctl_CreateServiceW_done(struct tevent_req *subreq)
2439 : {
2440 0 : struct tevent_req *req = tevent_req_callback_data(
2441 : subreq, struct tevent_req);
2442 0 : struct dcerpc_svcctl_CreateServiceW_state *state = tevent_req_data(
2443 : req, struct dcerpc_svcctl_CreateServiceW_state);
2444 : NTSTATUS status;
2445 : TALLOC_CTX *mem_ctx;
2446 :
2447 0 : if (state->out_mem_ctx) {
2448 0 : mem_ctx = state->out_mem_ctx;
2449 : } else {
2450 0 : mem_ctx = state;
2451 : }
2452 :
2453 0 : status = dcerpc_svcctl_CreateServiceW_r_recv(subreq, mem_ctx);
2454 0 : TALLOC_FREE(subreq);
2455 0 : if (tevent_req_nterror(req, status)) {
2456 0 : return;
2457 : }
2458 :
2459 : /* Copy out parameters */
2460 0 : if (state->orig.out.TagId && state->tmp.out.TagId) {
2461 0 : *state->orig.out.TagId = *state->tmp.out.TagId;
2462 : }
2463 0 : *state->orig.out.handle = *state->tmp.out.handle;
2464 :
2465 : /* Copy result */
2466 0 : state->orig.out.result = state->tmp.out.result;
2467 :
2468 : /* Reset temporary structure */
2469 0 : NDR_ZERO_STRUCT(state->tmp);
2470 :
2471 0 : tevent_req_done(req);
2472 : }
2473 :
2474 0 : NTSTATUS dcerpc_svcctl_CreateServiceW_recv(struct tevent_req *req,
2475 : TALLOC_CTX *mem_ctx,
2476 : WERROR *result)
2477 : {
2478 0 : struct dcerpc_svcctl_CreateServiceW_state *state = tevent_req_data(
2479 : req, struct dcerpc_svcctl_CreateServiceW_state);
2480 : NTSTATUS status;
2481 :
2482 0 : if (tevent_req_is_nterror(req, &status)) {
2483 0 : tevent_req_received(req);
2484 0 : return status;
2485 : }
2486 :
2487 : /* Steal possible out parameters to the callers context */
2488 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2489 :
2490 : /* Return result */
2491 0 : *result = state->orig.out.result;
2492 :
2493 0 : tevent_req_received(req);
2494 0 : return NT_STATUS_OK;
2495 : }
2496 :
2497 0 : NTSTATUS dcerpc_svcctl_CreateServiceW(struct dcerpc_binding_handle *h,
2498 : TALLOC_CTX *mem_ctx,
2499 : struct policy_handle *_scmanager_handle /* [in] [ref] */,
2500 : const char *_ServiceName /* [in] [charset(UTF16)] */,
2501 : const char *_DisplayName /* [in] [charset(UTF16),unique] */,
2502 : uint32_t _desired_access /* [in] */,
2503 : uint32_t _type /* [in] */,
2504 : enum svcctl_StartType _start_type /* [in] */,
2505 : enum svcctl_ErrorControl _error_control /* [in] */,
2506 : const char *_binary_path /* [in] [charset(UTF16)] */,
2507 : const char *_LoadOrderGroupKey /* [in] [charset(UTF16),unique] */,
2508 : uint32_t *_TagId /* [in,out] [unique] */,
2509 : uint8_t *_dependencies /* [in] [size_is(dependencies_size),unique] */,
2510 : uint32_t _dependencies_size /* [in] */,
2511 : const char *_service_start_name /* [in] [charset(UTF16),unique] */,
2512 : uint8_t *_password /* [in] [size_is(password_size),unique] */,
2513 : uint32_t _password_size /* [in] */,
2514 : struct policy_handle *_handle /* [out] [ref] */,
2515 : WERROR *result)
2516 : {
2517 : struct svcctl_CreateServiceW r;
2518 : NTSTATUS status;
2519 :
2520 : /* In parameters */
2521 0 : r.in.scmanager_handle = _scmanager_handle;
2522 0 : r.in.ServiceName = _ServiceName;
2523 0 : r.in.DisplayName = _DisplayName;
2524 0 : r.in.desired_access = _desired_access;
2525 0 : r.in.type = _type;
2526 0 : r.in.start_type = _start_type;
2527 0 : r.in.error_control = _error_control;
2528 0 : r.in.binary_path = _binary_path;
2529 0 : r.in.LoadOrderGroupKey = _LoadOrderGroupKey;
2530 0 : r.in.TagId = _TagId;
2531 0 : r.in.dependencies = _dependencies;
2532 0 : r.in.dependencies_size = _dependencies_size;
2533 0 : r.in.service_start_name = _service_start_name;
2534 0 : r.in.password = _password;
2535 0 : r.in.password_size = _password_size;
2536 :
2537 : /* Out parameters */
2538 0 : r.out.TagId = _TagId;
2539 0 : r.out.handle = _handle;
2540 :
2541 : /* Result */
2542 0 : NDR_ZERO_STRUCT(r.out.result);
2543 :
2544 0 : status = dcerpc_svcctl_CreateServiceW_r(h, mem_ctx, &r);
2545 0 : if (!NT_STATUS_IS_OK(status)) {
2546 0 : return status;
2547 : }
2548 :
2549 : /* Return variables */
2550 0 : if (_TagId && r.out.TagId) {
2551 0 : *_TagId = *r.out.TagId;
2552 : }
2553 0 : *_handle = *r.out.handle;
2554 :
2555 : /* Return result */
2556 0 : *result = r.out.result;
2557 :
2558 0 : return NT_STATUS_OK;
2559 : }
2560 :
2561 : struct dcerpc_svcctl_EnumDependentServicesW_r_state {
2562 : TALLOC_CTX *out_mem_ctx;
2563 : };
2564 :
2565 : static void dcerpc_svcctl_EnumDependentServicesW_r_done(struct tevent_req *subreq);
2566 :
2567 0 : struct tevent_req *dcerpc_svcctl_EnumDependentServicesW_r_send(TALLOC_CTX *mem_ctx,
2568 : struct tevent_context *ev,
2569 : struct dcerpc_binding_handle *h,
2570 : struct svcctl_EnumDependentServicesW *r)
2571 : {
2572 : struct tevent_req *req;
2573 : struct dcerpc_svcctl_EnumDependentServicesW_r_state *state;
2574 : struct tevent_req *subreq;
2575 :
2576 0 : req = tevent_req_create(mem_ctx, &state,
2577 : struct dcerpc_svcctl_EnumDependentServicesW_r_state);
2578 0 : if (req == NULL) {
2579 0 : return NULL;
2580 : }
2581 :
2582 0 : state->out_mem_ctx = talloc_new(state);
2583 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
2584 0 : return tevent_req_post(req, ev);
2585 : }
2586 :
2587 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
2588 : NULL, &ndr_table_svcctl,
2589 0 : NDR_SVCCTL_ENUMDEPENDENTSERVICESW, state->out_mem_ctx, r);
2590 0 : if (tevent_req_nomem(subreq, req)) {
2591 0 : return tevent_req_post(req, ev);
2592 : }
2593 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_EnumDependentServicesW_r_done, req);
2594 :
2595 0 : return req;
2596 : }
2597 :
2598 0 : static void dcerpc_svcctl_EnumDependentServicesW_r_done(struct tevent_req *subreq)
2599 : {
2600 0 : struct tevent_req *req =
2601 0 : tevent_req_callback_data(subreq,
2602 : struct tevent_req);
2603 : NTSTATUS status;
2604 :
2605 0 : status = dcerpc_binding_handle_call_recv(subreq);
2606 0 : TALLOC_FREE(subreq);
2607 0 : if (tevent_req_nterror(req, status)) {
2608 0 : return;
2609 : }
2610 :
2611 0 : tevent_req_done(req);
2612 : }
2613 :
2614 0 : NTSTATUS dcerpc_svcctl_EnumDependentServicesW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2615 : {
2616 0 : struct dcerpc_svcctl_EnumDependentServicesW_r_state *state =
2617 0 : tevent_req_data(req,
2618 : struct dcerpc_svcctl_EnumDependentServicesW_r_state);
2619 : NTSTATUS status;
2620 :
2621 0 : if (tevent_req_is_nterror(req, &status)) {
2622 0 : tevent_req_received(req);
2623 0 : return status;
2624 : }
2625 :
2626 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2627 :
2628 0 : tevent_req_received(req);
2629 0 : return NT_STATUS_OK;
2630 : }
2631 :
2632 0 : NTSTATUS dcerpc_svcctl_EnumDependentServicesW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_EnumDependentServicesW *r)
2633 : {
2634 : NTSTATUS status;
2635 :
2636 0 : status = dcerpc_binding_handle_call(h,
2637 : NULL, &ndr_table_svcctl,
2638 : NDR_SVCCTL_ENUMDEPENDENTSERVICESW, mem_ctx, r);
2639 :
2640 0 : return status;
2641 : }
2642 :
2643 : struct dcerpc_svcctl_EnumDependentServicesW_state {
2644 : struct svcctl_EnumDependentServicesW orig;
2645 : struct svcctl_EnumDependentServicesW tmp;
2646 : TALLOC_CTX *out_mem_ctx;
2647 : };
2648 :
2649 : static void dcerpc_svcctl_EnumDependentServicesW_done(struct tevent_req *subreq);
2650 :
2651 0 : struct tevent_req *dcerpc_svcctl_EnumDependentServicesW_send(TALLOC_CTX *mem_ctx,
2652 : struct tevent_context *ev,
2653 : struct dcerpc_binding_handle *h,
2654 : struct policy_handle *_service /* [in] [ref] */,
2655 : enum svcctl_ServiceState _state /* [in] */,
2656 : uint8_t *_service_status /* [out] [ref,size_is(offered)] */,
2657 : uint32_t _offered /* [in] [range(0,0x40000)] */,
2658 : uint32_t *_needed /* [out] [range(0,0x40000),ref] */,
2659 : uint32_t *_services_returned /* [out] [range(0,0x40000),ref] */)
2660 : {
2661 : struct tevent_req *req;
2662 : struct dcerpc_svcctl_EnumDependentServicesW_state *state;
2663 : struct tevent_req *subreq;
2664 :
2665 0 : req = tevent_req_create(mem_ctx, &state,
2666 : struct dcerpc_svcctl_EnumDependentServicesW_state);
2667 0 : if (req == NULL) {
2668 0 : return NULL;
2669 : }
2670 0 : state->out_mem_ctx = NULL;
2671 :
2672 : /* In parameters */
2673 0 : state->orig.in.service = _service;
2674 0 : state->orig.in.state = _state;
2675 0 : state->orig.in.offered = _offered;
2676 :
2677 : /* Out parameters */
2678 0 : state->orig.out.service_status = _service_status;
2679 0 : state->orig.out.needed = _needed;
2680 0 : state->orig.out.services_returned = _services_returned;
2681 :
2682 : /* Result */
2683 0 : NDR_ZERO_STRUCT(state->orig.out.result);
2684 :
2685 0 : state->out_mem_ctx = talloc_named_const(state, 0,
2686 : "dcerpc_svcctl_EnumDependentServicesW_out_memory");
2687 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
2688 0 : return tevent_req_post(req, ev);
2689 : }
2690 :
2691 : /* make a temporary copy, that we pass to the dispatch function */
2692 0 : state->tmp = state->orig;
2693 :
2694 0 : subreq = dcerpc_svcctl_EnumDependentServicesW_r_send(state, ev, h, &state->tmp);
2695 0 : if (tevent_req_nomem(subreq, req)) {
2696 0 : return tevent_req_post(req, ev);
2697 : }
2698 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_EnumDependentServicesW_done, req);
2699 0 : return req;
2700 : }
2701 :
2702 0 : static void dcerpc_svcctl_EnumDependentServicesW_done(struct tevent_req *subreq)
2703 : {
2704 0 : struct tevent_req *req = tevent_req_callback_data(
2705 : subreq, struct tevent_req);
2706 0 : struct dcerpc_svcctl_EnumDependentServicesW_state *state = tevent_req_data(
2707 : req, struct dcerpc_svcctl_EnumDependentServicesW_state);
2708 : NTSTATUS status;
2709 : TALLOC_CTX *mem_ctx;
2710 :
2711 0 : if (state->out_mem_ctx) {
2712 0 : mem_ctx = state->out_mem_ctx;
2713 : } else {
2714 0 : mem_ctx = state;
2715 : }
2716 :
2717 0 : status = dcerpc_svcctl_EnumDependentServicesW_r_recv(subreq, mem_ctx);
2718 0 : TALLOC_FREE(subreq);
2719 0 : if (tevent_req_nterror(req, status)) {
2720 0 : return;
2721 : }
2722 :
2723 : /* Copy out parameters */
2724 : {
2725 : size_t _copy_len_service_status;
2726 0 : _copy_len_service_status = state->tmp.in.offered;
2727 0 : if (state->orig.out.service_status != state->tmp.out.service_status) {
2728 0 : memcpy(state->orig.out.service_status, state->tmp.out.service_status, _copy_len_service_status * sizeof(*state->orig.out.service_status));
2729 : }
2730 : }
2731 0 : *state->orig.out.needed = *state->tmp.out.needed;
2732 0 : *state->orig.out.services_returned = *state->tmp.out.services_returned;
2733 :
2734 : /* Copy result */
2735 0 : state->orig.out.result = state->tmp.out.result;
2736 :
2737 : /* Reset temporary structure */
2738 0 : NDR_ZERO_STRUCT(state->tmp);
2739 :
2740 0 : tevent_req_done(req);
2741 : }
2742 :
2743 0 : NTSTATUS dcerpc_svcctl_EnumDependentServicesW_recv(struct tevent_req *req,
2744 : TALLOC_CTX *mem_ctx,
2745 : WERROR *result)
2746 : {
2747 0 : struct dcerpc_svcctl_EnumDependentServicesW_state *state = tevent_req_data(
2748 : req, struct dcerpc_svcctl_EnumDependentServicesW_state);
2749 : NTSTATUS status;
2750 :
2751 0 : if (tevent_req_is_nterror(req, &status)) {
2752 0 : tevent_req_received(req);
2753 0 : return status;
2754 : }
2755 :
2756 : /* Steal possible out parameters to the callers context */
2757 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2758 :
2759 : /* Return result */
2760 0 : *result = state->orig.out.result;
2761 :
2762 0 : tevent_req_received(req);
2763 0 : return NT_STATUS_OK;
2764 : }
2765 :
2766 0 : NTSTATUS dcerpc_svcctl_EnumDependentServicesW(struct dcerpc_binding_handle *h,
2767 : TALLOC_CTX *mem_ctx,
2768 : struct policy_handle *_service /* [in] [ref] */,
2769 : enum svcctl_ServiceState _state /* [in] */,
2770 : uint8_t *_service_status /* [out] [ref,size_is(offered)] */,
2771 : uint32_t _offered /* [in] [range(0,0x40000)] */,
2772 : uint32_t *_needed /* [out] [range(0,0x40000),ref] */,
2773 : uint32_t *_services_returned /* [out] [range(0,0x40000),ref] */,
2774 : WERROR *result)
2775 : {
2776 : struct svcctl_EnumDependentServicesW r;
2777 : NTSTATUS status;
2778 :
2779 : /* In parameters */
2780 0 : r.in.service = _service;
2781 0 : r.in.state = _state;
2782 0 : r.in.offered = _offered;
2783 :
2784 : /* Out parameters */
2785 0 : r.out.service_status = _service_status;
2786 0 : r.out.needed = _needed;
2787 0 : r.out.services_returned = _services_returned;
2788 :
2789 : /* Result */
2790 0 : NDR_ZERO_STRUCT(r.out.result);
2791 :
2792 0 : status = dcerpc_svcctl_EnumDependentServicesW_r(h, mem_ctx, &r);
2793 0 : if (!NT_STATUS_IS_OK(status)) {
2794 0 : return status;
2795 : }
2796 :
2797 : /* Return variables */
2798 : {
2799 : size_t _copy_len_service_status;
2800 0 : _copy_len_service_status = r.in.offered;
2801 0 : if (_service_status != r.out.service_status) {
2802 0 : memcpy(_service_status, r.out.service_status, _copy_len_service_status * sizeof(*_service_status));
2803 : }
2804 : }
2805 0 : *_needed = *r.out.needed;
2806 0 : *_services_returned = *r.out.services_returned;
2807 :
2808 : /* Return result */
2809 0 : *result = r.out.result;
2810 :
2811 0 : return NT_STATUS_OK;
2812 : }
2813 :
2814 : struct dcerpc_svcctl_EnumServicesStatusW_r_state {
2815 : TALLOC_CTX *out_mem_ctx;
2816 : };
2817 :
2818 : static void dcerpc_svcctl_EnumServicesStatusW_r_done(struct tevent_req *subreq);
2819 :
2820 0 : struct tevent_req *dcerpc_svcctl_EnumServicesStatusW_r_send(TALLOC_CTX *mem_ctx,
2821 : struct tevent_context *ev,
2822 : struct dcerpc_binding_handle *h,
2823 : struct svcctl_EnumServicesStatusW *r)
2824 : {
2825 : struct tevent_req *req;
2826 : struct dcerpc_svcctl_EnumServicesStatusW_r_state *state;
2827 : struct tevent_req *subreq;
2828 :
2829 0 : req = tevent_req_create(mem_ctx, &state,
2830 : struct dcerpc_svcctl_EnumServicesStatusW_r_state);
2831 0 : if (req == NULL) {
2832 0 : return NULL;
2833 : }
2834 :
2835 0 : state->out_mem_ctx = talloc_new(state);
2836 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
2837 0 : return tevent_req_post(req, ev);
2838 : }
2839 :
2840 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
2841 : NULL, &ndr_table_svcctl,
2842 0 : NDR_SVCCTL_ENUMSERVICESSTATUSW, state->out_mem_ctx, r);
2843 0 : if (tevent_req_nomem(subreq, req)) {
2844 0 : return tevent_req_post(req, ev);
2845 : }
2846 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_EnumServicesStatusW_r_done, req);
2847 :
2848 0 : return req;
2849 : }
2850 :
2851 0 : static void dcerpc_svcctl_EnumServicesStatusW_r_done(struct tevent_req *subreq)
2852 : {
2853 0 : struct tevent_req *req =
2854 0 : tevent_req_callback_data(subreq,
2855 : struct tevent_req);
2856 : NTSTATUS status;
2857 :
2858 0 : status = dcerpc_binding_handle_call_recv(subreq);
2859 0 : TALLOC_FREE(subreq);
2860 0 : if (tevent_req_nterror(req, status)) {
2861 0 : return;
2862 : }
2863 :
2864 0 : tevent_req_done(req);
2865 : }
2866 :
2867 0 : NTSTATUS dcerpc_svcctl_EnumServicesStatusW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2868 : {
2869 0 : struct dcerpc_svcctl_EnumServicesStatusW_r_state *state =
2870 0 : tevent_req_data(req,
2871 : struct dcerpc_svcctl_EnumServicesStatusW_r_state);
2872 : NTSTATUS status;
2873 :
2874 0 : if (tevent_req_is_nterror(req, &status)) {
2875 0 : tevent_req_received(req);
2876 0 : return status;
2877 : }
2878 :
2879 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
2880 :
2881 0 : tevent_req_received(req);
2882 0 : return NT_STATUS_OK;
2883 : }
2884 :
2885 0 : NTSTATUS dcerpc_svcctl_EnumServicesStatusW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_EnumServicesStatusW *r)
2886 : {
2887 : NTSTATUS status;
2888 :
2889 0 : status = dcerpc_binding_handle_call(h,
2890 : NULL, &ndr_table_svcctl,
2891 : NDR_SVCCTL_ENUMSERVICESSTATUSW, mem_ctx, r);
2892 :
2893 0 : return status;
2894 : }
2895 :
2896 : struct dcerpc_svcctl_EnumServicesStatusW_state {
2897 : struct svcctl_EnumServicesStatusW orig;
2898 : struct svcctl_EnumServicesStatusW tmp;
2899 : TALLOC_CTX *out_mem_ctx;
2900 : };
2901 :
2902 : static void dcerpc_svcctl_EnumServicesStatusW_done(struct tevent_req *subreq);
2903 :
2904 0 : struct tevent_req *dcerpc_svcctl_EnumServicesStatusW_send(TALLOC_CTX *mem_ctx,
2905 : struct tevent_context *ev,
2906 : struct dcerpc_binding_handle *h,
2907 : struct policy_handle *_handle /* [in] [ref] */,
2908 : uint32_t _type /* [in] */,
2909 : enum svcctl_ServiceState _state /* [in] */,
2910 : uint8_t *_service /* [out] [ref,size_is(offered)] */,
2911 : uint32_t _offered /* [in] [range(0,0x40000)] */,
2912 : uint32_t *_needed /* [out] [range(0,0x40000),ref] */,
2913 : uint32_t *_services_returned /* [out] [range(0,0x40000),ref] */,
2914 : uint32_t *_resume_handle /* [in,out] [unique] */)
2915 : {
2916 : struct tevent_req *req;
2917 : struct dcerpc_svcctl_EnumServicesStatusW_state *state;
2918 : struct tevent_req *subreq;
2919 :
2920 0 : req = tevent_req_create(mem_ctx, &state,
2921 : struct dcerpc_svcctl_EnumServicesStatusW_state);
2922 0 : if (req == NULL) {
2923 0 : return NULL;
2924 : }
2925 0 : state->out_mem_ctx = NULL;
2926 :
2927 : /* In parameters */
2928 0 : state->orig.in.handle = _handle;
2929 0 : state->orig.in.type = _type;
2930 0 : state->orig.in.state = _state;
2931 0 : state->orig.in.offered = _offered;
2932 0 : state->orig.in.resume_handle = _resume_handle;
2933 :
2934 : /* Out parameters */
2935 0 : state->orig.out.service = _service;
2936 0 : state->orig.out.needed = _needed;
2937 0 : state->orig.out.services_returned = _services_returned;
2938 0 : state->orig.out.resume_handle = _resume_handle;
2939 :
2940 : /* Result */
2941 0 : NDR_ZERO_STRUCT(state->orig.out.result);
2942 :
2943 0 : state->out_mem_ctx = talloc_named_const(state, 0,
2944 : "dcerpc_svcctl_EnumServicesStatusW_out_memory");
2945 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
2946 0 : return tevent_req_post(req, ev);
2947 : }
2948 :
2949 : /* make a temporary copy, that we pass to the dispatch function */
2950 0 : state->tmp = state->orig;
2951 :
2952 0 : subreq = dcerpc_svcctl_EnumServicesStatusW_r_send(state, ev, h, &state->tmp);
2953 0 : if (tevent_req_nomem(subreq, req)) {
2954 0 : return tevent_req_post(req, ev);
2955 : }
2956 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_EnumServicesStatusW_done, req);
2957 0 : return req;
2958 : }
2959 :
2960 0 : static void dcerpc_svcctl_EnumServicesStatusW_done(struct tevent_req *subreq)
2961 : {
2962 0 : struct tevent_req *req = tevent_req_callback_data(
2963 : subreq, struct tevent_req);
2964 0 : struct dcerpc_svcctl_EnumServicesStatusW_state *state = tevent_req_data(
2965 : req, struct dcerpc_svcctl_EnumServicesStatusW_state);
2966 : NTSTATUS status;
2967 : TALLOC_CTX *mem_ctx;
2968 :
2969 0 : if (state->out_mem_ctx) {
2970 0 : mem_ctx = state->out_mem_ctx;
2971 : } else {
2972 0 : mem_ctx = state;
2973 : }
2974 :
2975 0 : status = dcerpc_svcctl_EnumServicesStatusW_r_recv(subreq, mem_ctx);
2976 0 : TALLOC_FREE(subreq);
2977 0 : if (tevent_req_nterror(req, status)) {
2978 0 : return;
2979 : }
2980 :
2981 : /* Copy out parameters */
2982 : {
2983 : size_t _copy_len_service;
2984 0 : _copy_len_service = state->tmp.in.offered;
2985 0 : if (state->orig.out.service != state->tmp.out.service) {
2986 0 : memcpy(state->orig.out.service, state->tmp.out.service, _copy_len_service * sizeof(*state->orig.out.service));
2987 : }
2988 : }
2989 0 : *state->orig.out.needed = *state->tmp.out.needed;
2990 0 : *state->orig.out.services_returned = *state->tmp.out.services_returned;
2991 0 : if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
2992 0 : *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2993 : }
2994 :
2995 : /* Copy result */
2996 0 : state->orig.out.result = state->tmp.out.result;
2997 :
2998 : /* Reset temporary structure */
2999 0 : NDR_ZERO_STRUCT(state->tmp);
3000 :
3001 0 : tevent_req_done(req);
3002 : }
3003 :
3004 0 : NTSTATUS dcerpc_svcctl_EnumServicesStatusW_recv(struct tevent_req *req,
3005 : TALLOC_CTX *mem_ctx,
3006 : WERROR *result)
3007 : {
3008 0 : struct dcerpc_svcctl_EnumServicesStatusW_state *state = tevent_req_data(
3009 : req, struct dcerpc_svcctl_EnumServicesStatusW_state);
3010 : NTSTATUS status;
3011 :
3012 0 : if (tevent_req_is_nterror(req, &status)) {
3013 0 : tevent_req_received(req);
3014 0 : return status;
3015 : }
3016 :
3017 : /* Steal possible out parameters to the callers context */
3018 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
3019 :
3020 : /* Return result */
3021 0 : *result = state->orig.out.result;
3022 :
3023 0 : tevent_req_received(req);
3024 0 : return NT_STATUS_OK;
3025 : }
3026 :
3027 0 : NTSTATUS dcerpc_svcctl_EnumServicesStatusW(struct dcerpc_binding_handle *h,
3028 : TALLOC_CTX *mem_ctx,
3029 : struct policy_handle *_handle /* [in] [ref] */,
3030 : uint32_t _type /* [in] */,
3031 : enum svcctl_ServiceState _state /* [in] */,
3032 : uint8_t *_service /* [out] [ref,size_is(offered)] */,
3033 : uint32_t _offered /* [in] [range(0,0x40000)] */,
3034 : uint32_t *_needed /* [out] [range(0,0x40000),ref] */,
3035 : uint32_t *_services_returned /* [out] [range(0,0x40000),ref] */,
3036 : uint32_t *_resume_handle /* [in,out] [unique] */,
3037 : WERROR *result)
3038 : {
3039 : struct svcctl_EnumServicesStatusW r;
3040 : NTSTATUS status;
3041 :
3042 : /* In parameters */
3043 0 : r.in.handle = _handle;
3044 0 : r.in.type = _type;
3045 0 : r.in.state = _state;
3046 0 : r.in.offered = _offered;
3047 0 : r.in.resume_handle = _resume_handle;
3048 :
3049 : /* Out parameters */
3050 0 : r.out.service = _service;
3051 0 : r.out.needed = _needed;
3052 0 : r.out.services_returned = _services_returned;
3053 0 : r.out.resume_handle = _resume_handle;
3054 :
3055 : /* Result */
3056 0 : NDR_ZERO_STRUCT(r.out.result);
3057 :
3058 0 : status = dcerpc_svcctl_EnumServicesStatusW_r(h, mem_ctx, &r);
3059 0 : if (!NT_STATUS_IS_OK(status)) {
3060 0 : return status;
3061 : }
3062 :
3063 : /* Return variables */
3064 : {
3065 : size_t _copy_len_service;
3066 0 : _copy_len_service = r.in.offered;
3067 0 : if (_service != r.out.service) {
3068 0 : memcpy(_service, r.out.service, _copy_len_service * sizeof(*_service));
3069 : }
3070 : }
3071 0 : *_needed = *r.out.needed;
3072 0 : *_services_returned = *r.out.services_returned;
3073 0 : if (_resume_handle && r.out.resume_handle) {
3074 0 : *_resume_handle = *r.out.resume_handle;
3075 : }
3076 :
3077 : /* Return result */
3078 0 : *result = r.out.result;
3079 :
3080 0 : return NT_STATUS_OK;
3081 : }
3082 :
3083 : struct dcerpc_svcctl_OpenSCManagerW_r_state {
3084 : TALLOC_CTX *out_mem_ctx;
3085 : };
3086 :
3087 : static void dcerpc_svcctl_OpenSCManagerW_r_done(struct tevent_req *subreq);
3088 :
3089 0 : struct tevent_req *dcerpc_svcctl_OpenSCManagerW_r_send(TALLOC_CTX *mem_ctx,
3090 : struct tevent_context *ev,
3091 : struct dcerpc_binding_handle *h,
3092 : struct svcctl_OpenSCManagerW *r)
3093 : {
3094 : struct tevent_req *req;
3095 : struct dcerpc_svcctl_OpenSCManagerW_r_state *state;
3096 : struct tevent_req *subreq;
3097 :
3098 0 : req = tevent_req_create(mem_ctx, &state,
3099 : struct dcerpc_svcctl_OpenSCManagerW_r_state);
3100 0 : if (req == NULL) {
3101 0 : return NULL;
3102 : }
3103 :
3104 0 : state->out_mem_ctx = talloc_new(state);
3105 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
3106 0 : return tevent_req_post(req, ev);
3107 : }
3108 :
3109 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
3110 : NULL, &ndr_table_svcctl,
3111 0 : NDR_SVCCTL_OPENSCMANAGERW, state->out_mem_ctx, r);
3112 0 : if (tevent_req_nomem(subreq, req)) {
3113 0 : return tevent_req_post(req, ev);
3114 : }
3115 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_OpenSCManagerW_r_done, req);
3116 :
3117 0 : return req;
3118 : }
3119 :
3120 0 : static void dcerpc_svcctl_OpenSCManagerW_r_done(struct tevent_req *subreq)
3121 : {
3122 0 : struct tevent_req *req =
3123 0 : tevent_req_callback_data(subreq,
3124 : struct tevent_req);
3125 : NTSTATUS status;
3126 :
3127 0 : status = dcerpc_binding_handle_call_recv(subreq);
3128 0 : TALLOC_FREE(subreq);
3129 0 : if (tevent_req_nterror(req, status)) {
3130 0 : return;
3131 : }
3132 :
3133 0 : tevent_req_done(req);
3134 : }
3135 :
3136 0 : NTSTATUS dcerpc_svcctl_OpenSCManagerW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3137 : {
3138 0 : struct dcerpc_svcctl_OpenSCManagerW_r_state *state =
3139 0 : tevent_req_data(req,
3140 : struct dcerpc_svcctl_OpenSCManagerW_r_state);
3141 : NTSTATUS status;
3142 :
3143 0 : if (tevent_req_is_nterror(req, &status)) {
3144 0 : tevent_req_received(req);
3145 0 : return status;
3146 : }
3147 :
3148 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
3149 :
3150 0 : tevent_req_received(req);
3151 0 : return NT_STATUS_OK;
3152 : }
3153 :
3154 0 : NTSTATUS dcerpc_svcctl_OpenSCManagerW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_OpenSCManagerW *r)
3155 : {
3156 : NTSTATUS status;
3157 :
3158 0 : status = dcerpc_binding_handle_call(h,
3159 : NULL, &ndr_table_svcctl,
3160 : NDR_SVCCTL_OPENSCMANAGERW, mem_ctx, r);
3161 :
3162 0 : return status;
3163 : }
3164 :
3165 : struct dcerpc_svcctl_OpenSCManagerW_state {
3166 : struct svcctl_OpenSCManagerW orig;
3167 : struct svcctl_OpenSCManagerW tmp;
3168 : TALLOC_CTX *out_mem_ctx;
3169 : };
3170 :
3171 : static void dcerpc_svcctl_OpenSCManagerW_done(struct tevent_req *subreq);
3172 :
3173 0 : struct tevent_req *dcerpc_svcctl_OpenSCManagerW_send(TALLOC_CTX *mem_ctx,
3174 : struct tevent_context *ev,
3175 : struct dcerpc_binding_handle *h,
3176 : const char *_MachineName /* [in] [charset(UTF16),unique] */,
3177 : const char *_DatabaseName /* [in] [charset(UTF16),unique] */,
3178 : uint32_t _access_mask /* [in] */,
3179 : struct policy_handle *_handle /* [out] [ref] */)
3180 : {
3181 : struct tevent_req *req;
3182 : struct dcerpc_svcctl_OpenSCManagerW_state *state;
3183 : struct tevent_req *subreq;
3184 :
3185 0 : req = tevent_req_create(mem_ctx, &state,
3186 : struct dcerpc_svcctl_OpenSCManagerW_state);
3187 0 : if (req == NULL) {
3188 0 : return NULL;
3189 : }
3190 0 : state->out_mem_ctx = NULL;
3191 :
3192 : /* In parameters */
3193 0 : state->orig.in.MachineName = _MachineName;
3194 0 : state->orig.in.DatabaseName = _DatabaseName;
3195 0 : state->orig.in.access_mask = _access_mask;
3196 :
3197 : /* Out parameters */
3198 0 : state->orig.out.handle = _handle;
3199 :
3200 : /* Result */
3201 0 : NDR_ZERO_STRUCT(state->orig.out.result);
3202 :
3203 0 : state->out_mem_ctx = talloc_named_const(state, 0,
3204 : "dcerpc_svcctl_OpenSCManagerW_out_memory");
3205 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
3206 0 : return tevent_req_post(req, ev);
3207 : }
3208 :
3209 : /* make a temporary copy, that we pass to the dispatch function */
3210 0 : state->tmp = state->orig;
3211 :
3212 0 : subreq = dcerpc_svcctl_OpenSCManagerW_r_send(state, ev, h, &state->tmp);
3213 0 : if (tevent_req_nomem(subreq, req)) {
3214 0 : return tevent_req_post(req, ev);
3215 : }
3216 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_OpenSCManagerW_done, req);
3217 0 : return req;
3218 : }
3219 :
3220 0 : static void dcerpc_svcctl_OpenSCManagerW_done(struct tevent_req *subreq)
3221 : {
3222 0 : struct tevent_req *req = tevent_req_callback_data(
3223 : subreq, struct tevent_req);
3224 0 : struct dcerpc_svcctl_OpenSCManagerW_state *state = tevent_req_data(
3225 : req, struct dcerpc_svcctl_OpenSCManagerW_state);
3226 : NTSTATUS status;
3227 : TALLOC_CTX *mem_ctx;
3228 :
3229 0 : if (state->out_mem_ctx) {
3230 0 : mem_ctx = state->out_mem_ctx;
3231 : } else {
3232 0 : mem_ctx = state;
3233 : }
3234 :
3235 0 : status = dcerpc_svcctl_OpenSCManagerW_r_recv(subreq, mem_ctx);
3236 0 : TALLOC_FREE(subreq);
3237 0 : if (tevent_req_nterror(req, status)) {
3238 0 : return;
3239 : }
3240 :
3241 : /* Copy out parameters */
3242 0 : *state->orig.out.handle = *state->tmp.out.handle;
3243 :
3244 : /* Copy result */
3245 0 : state->orig.out.result = state->tmp.out.result;
3246 :
3247 : /* Reset temporary structure */
3248 0 : NDR_ZERO_STRUCT(state->tmp);
3249 :
3250 0 : tevent_req_done(req);
3251 : }
3252 :
3253 0 : NTSTATUS dcerpc_svcctl_OpenSCManagerW_recv(struct tevent_req *req,
3254 : TALLOC_CTX *mem_ctx,
3255 : WERROR *result)
3256 : {
3257 0 : struct dcerpc_svcctl_OpenSCManagerW_state *state = tevent_req_data(
3258 : req, struct dcerpc_svcctl_OpenSCManagerW_state);
3259 : NTSTATUS status;
3260 :
3261 0 : if (tevent_req_is_nterror(req, &status)) {
3262 0 : tevent_req_received(req);
3263 0 : return status;
3264 : }
3265 :
3266 : /* Steal possible out parameters to the callers context */
3267 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
3268 :
3269 : /* Return result */
3270 0 : *result = state->orig.out.result;
3271 :
3272 0 : tevent_req_received(req);
3273 0 : return NT_STATUS_OK;
3274 : }
3275 :
3276 0 : NTSTATUS dcerpc_svcctl_OpenSCManagerW(struct dcerpc_binding_handle *h,
3277 : TALLOC_CTX *mem_ctx,
3278 : const char *_MachineName /* [in] [charset(UTF16),unique] */,
3279 : const char *_DatabaseName /* [in] [charset(UTF16),unique] */,
3280 : uint32_t _access_mask /* [in] */,
3281 : struct policy_handle *_handle /* [out] [ref] */,
3282 : WERROR *result)
3283 : {
3284 : struct svcctl_OpenSCManagerW r;
3285 : NTSTATUS status;
3286 :
3287 : /* In parameters */
3288 0 : r.in.MachineName = _MachineName;
3289 0 : r.in.DatabaseName = _DatabaseName;
3290 0 : r.in.access_mask = _access_mask;
3291 :
3292 : /* Out parameters */
3293 0 : r.out.handle = _handle;
3294 :
3295 : /* Result */
3296 0 : NDR_ZERO_STRUCT(r.out.result);
3297 :
3298 0 : status = dcerpc_svcctl_OpenSCManagerW_r(h, mem_ctx, &r);
3299 0 : if (!NT_STATUS_IS_OK(status)) {
3300 0 : return status;
3301 : }
3302 :
3303 : /* Return variables */
3304 0 : *_handle = *r.out.handle;
3305 :
3306 : /* Return result */
3307 0 : *result = r.out.result;
3308 :
3309 0 : return NT_STATUS_OK;
3310 : }
3311 :
3312 : struct dcerpc_svcctl_OpenServiceW_r_state {
3313 : TALLOC_CTX *out_mem_ctx;
3314 : };
3315 :
3316 : static void dcerpc_svcctl_OpenServiceW_r_done(struct tevent_req *subreq);
3317 :
3318 0 : struct tevent_req *dcerpc_svcctl_OpenServiceW_r_send(TALLOC_CTX *mem_ctx,
3319 : struct tevent_context *ev,
3320 : struct dcerpc_binding_handle *h,
3321 : struct svcctl_OpenServiceW *r)
3322 : {
3323 : struct tevent_req *req;
3324 : struct dcerpc_svcctl_OpenServiceW_r_state *state;
3325 : struct tevent_req *subreq;
3326 :
3327 0 : req = tevent_req_create(mem_ctx, &state,
3328 : struct dcerpc_svcctl_OpenServiceW_r_state);
3329 0 : if (req == NULL) {
3330 0 : return NULL;
3331 : }
3332 :
3333 0 : state->out_mem_ctx = talloc_new(state);
3334 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
3335 0 : return tevent_req_post(req, ev);
3336 : }
3337 :
3338 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
3339 : NULL, &ndr_table_svcctl,
3340 0 : NDR_SVCCTL_OPENSERVICEW, state->out_mem_ctx, r);
3341 0 : if (tevent_req_nomem(subreq, req)) {
3342 0 : return tevent_req_post(req, ev);
3343 : }
3344 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_OpenServiceW_r_done, req);
3345 :
3346 0 : return req;
3347 : }
3348 :
3349 0 : static void dcerpc_svcctl_OpenServiceW_r_done(struct tevent_req *subreq)
3350 : {
3351 0 : struct tevent_req *req =
3352 0 : tevent_req_callback_data(subreq,
3353 : struct tevent_req);
3354 : NTSTATUS status;
3355 :
3356 0 : status = dcerpc_binding_handle_call_recv(subreq);
3357 0 : TALLOC_FREE(subreq);
3358 0 : if (tevent_req_nterror(req, status)) {
3359 0 : return;
3360 : }
3361 :
3362 0 : tevent_req_done(req);
3363 : }
3364 :
3365 0 : NTSTATUS dcerpc_svcctl_OpenServiceW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3366 : {
3367 0 : struct dcerpc_svcctl_OpenServiceW_r_state *state =
3368 0 : tevent_req_data(req,
3369 : struct dcerpc_svcctl_OpenServiceW_r_state);
3370 : NTSTATUS status;
3371 :
3372 0 : if (tevent_req_is_nterror(req, &status)) {
3373 0 : tevent_req_received(req);
3374 0 : return status;
3375 : }
3376 :
3377 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
3378 :
3379 0 : tevent_req_received(req);
3380 0 : return NT_STATUS_OK;
3381 : }
3382 :
3383 0 : NTSTATUS dcerpc_svcctl_OpenServiceW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_OpenServiceW *r)
3384 : {
3385 : NTSTATUS status;
3386 :
3387 0 : status = dcerpc_binding_handle_call(h,
3388 : NULL, &ndr_table_svcctl,
3389 : NDR_SVCCTL_OPENSERVICEW, mem_ctx, r);
3390 :
3391 0 : return status;
3392 : }
3393 :
3394 : struct dcerpc_svcctl_OpenServiceW_state {
3395 : struct svcctl_OpenServiceW orig;
3396 : struct svcctl_OpenServiceW tmp;
3397 : TALLOC_CTX *out_mem_ctx;
3398 : };
3399 :
3400 : static void dcerpc_svcctl_OpenServiceW_done(struct tevent_req *subreq);
3401 :
3402 0 : struct tevent_req *dcerpc_svcctl_OpenServiceW_send(TALLOC_CTX *mem_ctx,
3403 : struct tevent_context *ev,
3404 : struct dcerpc_binding_handle *h,
3405 : struct policy_handle *_scmanager_handle /* [in] [ref] */,
3406 : const char *_ServiceName /* [in] [charset(UTF16)] */,
3407 : uint32_t _access_mask /* [in] */,
3408 : struct policy_handle *_handle /* [out] [ref] */)
3409 : {
3410 : struct tevent_req *req;
3411 : struct dcerpc_svcctl_OpenServiceW_state *state;
3412 : struct tevent_req *subreq;
3413 :
3414 0 : req = tevent_req_create(mem_ctx, &state,
3415 : struct dcerpc_svcctl_OpenServiceW_state);
3416 0 : if (req == NULL) {
3417 0 : return NULL;
3418 : }
3419 0 : state->out_mem_ctx = NULL;
3420 :
3421 : /* In parameters */
3422 0 : state->orig.in.scmanager_handle = _scmanager_handle;
3423 0 : state->orig.in.ServiceName = _ServiceName;
3424 0 : state->orig.in.access_mask = _access_mask;
3425 :
3426 : /* Out parameters */
3427 0 : state->orig.out.handle = _handle;
3428 :
3429 : /* Result */
3430 0 : NDR_ZERO_STRUCT(state->orig.out.result);
3431 :
3432 0 : state->out_mem_ctx = talloc_named_const(state, 0,
3433 : "dcerpc_svcctl_OpenServiceW_out_memory");
3434 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
3435 0 : return tevent_req_post(req, ev);
3436 : }
3437 :
3438 : /* make a temporary copy, that we pass to the dispatch function */
3439 0 : state->tmp = state->orig;
3440 :
3441 0 : subreq = dcerpc_svcctl_OpenServiceW_r_send(state, ev, h, &state->tmp);
3442 0 : if (tevent_req_nomem(subreq, req)) {
3443 0 : return tevent_req_post(req, ev);
3444 : }
3445 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_OpenServiceW_done, req);
3446 0 : return req;
3447 : }
3448 :
3449 0 : static void dcerpc_svcctl_OpenServiceW_done(struct tevent_req *subreq)
3450 : {
3451 0 : struct tevent_req *req = tevent_req_callback_data(
3452 : subreq, struct tevent_req);
3453 0 : struct dcerpc_svcctl_OpenServiceW_state *state = tevent_req_data(
3454 : req, struct dcerpc_svcctl_OpenServiceW_state);
3455 : NTSTATUS status;
3456 : TALLOC_CTX *mem_ctx;
3457 :
3458 0 : if (state->out_mem_ctx) {
3459 0 : mem_ctx = state->out_mem_ctx;
3460 : } else {
3461 0 : mem_ctx = state;
3462 : }
3463 :
3464 0 : status = dcerpc_svcctl_OpenServiceW_r_recv(subreq, mem_ctx);
3465 0 : TALLOC_FREE(subreq);
3466 0 : if (tevent_req_nterror(req, status)) {
3467 0 : return;
3468 : }
3469 :
3470 : /* Copy out parameters */
3471 0 : *state->orig.out.handle = *state->tmp.out.handle;
3472 :
3473 : /* Copy result */
3474 0 : state->orig.out.result = state->tmp.out.result;
3475 :
3476 : /* Reset temporary structure */
3477 0 : NDR_ZERO_STRUCT(state->tmp);
3478 :
3479 0 : tevent_req_done(req);
3480 : }
3481 :
3482 0 : NTSTATUS dcerpc_svcctl_OpenServiceW_recv(struct tevent_req *req,
3483 : TALLOC_CTX *mem_ctx,
3484 : WERROR *result)
3485 : {
3486 0 : struct dcerpc_svcctl_OpenServiceW_state *state = tevent_req_data(
3487 : req, struct dcerpc_svcctl_OpenServiceW_state);
3488 : NTSTATUS status;
3489 :
3490 0 : if (tevent_req_is_nterror(req, &status)) {
3491 0 : tevent_req_received(req);
3492 0 : return status;
3493 : }
3494 :
3495 : /* Steal possible out parameters to the callers context */
3496 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
3497 :
3498 : /* Return result */
3499 0 : *result = state->orig.out.result;
3500 :
3501 0 : tevent_req_received(req);
3502 0 : return NT_STATUS_OK;
3503 : }
3504 :
3505 0 : NTSTATUS dcerpc_svcctl_OpenServiceW(struct dcerpc_binding_handle *h,
3506 : TALLOC_CTX *mem_ctx,
3507 : struct policy_handle *_scmanager_handle /* [in] [ref] */,
3508 : const char *_ServiceName /* [in] [charset(UTF16)] */,
3509 : uint32_t _access_mask /* [in] */,
3510 : struct policy_handle *_handle /* [out] [ref] */,
3511 : WERROR *result)
3512 : {
3513 : struct svcctl_OpenServiceW r;
3514 : NTSTATUS status;
3515 :
3516 : /* In parameters */
3517 0 : r.in.scmanager_handle = _scmanager_handle;
3518 0 : r.in.ServiceName = _ServiceName;
3519 0 : r.in.access_mask = _access_mask;
3520 :
3521 : /* Out parameters */
3522 0 : r.out.handle = _handle;
3523 :
3524 : /* Result */
3525 0 : NDR_ZERO_STRUCT(r.out.result);
3526 :
3527 0 : status = dcerpc_svcctl_OpenServiceW_r(h, mem_ctx, &r);
3528 0 : if (!NT_STATUS_IS_OK(status)) {
3529 0 : return status;
3530 : }
3531 :
3532 : /* Return variables */
3533 0 : *_handle = *r.out.handle;
3534 :
3535 : /* Return result */
3536 0 : *result = r.out.result;
3537 :
3538 0 : return NT_STATUS_OK;
3539 : }
3540 :
3541 : struct dcerpc_svcctl_QueryServiceConfigW_r_state {
3542 : TALLOC_CTX *out_mem_ctx;
3543 : };
3544 :
3545 : static void dcerpc_svcctl_QueryServiceConfigW_r_done(struct tevent_req *subreq);
3546 :
3547 0 : struct tevent_req *dcerpc_svcctl_QueryServiceConfigW_r_send(TALLOC_CTX *mem_ctx,
3548 : struct tevent_context *ev,
3549 : struct dcerpc_binding_handle *h,
3550 : struct svcctl_QueryServiceConfigW *r)
3551 : {
3552 : struct tevent_req *req;
3553 : struct dcerpc_svcctl_QueryServiceConfigW_r_state *state;
3554 : struct tevent_req *subreq;
3555 :
3556 0 : req = tevent_req_create(mem_ctx, &state,
3557 : struct dcerpc_svcctl_QueryServiceConfigW_r_state);
3558 0 : if (req == NULL) {
3559 0 : return NULL;
3560 : }
3561 :
3562 0 : state->out_mem_ctx = talloc_new(state);
3563 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
3564 0 : return tevent_req_post(req, ev);
3565 : }
3566 :
3567 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
3568 : NULL, &ndr_table_svcctl,
3569 0 : NDR_SVCCTL_QUERYSERVICECONFIGW, state->out_mem_ctx, r);
3570 0 : if (tevent_req_nomem(subreq, req)) {
3571 0 : return tevent_req_post(req, ev);
3572 : }
3573 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceConfigW_r_done, req);
3574 :
3575 0 : return req;
3576 : }
3577 :
3578 0 : static void dcerpc_svcctl_QueryServiceConfigW_r_done(struct tevent_req *subreq)
3579 : {
3580 0 : struct tevent_req *req =
3581 0 : tevent_req_callback_data(subreq,
3582 : struct tevent_req);
3583 : NTSTATUS status;
3584 :
3585 0 : status = dcerpc_binding_handle_call_recv(subreq);
3586 0 : TALLOC_FREE(subreq);
3587 0 : if (tevent_req_nterror(req, status)) {
3588 0 : return;
3589 : }
3590 :
3591 0 : tevent_req_done(req);
3592 : }
3593 :
3594 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfigW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3595 : {
3596 0 : struct dcerpc_svcctl_QueryServiceConfigW_r_state *state =
3597 0 : tevent_req_data(req,
3598 : struct dcerpc_svcctl_QueryServiceConfigW_r_state);
3599 : NTSTATUS status;
3600 :
3601 0 : if (tevent_req_is_nterror(req, &status)) {
3602 0 : tevent_req_received(req);
3603 0 : return status;
3604 : }
3605 :
3606 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
3607 :
3608 0 : tevent_req_received(req);
3609 0 : return NT_STATUS_OK;
3610 : }
3611 :
3612 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfigW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_QueryServiceConfigW *r)
3613 : {
3614 : NTSTATUS status;
3615 :
3616 0 : status = dcerpc_binding_handle_call(h,
3617 : NULL, &ndr_table_svcctl,
3618 : NDR_SVCCTL_QUERYSERVICECONFIGW, mem_ctx, r);
3619 :
3620 0 : return status;
3621 : }
3622 :
3623 : struct dcerpc_svcctl_QueryServiceConfigW_state {
3624 : struct svcctl_QueryServiceConfigW orig;
3625 : struct svcctl_QueryServiceConfigW tmp;
3626 : TALLOC_CTX *out_mem_ctx;
3627 : };
3628 :
3629 : static void dcerpc_svcctl_QueryServiceConfigW_done(struct tevent_req *subreq);
3630 :
3631 0 : struct tevent_req *dcerpc_svcctl_QueryServiceConfigW_send(TALLOC_CTX *mem_ctx,
3632 : struct tevent_context *ev,
3633 : struct dcerpc_binding_handle *h,
3634 : struct policy_handle *_handle /* [in] [ref] */,
3635 : struct QUERY_SERVICE_CONFIG *_query /* [out] [ref] */,
3636 : uint32_t _offered /* [in] [range(0,8192)] */,
3637 : uint32_t *_needed /* [out] [range(0,8192),ref] */)
3638 : {
3639 : struct tevent_req *req;
3640 : struct dcerpc_svcctl_QueryServiceConfigW_state *state;
3641 : struct tevent_req *subreq;
3642 :
3643 0 : req = tevent_req_create(mem_ctx, &state,
3644 : struct dcerpc_svcctl_QueryServiceConfigW_state);
3645 0 : if (req == NULL) {
3646 0 : return NULL;
3647 : }
3648 0 : state->out_mem_ctx = NULL;
3649 :
3650 : /* In parameters */
3651 0 : state->orig.in.handle = _handle;
3652 0 : state->orig.in.offered = _offered;
3653 :
3654 : /* Out parameters */
3655 0 : state->orig.out.query = _query;
3656 0 : state->orig.out.needed = _needed;
3657 :
3658 : /* Result */
3659 0 : NDR_ZERO_STRUCT(state->orig.out.result);
3660 :
3661 0 : state->out_mem_ctx = talloc_named_const(state, 0,
3662 : "dcerpc_svcctl_QueryServiceConfigW_out_memory");
3663 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
3664 0 : return tevent_req_post(req, ev);
3665 : }
3666 :
3667 : /* make a temporary copy, that we pass to the dispatch function */
3668 0 : state->tmp = state->orig;
3669 :
3670 0 : subreq = dcerpc_svcctl_QueryServiceConfigW_r_send(state, ev, h, &state->tmp);
3671 0 : if (tevent_req_nomem(subreq, req)) {
3672 0 : return tevent_req_post(req, ev);
3673 : }
3674 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceConfigW_done, req);
3675 0 : return req;
3676 : }
3677 :
3678 0 : static void dcerpc_svcctl_QueryServiceConfigW_done(struct tevent_req *subreq)
3679 : {
3680 0 : struct tevent_req *req = tevent_req_callback_data(
3681 : subreq, struct tevent_req);
3682 0 : struct dcerpc_svcctl_QueryServiceConfigW_state *state = tevent_req_data(
3683 : req, struct dcerpc_svcctl_QueryServiceConfigW_state);
3684 : NTSTATUS status;
3685 : TALLOC_CTX *mem_ctx;
3686 :
3687 0 : if (state->out_mem_ctx) {
3688 0 : mem_ctx = state->out_mem_ctx;
3689 : } else {
3690 0 : mem_ctx = state;
3691 : }
3692 :
3693 0 : status = dcerpc_svcctl_QueryServiceConfigW_r_recv(subreq, mem_ctx);
3694 0 : TALLOC_FREE(subreq);
3695 0 : if (tevent_req_nterror(req, status)) {
3696 0 : return;
3697 : }
3698 :
3699 : /* Copy out parameters */
3700 0 : *state->orig.out.query = *state->tmp.out.query;
3701 0 : *state->orig.out.needed = *state->tmp.out.needed;
3702 :
3703 : /* Copy result */
3704 0 : state->orig.out.result = state->tmp.out.result;
3705 :
3706 : /* Reset temporary structure */
3707 0 : NDR_ZERO_STRUCT(state->tmp);
3708 :
3709 0 : tevent_req_done(req);
3710 : }
3711 :
3712 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfigW_recv(struct tevent_req *req,
3713 : TALLOC_CTX *mem_ctx,
3714 : WERROR *result)
3715 : {
3716 0 : struct dcerpc_svcctl_QueryServiceConfigW_state *state = tevent_req_data(
3717 : req, struct dcerpc_svcctl_QueryServiceConfigW_state);
3718 : NTSTATUS status;
3719 :
3720 0 : if (tevent_req_is_nterror(req, &status)) {
3721 0 : tevent_req_received(req);
3722 0 : return status;
3723 : }
3724 :
3725 : /* Steal possible out parameters to the callers context */
3726 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
3727 :
3728 : /* Return result */
3729 0 : *result = state->orig.out.result;
3730 :
3731 0 : tevent_req_received(req);
3732 0 : return NT_STATUS_OK;
3733 : }
3734 :
3735 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfigW(struct dcerpc_binding_handle *h,
3736 : TALLOC_CTX *mem_ctx,
3737 : struct policy_handle *_handle /* [in] [ref] */,
3738 : struct QUERY_SERVICE_CONFIG *_query /* [out] [ref] */,
3739 : uint32_t _offered /* [in] [range(0,8192)] */,
3740 : uint32_t *_needed /* [out] [range(0,8192),ref] */,
3741 : WERROR *result)
3742 : {
3743 : struct svcctl_QueryServiceConfigW r;
3744 : NTSTATUS status;
3745 :
3746 : /* In parameters */
3747 0 : r.in.handle = _handle;
3748 0 : r.in.offered = _offered;
3749 :
3750 : /* Out parameters */
3751 0 : r.out.query = _query;
3752 0 : r.out.needed = _needed;
3753 :
3754 : /* Result */
3755 0 : NDR_ZERO_STRUCT(r.out.result);
3756 :
3757 0 : status = dcerpc_svcctl_QueryServiceConfigW_r(h, mem_ctx, &r);
3758 0 : if (!NT_STATUS_IS_OK(status)) {
3759 0 : return status;
3760 : }
3761 :
3762 : /* Return variables */
3763 0 : *_query = *r.out.query;
3764 0 : *_needed = *r.out.needed;
3765 :
3766 : /* Return result */
3767 0 : *result = r.out.result;
3768 :
3769 0 : return NT_STATUS_OK;
3770 : }
3771 :
3772 : struct dcerpc_svcctl_QueryServiceLockStatusW_r_state {
3773 : TALLOC_CTX *out_mem_ctx;
3774 : };
3775 :
3776 : static void dcerpc_svcctl_QueryServiceLockStatusW_r_done(struct tevent_req *subreq);
3777 :
3778 0 : struct tevent_req *dcerpc_svcctl_QueryServiceLockStatusW_r_send(TALLOC_CTX *mem_ctx,
3779 : struct tevent_context *ev,
3780 : struct dcerpc_binding_handle *h,
3781 : struct svcctl_QueryServiceLockStatusW *r)
3782 : {
3783 : struct tevent_req *req;
3784 : struct dcerpc_svcctl_QueryServiceLockStatusW_r_state *state;
3785 : struct tevent_req *subreq;
3786 :
3787 0 : req = tevent_req_create(mem_ctx, &state,
3788 : struct dcerpc_svcctl_QueryServiceLockStatusW_r_state);
3789 0 : if (req == NULL) {
3790 0 : return NULL;
3791 : }
3792 :
3793 0 : state->out_mem_ctx = talloc_new(state);
3794 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
3795 0 : return tevent_req_post(req, ev);
3796 : }
3797 :
3798 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
3799 : NULL, &ndr_table_svcctl,
3800 0 : NDR_SVCCTL_QUERYSERVICELOCKSTATUSW, state->out_mem_ctx, r);
3801 0 : if (tevent_req_nomem(subreq, req)) {
3802 0 : return tevent_req_post(req, ev);
3803 : }
3804 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceLockStatusW_r_done, req);
3805 :
3806 0 : return req;
3807 : }
3808 :
3809 0 : static void dcerpc_svcctl_QueryServiceLockStatusW_r_done(struct tevent_req *subreq)
3810 : {
3811 0 : struct tevent_req *req =
3812 0 : tevent_req_callback_data(subreq,
3813 : struct tevent_req);
3814 : NTSTATUS status;
3815 :
3816 0 : status = dcerpc_binding_handle_call_recv(subreq);
3817 0 : TALLOC_FREE(subreq);
3818 0 : if (tevent_req_nterror(req, status)) {
3819 0 : return;
3820 : }
3821 :
3822 0 : tevent_req_done(req);
3823 : }
3824 :
3825 0 : NTSTATUS dcerpc_svcctl_QueryServiceLockStatusW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3826 : {
3827 0 : struct dcerpc_svcctl_QueryServiceLockStatusW_r_state *state =
3828 0 : tevent_req_data(req,
3829 : struct dcerpc_svcctl_QueryServiceLockStatusW_r_state);
3830 : NTSTATUS status;
3831 :
3832 0 : if (tevent_req_is_nterror(req, &status)) {
3833 0 : tevent_req_received(req);
3834 0 : return status;
3835 : }
3836 :
3837 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
3838 :
3839 0 : tevent_req_received(req);
3840 0 : return NT_STATUS_OK;
3841 : }
3842 :
3843 0 : NTSTATUS dcerpc_svcctl_QueryServiceLockStatusW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_QueryServiceLockStatusW *r)
3844 : {
3845 : NTSTATUS status;
3846 :
3847 0 : status = dcerpc_binding_handle_call(h,
3848 : NULL, &ndr_table_svcctl,
3849 : NDR_SVCCTL_QUERYSERVICELOCKSTATUSW, mem_ctx, r);
3850 :
3851 0 : return status;
3852 : }
3853 :
3854 : struct dcerpc_svcctl_QueryServiceLockStatusW_state {
3855 : struct svcctl_QueryServiceLockStatusW orig;
3856 : struct svcctl_QueryServiceLockStatusW tmp;
3857 : TALLOC_CTX *out_mem_ctx;
3858 : };
3859 :
3860 : static void dcerpc_svcctl_QueryServiceLockStatusW_done(struct tevent_req *subreq);
3861 :
3862 0 : struct tevent_req *dcerpc_svcctl_QueryServiceLockStatusW_send(TALLOC_CTX *mem_ctx,
3863 : struct tevent_context *ev,
3864 : struct dcerpc_binding_handle *h,
3865 : struct policy_handle *_handle /* [in] [ref] */,
3866 : uint32_t _offered /* [in] */,
3867 : struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
3868 : uint32_t *_needed /* [out] [ref] */)
3869 : {
3870 : struct tevent_req *req;
3871 : struct dcerpc_svcctl_QueryServiceLockStatusW_state *state;
3872 : struct tevent_req *subreq;
3873 :
3874 0 : req = tevent_req_create(mem_ctx, &state,
3875 : struct dcerpc_svcctl_QueryServiceLockStatusW_state);
3876 0 : if (req == NULL) {
3877 0 : return NULL;
3878 : }
3879 0 : state->out_mem_ctx = NULL;
3880 :
3881 : /* In parameters */
3882 0 : state->orig.in.handle = _handle;
3883 0 : state->orig.in.offered = _offered;
3884 :
3885 : /* Out parameters */
3886 0 : state->orig.out.lock_status = _lock_status;
3887 0 : state->orig.out.needed = _needed;
3888 :
3889 : /* Result */
3890 0 : NDR_ZERO_STRUCT(state->orig.out.result);
3891 :
3892 0 : state->out_mem_ctx = talloc_named_const(state, 0,
3893 : "dcerpc_svcctl_QueryServiceLockStatusW_out_memory");
3894 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
3895 0 : return tevent_req_post(req, ev);
3896 : }
3897 :
3898 : /* make a temporary copy, that we pass to the dispatch function */
3899 0 : state->tmp = state->orig;
3900 :
3901 0 : subreq = dcerpc_svcctl_QueryServiceLockStatusW_r_send(state, ev, h, &state->tmp);
3902 0 : if (tevent_req_nomem(subreq, req)) {
3903 0 : return tevent_req_post(req, ev);
3904 : }
3905 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceLockStatusW_done, req);
3906 0 : return req;
3907 : }
3908 :
3909 0 : static void dcerpc_svcctl_QueryServiceLockStatusW_done(struct tevent_req *subreq)
3910 : {
3911 0 : struct tevent_req *req = tevent_req_callback_data(
3912 : subreq, struct tevent_req);
3913 0 : struct dcerpc_svcctl_QueryServiceLockStatusW_state *state = tevent_req_data(
3914 : req, struct dcerpc_svcctl_QueryServiceLockStatusW_state);
3915 : NTSTATUS status;
3916 : TALLOC_CTX *mem_ctx;
3917 :
3918 0 : if (state->out_mem_ctx) {
3919 0 : mem_ctx = state->out_mem_ctx;
3920 : } else {
3921 0 : mem_ctx = state;
3922 : }
3923 :
3924 0 : status = dcerpc_svcctl_QueryServiceLockStatusW_r_recv(subreq, mem_ctx);
3925 0 : TALLOC_FREE(subreq);
3926 0 : if (tevent_req_nterror(req, status)) {
3927 0 : return;
3928 : }
3929 :
3930 : /* Copy out parameters */
3931 0 : *state->orig.out.lock_status = *state->tmp.out.lock_status;
3932 0 : *state->orig.out.needed = *state->tmp.out.needed;
3933 :
3934 : /* Copy result */
3935 0 : state->orig.out.result = state->tmp.out.result;
3936 :
3937 : /* Reset temporary structure */
3938 0 : NDR_ZERO_STRUCT(state->tmp);
3939 :
3940 0 : tevent_req_done(req);
3941 : }
3942 :
3943 0 : NTSTATUS dcerpc_svcctl_QueryServiceLockStatusW_recv(struct tevent_req *req,
3944 : TALLOC_CTX *mem_ctx,
3945 : WERROR *result)
3946 : {
3947 0 : struct dcerpc_svcctl_QueryServiceLockStatusW_state *state = tevent_req_data(
3948 : req, struct dcerpc_svcctl_QueryServiceLockStatusW_state);
3949 : NTSTATUS status;
3950 :
3951 0 : if (tevent_req_is_nterror(req, &status)) {
3952 0 : tevent_req_received(req);
3953 0 : return status;
3954 : }
3955 :
3956 : /* Steal possible out parameters to the callers context */
3957 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
3958 :
3959 : /* Return result */
3960 0 : *result = state->orig.out.result;
3961 :
3962 0 : tevent_req_received(req);
3963 0 : return NT_STATUS_OK;
3964 : }
3965 :
3966 0 : NTSTATUS dcerpc_svcctl_QueryServiceLockStatusW(struct dcerpc_binding_handle *h,
3967 : TALLOC_CTX *mem_ctx,
3968 : struct policy_handle *_handle /* [in] [ref] */,
3969 : uint32_t _offered /* [in] */,
3970 : struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
3971 : uint32_t *_needed /* [out] [ref] */,
3972 : WERROR *result)
3973 : {
3974 : struct svcctl_QueryServiceLockStatusW r;
3975 : NTSTATUS status;
3976 :
3977 : /* In parameters */
3978 0 : r.in.handle = _handle;
3979 0 : r.in.offered = _offered;
3980 :
3981 : /* Out parameters */
3982 0 : r.out.lock_status = _lock_status;
3983 0 : r.out.needed = _needed;
3984 :
3985 : /* Result */
3986 0 : NDR_ZERO_STRUCT(r.out.result);
3987 :
3988 0 : status = dcerpc_svcctl_QueryServiceLockStatusW_r(h, mem_ctx, &r);
3989 0 : if (!NT_STATUS_IS_OK(status)) {
3990 0 : return status;
3991 : }
3992 :
3993 : /* Return variables */
3994 0 : *_lock_status = *r.out.lock_status;
3995 0 : *_needed = *r.out.needed;
3996 :
3997 : /* Return result */
3998 0 : *result = r.out.result;
3999 :
4000 0 : return NT_STATUS_OK;
4001 : }
4002 :
4003 : struct dcerpc_svcctl_StartServiceW_r_state {
4004 : TALLOC_CTX *out_mem_ctx;
4005 : };
4006 :
4007 : static void dcerpc_svcctl_StartServiceW_r_done(struct tevent_req *subreq);
4008 :
4009 0 : struct tevent_req *dcerpc_svcctl_StartServiceW_r_send(TALLOC_CTX *mem_ctx,
4010 : struct tevent_context *ev,
4011 : struct dcerpc_binding_handle *h,
4012 : struct svcctl_StartServiceW *r)
4013 : {
4014 : struct tevent_req *req;
4015 : struct dcerpc_svcctl_StartServiceW_r_state *state;
4016 : struct tevent_req *subreq;
4017 :
4018 0 : req = tevent_req_create(mem_ctx, &state,
4019 : struct dcerpc_svcctl_StartServiceW_r_state);
4020 0 : if (req == NULL) {
4021 0 : return NULL;
4022 : }
4023 :
4024 0 : state->out_mem_ctx = NULL;
4025 :
4026 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
4027 : NULL, &ndr_table_svcctl,
4028 : NDR_SVCCTL_STARTSERVICEW, state, r);
4029 0 : if (tevent_req_nomem(subreq, req)) {
4030 0 : return tevent_req_post(req, ev);
4031 : }
4032 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_StartServiceW_r_done, req);
4033 :
4034 0 : return req;
4035 : }
4036 :
4037 0 : static void dcerpc_svcctl_StartServiceW_r_done(struct tevent_req *subreq)
4038 : {
4039 0 : struct tevent_req *req =
4040 0 : tevent_req_callback_data(subreq,
4041 : struct tevent_req);
4042 : NTSTATUS status;
4043 :
4044 0 : status = dcerpc_binding_handle_call_recv(subreq);
4045 0 : TALLOC_FREE(subreq);
4046 0 : if (tevent_req_nterror(req, status)) {
4047 0 : return;
4048 : }
4049 :
4050 0 : tevent_req_done(req);
4051 : }
4052 :
4053 0 : NTSTATUS dcerpc_svcctl_StartServiceW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4054 : {
4055 0 : struct dcerpc_svcctl_StartServiceW_r_state *state =
4056 0 : tevent_req_data(req,
4057 : struct dcerpc_svcctl_StartServiceW_r_state);
4058 : NTSTATUS status;
4059 :
4060 0 : if (tevent_req_is_nterror(req, &status)) {
4061 0 : tevent_req_received(req);
4062 0 : return status;
4063 : }
4064 :
4065 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
4066 :
4067 0 : tevent_req_received(req);
4068 0 : return NT_STATUS_OK;
4069 : }
4070 :
4071 0 : NTSTATUS dcerpc_svcctl_StartServiceW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_StartServiceW *r)
4072 : {
4073 : NTSTATUS status;
4074 :
4075 0 : status = dcerpc_binding_handle_call(h,
4076 : NULL, &ndr_table_svcctl,
4077 : NDR_SVCCTL_STARTSERVICEW, mem_ctx, r);
4078 :
4079 0 : return status;
4080 : }
4081 :
4082 : struct dcerpc_svcctl_StartServiceW_state {
4083 : struct svcctl_StartServiceW orig;
4084 : struct svcctl_StartServiceW tmp;
4085 : TALLOC_CTX *out_mem_ctx;
4086 : };
4087 :
4088 : static void dcerpc_svcctl_StartServiceW_done(struct tevent_req *subreq);
4089 :
4090 0 : struct tevent_req *dcerpc_svcctl_StartServiceW_send(TALLOC_CTX *mem_ctx,
4091 : struct tevent_context *ev,
4092 : struct dcerpc_binding_handle *h,
4093 : struct policy_handle *_handle /* [in] [ref] */,
4094 : uint32_t _NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
4095 : struct svcctl_ArgumentString *_Arguments /* [in] [size_is(NumArgs),unique] */)
4096 : {
4097 : struct tevent_req *req;
4098 : struct dcerpc_svcctl_StartServiceW_state *state;
4099 : struct tevent_req *subreq;
4100 :
4101 0 : req = tevent_req_create(mem_ctx, &state,
4102 : struct dcerpc_svcctl_StartServiceW_state);
4103 0 : if (req == NULL) {
4104 0 : return NULL;
4105 : }
4106 0 : state->out_mem_ctx = NULL;
4107 :
4108 : /* In parameters */
4109 0 : state->orig.in.handle = _handle;
4110 0 : state->orig.in.NumArgs = _NumArgs;
4111 0 : state->orig.in.Arguments = _Arguments;
4112 :
4113 : /* Out parameters */
4114 :
4115 : /* Result */
4116 0 : NDR_ZERO_STRUCT(state->orig.out.result);
4117 :
4118 : /* make a temporary copy, that we pass to the dispatch function */
4119 0 : state->tmp = state->orig;
4120 :
4121 0 : subreq = dcerpc_svcctl_StartServiceW_r_send(state, ev, h, &state->tmp);
4122 0 : if (tevent_req_nomem(subreq, req)) {
4123 0 : return tevent_req_post(req, ev);
4124 : }
4125 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_StartServiceW_done, req);
4126 0 : return req;
4127 : }
4128 :
4129 0 : static void dcerpc_svcctl_StartServiceW_done(struct tevent_req *subreq)
4130 : {
4131 0 : struct tevent_req *req = tevent_req_callback_data(
4132 : subreq, struct tevent_req);
4133 0 : struct dcerpc_svcctl_StartServiceW_state *state = tevent_req_data(
4134 : req, struct dcerpc_svcctl_StartServiceW_state);
4135 : NTSTATUS status;
4136 : TALLOC_CTX *mem_ctx;
4137 :
4138 0 : if (state->out_mem_ctx) {
4139 0 : mem_ctx = state->out_mem_ctx;
4140 : } else {
4141 0 : mem_ctx = state;
4142 : }
4143 :
4144 0 : status = dcerpc_svcctl_StartServiceW_r_recv(subreq, mem_ctx);
4145 0 : TALLOC_FREE(subreq);
4146 0 : if (tevent_req_nterror(req, status)) {
4147 0 : return;
4148 : }
4149 :
4150 : /* Copy out parameters */
4151 :
4152 : /* Copy result */
4153 0 : state->orig.out.result = state->tmp.out.result;
4154 :
4155 : /* Reset temporary structure */
4156 0 : NDR_ZERO_STRUCT(state->tmp);
4157 :
4158 0 : tevent_req_done(req);
4159 : }
4160 :
4161 0 : NTSTATUS dcerpc_svcctl_StartServiceW_recv(struct tevent_req *req,
4162 : TALLOC_CTX *mem_ctx,
4163 : WERROR *result)
4164 : {
4165 0 : struct dcerpc_svcctl_StartServiceW_state *state = tevent_req_data(
4166 : req, struct dcerpc_svcctl_StartServiceW_state);
4167 : NTSTATUS status;
4168 :
4169 0 : if (tevent_req_is_nterror(req, &status)) {
4170 0 : tevent_req_received(req);
4171 0 : return status;
4172 : }
4173 :
4174 : /* Steal possible out parameters to the callers context */
4175 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
4176 :
4177 : /* Return result */
4178 0 : *result = state->orig.out.result;
4179 :
4180 0 : tevent_req_received(req);
4181 0 : return NT_STATUS_OK;
4182 : }
4183 :
4184 0 : NTSTATUS dcerpc_svcctl_StartServiceW(struct dcerpc_binding_handle *h,
4185 : TALLOC_CTX *mem_ctx,
4186 : struct policy_handle *_handle /* [in] [ref] */,
4187 : uint32_t _NumArgs /* [in] [range(0,SC_MAX_ARGUMENTS)] */,
4188 : struct svcctl_ArgumentString *_Arguments /* [in] [size_is(NumArgs),unique] */,
4189 : WERROR *result)
4190 : {
4191 : struct svcctl_StartServiceW r;
4192 : NTSTATUS status;
4193 :
4194 : /* In parameters */
4195 0 : r.in.handle = _handle;
4196 0 : r.in.NumArgs = _NumArgs;
4197 0 : r.in.Arguments = _Arguments;
4198 :
4199 : /* Out parameters */
4200 :
4201 : /* Result */
4202 0 : NDR_ZERO_STRUCT(r.out.result);
4203 :
4204 0 : status = dcerpc_svcctl_StartServiceW_r(h, mem_ctx, &r);
4205 0 : if (!NT_STATUS_IS_OK(status)) {
4206 0 : return status;
4207 : }
4208 :
4209 : /* Return variables */
4210 :
4211 : /* Return result */
4212 0 : *result = r.out.result;
4213 :
4214 0 : return NT_STATUS_OK;
4215 : }
4216 :
4217 : struct dcerpc_svcctl_GetServiceDisplayNameW_r_state {
4218 : TALLOC_CTX *out_mem_ctx;
4219 : };
4220 :
4221 : static void dcerpc_svcctl_GetServiceDisplayNameW_r_done(struct tevent_req *subreq);
4222 :
4223 0 : struct tevent_req *dcerpc_svcctl_GetServiceDisplayNameW_r_send(TALLOC_CTX *mem_ctx,
4224 : struct tevent_context *ev,
4225 : struct dcerpc_binding_handle *h,
4226 : struct svcctl_GetServiceDisplayNameW *r)
4227 : {
4228 : struct tevent_req *req;
4229 : struct dcerpc_svcctl_GetServiceDisplayNameW_r_state *state;
4230 : struct tevent_req *subreq;
4231 :
4232 0 : req = tevent_req_create(mem_ctx, &state,
4233 : struct dcerpc_svcctl_GetServiceDisplayNameW_r_state);
4234 0 : if (req == NULL) {
4235 0 : return NULL;
4236 : }
4237 :
4238 0 : state->out_mem_ctx = talloc_new(state);
4239 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
4240 0 : return tevent_req_post(req, ev);
4241 : }
4242 :
4243 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
4244 : NULL, &ndr_table_svcctl,
4245 0 : NDR_SVCCTL_GETSERVICEDISPLAYNAMEW, state->out_mem_ctx, r);
4246 0 : if (tevent_req_nomem(subreq, req)) {
4247 0 : return tevent_req_post(req, ev);
4248 : }
4249 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_GetServiceDisplayNameW_r_done, req);
4250 :
4251 0 : return req;
4252 : }
4253 :
4254 0 : static void dcerpc_svcctl_GetServiceDisplayNameW_r_done(struct tevent_req *subreq)
4255 : {
4256 0 : struct tevent_req *req =
4257 0 : tevent_req_callback_data(subreq,
4258 : struct tevent_req);
4259 : NTSTATUS status;
4260 :
4261 0 : status = dcerpc_binding_handle_call_recv(subreq);
4262 0 : TALLOC_FREE(subreq);
4263 0 : if (tevent_req_nterror(req, status)) {
4264 0 : return;
4265 : }
4266 :
4267 0 : tevent_req_done(req);
4268 : }
4269 :
4270 0 : NTSTATUS dcerpc_svcctl_GetServiceDisplayNameW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4271 : {
4272 0 : struct dcerpc_svcctl_GetServiceDisplayNameW_r_state *state =
4273 0 : tevent_req_data(req,
4274 : struct dcerpc_svcctl_GetServiceDisplayNameW_r_state);
4275 : NTSTATUS status;
4276 :
4277 0 : if (tevent_req_is_nterror(req, &status)) {
4278 0 : tevent_req_received(req);
4279 0 : return status;
4280 : }
4281 :
4282 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
4283 :
4284 0 : tevent_req_received(req);
4285 0 : return NT_STATUS_OK;
4286 : }
4287 :
4288 0 : NTSTATUS dcerpc_svcctl_GetServiceDisplayNameW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_GetServiceDisplayNameW *r)
4289 : {
4290 : NTSTATUS status;
4291 :
4292 0 : status = dcerpc_binding_handle_call(h,
4293 : NULL, &ndr_table_svcctl,
4294 : NDR_SVCCTL_GETSERVICEDISPLAYNAMEW, mem_ctx, r);
4295 :
4296 0 : return status;
4297 : }
4298 :
4299 : struct dcerpc_svcctl_GetServiceDisplayNameW_state {
4300 : struct svcctl_GetServiceDisplayNameW orig;
4301 : struct svcctl_GetServiceDisplayNameW tmp;
4302 : TALLOC_CTX *out_mem_ctx;
4303 : };
4304 :
4305 : static void dcerpc_svcctl_GetServiceDisplayNameW_done(struct tevent_req *subreq);
4306 :
4307 0 : struct tevent_req *dcerpc_svcctl_GetServiceDisplayNameW_send(TALLOC_CTX *mem_ctx,
4308 : struct tevent_context *ev,
4309 : struct dcerpc_binding_handle *h,
4310 : struct policy_handle *_handle /* [in] [ref] */,
4311 : const char *_service_name /* [in] [charset(UTF16),unique] */,
4312 : const char **_display_name /* [out] [charset(UTF16),ref] */,
4313 : uint32_t *_display_name_length /* [in,out] [unique] */)
4314 : {
4315 : struct tevent_req *req;
4316 : struct dcerpc_svcctl_GetServiceDisplayNameW_state *state;
4317 : struct tevent_req *subreq;
4318 :
4319 0 : req = tevent_req_create(mem_ctx, &state,
4320 : struct dcerpc_svcctl_GetServiceDisplayNameW_state);
4321 0 : if (req == NULL) {
4322 0 : return NULL;
4323 : }
4324 0 : state->out_mem_ctx = NULL;
4325 :
4326 : /* In parameters */
4327 0 : state->orig.in.handle = _handle;
4328 0 : state->orig.in.service_name = _service_name;
4329 0 : state->orig.in.display_name_length = _display_name_length;
4330 :
4331 : /* Out parameters */
4332 0 : state->orig.out.display_name = _display_name;
4333 0 : state->orig.out.display_name_length = _display_name_length;
4334 :
4335 : /* Result */
4336 0 : NDR_ZERO_STRUCT(state->orig.out.result);
4337 :
4338 0 : state->out_mem_ctx = talloc_named_const(state, 0,
4339 : "dcerpc_svcctl_GetServiceDisplayNameW_out_memory");
4340 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
4341 0 : return tevent_req_post(req, ev);
4342 : }
4343 :
4344 : /* make a temporary copy, that we pass to the dispatch function */
4345 0 : state->tmp = state->orig;
4346 :
4347 0 : subreq = dcerpc_svcctl_GetServiceDisplayNameW_r_send(state, ev, h, &state->tmp);
4348 0 : if (tevent_req_nomem(subreq, req)) {
4349 0 : return tevent_req_post(req, ev);
4350 : }
4351 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_GetServiceDisplayNameW_done, req);
4352 0 : return req;
4353 : }
4354 :
4355 0 : static void dcerpc_svcctl_GetServiceDisplayNameW_done(struct tevent_req *subreq)
4356 : {
4357 0 : struct tevent_req *req = tevent_req_callback_data(
4358 : subreq, struct tevent_req);
4359 0 : struct dcerpc_svcctl_GetServiceDisplayNameW_state *state = tevent_req_data(
4360 : req, struct dcerpc_svcctl_GetServiceDisplayNameW_state);
4361 : NTSTATUS status;
4362 : TALLOC_CTX *mem_ctx;
4363 :
4364 0 : if (state->out_mem_ctx) {
4365 0 : mem_ctx = state->out_mem_ctx;
4366 : } else {
4367 0 : mem_ctx = state;
4368 : }
4369 :
4370 0 : status = dcerpc_svcctl_GetServiceDisplayNameW_r_recv(subreq, mem_ctx);
4371 0 : TALLOC_FREE(subreq);
4372 0 : if (tevent_req_nterror(req, status)) {
4373 0 : return;
4374 : }
4375 :
4376 : /* Copy out parameters */
4377 0 : *state->orig.out.display_name = *state->tmp.out.display_name;
4378 0 : if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
4379 0 : *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
4380 : }
4381 :
4382 : /* Copy result */
4383 0 : state->orig.out.result = state->tmp.out.result;
4384 :
4385 : /* Reset temporary structure */
4386 0 : NDR_ZERO_STRUCT(state->tmp);
4387 :
4388 0 : tevent_req_done(req);
4389 : }
4390 :
4391 0 : NTSTATUS dcerpc_svcctl_GetServiceDisplayNameW_recv(struct tevent_req *req,
4392 : TALLOC_CTX *mem_ctx,
4393 : WERROR *result)
4394 : {
4395 0 : struct dcerpc_svcctl_GetServiceDisplayNameW_state *state = tevent_req_data(
4396 : req, struct dcerpc_svcctl_GetServiceDisplayNameW_state);
4397 : NTSTATUS status;
4398 :
4399 0 : if (tevent_req_is_nterror(req, &status)) {
4400 0 : tevent_req_received(req);
4401 0 : return status;
4402 : }
4403 :
4404 : /* Steal possible out parameters to the callers context */
4405 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
4406 :
4407 : /* Return result */
4408 0 : *result = state->orig.out.result;
4409 :
4410 0 : tevent_req_received(req);
4411 0 : return NT_STATUS_OK;
4412 : }
4413 :
4414 0 : NTSTATUS dcerpc_svcctl_GetServiceDisplayNameW(struct dcerpc_binding_handle *h,
4415 : TALLOC_CTX *mem_ctx,
4416 : struct policy_handle *_handle /* [in] [ref] */,
4417 : const char *_service_name /* [in] [charset(UTF16),unique] */,
4418 : const char **_display_name /* [out] [charset(UTF16),ref] */,
4419 : uint32_t *_display_name_length /* [in,out] [unique] */,
4420 : WERROR *result)
4421 : {
4422 : struct svcctl_GetServiceDisplayNameW r;
4423 : NTSTATUS status;
4424 :
4425 : /* In parameters */
4426 0 : r.in.handle = _handle;
4427 0 : r.in.service_name = _service_name;
4428 0 : r.in.display_name_length = _display_name_length;
4429 :
4430 : /* Out parameters */
4431 0 : r.out.display_name = _display_name;
4432 0 : r.out.display_name_length = _display_name_length;
4433 :
4434 : /* Result */
4435 0 : NDR_ZERO_STRUCT(r.out.result);
4436 :
4437 0 : status = dcerpc_svcctl_GetServiceDisplayNameW_r(h, mem_ctx, &r);
4438 0 : if (!NT_STATUS_IS_OK(status)) {
4439 0 : return status;
4440 : }
4441 :
4442 : /* Return variables */
4443 0 : *_display_name = *r.out.display_name;
4444 0 : if (_display_name_length && r.out.display_name_length) {
4445 0 : *_display_name_length = *r.out.display_name_length;
4446 : }
4447 :
4448 : /* Return result */
4449 0 : *result = r.out.result;
4450 :
4451 0 : return NT_STATUS_OK;
4452 : }
4453 :
4454 : struct dcerpc_svcctl_GetServiceKeyNameW_r_state {
4455 : TALLOC_CTX *out_mem_ctx;
4456 : };
4457 :
4458 : static void dcerpc_svcctl_GetServiceKeyNameW_r_done(struct tevent_req *subreq);
4459 :
4460 0 : struct tevent_req *dcerpc_svcctl_GetServiceKeyNameW_r_send(TALLOC_CTX *mem_ctx,
4461 : struct tevent_context *ev,
4462 : struct dcerpc_binding_handle *h,
4463 : struct svcctl_GetServiceKeyNameW *r)
4464 : {
4465 : struct tevent_req *req;
4466 : struct dcerpc_svcctl_GetServiceKeyNameW_r_state *state;
4467 : struct tevent_req *subreq;
4468 :
4469 0 : req = tevent_req_create(mem_ctx, &state,
4470 : struct dcerpc_svcctl_GetServiceKeyNameW_r_state);
4471 0 : if (req == NULL) {
4472 0 : return NULL;
4473 : }
4474 :
4475 0 : state->out_mem_ctx = talloc_new(state);
4476 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
4477 0 : return tevent_req_post(req, ev);
4478 : }
4479 :
4480 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
4481 : NULL, &ndr_table_svcctl,
4482 0 : NDR_SVCCTL_GETSERVICEKEYNAMEW, state->out_mem_ctx, r);
4483 0 : if (tevent_req_nomem(subreq, req)) {
4484 0 : return tevent_req_post(req, ev);
4485 : }
4486 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_GetServiceKeyNameW_r_done, req);
4487 :
4488 0 : return req;
4489 : }
4490 :
4491 0 : static void dcerpc_svcctl_GetServiceKeyNameW_r_done(struct tevent_req *subreq)
4492 : {
4493 0 : struct tevent_req *req =
4494 0 : tevent_req_callback_data(subreq,
4495 : struct tevent_req);
4496 : NTSTATUS status;
4497 :
4498 0 : status = dcerpc_binding_handle_call_recv(subreq);
4499 0 : TALLOC_FREE(subreq);
4500 0 : if (tevent_req_nterror(req, status)) {
4501 0 : return;
4502 : }
4503 :
4504 0 : tevent_req_done(req);
4505 : }
4506 :
4507 0 : NTSTATUS dcerpc_svcctl_GetServiceKeyNameW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4508 : {
4509 0 : struct dcerpc_svcctl_GetServiceKeyNameW_r_state *state =
4510 0 : tevent_req_data(req,
4511 : struct dcerpc_svcctl_GetServiceKeyNameW_r_state);
4512 : NTSTATUS status;
4513 :
4514 0 : if (tevent_req_is_nterror(req, &status)) {
4515 0 : tevent_req_received(req);
4516 0 : return status;
4517 : }
4518 :
4519 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
4520 :
4521 0 : tevent_req_received(req);
4522 0 : return NT_STATUS_OK;
4523 : }
4524 :
4525 0 : NTSTATUS dcerpc_svcctl_GetServiceKeyNameW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_GetServiceKeyNameW *r)
4526 : {
4527 : NTSTATUS status;
4528 :
4529 0 : status = dcerpc_binding_handle_call(h,
4530 : NULL, &ndr_table_svcctl,
4531 : NDR_SVCCTL_GETSERVICEKEYNAMEW, mem_ctx, r);
4532 :
4533 0 : return status;
4534 : }
4535 :
4536 : struct dcerpc_svcctl_GetServiceKeyNameW_state {
4537 : struct svcctl_GetServiceKeyNameW orig;
4538 : struct svcctl_GetServiceKeyNameW tmp;
4539 : TALLOC_CTX *out_mem_ctx;
4540 : };
4541 :
4542 : static void dcerpc_svcctl_GetServiceKeyNameW_done(struct tevent_req *subreq);
4543 :
4544 0 : struct tevent_req *dcerpc_svcctl_GetServiceKeyNameW_send(TALLOC_CTX *mem_ctx,
4545 : struct tevent_context *ev,
4546 : struct dcerpc_binding_handle *h,
4547 : struct policy_handle *_handle /* [in] [ref] */,
4548 : const char *_service_name /* [in] [charset(UTF16),unique] */,
4549 : const char **_key_name /* [out] [charset(UTF16),ref] */,
4550 : uint32_t *_display_name_length /* [in,out] [unique] */)
4551 : {
4552 : struct tevent_req *req;
4553 : struct dcerpc_svcctl_GetServiceKeyNameW_state *state;
4554 : struct tevent_req *subreq;
4555 :
4556 0 : req = tevent_req_create(mem_ctx, &state,
4557 : struct dcerpc_svcctl_GetServiceKeyNameW_state);
4558 0 : if (req == NULL) {
4559 0 : return NULL;
4560 : }
4561 0 : state->out_mem_ctx = NULL;
4562 :
4563 : /* In parameters */
4564 0 : state->orig.in.handle = _handle;
4565 0 : state->orig.in.service_name = _service_name;
4566 0 : state->orig.in.display_name_length = _display_name_length;
4567 :
4568 : /* Out parameters */
4569 0 : state->orig.out.key_name = _key_name;
4570 0 : state->orig.out.display_name_length = _display_name_length;
4571 :
4572 : /* Result */
4573 0 : NDR_ZERO_STRUCT(state->orig.out.result);
4574 :
4575 0 : state->out_mem_ctx = talloc_named_const(state, 0,
4576 : "dcerpc_svcctl_GetServiceKeyNameW_out_memory");
4577 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
4578 0 : return tevent_req_post(req, ev);
4579 : }
4580 :
4581 : /* make a temporary copy, that we pass to the dispatch function */
4582 0 : state->tmp = state->orig;
4583 :
4584 0 : subreq = dcerpc_svcctl_GetServiceKeyNameW_r_send(state, ev, h, &state->tmp);
4585 0 : if (tevent_req_nomem(subreq, req)) {
4586 0 : return tevent_req_post(req, ev);
4587 : }
4588 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_GetServiceKeyNameW_done, req);
4589 0 : return req;
4590 : }
4591 :
4592 0 : static void dcerpc_svcctl_GetServiceKeyNameW_done(struct tevent_req *subreq)
4593 : {
4594 0 : struct tevent_req *req = tevent_req_callback_data(
4595 : subreq, struct tevent_req);
4596 0 : struct dcerpc_svcctl_GetServiceKeyNameW_state *state = tevent_req_data(
4597 : req, struct dcerpc_svcctl_GetServiceKeyNameW_state);
4598 : NTSTATUS status;
4599 : TALLOC_CTX *mem_ctx;
4600 :
4601 0 : if (state->out_mem_ctx) {
4602 0 : mem_ctx = state->out_mem_ctx;
4603 : } else {
4604 0 : mem_ctx = state;
4605 : }
4606 :
4607 0 : status = dcerpc_svcctl_GetServiceKeyNameW_r_recv(subreq, mem_ctx);
4608 0 : TALLOC_FREE(subreq);
4609 0 : if (tevent_req_nterror(req, status)) {
4610 0 : return;
4611 : }
4612 :
4613 : /* Copy out parameters */
4614 0 : *state->orig.out.key_name = *state->tmp.out.key_name;
4615 0 : if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
4616 0 : *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
4617 : }
4618 :
4619 : /* Copy result */
4620 0 : state->orig.out.result = state->tmp.out.result;
4621 :
4622 : /* Reset temporary structure */
4623 0 : NDR_ZERO_STRUCT(state->tmp);
4624 :
4625 0 : tevent_req_done(req);
4626 : }
4627 :
4628 0 : NTSTATUS dcerpc_svcctl_GetServiceKeyNameW_recv(struct tevent_req *req,
4629 : TALLOC_CTX *mem_ctx,
4630 : WERROR *result)
4631 : {
4632 0 : struct dcerpc_svcctl_GetServiceKeyNameW_state *state = tevent_req_data(
4633 : req, struct dcerpc_svcctl_GetServiceKeyNameW_state);
4634 : NTSTATUS status;
4635 :
4636 0 : if (tevent_req_is_nterror(req, &status)) {
4637 0 : tevent_req_received(req);
4638 0 : return status;
4639 : }
4640 :
4641 : /* Steal possible out parameters to the callers context */
4642 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
4643 :
4644 : /* Return result */
4645 0 : *result = state->orig.out.result;
4646 :
4647 0 : tevent_req_received(req);
4648 0 : return NT_STATUS_OK;
4649 : }
4650 :
4651 0 : NTSTATUS dcerpc_svcctl_GetServiceKeyNameW(struct dcerpc_binding_handle *h,
4652 : TALLOC_CTX *mem_ctx,
4653 : struct policy_handle *_handle /* [in] [ref] */,
4654 : const char *_service_name /* [in] [charset(UTF16),unique] */,
4655 : const char **_key_name /* [out] [charset(UTF16),ref] */,
4656 : uint32_t *_display_name_length /* [in,out] [unique] */,
4657 : WERROR *result)
4658 : {
4659 : struct svcctl_GetServiceKeyNameW r;
4660 : NTSTATUS status;
4661 :
4662 : /* In parameters */
4663 0 : r.in.handle = _handle;
4664 0 : r.in.service_name = _service_name;
4665 0 : r.in.display_name_length = _display_name_length;
4666 :
4667 : /* Out parameters */
4668 0 : r.out.key_name = _key_name;
4669 0 : r.out.display_name_length = _display_name_length;
4670 :
4671 : /* Result */
4672 0 : NDR_ZERO_STRUCT(r.out.result);
4673 :
4674 0 : status = dcerpc_svcctl_GetServiceKeyNameW_r(h, mem_ctx, &r);
4675 0 : if (!NT_STATUS_IS_OK(status)) {
4676 0 : return status;
4677 : }
4678 :
4679 : /* Return variables */
4680 0 : *_key_name = *r.out.key_name;
4681 0 : if (_display_name_length && r.out.display_name_length) {
4682 0 : *_display_name_length = *r.out.display_name_length;
4683 : }
4684 :
4685 : /* Return result */
4686 0 : *result = r.out.result;
4687 :
4688 0 : return NT_STATUS_OK;
4689 : }
4690 :
4691 : struct dcerpc_svcctl_SCSetServiceBitsA_r_state {
4692 : TALLOC_CTX *out_mem_ctx;
4693 : };
4694 :
4695 : static void dcerpc_svcctl_SCSetServiceBitsA_r_done(struct tevent_req *subreq);
4696 :
4697 0 : struct tevent_req *dcerpc_svcctl_SCSetServiceBitsA_r_send(TALLOC_CTX *mem_ctx,
4698 : struct tevent_context *ev,
4699 : struct dcerpc_binding_handle *h,
4700 : struct svcctl_SCSetServiceBitsA *r)
4701 : {
4702 : struct tevent_req *req;
4703 : struct dcerpc_svcctl_SCSetServiceBitsA_r_state *state;
4704 : struct tevent_req *subreq;
4705 :
4706 0 : req = tevent_req_create(mem_ctx, &state,
4707 : struct dcerpc_svcctl_SCSetServiceBitsA_r_state);
4708 0 : if (req == NULL) {
4709 0 : return NULL;
4710 : }
4711 :
4712 0 : state->out_mem_ctx = NULL;
4713 :
4714 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
4715 : NULL, &ndr_table_svcctl,
4716 : NDR_SVCCTL_SCSETSERVICEBITSA, state, r);
4717 0 : if (tevent_req_nomem(subreq, req)) {
4718 0 : return tevent_req_post(req, ev);
4719 : }
4720 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_SCSetServiceBitsA_r_done, req);
4721 :
4722 0 : return req;
4723 : }
4724 :
4725 0 : static void dcerpc_svcctl_SCSetServiceBitsA_r_done(struct tevent_req *subreq)
4726 : {
4727 0 : struct tevent_req *req =
4728 0 : tevent_req_callback_data(subreq,
4729 : struct tevent_req);
4730 : NTSTATUS status;
4731 :
4732 0 : status = dcerpc_binding_handle_call_recv(subreq);
4733 0 : TALLOC_FREE(subreq);
4734 0 : if (tevent_req_nterror(req, status)) {
4735 0 : return;
4736 : }
4737 :
4738 0 : tevent_req_done(req);
4739 : }
4740 :
4741 0 : NTSTATUS dcerpc_svcctl_SCSetServiceBitsA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4742 : {
4743 0 : struct dcerpc_svcctl_SCSetServiceBitsA_r_state *state =
4744 0 : tevent_req_data(req,
4745 : struct dcerpc_svcctl_SCSetServiceBitsA_r_state);
4746 : NTSTATUS status;
4747 :
4748 0 : if (tevent_req_is_nterror(req, &status)) {
4749 0 : tevent_req_received(req);
4750 0 : return status;
4751 : }
4752 :
4753 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
4754 :
4755 0 : tevent_req_received(req);
4756 0 : return NT_STATUS_OK;
4757 : }
4758 :
4759 0 : NTSTATUS dcerpc_svcctl_SCSetServiceBitsA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_SCSetServiceBitsA *r)
4760 : {
4761 : NTSTATUS status;
4762 :
4763 0 : status = dcerpc_binding_handle_call(h,
4764 : NULL, &ndr_table_svcctl,
4765 : NDR_SVCCTL_SCSETSERVICEBITSA, mem_ctx, r);
4766 :
4767 0 : return status;
4768 : }
4769 :
4770 : struct dcerpc_svcctl_SCSetServiceBitsA_state {
4771 : struct svcctl_SCSetServiceBitsA orig;
4772 : struct svcctl_SCSetServiceBitsA tmp;
4773 : TALLOC_CTX *out_mem_ctx;
4774 : };
4775 :
4776 : static void dcerpc_svcctl_SCSetServiceBitsA_done(struct tevent_req *subreq);
4777 :
4778 0 : struct tevent_req *dcerpc_svcctl_SCSetServiceBitsA_send(TALLOC_CTX *mem_ctx,
4779 : struct tevent_context *ev,
4780 : struct dcerpc_binding_handle *h,
4781 : struct policy_handle *_handle /* [in] [ref] */,
4782 : uint32_t _bits /* [in] */,
4783 : uint32_t _bitson /* [in] */,
4784 : uint32_t _immediate /* [in] */)
4785 : {
4786 : struct tevent_req *req;
4787 : struct dcerpc_svcctl_SCSetServiceBitsA_state *state;
4788 : struct tevent_req *subreq;
4789 :
4790 0 : req = tevent_req_create(mem_ctx, &state,
4791 : struct dcerpc_svcctl_SCSetServiceBitsA_state);
4792 0 : if (req == NULL) {
4793 0 : return NULL;
4794 : }
4795 0 : state->out_mem_ctx = NULL;
4796 :
4797 : /* In parameters */
4798 0 : state->orig.in.handle = _handle;
4799 0 : state->orig.in.bits = _bits;
4800 0 : state->orig.in.bitson = _bitson;
4801 0 : state->orig.in.immediate = _immediate;
4802 :
4803 : /* Out parameters */
4804 :
4805 : /* Result */
4806 0 : NDR_ZERO_STRUCT(state->orig.out.result);
4807 :
4808 : /* make a temporary copy, that we pass to the dispatch function */
4809 0 : state->tmp = state->orig;
4810 :
4811 0 : subreq = dcerpc_svcctl_SCSetServiceBitsA_r_send(state, ev, h, &state->tmp);
4812 0 : if (tevent_req_nomem(subreq, req)) {
4813 0 : return tevent_req_post(req, ev);
4814 : }
4815 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_SCSetServiceBitsA_done, req);
4816 0 : return req;
4817 : }
4818 :
4819 0 : static void dcerpc_svcctl_SCSetServiceBitsA_done(struct tevent_req *subreq)
4820 : {
4821 0 : struct tevent_req *req = tevent_req_callback_data(
4822 : subreq, struct tevent_req);
4823 0 : struct dcerpc_svcctl_SCSetServiceBitsA_state *state = tevent_req_data(
4824 : req, struct dcerpc_svcctl_SCSetServiceBitsA_state);
4825 : NTSTATUS status;
4826 : TALLOC_CTX *mem_ctx;
4827 :
4828 0 : if (state->out_mem_ctx) {
4829 0 : mem_ctx = state->out_mem_ctx;
4830 : } else {
4831 0 : mem_ctx = state;
4832 : }
4833 :
4834 0 : status = dcerpc_svcctl_SCSetServiceBitsA_r_recv(subreq, mem_ctx);
4835 0 : TALLOC_FREE(subreq);
4836 0 : if (tevent_req_nterror(req, status)) {
4837 0 : return;
4838 : }
4839 :
4840 : /* Copy out parameters */
4841 :
4842 : /* Copy result */
4843 0 : state->orig.out.result = state->tmp.out.result;
4844 :
4845 : /* Reset temporary structure */
4846 0 : NDR_ZERO_STRUCT(state->tmp);
4847 :
4848 0 : tevent_req_done(req);
4849 : }
4850 :
4851 0 : NTSTATUS dcerpc_svcctl_SCSetServiceBitsA_recv(struct tevent_req *req,
4852 : TALLOC_CTX *mem_ctx,
4853 : WERROR *result)
4854 : {
4855 0 : struct dcerpc_svcctl_SCSetServiceBitsA_state *state = tevent_req_data(
4856 : req, struct dcerpc_svcctl_SCSetServiceBitsA_state);
4857 : NTSTATUS status;
4858 :
4859 0 : if (tevent_req_is_nterror(req, &status)) {
4860 0 : tevent_req_received(req);
4861 0 : return status;
4862 : }
4863 :
4864 : /* Steal possible out parameters to the callers context */
4865 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
4866 :
4867 : /* Return result */
4868 0 : *result = state->orig.out.result;
4869 :
4870 0 : tevent_req_received(req);
4871 0 : return NT_STATUS_OK;
4872 : }
4873 :
4874 0 : NTSTATUS dcerpc_svcctl_SCSetServiceBitsA(struct dcerpc_binding_handle *h,
4875 : TALLOC_CTX *mem_ctx,
4876 : struct policy_handle *_handle /* [in] [ref] */,
4877 : uint32_t _bits /* [in] */,
4878 : uint32_t _bitson /* [in] */,
4879 : uint32_t _immediate /* [in] */,
4880 : WERROR *result)
4881 : {
4882 : struct svcctl_SCSetServiceBitsA r;
4883 : NTSTATUS status;
4884 :
4885 : /* In parameters */
4886 0 : r.in.handle = _handle;
4887 0 : r.in.bits = _bits;
4888 0 : r.in.bitson = _bitson;
4889 0 : r.in.immediate = _immediate;
4890 :
4891 : /* Out parameters */
4892 :
4893 : /* Result */
4894 0 : NDR_ZERO_STRUCT(r.out.result);
4895 :
4896 0 : status = dcerpc_svcctl_SCSetServiceBitsA_r(h, mem_ctx, &r);
4897 0 : if (!NT_STATUS_IS_OK(status)) {
4898 0 : return status;
4899 : }
4900 :
4901 : /* Return variables */
4902 :
4903 : /* Return result */
4904 0 : *result = r.out.result;
4905 :
4906 0 : return NT_STATUS_OK;
4907 : }
4908 :
4909 : struct dcerpc_svcctl_ChangeServiceConfigA_r_state {
4910 : TALLOC_CTX *out_mem_ctx;
4911 : };
4912 :
4913 : static void dcerpc_svcctl_ChangeServiceConfigA_r_done(struct tevent_req *subreq);
4914 :
4915 0 : struct tevent_req *dcerpc_svcctl_ChangeServiceConfigA_r_send(TALLOC_CTX *mem_ctx,
4916 : struct tevent_context *ev,
4917 : struct dcerpc_binding_handle *h,
4918 : struct svcctl_ChangeServiceConfigA *r)
4919 : {
4920 : struct tevent_req *req;
4921 : struct dcerpc_svcctl_ChangeServiceConfigA_r_state *state;
4922 : struct tevent_req *subreq;
4923 :
4924 0 : req = tevent_req_create(mem_ctx, &state,
4925 : struct dcerpc_svcctl_ChangeServiceConfigA_r_state);
4926 0 : if (req == NULL) {
4927 0 : return NULL;
4928 : }
4929 :
4930 0 : state->out_mem_ctx = talloc_new(state);
4931 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
4932 0 : return tevent_req_post(req, ev);
4933 : }
4934 :
4935 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
4936 : NULL, &ndr_table_svcctl,
4937 0 : NDR_SVCCTL_CHANGESERVICECONFIGA, state->out_mem_ctx, r);
4938 0 : if (tevent_req_nomem(subreq, req)) {
4939 0 : return tevent_req_post(req, ev);
4940 : }
4941 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ChangeServiceConfigA_r_done, req);
4942 :
4943 0 : return req;
4944 : }
4945 :
4946 0 : static void dcerpc_svcctl_ChangeServiceConfigA_r_done(struct tevent_req *subreq)
4947 : {
4948 0 : struct tevent_req *req =
4949 0 : tevent_req_callback_data(subreq,
4950 : struct tevent_req);
4951 : NTSTATUS status;
4952 :
4953 0 : status = dcerpc_binding_handle_call_recv(subreq);
4954 0 : TALLOC_FREE(subreq);
4955 0 : if (tevent_req_nterror(req, status)) {
4956 0 : return;
4957 : }
4958 :
4959 0 : tevent_req_done(req);
4960 : }
4961 :
4962 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfigA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4963 : {
4964 0 : struct dcerpc_svcctl_ChangeServiceConfigA_r_state *state =
4965 0 : tevent_req_data(req,
4966 : struct dcerpc_svcctl_ChangeServiceConfigA_r_state);
4967 : NTSTATUS status;
4968 :
4969 0 : if (tevent_req_is_nterror(req, &status)) {
4970 0 : tevent_req_received(req);
4971 0 : return status;
4972 : }
4973 :
4974 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
4975 :
4976 0 : tevent_req_received(req);
4977 0 : return NT_STATUS_OK;
4978 : }
4979 :
4980 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfigA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_ChangeServiceConfigA *r)
4981 : {
4982 : NTSTATUS status;
4983 :
4984 0 : status = dcerpc_binding_handle_call(h,
4985 : NULL, &ndr_table_svcctl,
4986 : NDR_SVCCTL_CHANGESERVICECONFIGA, mem_ctx, r);
4987 :
4988 0 : return status;
4989 : }
4990 :
4991 : struct dcerpc_svcctl_ChangeServiceConfigA_state {
4992 : struct svcctl_ChangeServiceConfigA orig;
4993 : struct svcctl_ChangeServiceConfigA tmp;
4994 : TALLOC_CTX *out_mem_ctx;
4995 : };
4996 :
4997 : static void dcerpc_svcctl_ChangeServiceConfigA_done(struct tevent_req *subreq);
4998 :
4999 0 : struct tevent_req *dcerpc_svcctl_ChangeServiceConfigA_send(TALLOC_CTX *mem_ctx,
5000 : struct tevent_context *ev,
5001 : struct dcerpc_binding_handle *h,
5002 : struct policy_handle *_handle /* [in] [ref] */,
5003 : uint32_t _type /* [in] */,
5004 : enum svcctl_StartType _start_type /* [in] */,
5005 : enum svcctl_ErrorControl _error_control /* [in] */,
5006 : const char *_binary_path /* [in] [charset(UTF16),unique] */,
5007 : const char *_load_order_group /* [in] [charset(UTF16),unique] */,
5008 : uint32_t *_tag_id /* [out] [ref] */,
5009 : const char *_dependencies /* [in] [charset(UTF16),unique] */,
5010 : const char *_service_start_name /* [in] [charset(UTF16),unique] */,
5011 : const char *_password /* [in] [charset(UTF16),unique] */,
5012 : const char *_display_name /* [in] [charset(UTF16),unique] */)
5013 : {
5014 : struct tevent_req *req;
5015 : struct dcerpc_svcctl_ChangeServiceConfigA_state *state;
5016 : struct tevent_req *subreq;
5017 :
5018 0 : req = tevent_req_create(mem_ctx, &state,
5019 : struct dcerpc_svcctl_ChangeServiceConfigA_state);
5020 0 : if (req == NULL) {
5021 0 : return NULL;
5022 : }
5023 0 : state->out_mem_ctx = NULL;
5024 :
5025 : /* In parameters */
5026 0 : state->orig.in.handle = _handle;
5027 0 : state->orig.in.type = _type;
5028 0 : state->orig.in.start_type = _start_type;
5029 0 : state->orig.in.error_control = _error_control;
5030 0 : state->orig.in.binary_path = _binary_path;
5031 0 : state->orig.in.load_order_group = _load_order_group;
5032 0 : state->orig.in.dependencies = _dependencies;
5033 0 : state->orig.in.service_start_name = _service_start_name;
5034 0 : state->orig.in.password = _password;
5035 0 : state->orig.in.display_name = _display_name;
5036 :
5037 : /* Out parameters */
5038 0 : state->orig.out.tag_id = _tag_id;
5039 :
5040 : /* Result */
5041 0 : NDR_ZERO_STRUCT(state->orig.out.result);
5042 :
5043 0 : state->out_mem_ctx = talloc_named_const(state, 0,
5044 : "dcerpc_svcctl_ChangeServiceConfigA_out_memory");
5045 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
5046 0 : return tevent_req_post(req, ev);
5047 : }
5048 :
5049 : /* make a temporary copy, that we pass to the dispatch function */
5050 0 : state->tmp = state->orig;
5051 :
5052 0 : subreq = dcerpc_svcctl_ChangeServiceConfigA_r_send(state, ev, h, &state->tmp);
5053 0 : if (tevent_req_nomem(subreq, req)) {
5054 0 : return tevent_req_post(req, ev);
5055 : }
5056 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ChangeServiceConfigA_done, req);
5057 0 : return req;
5058 : }
5059 :
5060 0 : static void dcerpc_svcctl_ChangeServiceConfigA_done(struct tevent_req *subreq)
5061 : {
5062 0 : struct tevent_req *req = tevent_req_callback_data(
5063 : subreq, struct tevent_req);
5064 0 : struct dcerpc_svcctl_ChangeServiceConfigA_state *state = tevent_req_data(
5065 : req, struct dcerpc_svcctl_ChangeServiceConfigA_state);
5066 : NTSTATUS status;
5067 : TALLOC_CTX *mem_ctx;
5068 :
5069 0 : if (state->out_mem_ctx) {
5070 0 : mem_ctx = state->out_mem_ctx;
5071 : } else {
5072 0 : mem_ctx = state;
5073 : }
5074 :
5075 0 : status = dcerpc_svcctl_ChangeServiceConfigA_r_recv(subreq, mem_ctx);
5076 0 : TALLOC_FREE(subreq);
5077 0 : if (tevent_req_nterror(req, status)) {
5078 0 : return;
5079 : }
5080 :
5081 : /* Copy out parameters */
5082 0 : *state->orig.out.tag_id = *state->tmp.out.tag_id;
5083 :
5084 : /* Copy result */
5085 0 : state->orig.out.result = state->tmp.out.result;
5086 :
5087 : /* Reset temporary structure */
5088 0 : NDR_ZERO_STRUCT(state->tmp);
5089 :
5090 0 : tevent_req_done(req);
5091 : }
5092 :
5093 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfigA_recv(struct tevent_req *req,
5094 : TALLOC_CTX *mem_ctx,
5095 : WERROR *result)
5096 : {
5097 0 : struct dcerpc_svcctl_ChangeServiceConfigA_state *state = tevent_req_data(
5098 : req, struct dcerpc_svcctl_ChangeServiceConfigA_state);
5099 : NTSTATUS status;
5100 :
5101 0 : if (tevent_req_is_nterror(req, &status)) {
5102 0 : tevent_req_received(req);
5103 0 : return status;
5104 : }
5105 :
5106 : /* Steal possible out parameters to the callers context */
5107 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
5108 :
5109 : /* Return result */
5110 0 : *result = state->orig.out.result;
5111 :
5112 0 : tevent_req_received(req);
5113 0 : return NT_STATUS_OK;
5114 : }
5115 :
5116 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfigA(struct dcerpc_binding_handle *h,
5117 : TALLOC_CTX *mem_ctx,
5118 : struct policy_handle *_handle /* [in] [ref] */,
5119 : uint32_t _type /* [in] */,
5120 : enum svcctl_StartType _start_type /* [in] */,
5121 : enum svcctl_ErrorControl _error_control /* [in] */,
5122 : const char *_binary_path /* [in] [charset(UTF16),unique] */,
5123 : const char *_load_order_group /* [in] [charset(UTF16),unique] */,
5124 : uint32_t *_tag_id /* [out] [ref] */,
5125 : const char *_dependencies /* [in] [charset(UTF16),unique] */,
5126 : const char *_service_start_name /* [in] [charset(UTF16),unique] */,
5127 : const char *_password /* [in] [charset(UTF16),unique] */,
5128 : const char *_display_name /* [in] [charset(UTF16),unique] */,
5129 : WERROR *result)
5130 : {
5131 : struct svcctl_ChangeServiceConfigA r;
5132 : NTSTATUS status;
5133 :
5134 : /* In parameters */
5135 0 : r.in.handle = _handle;
5136 0 : r.in.type = _type;
5137 0 : r.in.start_type = _start_type;
5138 0 : r.in.error_control = _error_control;
5139 0 : r.in.binary_path = _binary_path;
5140 0 : r.in.load_order_group = _load_order_group;
5141 0 : r.in.dependencies = _dependencies;
5142 0 : r.in.service_start_name = _service_start_name;
5143 0 : r.in.password = _password;
5144 0 : r.in.display_name = _display_name;
5145 :
5146 : /* Out parameters */
5147 0 : r.out.tag_id = _tag_id;
5148 :
5149 : /* Result */
5150 0 : NDR_ZERO_STRUCT(r.out.result);
5151 :
5152 0 : status = dcerpc_svcctl_ChangeServiceConfigA_r(h, mem_ctx, &r);
5153 0 : if (!NT_STATUS_IS_OK(status)) {
5154 0 : return status;
5155 : }
5156 :
5157 : /* Return variables */
5158 0 : *_tag_id = *r.out.tag_id;
5159 :
5160 : /* Return result */
5161 0 : *result = r.out.result;
5162 :
5163 0 : return NT_STATUS_OK;
5164 : }
5165 :
5166 : struct dcerpc_svcctl_CreateServiceA_r_state {
5167 : TALLOC_CTX *out_mem_ctx;
5168 : };
5169 :
5170 : static void dcerpc_svcctl_CreateServiceA_r_done(struct tevent_req *subreq);
5171 :
5172 0 : struct tevent_req *dcerpc_svcctl_CreateServiceA_r_send(TALLOC_CTX *mem_ctx,
5173 : struct tevent_context *ev,
5174 : struct dcerpc_binding_handle *h,
5175 : struct svcctl_CreateServiceA *r)
5176 : {
5177 : struct tevent_req *req;
5178 : struct dcerpc_svcctl_CreateServiceA_r_state *state;
5179 : struct tevent_req *subreq;
5180 :
5181 0 : req = tevent_req_create(mem_ctx, &state,
5182 : struct dcerpc_svcctl_CreateServiceA_r_state);
5183 0 : if (req == NULL) {
5184 0 : return NULL;
5185 : }
5186 :
5187 0 : state->out_mem_ctx = talloc_new(state);
5188 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
5189 0 : return tevent_req_post(req, ev);
5190 : }
5191 :
5192 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
5193 : NULL, &ndr_table_svcctl,
5194 0 : NDR_SVCCTL_CREATESERVICEA, state->out_mem_ctx, r);
5195 0 : if (tevent_req_nomem(subreq, req)) {
5196 0 : return tevent_req_post(req, ev);
5197 : }
5198 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_CreateServiceA_r_done, req);
5199 :
5200 0 : return req;
5201 : }
5202 :
5203 0 : static void dcerpc_svcctl_CreateServiceA_r_done(struct tevent_req *subreq)
5204 : {
5205 0 : struct tevent_req *req =
5206 0 : tevent_req_callback_data(subreq,
5207 : struct tevent_req);
5208 : NTSTATUS status;
5209 :
5210 0 : status = dcerpc_binding_handle_call_recv(subreq);
5211 0 : TALLOC_FREE(subreq);
5212 0 : if (tevent_req_nterror(req, status)) {
5213 0 : return;
5214 : }
5215 :
5216 0 : tevent_req_done(req);
5217 : }
5218 :
5219 0 : NTSTATUS dcerpc_svcctl_CreateServiceA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5220 : {
5221 0 : struct dcerpc_svcctl_CreateServiceA_r_state *state =
5222 0 : tevent_req_data(req,
5223 : struct dcerpc_svcctl_CreateServiceA_r_state);
5224 : NTSTATUS status;
5225 :
5226 0 : if (tevent_req_is_nterror(req, &status)) {
5227 0 : tevent_req_received(req);
5228 0 : return status;
5229 : }
5230 :
5231 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
5232 :
5233 0 : tevent_req_received(req);
5234 0 : return NT_STATUS_OK;
5235 : }
5236 :
5237 0 : NTSTATUS dcerpc_svcctl_CreateServiceA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_CreateServiceA *r)
5238 : {
5239 : NTSTATUS status;
5240 :
5241 0 : status = dcerpc_binding_handle_call(h,
5242 : NULL, &ndr_table_svcctl,
5243 : NDR_SVCCTL_CREATESERVICEA, mem_ctx, r);
5244 :
5245 0 : return status;
5246 : }
5247 :
5248 : struct dcerpc_svcctl_CreateServiceA_state {
5249 : struct svcctl_CreateServiceA orig;
5250 : struct svcctl_CreateServiceA tmp;
5251 : TALLOC_CTX *out_mem_ctx;
5252 : };
5253 :
5254 : static void dcerpc_svcctl_CreateServiceA_done(struct tevent_req *subreq);
5255 :
5256 0 : struct tevent_req *dcerpc_svcctl_CreateServiceA_send(TALLOC_CTX *mem_ctx,
5257 : struct tevent_context *ev,
5258 : struct dcerpc_binding_handle *h,
5259 : struct policy_handle *_handle /* [in] [ref] */,
5260 : const char *_ServiceName /* [in] [charset(UTF16),unique] */,
5261 : const char *_DisplayName /* [in] [charset(UTF16),unique] */,
5262 : uint32_t _desired_access /* [in] */,
5263 : uint32_t _type /* [in] */,
5264 : enum svcctl_StartType _start_type /* [in] */,
5265 : enum svcctl_ErrorControl _error_control /* [in] */,
5266 : const char *_binary_path /* [in] [charset(UTF16),unique] */,
5267 : const char *_LoadOrderGroupKey /* [in] [charset(UTF16),unique] */,
5268 : uint32_t *_TagId /* [out] [unique] */,
5269 : const char *_dependencies /* [in] [charset(UTF16),unique] */,
5270 : const char *_service_start_name /* [in] [charset(UTF16),unique] */,
5271 : const char *_password /* [in] [charset(UTF16),unique] */)
5272 : {
5273 : struct tevent_req *req;
5274 : struct dcerpc_svcctl_CreateServiceA_state *state;
5275 : struct tevent_req *subreq;
5276 :
5277 0 : req = tevent_req_create(mem_ctx, &state,
5278 : struct dcerpc_svcctl_CreateServiceA_state);
5279 0 : if (req == NULL) {
5280 0 : return NULL;
5281 : }
5282 0 : state->out_mem_ctx = NULL;
5283 :
5284 : /* In parameters */
5285 0 : state->orig.in.handle = _handle;
5286 0 : state->orig.in.ServiceName = _ServiceName;
5287 0 : state->orig.in.DisplayName = _DisplayName;
5288 0 : state->orig.in.desired_access = _desired_access;
5289 0 : state->orig.in.type = _type;
5290 0 : state->orig.in.start_type = _start_type;
5291 0 : state->orig.in.error_control = _error_control;
5292 0 : state->orig.in.binary_path = _binary_path;
5293 0 : state->orig.in.LoadOrderGroupKey = _LoadOrderGroupKey;
5294 0 : state->orig.in.dependencies = _dependencies;
5295 0 : state->orig.in.service_start_name = _service_start_name;
5296 0 : state->orig.in.password = _password;
5297 :
5298 : /* Out parameters */
5299 0 : state->orig.out.TagId = _TagId;
5300 :
5301 : /* Result */
5302 0 : NDR_ZERO_STRUCT(state->orig.out.result);
5303 :
5304 0 : state->out_mem_ctx = talloc_named_const(state, 0,
5305 : "dcerpc_svcctl_CreateServiceA_out_memory");
5306 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
5307 0 : return tevent_req_post(req, ev);
5308 : }
5309 :
5310 : /* make a temporary copy, that we pass to the dispatch function */
5311 0 : state->tmp = state->orig;
5312 :
5313 0 : subreq = dcerpc_svcctl_CreateServiceA_r_send(state, ev, h, &state->tmp);
5314 0 : if (tevent_req_nomem(subreq, req)) {
5315 0 : return tevent_req_post(req, ev);
5316 : }
5317 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_CreateServiceA_done, req);
5318 0 : return req;
5319 : }
5320 :
5321 0 : static void dcerpc_svcctl_CreateServiceA_done(struct tevent_req *subreq)
5322 : {
5323 0 : struct tevent_req *req = tevent_req_callback_data(
5324 : subreq, struct tevent_req);
5325 0 : struct dcerpc_svcctl_CreateServiceA_state *state = tevent_req_data(
5326 : req, struct dcerpc_svcctl_CreateServiceA_state);
5327 : NTSTATUS status;
5328 : TALLOC_CTX *mem_ctx;
5329 :
5330 0 : if (state->out_mem_ctx) {
5331 0 : mem_ctx = state->out_mem_ctx;
5332 : } else {
5333 0 : mem_ctx = state;
5334 : }
5335 :
5336 0 : status = dcerpc_svcctl_CreateServiceA_r_recv(subreq, mem_ctx);
5337 0 : TALLOC_FREE(subreq);
5338 0 : if (tevent_req_nterror(req, status)) {
5339 0 : return;
5340 : }
5341 :
5342 : /* Copy out parameters */
5343 0 : if (state->orig.out.TagId && state->tmp.out.TagId) {
5344 0 : *state->orig.out.TagId = *state->tmp.out.TagId;
5345 : }
5346 :
5347 : /* Copy result */
5348 0 : state->orig.out.result = state->tmp.out.result;
5349 :
5350 : /* Reset temporary structure */
5351 0 : NDR_ZERO_STRUCT(state->tmp);
5352 :
5353 0 : tevent_req_done(req);
5354 : }
5355 :
5356 0 : NTSTATUS dcerpc_svcctl_CreateServiceA_recv(struct tevent_req *req,
5357 : TALLOC_CTX *mem_ctx,
5358 : WERROR *result)
5359 : {
5360 0 : struct dcerpc_svcctl_CreateServiceA_state *state = tevent_req_data(
5361 : req, struct dcerpc_svcctl_CreateServiceA_state);
5362 : NTSTATUS status;
5363 :
5364 0 : if (tevent_req_is_nterror(req, &status)) {
5365 0 : tevent_req_received(req);
5366 0 : return status;
5367 : }
5368 :
5369 : /* Steal possible out parameters to the callers context */
5370 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
5371 :
5372 : /* Return result */
5373 0 : *result = state->orig.out.result;
5374 :
5375 0 : tevent_req_received(req);
5376 0 : return NT_STATUS_OK;
5377 : }
5378 :
5379 0 : NTSTATUS dcerpc_svcctl_CreateServiceA(struct dcerpc_binding_handle *h,
5380 : TALLOC_CTX *mem_ctx,
5381 : struct policy_handle *_handle /* [in] [ref] */,
5382 : const char *_ServiceName /* [in] [charset(UTF16),unique] */,
5383 : const char *_DisplayName /* [in] [charset(UTF16),unique] */,
5384 : uint32_t _desired_access /* [in] */,
5385 : uint32_t _type /* [in] */,
5386 : enum svcctl_StartType _start_type /* [in] */,
5387 : enum svcctl_ErrorControl _error_control /* [in] */,
5388 : const char *_binary_path /* [in] [charset(UTF16),unique] */,
5389 : const char *_LoadOrderGroupKey /* [in] [charset(UTF16),unique] */,
5390 : uint32_t *_TagId /* [out] [unique] */,
5391 : const char *_dependencies /* [in] [charset(UTF16),unique] */,
5392 : const char *_service_start_name /* [in] [charset(UTF16),unique] */,
5393 : const char *_password /* [in] [charset(UTF16),unique] */,
5394 : WERROR *result)
5395 : {
5396 : struct svcctl_CreateServiceA r;
5397 : NTSTATUS status;
5398 :
5399 : /* In parameters */
5400 0 : r.in.handle = _handle;
5401 0 : r.in.ServiceName = _ServiceName;
5402 0 : r.in.DisplayName = _DisplayName;
5403 0 : r.in.desired_access = _desired_access;
5404 0 : r.in.type = _type;
5405 0 : r.in.start_type = _start_type;
5406 0 : r.in.error_control = _error_control;
5407 0 : r.in.binary_path = _binary_path;
5408 0 : r.in.LoadOrderGroupKey = _LoadOrderGroupKey;
5409 0 : r.in.dependencies = _dependencies;
5410 0 : r.in.service_start_name = _service_start_name;
5411 0 : r.in.password = _password;
5412 :
5413 : /* Out parameters */
5414 0 : r.out.TagId = _TagId;
5415 :
5416 : /* Result */
5417 0 : NDR_ZERO_STRUCT(r.out.result);
5418 :
5419 0 : status = dcerpc_svcctl_CreateServiceA_r(h, mem_ctx, &r);
5420 0 : if (!NT_STATUS_IS_OK(status)) {
5421 0 : return status;
5422 : }
5423 :
5424 : /* Return variables */
5425 0 : if (_TagId && r.out.TagId) {
5426 0 : *_TagId = *r.out.TagId;
5427 : }
5428 :
5429 : /* Return result */
5430 0 : *result = r.out.result;
5431 :
5432 0 : return NT_STATUS_OK;
5433 : }
5434 :
5435 : struct dcerpc_svcctl_EnumDependentServicesA_r_state {
5436 : TALLOC_CTX *out_mem_ctx;
5437 : };
5438 :
5439 : static void dcerpc_svcctl_EnumDependentServicesA_r_done(struct tevent_req *subreq);
5440 :
5441 0 : struct tevent_req *dcerpc_svcctl_EnumDependentServicesA_r_send(TALLOC_CTX *mem_ctx,
5442 : struct tevent_context *ev,
5443 : struct dcerpc_binding_handle *h,
5444 : struct svcctl_EnumDependentServicesA *r)
5445 : {
5446 : struct tevent_req *req;
5447 : struct dcerpc_svcctl_EnumDependentServicesA_r_state *state;
5448 : struct tevent_req *subreq;
5449 :
5450 0 : req = tevent_req_create(mem_ctx, &state,
5451 : struct dcerpc_svcctl_EnumDependentServicesA_r_state);
5452 0 : if (req == NULL) {
5453 0 : return NULL;
5454 : }
5455 :
5456 0 : state->out_mem_ctx = talloc_new(state);
5457 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
5458 0 : return tevent_req_post(req, ev);
5459 : }
5460 :
5461 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
5462 : NULL, &ndr_table_svcctl,
5463 0 : NDR_SVCCTL_ENUMDEPENDENTSERVICESA, state->out_mem_ctx, r);
5464 0 : if (tevent_req_nomem(subreq, req)) {
5465 0 : return tevent_req_post(req, ev);
5466 : }
5467 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_EnumDependentServicesA_r_done, req);
5468 :
5469 0 : return req;
5470 : }
5471 :
5472 0 : static void dcerpc_svcctl_EnumDependentServicesA_r_done(struct tevent_req *subreq)
5473 : {
5474 0 : struct tevent_req *req =
5475 0 : tevent_req_callback_data(subreq,
5476 : struct tevent_req);
5477 : NTSTATUS status;
5478 :
5479 0 : status = dcerpc_binding_handle_call_recv(subreq);
5480 0 : TALLOC_FREE(subreq);
5481 0 : if (tevent_req_nterror(req, status)) {
5482 0 : return;
5483 : }
5484 :
5485 0 : tevent_req_done(req);
5486 : }
5487 :
5488 0 : NTSTATUS dcerpc_svcctl_EnumDependentServicesA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5489 : {
5490 0 : struct dcerpc_svcctl_EnumDependentServicesA_r_state *state =
5491 0 : tevent_req_data(req,
5492 : struct dcerpc_svcctl_EnumDependentServicesA_r_state);
5493 : NTSTATUS status;
5494 :
5495 0 : if (tevent_req_is_nterror(req, &status)) {
5496 0 : tevent_req_received(req);
5497 0 : return status;
5498 : }
5499 :
5500 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
5501 :
5502 0 : tevent_req_received(req);
5503 0 : return NT_STATUS_OK;
5504 : }
5505 :
5506 0 : NTSTATUS dcerpc_svcctl_EnumDependentServicesA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_EnumDependentServicesA *r)
5507 : {
5508 : NTSTATUS status;
5509 :
5510 0 : status = dcerpc_binding_handle_call(h,
5511 : NULL, &ndr_table_svcctl,
5512 : NDR_SVCCTL_ENUMDEPENDENTSERVICESA, mem_ctx, r);
5513 :
5514 0 : return status;
5515 : }
5516 :
5517 : struct dcerpc_svcctl_EnumDependentServicesA_state {
5518 : struct svcctl_EnumDependentServicesA orig;
5519 : struct svcctl_EnumDependentServicesA tmp;
5520 : TALLOC_CTX *out_mem_ctx;
5521 : };
5522 :
5523 : static void dcerpc_svcctl_EnumDependentServicesA_done(struct tevent_req *subreq);
5524 :
5525 0 : struct tevent_req *dcerpc_svcctl_EnumDependentServicesA_send(TALLOC_CTX *mem_ctx,
5526 : struct tevent_context *ev,
5527 : struct dcerpc_binding_handle *h,
5528 : struct policy_handle *_service /* [in] [ref] */,
5529 : enum svcctl_ServiceState _state /* [in] */,
5530 : struct ENUM_SERVICE_STATUSA *_service_status /* [out] [unique] */,
5531 : uint32_t _offered /* [in] */,
5532 : uint32_t *_needed /* [out] [ref] */,
5533 : uint32_t *_services_returned /* [out] [ref] */)
5534 : {
5535 : struct tevent_req *req;
5536 : struct dcerpc_svcctl_EnumDependentServicesA_state *state;
5537 : struct tevent_req *subreq;
5538 :
5539 0 : req = tevent_req_create(mem_ctx, &state,
5540 : struct dcerpc_svcctl_EnumDependentServicesA_state);
5541 0 : if (req == NULL) {
5542 0 : return NULL;
5543 : }
5544 0 : state->out_mem_ctx = NULL;
5545 :
5546 : /* In parameters */
5547 0 : state->orig.in.service = _service;
5548 0 : state->orig.in.state = _state;
5549 0 : state->orig.in.offered = _offered;
5550 :
5551 : /* Out parameters */
5552 0 : state->orig.out.service_status = _service_status;
5553 0 : state->orig.out.needed = _needed;
5554 0 : state->orig.out.services_returned = _services_returned;
5555 :
5556 : /* Result */
5557 0 : NDR_ZERO_STRUCT(state->orig.out.result);
5558 :
5559 0 : state->out_mem_ctx = talloc_named_const(state, 0,
5560 : "dcerpc_svcctl_EnumDependentServicesA_out_memory");
5561 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
5562 0 : return tevent_req_post(req, ev);
5563 : }
5564 :
5565 : /* make a temporary copy, that we pass to the dispatch function */
5566 0 : state->tmp = state->orig;
5567 :
5568 0 : subreq = dcerpc_svcctl_EnumDependentServicesA_r_send(state, ev, h, &state->tmp);
5569 0 : if (tevent_req_nomem(subreq, req)) {
5570 0 : return tevent_req_post(req, ev);
5571 : }
5572 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_EnumDependentServicesA_done, req);
5573 0 : return req;
5574 : }
5575 :
5576 0 : static void dcerpc_svcctl_EnumDependentServicesA_done(struct tevent_req *subreq)
5577 : {
5578 0 : struct tevent_req *req = tevent_req_callback_data(
5579 : subreq, struct tevent_req);
5580 0 : struct dcerpc_svcctl_EnumDependentServicesA_state *state = tevent_req_data(
5581 : req, struct dcerpc_svcctl_EnumDependentServicesA_state);
5582 : NTSTATUS status;
5583 : TALLOC_CTX *mem_ctx;
5584 :
5585 0 : if (state->out_mem_ctx) {
5586 0 : mem_ctx = state->out_mem_ctx;
5587 : } else {
5588 0 : mem_ctx = state;
5589 : }
5590 :
5591 0 : status = dcerpc_svcctl_EnumDependentServicesA_r_recv(subreq, mem_ctx);
5592 0 : TALLOC_FREE(subreq);
5593 0 : if (tevent_req_nterror(req, status)) {
5594 0 : return;
5595 : }
5596 :
5597 : /* Copy out parameters */
5598 0 : if (state->orig.out.service_status && state->tmp.out.service_status) {
5599 0 : *state->orig.out.service_status = *state->tmp.out.service_status;
5600 : }
5601 0 : *state->orig.out.needed = *state->tmp.out.needed;
5602 0 : *state->orig.out.services_returned = *state->tmp.out.services_returned;
5603 :
5604 : /* Copy result */
5605 0 : state->orig.out.result = state->tmp.out.result;
5606 :
5607 : /* Reset temporary structure */
5608 0 : NDR_ZERO_STRUCT(state->tmp);
5609 :
5610 0 : tevent_req_done(req);
5611 : }
5612 :
5613 0 : NTSTATUS dcerpc_svcctl_EnumDependentServicesA_recv(struct tevent_req *req,
5614 : TALLOC_CTX *mem_ctx,
5615 : WERROR *result)
5616 : {
5617 0 : struct dcerpc_svcctl_EnumDependentServicesA_state *state = tevent_req_data(
5618 : req, struct dcerpc_svcctl_EnumDependentServicesA_state);
5619 : NTSTATUS status;
5620 :
5621 0 : if (tevent_req_is_nterror(req, &status)) {
5622 0 : tevent_req_received(req);
5623 0 : return status;
5624 : }
5625 :
5626 : /* Steal possible out parameters to the callers context */
5627 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
5628 :
5629 : /* Return result */
5630 0 : *result = state->orig.out.result;
5631 :
5632 0 : tevent_req_received(req);
5633 0 : return NT_STATUS_OK;
5634 : }
5635 :
5636 0 : NTSTATUS dcerpc_svcctl_EnumDependentServicesA(struct dcerpc_binding_handle *h,
5637 : TALLOC_CTX *mem_ctx,
5638 : struct policy_handle *_service /* [in] [ref] */,
5639 : enum svcctl_ServiceState _state /* [in] */,
5640 : struct ENUM_SERVICE_STATUSA *_service_status /* [out] [unique] */,
5641 : uint32_t _offered /* [in] */,
5642 : uint32_t *_needed /* [out] [ref] */,
5643 : uint32_t *_services_returned /* [out] [ref] */,
5644 : WERROR *result)
5645 : {
5646 : struct svcctl_EnumDependentServicesA r;
5647 : NTSTATUS status;
5648 :
5649 : /* In parameters */
5650 0 : r.in.service = _service;
5651 0 : r.in.state = _state;
5652 0 : r.in.offered = _offered;
5653 :
5654 : /* Out parameters */
5655 0 : r.out.service_status = _service_status;
5656 0 : r.out.needed = _needed;
5657 0 : r.out.services_returned = _services_returned;
5658 :
5659 : /* Result */
5660 0 : NDR_ZERO_STRUCT(r.out.result);
5661 :
5662 0 : status = dcerpc_svcctl_EnumDependentServicesA_r(h, mem_ctx, &r);
5663 0 : if (!NT_STATUS_IS_OK(status)) {
5664 0 : return status;
5665 : }
5666 :
5667 : /* Return variables */
5668 0 : if (_service_status && r.out.service_status) {
5669 0 : *_service_status = *r.out.service_status;
5670 : }
5671 0 : *_needed = *r.out.needed;
5672 0 : *_services_returned = *r.out.services_returned;
5673 :
5674 : /* Return result */
5675 0 : *result = r.out.result;
5676 :
5677 0 : return NT_STATUS_OK;
5678 : }
5679 :
5680 : struct dcerpc_svcctl_EnumServicesStatusA_r_state {
5681 : TALLOC_CTX *out_mem_ctx;
5682 : };
5683 :
5684 : static void dcerpc_svcctl_EnumServicesStatusA_r_done(struct tevent_req *subreq);
5685 :
5686 0 : struct tevent_req *dcerpc_svcctl_EnumServicesStatusA_r_send(TALLOC_CTX *mem_ctx,
5687 : struct tevent_context *ev,
5688 : struct dcerpc_binding_handle *h,
5689 : struct svcctl_EnumServicesStatusA *r)
5690 : {
5691 : struct tevent_req *req;
5692 : struct dcerpc_svcctl_EnumServicesStatusA_r_state *state;
5693 : struct tevent_req *subreq;
5694 :
5695 0 : req = tevent_req_create(mem_ctx, &state,
5696 : struct dcerpc_svcctl_EnumServicesStatusA_r_state);
5697 0 : if (req == NULL) {
5698 0 : return NULL;
5699 : }
5700 :
5701 0 : state->out_mem_ctx = talloc_new(state);
5702 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
5703 0 : return tevent_req_post(req, ev);
5704 : }
5705 :
5706 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
5707 : NULL, &ndr_table_svcctl,
5708 0 : NDR_SVCCTL_ENUMSERVICESSTATUSA, state->out_mem_ctx, r);
5709 0 : if (tevent_req_nomem(subreq, req)) {
5710 0 : return tevent_req_post(req, ev);
5711 : }
5712 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_EnumServicesStatusA_r_done, req);
5713 :
5714 0 : return req;
5715 : }
5716 :
5717 0 : static void dcerpc_svcctl_EnumServicesStatusA_r_done(struct tevent_req *subreq)
5718 : {
5719 0 : struct tevent_req *req =
5720 0 : tevent_req_callback_data(subreq,
5721 : struct tevent_req);
5722 : NTSTATUS status;
5723 :
5724 0 : status = dcerpc_binding_handle_call_recv(subreq);
5725 0 : TALLOC_FREE(subreq);
5726 0 : if (tevent_req_nterror(req, status)) {
5727 0 : return;
5728 : }
5729 :
5730 0 : tevent_req_done(req);
5731 : }
5732 :
5733 0 : NTSTATUS dcerpc_svcctl_EnumServicesStatusA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
5734 : {
5735 0 : struct dcerpc_svcctl_EnumServicesStatusA_r_state *state =
5736 0 : tevent_req_data(req,
5737 : struct dcerpc_svcctl_EnumServicesStatusA_r_state);
5738 : NTSTATUS status;
5739 :
5740 0 : if (tevent_req_is_nterror(req, &status)) {
5741 0 : tevent_req_received(req);
5742 0 : return status;
5743 : }
5744 :
5745 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
5746 :
5747 0 : tevent_req_received(req);
5748 0 : return NT_STATUS_OK;
5749 : }
5750 :
5751 0 : NTSTATUS dcerpc_svcctl_EnumServicesStatusA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_EnumServicesStatusA *r)
5752 : {
5753 : NTSTATUS status;
5754 :
5755 0 : status = dcerpc_binding_handle_call(h,
5756 : NULL, &ndr_table_svcctl,
5757 : NDR_SVCCTL_ENUMSERVICESSTATUSA, mem_ctx, r);
5758 :
5759 0 : return status;
5760 : }
5761 :
5762 : struct dcerpc_svcctl_EnumServicesStatusA_state {
5763 : struct svcctl_EnumServicesStatusA orig;
5764 : struct svcctl_EnumServicesStatusA tmp;
5765 : TALLOC_CTX *out_mem_ctx;
5766 : };
5767 :
5768 : static void dcerpc_svcctl_EnumServicesStatusA_done(struct tevent_req *subreq);
5769 :
5770 0 : struct tevent_req *dcerpc_svcctl_EnumServicesStatusA_send(TALLOC_CTX *mem_ctx,
5771 : struct tevent_context *ev,
5772 : struct dcerpc_binding_handle *h,
5773 : struct policy_handle *_handle /* [in] [ref] */,
5774 : uint32_t _type /* [in] */,
5775 : enum svcctl_ServiceState _state /* [in] */,
5776 : uint32_t _offered /* [in] */,
5777 : uint8_t *_service /* [out] [size_is(offered)] */,
5778 : uint32_t *_needed /* [out] [ref] */,
5779 : uint32_t *_services_returned /* [out] [ref] */,
5780 : uint32_t *_resume_handle /* [in,out] [unique] */)
5781 : {
5782 : struct tevent_req *req;
5783 : struct dcerpc_svcctl_EnumServicesStatusA_state *state;
5784 : struct tevent_req *subreq;
5785 :
5786 0 : req = tevent_req_create(mem_ctx, &state,
5787 : struct dcerpc_svcctl_EnumServicesStatusA_state);
5788 0 : if (req == NULL) {
5789 0 : return NULL;
5790 : }
5791 0 : state->out_mem_ctx = NULL;
5792 :
5793 : /* In parameters */
5794 0 : state->orig.in.handle = _handle;
5795 0 : state->orig.in.type = _type;
5796 0 : state->orig.in.state = _state;
5797 0 : state->orig.in.offered = _offered;
5798 0 : state->orig.in.resume_handle = _resume_handle;
5799 :
5800 : /* Out parameters */
5801 0 : state->orig.out.service = _service;
5802 0 : state->orig.out.needed = _needed;
5803 0 : state->orig.out.services_returned = _services_returned;
5804 0 : state->orig.out.resume_handle = _resume_handle;
5805 :
5806 : /* Result */
5807 0 : NDR_ZERO_STRUCT(state->orig.out.result);
5808 :
5809 0 : state->out_mem_ctx = talloc_named_const(state, 0,
5810 : "dcerpc_svcctl_EnumServicesStatusA_out_memory");
5811 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
5812 0 : return tevent_req_post(req, ev);
5813 : }
5814 :
5815 : /* make a temporary copy, that we pass to the dispatch function */
5816 0 : state->tmp = state->orig;
5817 :
5818 0 : subreq = dcerpc_svcctl_EnumServicesStatusA_r_send(state, ev, h, &state->tmp);
5819 0 : if (tevent_req_nomem(subreq, req)) {
5820 0 : return tevent_req_post(req, ev);
5821 : }
5822 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_EnumServicesStatusA_done, req);
5823 0 : return req;
5824 : }
5825 :
5826 0 : static void dcerpc_svcctl_EnumServicesStatusA_done(struct tevent_req *subreq)
5827 : {
5828 0 : struct tevent_req *req = tevent_req_callback_data(
5829 : subreq, struct tevent_req);
5830 0 : struct dcerpc_svcctl_EnumServicesStatusA_state *state = tevent_req_data(
5831 : req, struct dcerpc_svcctl_EnumServicesStatusA_state);
5832 : NTSTATUS status;
5833 : TALLOC_CTX *mem_ctx;
5834 :
5835 0 : if (state->out_mem_ctx) {
5836 0 : mem_ctx = state->out_mem_ctx;
5837 : } else {
5838 0 : mem_ctx = state;
5839 : }
5840 :
5841 0 : status = dcerpc_svcctl_EnumServicesStatusA_r_recv(subreq, mem_ctx);
5842 0 : TALLOC_FREE(subreq);
5843 0 : if (tevent_req_nterror(req, status)) {
5844 0 : return;
5845 : }
5846 :
5847 : /* Copy out parameters */
5848 : {
5849 : size_t _copy_len_service;
5850 0 : _copy_len_service = state->tmp.in.offered;
5851 0 : if (state->orig.out.service != state->tmp.out.service) {
5852 0 : memcpy(state->orig.out.service, state->tmp.out.service, _copy_len_service * sizeof(*state->orig.out.service));
5853 : }
5854 : }
5855 0 : *state->orig.out.needed = *state->tmp.out.needed;
5856 0 : *state->orig.out.services_returned = *state->tmp.out.services_returned;
5857 0 : if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
5858 0 : *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
5859 : }
5860 :
5861 : /* Copy result */
5862 0 : state->orig.out.result = state->tmp.out.result;
5863 :
5864 : /* Reset temporary structure */
5865 0 : NDR_ZERO_STRUCT(state->tmp);
5866 :
5867 0 : tevent_req_done(req);
5868 : }
5869 :
5870 0 : NTSTATUS dcerpc_svcctl_EnumServicesStatusA_recv(struct tevent_req *req,
5871 : TALLOC_CTX *mem_ctx,
5872 : WERROR *result)
5873 : {
5874 0 : struct dcerpc_svcctl_EnumServicesStatusA_state *state = tevent_req_data(
5875 : req, struct dcerpc_svcctl_EnumServicesStatusA_state);
5876 : NTSTATUS status;
5877 :
5878 0 : if (tevent_req_is_nterror(req, &status)) {
5879 0 : tevent_req_received(req);
5880 0 : return status;
5881 : }
5882 :
5883 : /* Steal possible out parameters to the callers context */
5884 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
5885 :
5886 : /* Return result */
5887 0 : *result = state->orig.out.result;
5888 :
5889 0 : tevent_req_received(req);
5890 0 : return NT_STATUS_OK;
5891 : }
5892 :
5893 0 : NTSTATUS dcerpc_svcctl_EnumServicesStatusA(struct dcerpc_binding_handle *h,
5894 : TALLOC_CTX *mem_ctx,
5895 : struct policy_handle *_handle /* [in] [ref] */,
5896 : uint32_t _type /* [in] */,
5897 : enum svcctl_ServiceState _state /* [in] */,
5898 : uint32_t _offered /* [in] */,
5899 : uint8_t *_service /* [out] [size_is(offered)] */,
5900 : uint32_t *_needed /* [out] [ref] */,
5901 : uint32_t *_services_returned /* [out] [ref] */,
5902 : uint32_t *_resume_handle /* [in,out] [unique] */,
5903 : WERROR *result)
5904 : {
5905 : struct svcctl_EnumServicesStatusA r;
5906 : NTSTATUS status;
5907 :
5908 : /* In parameters */
5909 0 : r.in.handle = _handle;
5910 0 : r.in.type = _type;
5911 0 : r.in.state = _state;
5912 0 : r.in.offered = _offered;
5913 0 : r.in.resume_handle = _resume_handle;
5914 :
5915 : /* Out parameters */
5916 0 : r.out.service = _service;
5917 0 : r.out.needed = _needed;
5918 0 : r.out.services_returned = _services_returned;
5919 0 : r.out.resume_handle = _resume_handle;
5920 :
5921 : /* Result */
5922 0 : NDR_ZERO_STRUCT(r.out.result);
5923 :
5924 0 : status = dcerpc_svcctl_EnumServicesStatusA_r(h, mem_ctx, &r);
5925 0 : if (!NT_STATUS_IS_OK(status)) {
5926 0 : return status;
5927 : }
5928 :
5929 : /* Return variables */
5930 : {
5931 : size_t _copy_len_service;
5932 0 : _copy_len_service = r.in.offered;
5933 0 : if (_service != r.out.service) {
5934 0 : memcpy(_service, r.out.service, _copy_len_service * sizeof(*_service));
5935 : }
5936 : }
5937 0 : *_needed = *r.out.needed;
5938 0 : *_services_returned = *r.out.services_returned;
5939 0 : if (_resume_handle && r.out.resume_handle) {
5940 0 : *_resume_handle = *r.out.resume_handle;
5941 : }
5942 :
5943 : /* Return result */
5944 0 : *result = r.out.result;
5945 :
5946 0 : return NT_STATUS_OK;
5947 : }
5948 :
5949 : struct dcerpc_svcctl_OpenSCManagerA_r_state {
5950 : TALLOC_CTX *out_mem_ctx;
5951 : };
5952 :
5953 : static void dcerpc_svcctl_OpenSCManagerA_r_done(struct tevent_req *subreq);
5954 :
5955 0 : struct tevent_req *dcerpc_svcctl_OpenSCManagerA_r_send(TALLOC_CTX *mem_ctx,
5956 : struct tevent_context *ev,
5957 : struct dcerpc_binding_handle *h,
5958 : struct svcctl_OpenSCManagerA *r)
5959 : {
5960 : struct tevent_req *req;
5961 : struct dcerpc_svcctl_OpenSCManagerA_r_state *state;
5962 : struct tevent_req *subreq;
5963 :
5964 0 : req = tevent_req_create(mem_ctx, &state,
5965 : struct dcerpc_svcctl_OpenSCManagerA_r_state);
5966 0 : if (req == NULL) {
5967 0 : return NULL;
5968 : }
5969 :
5970 0 : state->out_mem_ctx = talloc_new(state);
5971 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
5972 0 : return tevent_req_post(req, ev);
5973 : }
5974 :
5975 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
5976 : NULL, &ndr_table_svcctl,
5977 0 : NDR_SVCCTL_OPENSCMANAGERA, state->out_mem_ctx, r);
5978 0 : if (tevent_req_nomem(subreq, req)) {
5979 0 : return tevent_req_post(req, ev);
5980 : }
5981 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_OpenSCManagerA_r_done, req);
5982 :
5983 0 : return req;
5984 : }
5985 :
5986 0 : static void dcerpc_svcctl_OpenSCManagerA_r_done(struct tevent_req *subreq)
5987 : {
5988 0 : struct tevent_req *req =
5989 0 : tevent_req_callback_data(subreq,
5990 : struct tevent_req);
5991 : NTSTATUS status;
5992 :
5993 0 : status = dcerpc_binding_handle_call_recv(subreq);
5994 0 : TALLOC_FREE(subreq);
5995 0 : if (tevent_req_nterror(req, status)) {
5996 0 : return;
5997 : }
5998 :
5999 0 : tevent_req_done(req);
6000 : }
6001 :
6002 0 : NTSTATUS dcerpc_svcctl_OpenSCManagerA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6003 : {
6004 0 : struct dcerpc_svcctl_OpenSCManagerA_r_state *state =
6005 0 : tevent_req_data(req,
6006 : struct dcerpc_svcctl_OpenSCManagerA_r_state);
6007 : NTSTATUS status;
6008 :
6009 0 : if (tevent_req_is_nterror(req, &status)) {
6010 0 : tevent_req_received(req);
6011 0 : return status;
6012 : }
6013 :
6014 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
6015 :
6016 0 : tevent_req_received(req);
6017 0 : return NT_STATUS_OK;
6018 : }
6019 :
6020 0 : NTSTATUS dcerpc_svcctl_OpenSCManagerA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_OpenSCManagerA *r)
6021 : {
6022 : NTSTATUS status;
6023 :
6024 0 : status = dcerpc_binding_handle_call(h,
6025 : NULL, &ndr_table_svcctl,
6026 : NDR_SVCCTL_OPENSCMANAGERA, mem_ctx, r);
6027 :
6028 0 : return status;
6029 : }
6030 :
6031 : struct dcerpc_svcctl_OpenSCManagerA_state {
6032 : struct svcctl_OpenSCManagerA orig;
6033 : struct svcctl_OpenSCManagerA tmp;
6034 : TALLOC_CTX *out_mem_ctx;
6035 : };
6036 :
6037 : static void dcerpc_svcctl_OpenSCManagerA_done(struct tevent_req *subreq);
6038 :
6039 0 : struct tevent_req *dcerpc_svcctl_OpenSCManagerA_send(TALLOC_CTX *mem_ctx,
6040 : struct tevent_context *ev,
6041 : struct dcerpc_binding_handle *h,
6042 : const char *_MachineName /* [in] [charset(UTF16),unique] */,
6043 : const char *_DatabaseName /* [in] [charset(UTF16),unique] */,
6044 : uint32_t _access_mask /* [in] */,
6045 : struct policy_handle *_handle /* [out] [ref] */)
6046 : {
6047 : struct tevent_req *req;
6048 : struct dcerpc_svcctl_OpenSCManagerA_state *state;
6049 : struct tevent_req *subreq;
6050 :
6051 0 : req = tevent_req_create(mem_ctx, &state,
6052 : struct dcerpc_svcctl_OpenSCManagerA_state);
6053 0 : if (req == NULL) {
6054 0 : return NULL;
6055 : }
6056 0 : state->out_mem_ctx = NULL;
6057 :
6058 : /* In parameters */
6059 0 : state->orig.in.MachineName = _MachineName;
6060 0 : state->orig.in.DatabaseName = _DatabaseName;
6061 0 : state->orig.in.access_mask = _access_mask;
6062 :
6063 : /* Out parameters */
6064 0 : state->orig.out.handle = _handle;
6065 :
6066 : /* Result */
6067 0 : NDR_ZERO_STRUCT(state->orig.out.result);
6068 :
6069 0 : state->out_mem_ctx = talloc_named_const(state, 0,
6070 : "dcerpc_svcctl_OpenSCManagerA_out_memory");
6071 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
6072 0 : return tevent_req_post(req, ev);
6073 : }
6074 :
6075 : /* make a temporary copy, that we pass to the dispatch function */
6076 0 : state->tmp = state->orig;
6077 :
6078 0 : subreq = dcerpc_svcctl_OpenSCManagerA_r_send(state, ev, h, &state->tmp);
6079 0 : if (tevent_req_nomem(subreq, req)) {
6080 0 : return tevent_req_post(req, ev);
6081 : }
6082 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_OpenSCManagerA_done, req);
6083 0 : return req;
6084 : }
6085 :
6086 0 : static void dcerpc_svcctl_OpenSCManagerA_done(struct tevent_req *subreq)
6087 : {
6088 0 : struct tevent_req *req = tevent_req_callback_data(
6089 : subreq, struct tevent_req);
6090 0 : struct dcerpc_svcctl_OpenSCManagerA_state *state = tevent_req_data(
6091 : req, struct dcerpc_svcctl_OpenSCManagerA_state);
6092 : NTSTATUS status;
6093 : TALLOC_CTX *mem_ctx;
6094 :
6095 0 : if (state->out_mem_ctx) {
6096 0 : mem_ctx = state->out_mem_ctx;
6097 : } else {
6098 0 : mem_ctx = state;
6099 : }
6100 :
6101 0 : status = dcerpc_svcctl_OpenSCManagerA_r_recv(subreq, mem_ctx);
6102 0 : TALLOC_FREE(subreq);
6103 0 : if (tevent_req_nterror(req, status)) {
6104 0 : return;
6105 : }
6106 :
6107 : /* Copy out parameters */
6108 0 : *state->orig.out.handle = *state->tmp.out.handle;
6109 :
6110 : /* Copy result */
6111 0 : state->orig.out.result = state->tmp.out.result;
6112 :
6113 : /* Reset temporary structure */
6114 0 : NDR_ZERO_STRUCT(state->tmp);
6115 :
6116 0 : tevent_req_done(req);
6117 : }
6118 :
6119 0 : NTSTATUS dcerpc_svcctl_OpenSCManagerA_recv(struct tevent_req *req,
6120 : TALLOC_CTX *mem_ctx,
6121 : WERROR *result)
6122 : {
6123 0 : struct dcerpc_svcctl_OpenSCManagerA_state *state = tevent_req_data(
6124 : req, struct dcerpc_svcctl_OpenSCManagerA_state);
6125 : NTSTATUS status;
6126 :
6127 0 : if (tevent_req_is_nterror(req, &status)) {
6128 0 : tevent_req_received(req);
6129 0 : return status;
6130 : }
6131 :
6132 : /* Steal possible out parameters to the callers context */
6133 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
6134 :
6135 : /* Return result */
6136 0 : *result = state->orig.out.result;
6137 :
6138 0 : tevent_req_received(req);
6139 0 : return NT_STATUS_OK;
6140 : }
6141 :
6142 0 : NTSTATUS dcerpc_svcctl_OpenSCManagerA(struct dcerpc_binding_handle *h,
6143 : TALLOC_CTX *mem_ctx,
6144 : const char *_MachineName /* [in] [charset(UTF16),unique] */,
6145 : const char *_DatabaseName /* [in] [charset(UTF16),unique] */,
6146 : uint32_t _access_mask /* [in] */,
6147 : struct policy_handle *_handle /* [out] [ref] */,
6148 : WERROR *result)
6149 : {
6150 : struct svcctl_OpenSCManagerA r;
6151 : NTSTATUS status;
6152 :
6153 : /* In parameters */
6154 0 : r.in.MachineName = _MachineName;
6155 0 : r.in.DatabaseName = _DatabaseName;
6156 0 : r.in.access_mask = _access_mask;
6157 :
6158 : /* Out parameters */
6159 0 : r.out.handle = _handle;
6160 :
6161 : /* Result */
6162 0 : NDR_ZERO_STRUCT(r.out.result);
6163 :
6164 0 : status = dcerpc_svcctl_OpenSCManagerA_r(h, mem_ctx, &r);
6165 0 : if (!NT_STATUS_IS_OK(status)) {
6166 0 : return status;
6167 : }
6168 :
6169 : /* Return variables */
6170 0 : *_handle = *r.out.handle;
6171 :
6172 : /* Return result */
6173 0 : *result = r.out.result;
6174 :
6175 0 : return NT_STATUS_OK;
6176 : }
6177 :
6178 : struct dcerpc_svcctl_OpenServiceA_r_state {
6179 : TALLOC_CTX *out_mem_ctx;
6180 : };
6181 :
6182 : static void dcerpc_svcctl_OpenServiceA_r_done(struct tevent_req *subreq);
6183 :
6184 0 : struct tevent_req *dcerpc_svcctl_OpenServiceA_r_send(TALLOC_CTX *mem_ctx,
6185 : struct tevent_context *ev,
6186 : struct dcerpc_binding_handle *h,
6187 : struct svcctl_OpenServiceA *r)
6188 : {
6189 : struct tevent_req *req;
6190 : struct dcerpc_svcctl_OpenServiceA_r_state *state;
6191 : struct tevent_req *subreq;
6192 :
6193 0 : req = tevent_req_create(mem_ctx, &state,
6194 : struct dcerpc_svcctl_OpenServiceA_r_state);
6195 0 : if (req == NULL) {
6196 0 : return NULL;
6197 : }
6198 :
6199 0 : state->out_mem_ctx = talloc_new(state);
6200 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
6201 0 : return tevent_req_post(req, ev);
6202 : }
6203 :
6204 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
6205 : NULL, &ndr_table_svcctl,
6206 0 : NDR_SVCCTL_OPENSERVICEA, state->out_mem_ctx, r);
6207 0 : if (tevent_req_nomem(subreq, req)) {
6208 0 : return tevent_req_post(req, ev);
6209 : }
6210 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_OpenServiceA_r_done, req);
6211 :
6212 0 : return req;
6213 : }
6214 :
6215 0 : static void dcerpc_svcctl_OpenServiceA_r_done(struct tevent_req *subreq)
6216 : {
6217 0 : struct tevent_req *req =
6218 0 : tevent_req_callback_data(subreq,
6219 : struct tevent_req);
6220 : NTSTATUS status;
6221 :
6222 0 : status = dcerpc_binding_handle_call_recv(subreq);
6223 0 : TALLOC_FREE(subreq);
6224 0 : if (tevent_req_nterror(req, status)) {
6225 0 : return;
6226 : }
6227 :
6228 0 : tevent_req_done(req);
6229 : }
6230 :
6231 0 : NTSTATUS dcerpc_svcctl_OpenServiceA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6232 : {
6233 0 : struct dcerpc_svcctl_OpenServiceA_r_state *state =
6234 0 : tevent_req_data(req,
6235 : struct dcerpc_svcctl_OpenServiceA_r_state);
6236 : NTSTATUS status;
6237 :
6238 0 : if (tevent_req_is_nterror(req, &status)) {
6239 0 : tevent_req_received(req);
6240 0 : return status;
6241 : }
6242 :
6243 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
6244 :
6245 0 : tevent_req_received(req);
6246 0 : return NT_STATUS_OK;
6247 : }
6248 :
6249 0 : NTSTATUS dcerpc_svcctl_OpenServiceA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_OpenServiceA *r)
6250 : {
6251 : NTSTATUS status;
6252 :
6253 0 : status = dcerpc_binding_handle_call(h,
6254 : NULL, &ndr_table_svcctl,
6255 : NDR_SVCCTL_OPENSERVICEA, mem_ctx, r);
6256 :
6257 0 : return status;
6258 : }
6259 :
6260 : struct dcerpc_svcctl_OpenServiceA_state {
6261 : struct svcctl_OpenServiceA orig;
6262 : struct svcctl_OpenServiceA tmp;
6263 : TALLOC_CTX *out_mem_ctx;
6264 : };
6265 :
6266 : static void dcerpc_svcctl_OpenServiceA_done(struct tevent_req *subreq);
6267 :
6268 0 : struct tevent_req *dcerpc_svcctl_OpenServiceA_send(TALLOC_CTX *mem_ctx,
6269 : struct tevent_context *ev,
6270 : struct dcerpc_binding_handle *h,
6271 : struct policy_handle *_scmanager_handle /* [in] [ref] */,
6272 : const char *_ServiceName /* [in] [charset(UTF16),unique] */,
6273 : uint32_t _access_mask /* [in] */,
6274 : struct policy_handle *_handle /* [out] [ref] */)
6275 : {
6276 : struct tevent_req *req;
6277 : struct dcerpc_svcctl_OpenServiceA_state *state;
6278 : struct tevent_req *subreq;
6279 :
6280 0 : req = tevent_req_create(mem_ctx, &state,
6281 : struct dcerpc_svcctl_OpenServiceA_state);
6282 0 : if (req == NULL) {
6283 0 : return NULL;
6284 : }
6285 0 : state->out_mem_ctx = NULL;
6286 :
6287 : /* In parameters */
6288 0 : state->orig.in.scmanager_handle = _scmanager_handle;
6289 0 : state->orig.in.ServiceName = _ServiceName;
6290 0 : state->orig.in.access_mask = _access_mask;
6291 :
6292 : /* Out parameters */
6293 0 : state->orig.out.handle = _handle;
6294 :
6295 : /* Result */
6296 0 : NDR_ZERO_STRUCT(state->orig.out.result);
6297 :
6298 0 : state->out_mem_ctx = talloc_named_const(state, 0,
6299 : "dcerpc_svcctl_OpenServiceA_out_memory");
6300 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
6301 0 : return tevent_req_post(req, ev);
6302 : }
6303 :
6304 : /* make a temporary copy, that we pass to the dispatch function */
6305 0 : state->tmp = state->orig;
6306 :
6307 0 : subreq = dcerpc_svcctl_OpenServiceA_r_send(state, ev, h, &state->tmp);
6308 0 : if (tevent_req_nomem(subreq, req)) {
6309 0 : return tevent_req_post(req, ev);
6310 : }
6311 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_OpenServiceA_done, req);
6312 0 : return req;
6313 : }
6314 :
6315 0 : static void dcerpc_svcctl_OpenServiceA_done(struct tevent_req *subreq)
6316 : {
6317 0 : struct tevent_req *req = tevent_req_callback_data(
6318 : subreq, struct tevent_req);
6319 0 : struct dcerpc_svcctl_OpenServiceA_state *state = tevent_req_data(
6320 : req, struct dcerpc_svcctl_OpenServiceA_state);
6321 : NTSTATUS status;
6322 : TALLOC_CTX *mem_ctx;
6323 :
6324 0 : if (state->out_mem_ctx) {
6325 0 : mem_ctx = state->out_mem_ctx;
6326 : } else {
6327 0 : mem_ctx = state;
6328 : }
6329 :
6330 0 : status = dcerpc_svcctl_OpenServiceA_r_recv(subreq, mem_ctx);
6331 0 : TALLOC_FREE(subreq);
6332 0 : if (tevent_req_nterror(req, status)) {
6333 0 : return;
6334 : }
6335 :
6336 : /* Copy out parameters */
6337 0 : *state->orig.out.handle = *state->tmp.out.handle;
6338 :
6339 : /* Copy result */
6340 0 : state->orig.out.result = state->tmp.out.result;
6341 :
6342 : /* Reset temporary structure */
6343 0 : NDR_ZERO_STRUCT(state->tmp);
6344 :
6345 0 : tevent_req_done(req);
6346 : }
6347 :
6348 0 : NTSTATUS dcerpc_svcctl_OpenServiceA_recv(struct tevent_req *req,
6349 : TALLOC_CTX *mem_ctx,
6350 : WERROR *result)
6351 : {
6352 0 : struct dcerpc_svcctl_OpenServiceA_state *state = tevent_req_data(
6353 : req, struct dcerpc_svcctl_OpenServiceA_state);
6354 : NTSTATUS status;
6355 :
6356 0 : if (tevent_req_is_nterror(req, &status)) {
6357 0 : tevent_req_received(req);
6358 0 : return status;
6359 : }
6360 :
6361 : /* Steal possible out parameters to the callers context */
6362 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
6363 :
6364 : /* Return result */
6365 0 : *result = state->orig.out.result;
6366 :
6367 0 : tevent_req_received(req);
6368 0 : return NT_STATUS_OK;
6369 : }
6370 :
6371 0 : NTSTATUS dcerpc_svcctl_OpenServiceA(struct dcerpc_binding_handle *h,
6372 : TALLOC_CTX *mem_ctx,
6373 : struct policy_handle *_scmanager_handle /* [in] [ref] */,
6374 : const char *_ServiceName /* [in] [charset(UTF16),unique] */,
6375 : uint32_t _access_mask /* [in] */,
6376 : struct policy_handle *_handle /* [out] [ref] */,
6377 : WERROR *result)
6378 : {
6379 : struct svcctl_OpenServiceA r;
6380 : NTSTATUS status;
6381 :
6382 : /* In parameters */
6383 0 : r.in.scmanager_handle = _scmanager_handle;
6384 0 : r.in.ServiceName = _ServiceName;
6385 0 : r.in.access_mask = _access_mask;
6386 :
6387 : /* Out parameters */
6388 0 : r.out.handle = _handle;
6389 :
6390 : /* Result */
6391 0 : NDR_ZERO_STRUCT(r.out.result);
6392 :
6393 0 : status = dcerpc_svcctl_OpenServiceA_r(h, mem_ctx, &r);
6394 0 : if (!NT_STATUS_IS_OK(status)) {
6395 0 : return status;
6396 : }
6397 :
6398 : /* Return variables */
6399 0 : *_handle = *r.out.handle;
6400 :
6401 : /* Return result */
6402 0 : *result = r.out.result;
6403 :
6404 0 : return NT_STATUS_OK;
6405 : }
6406 :
6407 : struct dcerpc_svcctl_QueryServiceConfigA_r_state {
6408 : TALLOC_CTX *out_mem_ctx;
6409 : };
6410 :
6411 : static void dcerpc_svcctl_QueryServiceConfigA_r_done(struct tevent_req *subreq);
6412 :
6413 0 : struct tevent_req *dcerpc_svcctl_QueryServiceConfigA_r_send(TALLOC_CTX *mem_ctx,
6414 : struct tevent_context *ev,
6415 : struct dcerpc_binding_handle *h,
6416 : struct svcctl_QueryServiceConfigA *r)
6417 : {
6418 : struct tevent_req *req;
6419 : struct dcerpc_svcctl_QueryServiceConfigA_r_state *state;
6420 : struct tevent_req *subreq;
6421 :
6422 0 : req = tevent_req_create(mem_ctx, &state,
6423 : struct dcerpc_svcctl_QueryServiceConfigA_r_state);
6424 0 : if (req == NULL) {
6425 0 : return NULL;
6426 : }
6427 :
6428 0 : state->out_mem_ctx = talloc_new(state);
6429 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
6430 0 : return tevent_req_post(req, ev);
6431 : }
6432 :
6433 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
6434 : NULL, &ndr_table_svcctl,
6435 0 : NDR_SVCCTL_QUERYSERVICECONFIGA, state->out_mem_ctx, r);
6436 0 : if (tevent_req_nomem(subreq, req)) {
6437 0 : return tevent_req_post(req, ev);
6438 : }
6439 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceConfigA_r_done, req);
6440 :
6441 0 : return req;
6442 : }
6443 :
6444 0 : static void dcerpc_svcctl_QueryServiceConfigA_r_done(struct tevent_req *subreq)
6445 : {
6446 0 : struct tevent_req *req =
6447 0 : tevent_req_callback_data(subreq,
6448 : struct tevent_req);
6449 : NTSTATUS status;
6450 :
6451 0 : status = dcerpc_binding_handle_call_recv(subreq);
6452 0 : TALLOC_FREE(subreq);
6453 0 : if (tevent_req_nterror(req, status)) {
6454 0 : return;
6455 : }
6456 :
6457 0 : tevent_req_done(req);
6458 : }
6459 :
6460 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfigA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6461 : {
6462 0 : struct dcerpc_svcctl_QueryServiceConfigA_r_state *state =
6463 0 : tevent_req_data(req,
6464 : struct dcerpc_svcctl_QueryServiceConfigA_r_state);
6465 : NTSTATUS status;
6466 :
6467 0 : if (tevent_req_is_nterror(req, &status)) {
6468 0 : tevent_req_received(req);
6469 0 : return status;
6470 : }
6471 :
6472 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
6473 :
6474 0 : tevent_req_received(req);
6475 0 : return NT_STATUS_OK;
6476 : }
6477 :
6478 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfigA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_QueryServiceConfigA *r)
6479 : {
6480 : NTSTATUS status;
6481 :
6482 0 : status = dcerpc_binding_handle_call(h,
6483 : NULL, &ndr_table_svcctl,
6484 : NDR_SVCCTL_QUERYSERVICECONFIGA, mem_ctx, r);
6485 :
6486 0 : return status;
6487 : }
6488 :
6489 : struct dcerpc_svcctl_QueryServiceConfigA_state {
6490 : struct svcctl_QueryServiceConfigA orig;
6491 : struct svcctl_QueryServiceConfigA tmp;
6492 : TALLOC_CTX *out_mem_ctx;
6493 : };
6494 :
6495 : static void dcerpc_svcctl_QueryServiceConfigA_done(struct tevent_req *subreq);
6496 :
6497 0 : struct tevent_req *dcerpc_svcctl_QueryServiceConfigA_send(TALLOC_CTX *mem_ctx,
6498 : struct tevent_context *ev,
6499 : struct dcerpc_binding_handle *h,
6500 : struct policy_handle *_handle /* [in] [ref] */,
6501 : uint8_t *_query /* [out] */,
6502 : uint32_t _offered /* [in] */,
6503 : uint32_t *_needed /* [out] [ref] */)
6504 : {
6505 : struct tevent_req *req;
6506 : struct dcerpc_svcctl_QueryServiceConfigA_state *state;
6507 : struct tevent_req *subreq;
6508 :
6509 0 : req = tevent_req_create(mem_ctx, &state,
6510 : struct dcerpc_svcctl_QueryServiceConfigA_state);
6511 0 : if (req == NULL) {
6512 0 : return NULL;
6513 : }
6514 0 : state->out_mem_ctx = NULL;
6515 :
6516 : /* In parameters */
6517 0 : state->orig.in.handle = _handle;
6518 0 : state->orig.in.offered = _offered;
6519 :
6520 : /* Out parameters */
6521 0 : state->orig.out.query = _query;
6522 0 : state->orig.out.needed = _needed;
6523 :
6524 : /* Result */
6525 0 : NDR_ZERO_STRUCT(state->orig.out.result);
6526 :
6527 0 : state->out_mem_ctx = talloc_named_const(state, 0,
6528 : "dcerpc_svcctl_QueryServiceConfigA_out_memory");
6529 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
6530 0 : return tevent_req_post(req, ev);
6531 : }
6532 :
6533 : /* make a temporary copy, that we pass to the dispatch function */
6534 0 : state->tmp = state->orig;
6535 :
6536 0 : subreq = dcerpc_svcctl_QueryServiceConfigA_r_send(state, ev, h, &state->tmp);
6537 0 : if (tevent_req_nomem(subreq, req)) {
6538 0 : return tevent_req_post(req, ev);
6539 : }
6540 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceConfigA_done, req);
6541 0 : return req;
6542 : }
6543 :
6544 0 : static void dcerpc_svcctl_QueryServiceConfigA_done(struct tevent_req *subreq)
6545 : {
6546 0 : struct tevent_req *req = tevent_req_callback_data(
6547 : subreq, struct tevent_req);
6548 0 : struct dcerpc_svcctl_QueryServiceConfigA_state *state = tevent_req_data(
6549 : req, struct dcerpc_svcctl_QueryServiceConfigA_state);
6550 : NTSTATUS status;
6551 : TALLOC_CTX *mem_ctx;
6552 :
6553 0 : if (state->out_mem_ctx) {
6554 0 : mem_ctx = state->out_mem_ctx;
6555 : } else {
6556 0 : mem_ctx = state;
6557 : }
6558 :
6559 0 : status = dcerpc_svcctl_QueryServiceConfigA_r_recv(subreq, mem_ctx);
6560 0 : TALLOC_FREE(subreq);
6561 0 : if (tevent_req_nterror(req, status)) {
6562 0 : return;
6563 : }
6564 :
6565 : /* Copy out parameters */
6566 : {
6567 : size_t _copy_len_query;
6568 0 : _copy_len_query = state->tmp.in.offered;
6569 0 : if (state->orig.out.query != state->tmp.out.query) {
6570 0 : memcpy(state->orig.out.query, state->tmp.out.query, _copy_len_query * sizeof(*state->orig.out.query));
6571 : }
6572 : }
6573 0 : *state->orig.out.needed = *state->tmp.out.needed;
6574 :
6575 : /* Copy result */
6576 0 : state->orig.out.result = state->tmp.out.result;
6577 :
6578 : /* Reset temporary structure */
6579 0 : NDR_ZERO_STRUCT(state->tmp);
6580 :
6581 0 : tevent_req_done(req);
6582 : }
6583 :
6584 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfigA_recv(struct tevent_req *req,
6585 : TALLOC_CTX *mem_ctx,
6586 : WERROR *result)
6587 : {
6588 0 : struct dcerpc_svcctl_QueryServiceConfigA_state *state = tevent_req_data(
6589 : req, struct dcerpc_svcctl_QueryServiceConfigA_state);
6590 : NTSTATUS status;
6591 :
6592 0 : if (tevent_req_is_nterror(req, &status)) {
6593 0 : tevent_req_received(req);
6594 0 : return status;
6595 : }
6596 :
6597 : /* Steal possible out parameters to the callers context */
6598 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
6599 :
6600 : /* Return result */
6601 0 : *result = state->orig.out.result;
6602 :
6603 0 : tevent_req_received(req);
6604 0 : return NT_STATUS_OK;
6605 : }
6606 :
6607 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfigA(struct dcerpc_binding_handle *h,
6608 : TALLOC_CTX *mem_ctx,
6609 : struct policy_handle *_handle /* [in] [ref] */,
6610 : uint8_t *_query /* [out] */,
6611 : uint32_t _offered /* [in] */,
6612 : uint32_t *_needed /* [out] [ref] */,
6613 : WERROR *result)
6614 : {
6615 : struct svcctl_QueryServiceConfigA r;
6616 : NTSTATUS status;
6617 :
6618 : /* In parameters */
6619 0 : r.in.handle = _handle;
6620 0 : r.in.offered = _offered;
6621 :
6622 : /* Out parameters */
6623 0 : r.out.query = _query;
6624 0 : r.out.needed = _needed;
6625 :
6626 : /* Result */
6627 0 : NDR_ZERO_STRUCT(r.out.result);
6628 :
6629 0 : status = dcerpc_svcctl_QueryServiceConfigA_r(h, mem_ctx, &r);
6630 0 : if (!NT_STATUS_IS_OK(status)) {
6631 0 : return status;
6632 : }
6633 :
6634 : /* Return variables */
6635 : {
6636 : size_t _copy_len_query;
6637 0 : _copy_len_query = r.in.offered;
6638 0 : if (_query != r.out.query) {
6639 0 : memcpy(_query, r.out.query, _copy_len_query * sizeof(*_query));
6640 : }
6641 : }
6642 0 : *_needed = *r.out.needed;
6643 :
6644 : /* Return result */
6645 0 : *result = r.out.result;
6646 :
6647 0 : return NT_STATUS_OK;
6648 : }
6649 :
6650 : struct dcerpc_svcctl_QueryServiceLockStatusA_r_state {
6651 : TALLOC_CTX *out_mem_ctx;
6652 : };
6653 :
6654 : static void dcerpc_svcctl_QueryServiceLockStatusA_r_done(struct tevent_req *subreq);
6655 :
6656 0 : struct tevent_req *dcerpc_svcctl_QueryServiceLockStatusA_r_send(TALLOC_CTX *mem_ctx,
6657 : struct tevent_context *ev,
6658 : struct dcerpc_binding_handle *h,
6659 : struct svcctl_QueryServiceLockStatusA *r)
6660 : {
6661 : struct tevent_req *req;
6662 : struct dcerpc_svcctl_QueryServiceLockStatusA_r_state *state;
6663 : struct tevent_req *subreq;
6664 :
6665 0 : req = tevent_req_create(mem_ctx, &state,
6666 : struct dcerpc_svcctl_QueryServiceLockStatusA_r_state);
6667 0 : if (req == NULL) {
6668 0 : return NULL;
6669 : }
6670 :
6671 0 : state->out_mem_ctx = talloc_new(state);
6672 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
6673 0 : return tevent_req_post(req, ev);
6674 : }
6675 :
6676 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
6677 : NULL, &ndr_table_svcctl,
6678 0 : NDR_SVCCTL_QUERYSERVICELOCKSTATUSA, state->out_mem_ctx, r);
6679 0 : if (tevent_req_nomem(subreq, req)) {
6680 0 : return tevent_req_post(req, ev);
6681 : }
6682 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceLockStatusA_r_done, req);
6683 :
6684 0 : return req;
6685 : }
6686 :
6687 0 : static void dcerpc_svcctl_QueryServiceLockStatusA_r_done(struct tevent_req *subreq)
6688 : {
6689 0 : struct tevent_req *req =
6690 0 : tevent_req_callback_data(subreq,
6691 : struct tevent_req);
6692 : NTSTATUS status;
6693 :
6694 0 : status = dcerpc_binding_handle_call_recv(subreq);
6695 0 : TALLOC_FREE(subreq);
6696 0 : if (tevent_req_nterror(req, status)) {
6697 0 : return;
6698 : }
6699 :
6700 0 : tevent_req_done(req);
6701 : }
6702 :
6703 0 : NTSTATUS dcerpc_svcctl_QueryServiceLockStatusA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6704 : {
6705 0 : struct dcerpc_svcctl_QueryServiceLockStatusA_r_state *state =
6706 0 : tevent_req_data(req,
6707 : struct dcerpc_svcctl_QueryServiceLockStatusA_r_state);
6708 : NTSTATUS status;
6709 :
6710 0 : if (tevent_req_is_nterror(req, &status)) {
6711 0 : tevent_req_received(req);
6712 0 : return status;
6713 : }
6714 :
6715 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
6716 :
6717 0 : tevent_req_received(req);
6718 0 : return NT_STATUS_OK;
6719 : }
6720 :
6721 0 : NTSTATUS dcerpc_svcctl_QueryServiceLockStatusA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_QueryServiceLockStatusA *r)
6722 : {
6723 : NTSTATUS status;
6724 :
6725 0 : status = dcerpc_binding_handle_call(h,
6726 : NULL, &ndr_table_svcctl,
6727 : NDR_SVCCTL_QUERYSERVICELOCKSTATUSA, mem_ctx, r);
6728 :
6729 0 : return status;
6730 : }
6731 :
6732 : struct dcerpc_svcctl_QueryServiceLockStatusA_state {
6733 : struct svcctl_QueryServiceLockStatusA orig;
6734 : struct svcctl_QueryServiceLockStatusA tmp;
6735 : TALLOC_CTX *out_mem_ctx;
6736 : };
6737 :
6738 : static void dcerpc_svcctl_QueryServiceLockStatusA_done(struct tevent_req *subreq);
6739 :
6740 0 : struct tevent_req *dcerpc_svcctl_QueryServiceLockStatusA_send(TALLOC_CTX *mem_ctx,
6741 : struct tevent_context *ev,
6742 : struct dcerpc_binding_handle *h,
6743 : struct policy_handle *_handle /* [in] [ref] */,
6744 : uint32_t _offered /* [in] */,
6745 : struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
6746 : uint32_t *_needed /* [out] [ref] */)
6747 : {
6748 : struct tevent_req *req;
6749 : struct dcerpc_svcctl_QueryServiceLockStatusA_state *state;
6750 : struct tevent_req *subreq;
6751 :
6752 0 : req = tevent_req_create(mem_ctx, &state,
6753 : struct dcerpc_svcctl_QueryServiceLockStatusA_state);
6754 0 : if (req == NULL) {
6755 0 : return NULL;
6756 : }
6757 0 : state->out_mem_ctx = NULL;
6758 :
6759 : /* In parameters */
6760 0 : state->orig.in.handle = _handle;
6761 0 : state->orig.in.offered = _offered;
6762 :
6763 : /* Out parameters */
6764 0 : state->orig.out.lock_status = _lock_status;
6765 0 : state->orig.out.needed = _needed;
6766 :
6767 : /* Result */
6768 0 : NDR_ZERO_STRUCT(state->orig.out.result);
6769 :
6770 0 : state->out_mem_ctx = talloc_named_const(state, 0,
6771 : "dcerpc_svcctl_QueryServiceLockStatusA_out_memory");
6772 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
6773 0 : return tevent_req_post(req, ev);
6774 : }
6775 :
6776 : /* make a temporary copy, that we pass to the dispatch function */
6777 0 : state->tmp = state->orig;
6778 :
6779 0 : subreq = dcerpc_svcctl_QueryServiceLockStatusA_r_send(state, ev, h, &state->tmp);
6780 0 : if (tevent_req_nomem(subreq, req)) {
6781 0 : return tevent_req_post(req, ev);
6782 : }
6783 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceLockStatusA_done, req);
6784 0 : return req;
6785 : }
6786 :
6787 0 : static void dcerpc_svcctl_QueryServiceLockStatusA_done(struct tevent_req *subreq)
6788 : {
6789 0 : struct tevent_req *req = tevent_req_callback_data(
6790 : subreq, struct tevent_req);
6791 0 : struct dcerpc_svcctl_QueryServiceLockStatusA_state *state = tevent_req_data(
6792 : req, struct dcerpc_svcctl_QueryServiceLockStatusA_state);
6793 : NTSTATUS status;
6794 : TALLOC_CTX *mem_ctx;
6795 :
6796 0 : if (state->out_mem_ctx) {
6797 0 : mem_ctx = state->out_mem_ctx;
6798 : } else {
6799 0 : mem_ctx = state;
6800 : }
6801 :
6802 0 : status = dcerpc_svcctl_QueryServiceLockStatusA_r_recv(subreq, mem_ctx);
6803 0 : TALLOC_FREE(subreq);
6804 0 : if (tevent_req_nterror(req, status)) {
6805 0 : return;
6806 : }
6807 :
6808 : /* Copy out parameters */
6809 0 : *state->orig.out.lock_status = *state->tmp.out.lock_status;
6810 0 : *state->orig.out.needed = *state->tmp.out.needed;
6811 :
6812 : /* Copy result */
6813 0 : state->orig.out.result = state->tmp.out.result;
6814 :
6815 : /* Reset temporary structure */
6816 0 : NDR_ZERO_STRUCT(state->tmp);
6817 :
6818 0 : tevent_req_done(req);
6819 : }
6820 :
6821 0 : NTSTATUS dcerpc_svcctl_QueryServiceLockStatusA_recv(struct tevent_req *req,
6822 : TALLOC_CTX *mem_ctx,
6823 : WERROR *result)
6824 : {
6825 0 : struct dcerpc_svcctl_QueryServiceLockStatusA_state *state = tevent_req_data(
6826 : req, struct dcerpc_svcctl_QueryServiceLockStatusA_state);
6827 : NTSTATUS status;
6828 :
6829 0 : if (tevent_req_is_nterror(req, &status)) {
6830 0 : tevent_req_received(req);
6831 0 : return status;
6832 : }
6833 :
6834 : /* Steal possible out parameters to the callers context */
6835 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
6836 :
6837 : /* Return result */
6838 0 : *result = state->orig.out.result;
6839 :
6840 0 : tevent_req_received(req);
6841 0 : return NT_STATUS_OK;
6842 : }
6843 :
6844 0 : NTSTATUS dcerpc_svcctl_QueryServiceLockStatusA(struct dcerpc_binding_handle *h,
6845 : TALLOC_CTX *mem_ctx,
6846 : struct policy_handle *_handle /* [in] [ref] */,
6847 : uint32_t _offered /* [in] */,
6848 : struct SERVICE_LOCK_STATUS *_lock_status /* [out] [ref] */,
6849 : uint32_t *_needed /* [out] [ref] */,
6850 : WERROR *result)
6851 : {
6852 : struct svcctl_QueryServiceLockStatusA r;
6853 : NTSTATUS status;
6854 :
6855 : /* In parameters */
6856 0 : r.in.handle = _handle;
6857 0 : r.in.offered = _offered;
6858 :
6859 : /* Out parameters */
6860 0 : r.out.lock_status = _lock_status;
6861 0 : r.out.needed = _needed;
6862 :
6863 : /* Result */
6864 0 : NDR_ZERO_STRUCT(r.out.result);
6865 :
6866 0 : status = dcerpc_svcctl_QueryServiceLockStatusA_r(h, mem_ctx, &r);
6867 0 : if (!NT_STATUS_IS_OK(status)) {
6868 0 : return status;
6869 : }
6870 :
6871 : /* Return variables */
6872 0 : *_lock_status = *r.out.lock_status;
6873 0 : *_needed = *r.out.needed;
6874 :
6875 : /* Return result */
6876 0 : *result = r.out.result;
6877 :
6878 0 : return NT_STATUS_OK;
6879 : }
6880 :
6881 : struct dcerpc_svcctl_StartServiceA_r_state {
6882 : TALLOC_CTX *out_mem_ctx;
6883 : };
6884 :
6885 : static void dcerpc_svcctl_StartServiceA_r_done(struct tevent_req *subreq);
6886 :
6887 0 : struct tevent_req *dcerpc_svcctl_StartServiceA_r_send(TALLOC_CTX *mem_ctx,
6888 : struct tevent_context *ev,
6889 : struct dcerpc_binding_handle *h,
6890 : struct svcctl_StartServiceA *r)
6891 : {
6892 : struct tevent_req *req;
6893 : struct dcerpc_svcctl_StartServiceA_r_state *state;
6894 : struct tevent_req *subreq;
6895 :
6896 0 : req = tevent_req_create(mem_ctx, &state,
6897 : struct dcerpc_svcctl_StartServiceA_r_state);
6898 0 : if (req == NULL) {
6899 0 : return NULL;
6900 : }
6901 :
6902 0 : state->out_mem_ctx = NULL;
6903 :
6904 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
6905 : NULL, &ndr_table_svcctl,
6906 : NDR_SVCCTL_STARTSERVICEA, state, r);
6907 0 : if (tevent_req_nomem(subreq, req)) {
6908 0 : return tevent_req_post(req, ev);
6909 : }
6910 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_StartServiceA_r_done, req);
6911 :
6912 0 : return req;
6913 : }
6914 :
6915 0 : static void dcerpc_svcctl_StartServiceA_r_done(struct tevent_req *subreq)
6916 : {
6917 0 : struct tevent_req *req =
6918 0 : tevent_req_callback_data(subreq,
6919 : struct tevent_req);
6920 : NTSTATUS status;
6921 :
6922 0 : status = dcerpc_binding_handle_call_recv(subreq);
6923 0 : TALLOC_FREE(subreq);
6924 0 : if (tevent_req_nterror(req, status)) {
6925 0 : return;
6926 : }
6927 :
6928 0 : tevent_req_done(req);
6929 : }
6930 :
6931 0 : NTSTATUS dcerpc_svcctl_StartServiceA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
6932 : {
6933 0 : struct dcerpc_svcctl_StartServiceA_r_state *state =
6934 0 : tevent_req_data(req,
6935 : struct dcerpc_svcctl_StartServiceA_r_state);
6936 : NTSTATUS status;
6937 :
6938 0 : if (tevent_req_is_nterror(req, &status)) {
6939 0 : tevent_req_received(req);
6940 0 : return status;
6941 : }
6942 :
6943 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
6944 :
6945 0 : tevent_req_received(req);
6946 0 : return NT_STATUS_OK;
6947 : }
6948 :
6949 0 : NTSTATUS dcerpc_svcctl_StartServiceA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_StartServiceA *r)
6950 : {
6951 : NTSTATUS status;
6952 :
6953 0 : status = dcerpc_binding_handle_call(h,
6954 : NULL, &ndr_table_svcctl,
6955 : NDR_SVCCTL_STARTSERVICEA, mem_ctx, r);
6956 :
6957 0 : return status;
6958 : }
6959 :
6960 : struct dcerpc_svcctl_StartServiceA_state {
6961 : struct svcctl_StartServiceA orig;
6962 : struct svcctl_StartServiceA tmp;
6963 : TALLOC_CTX *out_mem_ctx;
6964 : };
6965 :
6966 : static void dcerpc_svcctl_StartServiceA_done(struct tevent_req *subreq);
6967 :
6968 0 : struct tevent_req *dcerpc_svcctl_StartServiceA_send(TALLOC_CTX *mem_ctx,
6969 : struct tevent_context *ev,
6970 : struct dcerpc_binding_handle *h,
6971 : struct policy_handle *_handle /* [in] [ref] */,
6972 : uint32_t _NumArgs /* [in] */,
6973 : const char *_Arguments /* [in] [charset(UTF16),unique] */)
6974 : {
6975 : struct tevent_req *req;
6976 : struct dcerpc_svcctl_StartServiceA_state *state;
6977 : struct tevent_req *subreq;
6978 :
6979 0 : req = tevent_req_create(mem_ctx, &state,
6980 : struct dcerpc_svcctl_StartServiceA_state);
6981 0 : if (req == NULL) {
6982 0 : return NULL;
6983 : }
6984 0 : state->out_mem_ctx = NULL;
6985 :
6986 : /* In parameters */
6987 0 : state->orig.in.handle = _handle;
6988 0 : state->orig.in.NumArgs = _NumArgs;
6989 0 : state->orig.in.Arguments = _Arguments;
6990 :
6991 : /* Out parameters */
6992 :
6993 : /* Result */
6994 0 : NDR_ZERO_STRUCT(state->orig.out.result);
6995 :
6996 : /* make a temporary copy, that we pass to the dispatch function */
6997 0 : state->tmp = state->orig;
6998 :
6999 0 : subreq = dcerpc_svcctl_StartServiceA_r_send(state, ev, h, &state->tmp);
7000 0 : if (tevent_req_nomem(subreq, req)) {
7001 0 : return tevent_req_post(req, ev);
7002 : }
7003 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_StartServiceA_done, req);
7004 0 : return req;
7005 : }
7006 :
7007 0 : static void dcerpc_svcctl_StartServiceA_done(struct tevent_req *subreq)
7008 : {
7009 0 : struct tevent_req *req = tevent_req_callback_data(
7010 : subreq, struct tevent_req);
7011 0 : struct dcerpc_svcctl_StartServiceA_state *state = tevent_req_data(
7012 : req, struct dcerpc_svcctl_StartServiceA_state);
7013 : NTSTATUS status;
7014 : TALLOC_CTX *mem_ctx;
7015 :
7016 0 : if (state->out_mem_ctx) {
7017 0 : mem_ctx = state->out_mem_ctx;
7018 : } else {
7019 0 : mem_ctx = state;
7020 : }
7021 :
7022 0 : status = dcerpc_svcctl_StartServiceA_r_recv(subreq, mem_ctx);
7023 0 : TALLOC_FREE(subreq);
7024 0 : if (tevent_req_nterror(req, status)) {
7025 0 : return;
7026 : }
7027 :
7028 : /* Copy out parameters */
7029 :
7030 : /* Copy result */
7031 0 : state->orig.out.result = state->tmp.out.result;
7032 :
7033 : /* Reset temporary structure */
7034 0 : NDR_ZERO_STRUCT(state->tmp);
7035 :
7036 0 : tevent_req_done(req);
7037 : }
7038 :
7039 0 : NTSTATUS dcerpc_svcctl_StartServiceA_recv(struct tevent_req *req,
7040 : TALLOC_CTX *mem_ctx,
7041 : WERROR *result)
7042 : {
7043 0 : struct dcerpc_svcctl_StartServiceA_state *state = tevent_req_data(
7044 : req, struct dcerpc_svcctl_StartServiceA_state);
7045 : NTSTATUS status;
7046 :
7047 0 : if (tevent_req_is_nterror(req, &status)) {
7048 0 : tevent_req_received(req);
7049 0 : return status;
7050 : }
7051 :
7052 : /* Steal possible out parameters to the callers context */
7053 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
7054 :
7055 : /* Return result */
7056 0 : *result = state->orig.out.result;
7057 :
7058 0 : tevent_req_received(req);
7059 0 : return NT_STATUS_OK;
7060 : }
7061 :
7062 0 : NTSTATUS dcerpc_svcctl_StartServiceA(struct dcerpc_binding_handle *h,
7063 : TALLOC_CTX *mem_ctx,
7064 : struct policy_handle *_handle /* [in] [ref] */,
7065 : uint32_t _NumArgs /* [in] */,
7066 : const char *_Arguments /* [in] [charset(UTF16),unique] */,
7067 : WERROR *result)
7068 : {
7069 : struct svcctl_StartServiceA r;
7070 : NTSTATUS status;
7071 :
7072 : /* In parameters */
7073 0 : r.in.handle = _handle;
7074 0 : r.in.NumArgs = _NumArgs;
7075 0 : r.in.Arguments = _Arguments;
7076 :
7077 : /* Out parameters */
7078 :
7079 : /* Result */
7080 0 : NDR_ZERO_STRUCT(r.out.result);
7081 :
7082 0 : status = dcerpc_svcctl_StartServiceA_r(h, mem_ctx, &r);
7083 0 : if (!NT_STATUS_IS_OK(status)) {
7084 0 : return status;
7085 : }
7086 :
7087 : /* Return variables */
7088 :
7089 : /* Return result */
7090 0 : *result = r.out.result;
7091 :
7092 0 : return NT_STATUS_OK;
7093 : }
7094 :
7095 : struct dcerpc_svcctl_GetServiceDisplayNameA_r_state {
7096 : TALLOC_CTX *out_mem_ctx;
7097 : };
7098 :
7099 : static void dcerpc_svcctl_GetServiceDisplayNameA_r_done(struct tevent_req *subreq);
7100 :
7101 0 : struct tevent_req *dcerpc_svcctl_GetServiceDisplayNameA_r_send(TALLOC_CTX *mem_ctx,
7102 : struct tevent_context *ev,
7103 : struct dcerpc_binding_handle *h,
7104 : struct svcctl_GetServiceDisplayNameA *r)
7105 : {
7106 : struct tevent_req *req;
7107 : struct dcerpc_svcctl_GetServiceDisplayNameA_r_state *state;
7108 : struct tevent_req *subreq;
7109 :
7110 0 : req = tevent_req_create(mem_ctx, &state,
7111 : struct dcerpc_svcctl_GetServiceDisplayNameA_r_state);
7112 0 : if (req == NULL) {
7113 0 : return NULL;
7114 : }
7115 :
7116 0 : state->out_mem_ctx = talloc_new(state);
7117 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
7118 0 : return tevent_req_post(req, ev);
7119 : }
7120 :
7121 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
7122 : NULL, &ndr_table_svcctl,
7123 0 : NDR_SVCCTL_GETSERVICEDISPLAYNAMEA, state->out_mem_ctx, r);
7124 0 : if (tevent_req_nomem(subreq, req)) {
7125 0 : return tevent_req_post(req, ev);
7126 : }
7127 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_GetServiceDisplayNameA_r_done, req);
7128 :
7129 0 : return req;
7130 : }
7131 :
7132 0 : static void dcerpc_svcctl_GetServiceDisplayNameA_r_done(struct tevent_req *subreq)
7133 : {
7134 0 : struct tevent_req *req =
7135 0 : tevent_req_callback_data(subreq,
7136 : struct tevent_req);
7137 : NTSTATUS status;
7138 :
7139 0 : status = dcerpc_binding_handle_call_recv(subreq);
7140 0 : TALLOC_FREE(subreq);
7141 0 : if (tevent_req_nterror(req, status)) {
7142 0 : return;
7143 : }
7144 :
7145 0 : tevent_req_done(req);
7146 : }
7147 :
7148 0 : NTSTATUS dcerpc_svcctl_GetServiceDisplayNameA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7149 : {
7150 0 : struct dcerpc_svcctl_GetServiceDisplayNameA_r_state *state =
7151 0 : tevent_req_data(req,
7152 : struct dcerpc_svcctl_GetServiceDisplayNameA_r_state);
7153 : NTSTATUS status;
7154 :
7155 0 : if (tevent_req_is_nterror(req, &status)) {
7156 0 : tevent_req_received(req);
7157 0 : return status;
7158 : }
7159 :
7160 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
7161 :
7162 0 : tevent_req_received(req);
7163 0 : return NT_STATUS_OK;
7164 : }
7165 :
7166 0 : NTSTATUS dcerpc_svcctl_GetServiceDisplayNameA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_GetServiceDisplayNameA *r)
7167 : {
7168 : NTSTATUS status;
7169 :
7170 0 : status = dcerpc_binding_handle_call(h,
7171 : NULL, &ndr_table_svcctl,
7172 : NDR_SVCCTL_GETSERVICEDISPLAYNAMEA, mem_ctx, r);
7173 :
7174 0 : return status;
7175 : }
7176 :
7177 : struct dcerpc_svcctl_GetServiceDisplayNameA_state {
7178 : struct svcctl_GetServiceDisplayNameA orig;
7179 : struct svcctl_GetServiceDisplayNameA tmp;
7180 : TALLOC_CTX *out_mem_ctx;
7181 : };
7182 :
7183 : static void dcerpc_svcctl_GetServiceDisplayNameA_done(struct tevent_req *subreq);
7184 :
7185 0 : struct tevent_req *dcerpc_svcctl_GetServiceDisplayNameA_send(TALLOC_CTX *mem_ctx,
7186 : struct tevent_context *ev,
7187 : struct dcerpc_binding_handle *h,
7188 : struct policy_handle *_handle /* [in] [ref] */,
7189 : const char *_service_name /* [in] [charset(UTF16),unique] */,
7190 : const char **_display_name /* [out] [charset(UTF16),ref] */,
7191 : uint32_t *_display_name_length /* [in,out] [unique] */)
7192 : {
7193 : struct tevent_req *req;
7194 : struct dcerpc_svcctl_GetServiceDisplayNameA_state *state;
7195 : struct tevent_req *subreq;
7196 :
7197 0 : req = tevent_req_create(mem_ctx, &state,
7198 : struct dcerpc_svcctl_GetServiceDisplayNameA_state);
7199 0 : if (req == NULL) {
7200 0 : return NULL;
7201 : }
7202 0 : state->out_mem_ctx = NULL;
7203 :
7204 : /* In parameters */
7205 0 : state->orig.in.handle = _handle;
7206 0 : state->orig.in.service_name = _service_name;
7207 0 : state->orig.in.display_name_length = _display_name_length;
7208 :
7209 : /* Out parameters */
7210 0 : state->orig.out.display_name = _display_name;
7211 0 : state->orig.out.display_name_length = _display_name_length;
7212 :
7213 : /* Result */
7214 0 : NDR_ZERO_STRUCT(state->orig.out.result);
7215 :
7216 0 : state->out_mem_ctx = talloc_named_const(state, 0,
7217 : "dcerpc_svcctl_GetServiceDisplayNameA_out_memory");
7218 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
7219 0 : return tevent_req_post(req, ev);
7220 : }
7221 :
7222 : /* make a temporary copy, that we pass to the dispatch function */
7223 0 : state->tmp = state->orig;
7224 :
7225 0 : subreq = dcerpc_svcctl_GetServiceDisplayNameA_r_send(state, ev, h, &state->tmp);
7226 0 : if (tevent_req_nomem(subreq, req)) {
7227 0 : return tevent_req_post(req, ev);
7228 : }
7229 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_GetServiceDisplayNameA_done, req);
7230 0 : return req;
7231 : }
7232 :
7233 0 : static void dcerpc_svcctl_GetServiceDisplayNameA_done(struct tevent_req *subreq)
7234 : {
7235 0 : struct tevent_req *req = tevent_req_callback_data(
7236 : subreq, struct tevent_req);
7237 0 : struct dcerpc_svcctl_GetServiceDisplayNameA_state *state = tevent_req_data(
7238 : req, struct dcerpc_svcctl_GetServiceDisplayNameA_state);
7239 : NTSTATUS status;
7240 : TALLOC_CTX *mem_ctx;
7241 :
7242 0 : if (state->out_mem_ctx) {
7243 0 : mem_ctx = state->out_mem_ctx;
7244 : } else {
7245 0 : mem_ctx = state;
7246 : }
7247 :
7248 0 : status = dcerpc_svcctl_GetServiceDisplayNameA_r_recv(subreq, mem_ctx);
7249 0 : TALLOC_FREE(subreq);
7250 0 : if (tevent_req_nterror(req, status)) {
7251 0 : return;
7252 : }
7253 :
7254 : /* Copy out parameters */
7255 0 : *state->orig.out.display_name = *state->tmp.out.display_name;
7256 0 : if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
7257 0 : *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
7258 : }
7259 :
7260 : /* Copy result */
7261 0 : state->orig.out.result = state->tmp.out.result;
7262 :
7263 : /* Reset temporary structure */
7264 0 : NDR_ZERO_STRUCT(state->tmp);
7265 :
7266 0 : tevent_req_done(req);
7267 : }
7268 :
7269 0 : NTSTATUS dcerpc_svcctl_GetServiceDisplayNameA_recv(struct tevent_req *req,
7270 : TALLOC_CTX *mem_ctx,
7271 : WERROR *result)
7272 : {
7273 0 : struct dcerpc_svcctl_GetServiceDisplayNameA_state *state = tevent_req_data(
7274 : req, struct dcerpc_svcctl_GetServiceDisplayNameA_state);
7275 : NTSTATUS status;
7276 :
7277 0 : if (tevent_req_is_nterror(req, &status)) {
7278 0 : tevent_req_received(req);
7279 0 : return status;
7280 : }
7281 :
7282 : /* Steal possible out parameters to the callers context */
7283 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
7284 :
7285 : /* Return result */
7286 0 : *result = state->orig.out.result;
7287 :
7288 0 : tevent_req_received(req);
7289 0 : return NT_STATUS_OK;
7290 : }
7291 :
7292 0 : NTSTATUS dcerpc_svcctl_GetServiceDisplayNameA(struct dcerpc_binding_handle *h,
7293 : TALLOC_CTX *mem_ctx,
7294 : struct policy_handle *_handle /* [in] [ref] */,
7295 : const char *_service_name /* [in] [charset(UTF16),unique] */,
7296 : const char **_display_name /* [out] [charset(UTF16),ref] */,
7297 : uint32_t *_display_name_length /* [in,out] [unique] */,
7298 : WERROR *result)
7299 : {
7300 : struct svcctl_GetServiceDisplayNameA r;
7301 : NTSTATUS status;
7302 :
7303 : /* In parameters */
7304 0 : r.in.handle = _handle;
7305 0 : r.in.service_name = _service_name;
7306 0 : r.in.display_name_length = _display_name_length;
7307 :
7308 : /* Out parameters */
7309 0 : r.out.display_name = _display_name;
7310 0 : r.out.display_name_length = _display_name_length;
7311 :
7312 : /* Result */
7313 0 : NDR_ZERO_STRUCT(r.out.result);
7314 :
7315 0 : status = dcerpc_svcctl_GetServiceDisplayNameA_r(h, mem_ctx, &r);
7316 0 : if (!NT_STATUS_IS_OK(status)) {
7317 0 : return status;
7318 : }
7319 :
7320 : /* Return variables */
7321 0 : *_display_name = *r.out.display_name;
7322 0 : if (_display_name_length && r.out.display_name_length) {
7323 0 : *_display_name_length = *r.out.display_name_length;
7324 : }
7325 :
7326 : /* Return result */
7327 0 : *result = r.out.result;
7328 :
7329 0 : return NT_STATUS_OK;
7330 : }
7331 :
7332 : struct dcerpc_svcctl_GetServiceKeyNameA_r_state {
7333 : TALLOC_CTX *out_mem_ctx;
7334 : };
7335 :
7336 : static void dcerpc_svcctl_GetServiceKeyNameA_r_done(struct tevent_req *subreq);
7337 :
7338 0 : struct tevent_req *dcerpc_svcctl_GetServiceKeyNameA_r_send(TALLOC_CTX *mem_ctx,
7339 : struct tevent_context *ev,
7340 : struct dcerpc_binding_handle *h,
7341 : struct svcctl_GetServiceKeyNameA *r)
7342 : {
7343 : struct tevent_req *req;
7344 : struct dcerpc_svcctl_GetServiceKeyNameA_r_state *state;
7345 : struct tevent_req *subreq;
7346 :
7347 0 : req = tevent_req_create(mem_ctx, &state,
7348 : struct dcerpc_svcctl_GetServiceKeyNameA_r_state);
7349 0 : if (req == NULL) {
7350 0 : return NULL;
7351 : }
7352 :
7353 0 : state->out_mem_ctx = talloc_new(state);
7354 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
7355 0 : return tevent_req_post(req, ev);
7356 : }
7357 :
7358 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
7359 : NULL, &ndr_table_svcctl,
7360 0 : NDR_SVCCTL_GETSERVICEKEYNAMEA, state->out_mem_ctx, r);
7361 0 : if (tevent_req_nomem(subreq, req)) {
7362 0 : return tevent_req_post(req, ev);
7363 : }
7364 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_GetServiceKeyNameA_r_done, req);
7365 :
7366 0 : return req;
7367 : }
7368 :
7369 0 : static void dcerpc_svcctl_GetServiceKeyNameA_r_done(struct tevent_req *subreq)
7370 : {
7371 0 : struct tevent_req *req =
7372 0 : tevent_req_callback_data(subreq,
7373 : struct tevent_req);
7374 : NTSTATUS status;
7375 :
7376 0 : status = dcerpc_binding_handle_call_recv(subreq);
7377 0 : TALLOC_FREE(subreq);
7378 0 : if (tevent_req_nterror(req, status)) {
7379 0 : return;
7380 : }
7381 :
7382 0 : tevent_req_done(req);
7383 : }
7384 :
7385 0 : NTSTATUS dcerpc_svcctl_GetServiceKeyNameA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7386 : {
7387 0 : struct dcerpc_svcctl_GetServiceKeyNameA_r_state *state =
7388 0 : tevent_req_data(req,
7389 : struct dcerpc_svcctl_GetServiceKeyNameA_r_state);
7390 : NTSTATUS status;
7391 :
7392 0 : if (tevent_req_is_nterror(req, &status)) {
7393 0 : tevent_req_received(req);
7394 0 : return status;
7395 : }
7396 :
7397 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
7398 :
7399 0 : tevent_req_received(req);
7400 0 : return NT_STATUS_OK;
7401 : }
7402 :
7403 0 : NTSTATUS dcerpc_svcctl_GetServiceKeyNameA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_GetServiceKeyNameA *r)
7404 : {
7405 : NTSTATUS status;
7406 :
7407 0 : status = dcerpc_binding_handle_call(h,
7408 : NULL, &ndr_table_svcctl,
7409 : NDR_SVCCTL_GETSERVICEKEYNAMEA, mem_ctx, r);
7410 :
7411 0 : return status;
7412 : }
7413 :
7414 : struct dcerpc_svcctl_GetServiceKeyNameA_state {
7415 : struct svcctl_GetServiceKeyNameA orig;
7416 : struct svcctl_GetServiceKeyNameA tmp;
7417 : TALLOC_CTX *out_mem_ctx;
7418 : };
7419 :
7420 : static void dcerpc_svcctl_GetServiceKeyNameA_done(struct tevent_req *subreq);
7421 :
7422 0 : struct tevent_req *dcerpc_svcctl_GetServiceKeyNameA_send(TALLOC_CTX *mem_ctx,
7423 : struct tevent_context *ev,
7424 : struct dcerpc_binding_handle *h,
7425 : struct policy_handle *_handle /* [in] [ref] */,
7426 : const char *_service_name /* [in] [charset(UTF16),unique] */,
7427 : const char **_key_name /* [out] [charset(UTF16),ref] */,
7428 : uint32_t *_display_name_length /* [in,out] [unique] */)
7429 : {
7430 : struct tevent_req *req;
7431 : struct dcerpc_svcctl_GetServiceKeyNameA_state *state;
7432 : struct tevent_req *subreq;
7433 :
7434 0 : req = tevent_req_create(mem_ctx, &state,
7435 : struct dcerpc_svcctl_GetServiceKeyNameA_state);
7436 0 : if (req == NULL) {
7437 0 : return NULL;
7438 : }
7439 0 : state->out_mem_ctx = NULL;
7440 :
7441 : /* In parameters */
7442 0 : state->orig.in.handle = _handle;
7443 0 : state->orig.in.service_name = _service_name;
7444 0 : state->orig.in.display_name_length = _display_name_length;
7445 :
7446 : /* Out parameters */
7447 0 : state->orig.out.key_name = _key_name;
7448 0 : state->orig.out.display_name_length = _display_name_length;
7449 :
7450 : /* Result */
7451 0 : NDR_ZERO_STRUCT(state->orig.out.result);
7452 :
7453 0 : state->out_mem_ctx = talloc_named_const(state, 0,
7454 : "dcerpc_svcctl_GetServiceKeyNameA_out_memory");
7455 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
7456 0 : return tevent_req_post(req, ev);
7457 : }
7458 :
7459 : /* make a temporary copy, that we pass to the dispatch function */
7460 0 : state->tmp = state->orig;
7461 :
7462 0 : subreq = dcerpc_svcctl_GetServiceKeyNameA_r_send(state, ev, h, &state->tmp);
7463 0 : if (tevent_req_nomem(subreq, req)) {
7464 0 : return tevent_req_post(req, ev);
7465 : }
7466 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_GetServiceKeyNameA_done, req);
7467 0 : return req;
7468 : }
7469 :
7470 0 : static void dcerpc_svcctl_GetServiceKeyNameA_done(struct tevent_req *subreq)
7471 : {
7472 0 : struct tevent_req *req = tevent_req_callback_data(
7473 : subreq, struct tevent_req);
7474 0 : struct dcerpc_svcctl_GetServiceKeyNameA_state *state = tevent_req_data(
7475 : req, struct dcerpc_svcctl_GetServiceKeyNameA_state);
7476 : NTSTATUS status;
7477 : TALLOC_CTX *mem_ctx;
7478 :
7479 0 : if (state->out_mem_ctx) {
7480 0 : mem_ctx = state->out_mem_ctx;
7481 : } else {
7482 0 : mem_ctx = state;
7483 : }
7484 :
7485 0 : status = dcerpc_svcctl_GetServiceKeyNameA_r_recv(subreq, mem_ctx);
7486 0 : TALLOC_FREE(subreq);
7487 0 : if (tevent_req_nterror(req, status)) {
7488 0 : return;
7489 : }
7490 :
7491 : /* Copy out parameters */
7492 0 : *state->orig.out.key_name = *state->tmp.out.key_name;
7493 0 : if (state->orig.out.display_name_length && state->tmp.out.display_name_length) {
7494 0 : *state->orig.out.display_name_length = *state->tmp.out.display_name_length;
7495 : }
7496 :
7497 : /* Copy result */
7498 0 : state->orig.out.result = state->tmp.out.result;
7499 :
7500 : /* Reset temporary structure */
7501 0 : NDR_ZERO_STRUCT(state->tmp);
7502 :
7503 0 : tevent_req_done(req);
7504 : }
7505 :
7506 0 : NTSTATUS dcerpc_svcctl_GetServiceKeyNameA_recv(struct tevent_req *req,
7507 : TALLOC_CTX *mem_ctx,
7508 : WERROR *result)
7509 : {
7510 0 : struct dcerpc_svcctl_GetServiceKeyNameA_state *state = tevent_req_data(
7511 : req, struct dcerpc_svcctl_GetServiceKeyNameA_state);
7512 : NTSTATUS status;
7513 :
7514 0 : if (tevent_req_is_nterror(req, &status)) {
7515 0 : tevent_req_received(req);
7516 0 : return status;
7517 : }
7518 :
7519 : /* Steal possible out parameters to the callers context */
7520 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
7521 :
7522 : /* Return result */
7523 0 : *result = state->orig.out.result;
7524 :
7525 0 : tevent_req_received(req);
7526 0 : return NT_STATUS_OK;
7527 : }
7528 :
7529 0 : NTSTATUS dcerpc_svcctl_GetServiceKeyNameA(struct dcerpc_binding_handle *h,
7530 : TALLOC_CTX *mem_ctx,
7531 : struct policy_handle *_handle /* [in] [ref] */,
7532 : const char *_service_name /* [in] [charset(UTF16),unique] */,
7533 : const char **_key_name /* [out] [charset(UTF16),ref] */,
7534 : uint32_t *_display_name_length /* [in,out] [unique] */,
7535 : WERROR *result)
7536 : {
7537 : struct svcctl_GetServiceKeyNameA r;
7538 : NTSTATUS status;
7539 :
7540 : /* In parameters */
7541 0 : r.in.handle = _handle;
7542 0 : r.in.service_name = _service_name;
7543 0 : r.in.display_name_length = _display_name_length;
7544 :
7545 : /* Out parameters */
7546 0 : r.out.key_name = _key_name;
7547 0 : r.out.display_name_length = _display_name_length;
7548 :
7549 : /* Result */
7550 0 : NDR_ZERO_STRUCT(r.out.result);
7551 :
7552 0 : status = dcerpc_svcctl_GetServiceKeyNameA_r(h, mem_ctx, &r);
7553 0 : if (!NT_STATUS_IS_OK(status)) {
7554 0 : return status;
7555 : }
7556 :
7557 : /* Return variables */
7558 0 : *_key_name = *r.out.key_name;
7559 0 : if (_display_name_length && r.out.display_name_length) {
7560 0 : *_display_name_length = *r.out.display_name_length;
7561 : }
7562 :
7563 : /* Return result */
7564 0 : *result = r.out.result;
7565 :
7566 0 : return NT_STATUS_OK;
7567 : }
7568 :
7569 : struct dcerpc_svcctl_ChangeServiceConfig2A_r_state {
7570 : TALLOC_CTX *out_mem_ctx;
7571 : };
7572 :
7573 : static void dcerpc_svcctl_ChangeServiceConfig2A_r_done(struct tevent_req *subreq);
7574 :
7575 0 : struct tevent_req *dcerpc_svcctl_ChangeServiceConfig2A_r_send(TALLOC_CTX *mem_ctx,
7576 : struct tevent_context *ev,
7577 : struct dcerpc_binding_handle *h,
7578 : struct svcctl_ChangeServiceConfig2A *r)
7579 : {
7580 : struct tevent_req *req;
7581 : struct dcerpc_svcctl_ChangeServiceConfig2A_r_state *state;
7582 : struct tevent_req *subreq;
7583 :
7584 0 : req = tevent_req_create(mem_ctx, &state,
7585 : struct dcerpc_svcctl_ChangeServiceConfig2A_r_state);
7586 0 : if (req == NULL) {
7587 0 : return NULL;
7588 : }
7589 :
7590 0 : state->out_mem_ctx = NULL;
7591 :
7592 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
7593 : NULL, &ndr_table_svcctl,
7594 : NDR_SVCCTL_CHANGESERVICECONFIG2A, state, r);
7595 0 : if (tevent_req_nomem(subreq, req)) {
7596 0 : return tevent_req_post(req, ev);
7597 : }
7598 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ChangeServiceConfig2A_r_done, req);
7599 :
7600 0 : return req;
7601 : }
7602 :
7603 0 : static void dcerpc_svcctl_ChangeServiceConfig2A_r_done(struct tevent_req *subreq)
7604 : {
7605 0 : struct tevent_req *req =
7606 0 : tevent_req_callback_data(subreq,
7607 : struct tevent_req);
7608 : NTSTATUS status;
7609 :
7610 0 : status = dcerpc_binding_handle_call_recv(subreq);
7611 0 : TALLOC_FREE(subreq);
7612 0 : if (tevent_req_nterror(req, status)) {
7613 0 : return;
7614 : }
7615 :
7616 0 : tevent_req_done(req);
7617 : }
7618 :
7619 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfig2A_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7620 : {
7621 0 : struct dcerpc_svcctl_ChangeServiceConfig2A_r_state *state =
7622 0 : tevent_req_data(req,
7623 : struct dcerpc_svcctl_ChangeServiceConfig2A_r_state);
7624 : NTSTATUS status;
7625 :
7626 0 : if (tevent_req_is_nterror(req, &status)) {
7627 0 : tevent_req_received(req);
7628 0 : return status;
7629 : }
7630 :
7631 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
7632 :
7633 0 : tevent_req_received(req);
7634 0 : return NT_STATUS_OK;
7635 : }
7636 :
7637 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfig2A_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_ChangeServiceConfig2A *r)
7638 : {
7639 : NTSTATUS status;
7640 :
7641 0 : status = dcerpc_binding_handle_call(h,
7642 : NULL, &ndr_table_svcctl,
7643 : NDR_SVCCTL_CHANGESERVICECONFIG2A, mem_ctx, r);
7644 :
7645 0 : return status;
7646 : }
7647 :
7648 : struct dcerpc_svcctl_ChangeServiceConfig2A_state {
7649 : struct svcctl_ChangeServiceConfig2A orig;
7650 : struct svcctl_ChangeServiceConfig2A tmp;
7651 : TALLOC_CTX *out_mem_ctx;
7652 : };
7653 :
7654 : static void dcerpc_svcctl_ChangeServiceConfig2A_done(struct tevent_req *subreq);
7655 :
7656 0 : struct tevent_req *dcerpc_svcctl_ChangeServiceConfig2A_send(TALLOC_CTX *mem_ctx,
7657 : struct tevent_context *ev,
7658 : struct dcerpc_binding_handle *h,
7659 : struct policy_handle *_handle /* [in] [ref] */,
7660 : uint32_t _info_level /* [in] */,
7661 : uint8_t *_info /* [in] [unique] */)
7662 : {
7663 : struct tevent_req *req;
7664 : struct dcerpc_svcctl_ChangeServiceConfig2A_state *state;
7665 : struct tevent_req *subreq;
7666 :
7667 0 : req = tevent_req_create(mem_ctx, &state,
7668 : struct dcerpc_svcctl_ChangeServiceConfig2A_state);
7669 0 : if (req == NULL) {
7670 0 : return NULL;
7671 : }
7672 0 : state->out_mem_ctx = NULL;
7673 :
7674 : /* In parameters */
7675 0 : state->orig.in.handle = _handle;
7676 0 : state->orig.in.info_level = _info_level;
7677 0 : state->orig.in.info = _info;
7678 :
7679 : /* Out parameters */
7680 :
7681 : /* Result */
7682 0 : NDR_ZERO_STRUCT(state->orig.out.result);
7683 :
7684 : /* make a temporary copy, that we pass to the dispatch function */
7685 0 : state->tmp = state->orig;
7686 :
7687 0 : subreq = dcerpc_svcctl_ChangeServiceConfig2A_r_send(state, ev, h, &state->tmp);
7688 0 : if (tevent_req_nomem(subreq, req)) {
7689 0 : return tevent_req_post(req, ev);
7690 : }
7691 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ChangeServiceConfig2A_done, req);
7692 0 : return req;
7693 : }
7694 :
7695 0 : static void dcerpc_svcctl_ChangeServiceConfig2A_done(struct tevent_req *subreq)
7696 : {
7697 0 : struct tevent_req *req = tevent_req_callback_data(
7698 : subreq, struct tevent_req);
7699 0 : struct dcerpc_svcctl_ChangeServiceConfig2A_state *state = tevent_req_data(
7700 : req, struct dcerpc_svcctl_ChangeServiceConfig2A_state);
7701 : NTSTATUS status;
7702 : TALLOC_CTX *mem_ctx;
7703 :
7704 0 : if (state->out_mem_ctx) {
7705 0 : mem_ctx = state->out_mem_ctx;
7706 : } else {
7707 0 : mem_ctx = state;
7708 : }
7709 :
7710 0 : status = dcerpc_svcctl_ChangeServiceConfig2A_r_recv(subreq, mem_ctx);
7711 0 : TALLOC_FREE(subreq);
7712 0 : if (tevent_req_nterror(req, status)) {
7713 0 : return;
7714 : }
7715 :
7716 : /* Copy out parameters */
7717 :
7718 : /* Copy result */
7719 0 : state->orig.out.result = state->tmp.out.result;
7720 :
7721 : /* Reset temporary structure */
7722 0 : NDR_ZERO_STRUCT(state->tmp);
7723 :
7724 0 : tevent_req_done(req);
7725 : }
7726 :
7727 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfig2A_recv(struct tevent_req *req,
7728 : TALLOC_CTX *mem_ctx,
7729 : WERROR *result)
7730 : {
7731 0 : struct dcerpc_svcctl_ChangeServiceConfig2A_state *state = tevent_req_data(
7732 : req, struct dcerpc_svcctl_ChangeServiceConfig2A_state);
7733 : NTSTATUS status;
7734 :
7735 0 : if (tevent_req_is_nterror(req, &status)) {
7736 0 : tevent_req_received(req);
7737 0 : return status;
7738 : }
7739 :
7740 : /* Steal possible out parameters to the callers context */
7741 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
7742 :
7743 : /* Return result */
7744 0 : *result = state->orig.out.result;
7745 :
7746 0 : tevent_req_received(req);
7747 0 : return NT_STATUS_OK;
7748 : }
7749 :
7750 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfig2A(struct dcerpc_binding_handle *h,
7751 : TALLOC_CTX *mem_ctx,
7752 : struct policy_handle *_handle /* [in] [ref] */,
7753 : uint32_t _info_level /* [in] */,
7754 : uint8_t *_info /* [in] [unique] */,
7755 : WERROR *result)
7756 : {
7757 : struct svcctl_ChangeServiceConfig2A r;
7758 : NTSTATUS status;
7759 :
7760 : /* In parameters */
7761 0 : r.in.handle = _handle;
7762 0 : r.in.info_level = _info_level;
7763 0 : r.in.info = _info;
7764 :
7765 : /* Out parameters */
7766 :
7767 : /* Result */
7768 0 : NDR_ZERO_STRUCT(r.out.result);
7769 :
7770 0 : status = dcerpc_svcctl_ChangeServiceConfig2A_r(h, mem_ctx, &r);
7771 0 : if (!NT_STATUS_IS_OK(status)) {
7772 0 : return status;
7773 : }
7774 :
7775 : /* Return variables */
7776 :
7777 : /* Return result */
7778 0 : *result = r.out.result;
7779 :
7780 0 : return NT_STATUS_OK;
7781 : }
7782 :
7783 : struct dcerpc_svcctl_ChangeServiceConfig2W_r_state {
7784 : TALLOC_CTX *out_mem_ctx;
7785 : };
7786 :
7787 : static void dcerpc_svcctl_ChangeServiceConfig2W_r_done(struct tevent_req *subreq);
7788 :
7789 0 : struct tevent_req *dcerpc_svcctl_ChangeServiceConfig2W_r_send(TALLOC_CTX *mem_ctx,
7790 : struct tevent_context *ev,
7791 : struct dcerpc_binding_handle *h,
7792 : struct svcctl_ChangeServiceConfig2W *r)
7793 : {
7794 : struct tevent_req *req;
7795 : struct dcerpc_svcctl_ChangeServiceConfig2W_r_state *state;
7796 : struct tevent_req *subreq;
7797 :
7798 0 : req = tevent_req_create(mem_ctx, &state,
7799 : struct dcerpc_svcctl_ChangeServiceConfig2W_r_state);
7800 0 : if (req == NULL) {
7801 0 : return NULL;
7802 : }
7803 :
7804 0 : state->out_mem_ctx = NULL;
7805 :
7806 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
7807 : NULL, &ndr_table_svcctl,
7808 : NDR_SVCCTL_CHANGESERVICECONFIG2W, state, r);
7809 0 : if (tevent_req_nomem(subreq, req)) {
7810 0 : return tevent_req_post(req, ev);
7811 : }
7812 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ChangeServiceConfig2W_r_done, req);
7813 :
7814 0 : return req;
7815 : }
7816 :
7817 0 : static void dcerpc_svcctl_ChangeServiceConfig2W_r_done(struct tevent_req *subreq)
7818 : {
7819 0 : struct tevent_req *req =
7820 0 : tevent_req_callback_data(subreq,
7821 : struct tevent_req);
7822 : NTSTATUS status;
7823 :
7824 0 : status = dcerpc_binding_handle_call_recv(subreq);
7825 0 : TALLOC_FREE(subreq);
7826 0 : if (tevent_req_nterror(req, status)) {
7827 0 : return;
7828 : }
7829 :
7830 0 : tevent_req_done(req);
7831 : }
7832 :
7833 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfig2W_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
7834 : {
7835 0 : struct dcerpc_svcctl_ChangeServiceConfig2W_r_state *state =
7836 0 : tevent_req_data(req,
7837 : struct dcerpc_svcctl_ChangeServiceConfig2W_r_state);
7838 : NTSTATUS status;
7839 :
7840 0 : if (tevent_req_is_nterror(req, &status)) {
7841 0 : tevent_req_received(req);
7842 0 : return status;
7843 : }
7844 :
7845 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
7846 :
7847 0 : tevent_req_received(req);
7848 0 : return NT_STATUS_OK;
7849 : }
7850 :
7851 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfig2W_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_ChangeServiceConfig2W *r)
7852 : {
7853 : NTSTATUS status;
7854 :
7855 0 : status = dcerpc_binding_handle_call(h,
7856 : NULL, &ndr_table_svcctl,
7857 : NDR_SVCCTL_CHANGESERVICECONFIG2W, mem_ctx, r);
7858 :
7859 0 : return status;
7860 : }
7861 :
7862 : struct dcerpc_svcctl_ChangeServiceConfig2W_state {
7863 : struct svcctl_ChangeServiceConfig2W orig;
7864 : struct svcctl_ChangeServiceConfig2W tmp;
7865 : TALLOC_CTX *out_mem_ctx;
7866 : };
7867 :
7868 : static void dcerpc_svcctl_ChangeServiceConfig2W_done(struct tevent_req *subreq);
7869 :
7870 0 : struct tevent_req *dcerpc_svcctl_ChangeServiceConfig2W_send(TALLOC_CTX *mem_ctx,
7871 : struct tevent_context *ev,
7872 : struct dcerpc_binding_handle *h,
7873 : struct policy_handle *_handle /* [in] [ref] */,
7874 : uint32_t _info_level /* [in] */,
7875 : uint8_t *_info /* [in] [unique] */)
7876 : {
7877 : struct tevent_req *req;
7878 : struct dcerpc_svcctl_ChangeServiceConfig2W_state *state;
7879 : struct tevent_req *subreq;
7880 :
7881 0 : req = tevent_req_create(mem_ctx, &state,
7882 : struct dcerpc_svcctl_ChangeServiceConfig2W_state);
7883 0 : if (req == NULL) {
7884 0 : return NULL;
7885 : }
7886 0 : state->out_mem_ctx = NULL;
7887 :
7888 : /* In parameters */
7889 0 : state->orig.in.handle = _handle;
7890 0 : state->orig.in.info_level = _info_level;
7891 0 : state->orig.in.info = _info;
7892 :
7893 : /* Out parameters */
7894 :
7895 : /* Result */
7896 0 : NDR_ZERO_STRUCT(state->orig.out.result);
7897 :
7898 : /* make a temporary copy, that we pass to the dispatch function */
7899 0 : state->tmp = state->orig;
7900 :
7901 0 : subreq = dcerpc_svcctl_ChangeServiceConfig2W_r_send(state, ev, h, &state->tmp);
7902 0 : if (tevent_req_nomem(subreq, req)) {
7903 0 : return tevent_req_post(req, ev);
7904 : }
7905 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_ChangeServiceConfig2W_done, req);
7906 0 : return req;
7907 : }
7908 :
7909 0 : static void dcerpc_svcctl_ChangeServiceConfig2W_done(struct tevent_req *subreq)
7910 : {
7911 0 : struct tevent_req *req = tevent_req_callback_data(
7912 : subreq, struct tevent_req);
7913 0 : struct dcerpc_svcctl_ChangeServiceConfig2W_state *state = tevent_req_data(
7914 : req, struct dcerpc_svcctl_ChangeServiceConfig2W_state);
7915 : NTSTATUS status;
7916 : TALLOC_CTX *mem_ctx;
7917 :
7918 0 : if (state->out_mem_ctx) {
7919 0 : mem_ctx = state->out_mem_ctx;
7920 : } else {
7921 0 : mem_ctx = state;
7922 : }
7923 :
7924 0 : status = dcerpc_svcctl_ChangeServiceConfig2W_r_recv(subreq, mem_ctx);
7925 0 : TALLOC_FREE(subreq);
7926 0 : if (tevent_req_nterror(req, status)) {
7927 0 : return;
7928 : }
7929 :
7930 : /* Copy out parameters */
7931 :
7932 : /* Copy result */
7933 0 : state->orig.out.result = state->tmp.out.result;
7934 :
7935 : /* Reset temporary structure */
7936 0 : NDR_ZERO_STRUCT(state->tmp);
7937 :
7938 0 : tevent_req_done(req);
7939 : }
7940 :
7941 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfig2W_recv(struct tevent_req *req,
7942 : TALLOC_CTX *mem_ctx,
7943 : WERROR *result)
7944 : {
7945 0 : struct dcerpc_svcctl_ChangeServiceConfig2W_state *state = tevent_req_data(
7946 : req, struct dcerpc_svcctl_ChangeServiceConfig2W_state);
7947 : NTSTATUS status;
7948 :
7949 0 : if (tevent_req_is_nterror(req, &status)) {
7950 0 : tevent_req_received(req);
7951 0 : return status;
7952 : }
7953 :
7954 : /* Steal possible out parameters to the callers context */
7955 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
7956 :
7957 : /* Return result */
7958 0 : *result = state->orig.out.result;
7959 :
7960 0 : tevent_req_received(req);
7961 0 : return NT_STATUS_OK;
7962 : }
7963 :
7964 0 : NTSTATUS dcerpc_svcctl_ChangeServiceConfig2W(struct dcerpc_binding_handle *h,
7965 : TALLOC_CTX *mem_ctx,
7966 : struct policy_handle *_handle /* [in] [ref] */,
7967 : uint32_t _info_level /* [in] */,
7968 : uint8_t *_info /* [in] [unique] */,
7969 : WERROR *result)
7970 : {
7971 : struct svcctl_ChangeServiceConfig2W r;
7972 : NTSTATUS status;
7973 :
7974 : /* In parameters */
7975 0 : r.in.handle = _handle;
7976 0 : r.in.info_level = _info_level;
7977 0 : r.in.info = _info;
7978 :
7979 : /* Out parameters */
7980 :
7981 : /* Result */
7982 0 : NDR_ZERO_STRUCT(r.out.result);
7983 :
7984 0 : status = dcerpc_svcctl_ChangeServiceConfig2W_r(h, mem_ctx, &r);
7985 0 : if (!NT_STATUS_IS_OK(status)) {
7986 0 : return status;
7987 : }
7988 :
7989 : /* Return variables */
7990 :
7991 : /* Return result */
7992 0 : *result = r.out.result;
7993 :
7994 0 : return NT_STATUS_OK;
7995 : }
7996 :
7997 : struct dcerpc_svcctl_QueryServiceConfig2A_r_state {
7998 : TALLOC_CTX *out_mem_ctx;
7999 : };
8000 :
8001 : static void dcerpc_svcctl_QueryServiceConfig2A_r_done(struct tevent_req *subreq);
8002 :
8003 0 : struct tevent_req *dcerpc_svcctl_QueryServiceConfig2A_r_send(TALLOC_CTX *mem_ctx,
8004 : struct tevent_context *ev,
8005 : struct dcerpc_binding_handle *h,
8006 : struct svcctl_QueryServiceConfig2A *r)
8007 : {
8008 : struct tevent_req *req;
8009 : struct dcerpc_svcctl_QueryServiceConfig2A_r_state *state;
8010 : struct tevent_req *subreq;
8011 :
8012 0 : req = tevent_req_create(mem_ctx, &state,
8013 : struct dcerpc_svcctl_QueryServiceConfig2A_r_state);
8014 0 : if (req == NULL) {
8015 0 : return NULL;
8016 : }
8017 :
8018 0 : state->out_mem_ctx = talloc_new(state);
8019 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
8020 0 : return tevent_req_post(req, ev);
8021 : }
8022 :
8023 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
8024 : NULL, &ndr_table_svcctl,
8025 0 : NDR_SVCCTL_QUERYSERVICECONFIG2A, state->out_mem_ctx, r);
8026 0 : if (tevent_req_nomem(subreq, req)) {
8027 0 : return tevent_req_post(req, ev);
8028 : }
8029 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceConfig2A_r_done, req);
8030 :
8031 0 : return req;
8032 : }
8033 :
8034 0 : static void dcerpc_svcctl_QueryServiceConfig2A_r_done(struct tevent_req *subreq)
8035 : {
8036 0 : struct tevent_req *req =
8037 0 : tevent_req_callback_data(subreq,
8038 : struct tevent_req);
8039 : NTSTATUS status;
8040 :
8041 0 : status = dcerpc_binding_handle_call_recv(subreq);
8042 0 : TALLOC_FREE(subreq);
8043 0 : if (tevent_req_nterror(req, status)) {
8044 0 : return;
8045 : }
8046 :
8047 0 : tevent_req_done(req);
8048 : }
8049 :
8050 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfig2A_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8051 : {
8052 0 : struct dcerpc_svcctl_QueryServiceConfig2A_r_state *state =
8053 0 : tevent_req_data(req,
8054 : struct dcerpc_svcctl_QueryServiceConfig2A_r_state);
8055 : NTSTATUS status;
8056 :
8057 0 : if (tevent_req_is_nterror(req, &status)) {
8058 0 : tevent_req_received(req);
8059 0 : return status;
8060 : }
8061 :
8062 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
8063 :
8064 0 : tevent_req_received(req);
8065 0 : return NT_STATUS_OK;
8066 : }
8067 :
8068 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfig2A_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_QueryServiceConfig2A *r)
8069 : {
8070 : NTSTATUS status;
8071 :
8072 0 : status = dcerpc_binding_handle_call(h,
8073 : NULL, &ndr_table_svcctl,
8074 : NDR_SVCCTL_QUERYSERVICECONFIG2A, mem_ctx, r);
8075 :
8076 0 : return status;
8077 : }
8078 :
8079 : struct dcerpc_svcctl_QueryServiceConfig2A_state {
8080 : struct svcctl_QueryServiceConfig2A orig;
8081 : struct svcctl_QueryServiceConfig2A tmp;
8082 : TALLOC_CTX *out_mem_ctx;
8083 : };
8084 :
8085 : static void dcerpc_svcctl_QueryServiceConfig2A_done(struct tevent_req *subreq);
8086 :
8087 0 : struct tevent_req *dcerpc_svcctl_QueryServiceConfig2A_send(TALLOC_CTX *mem_ctx,
8088 : struct tevent_context *ev,
8089 : struct dcerpc_binding_handle *h,
8090 : struct policy_handle *_handle /* [in] [ref] */,
8091 : enum svcctl_ConfigLevel _info_level /* [in] */,
8092 : uint8_t *_buffer /* [out] */,
8093 : uint32_t _offered /* [in] */,
8094 : uint32_t *_needed /* [out] [ref] */)
8095 : {
8096 : struct tevent_req *req;
8097 : struct dcerpc_svcctl_QueryServiceConfig2A_state *state;
8098 : struct tevent_req *subreq;
8099 :
8100 0 : req = tevent_req_create(mem_ctx, &state,
8101 : struct dcerpc_svcctl_QueryServiceConfig2A_state);
8102 0 : if (req == NULL) {
8103 0 : return NULL;
8104 : }
8105 0 : state->out_mem_ctx = NULL;
8106 :
8107 : /* In parameters */
8108 0 : state->orig.in.handle = _handle;
8109 0 : state->orig.in.info_level = _info_level;
8110 0 : state->orig.in.offered = _offered;
8111 :
8112 : /* Out parameters */
8113 0 : state->orig.out.buffer = _buffer;
8114 0 : state->orig.out.needed = _needed;
8115 :
8116 : /* Result */
8117 0 : NDR_ZERO_STRUCT(state->orig.out.result);
8118 :
8119 0 : state->out_mem_ctx = talloc_named_const(state, 0,
8120 : "dcerpc_svcctl_QueryServiceConfig2A_out_memory");
8121 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
8122 0 : return tevent_req_post(req, ev);
8123 : }
8124 :
8125 : /* make a temporary copy, that we pass to the dispatch function */
8126 0 : state->tmp = state->orig;
8127 :
8128 0 : subreq = dcerpc_svcctl_QueryServiceConfig2A_r_send(state, ev, h, &state->tmp);
8129 0 : if (tevent_req_nomem(subreq, req)) {
8130 0 : return tevent_req_post(req, ev);
8131 : }
8132 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceConfig2A_done, req);
8133 0 : return req;
8134 : }
8135 :
8136 0 : static void dcerpc_svcctl_QueryServiceConfig2A_done(struct tevent_req *subreq)
8137 : {
8138 0 : struct tevent_req *req = tevent_req_callback_data(
8139 : subreq, struct tevent_req);
8140 0 : struct dcerpc_svcctl_QueryServiceConfig2A_state *state = tevent_req_data(
8141 : req, struct dcerpc_svcctl_QueryServiceConfig2A_state);
8142 : NTSTATUS status;
8143 : TALLOC_CTX *mem_ctx;
8144 :
8145 0 : if (state->out_mem_ctx) {
8146 0 : mem_ctx = state->out_mem_ctx;
8147 : } else {
8148 0 : mem_ctx = state;
8149 : }
8150 :
8151 0 : status = dcerpc_svcctl_QueryServiceConfig2A_r_recv(subreq, mem_ctx);
8152 0 : TALLOC_FREE(subreq);
8153 0 : if (tevent_req_nterror(req, status)) {
8154 0 : return;
8155 : }
8156 :
8157 : /* Copy out parameters */
8158 : {
8159 : size_t _copy_len_buffer;
8160 0 : _copy_len_buffer = state->tmp.in.offered;
8161 0 : if (state->orig.out.buffer != state->tmp.out.buffer) {
8162 0 : memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
8163 : }
8164 : }
8165 0 : *state->orig.out.needed = *state->tmp.out.needed;
8166 :
8167 : /* Copy result */
8168 0 : state->orig.out.result = state->tmp.out.result;
8169 :
8170 : /* Reset temporary structure */
8171 0 : NDR_ZERO_STRUCT(state->tmp);
8172 :
8173 0 : tevent_req_done(req);
8174 : }
8175 :
8176 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfig2A_recv(struct tevent_req *req,
8177 : TALLOC_CTX *mem_ctx,
8178 : WERROR *result)
8179 : {
8180 0 : struct dcerpc_svcctl_QueryServiceConfig2A_state *state = tevent_req_data(
8181 : req, struct dcerpc_svcctl_QueryServiceConfig2A_state);
8182 : NTSTATUS status;
8183 :
8184 0 : if (tevent_req_is_nterror(req, &status)) {
8185 0 : tevent_req_received(req);
8186 0 : return status;
8187 : }
8188 :
8189 : /* Steal possible out parameters to the callers context */
8190 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
8191 :
8192 : /* Return result */
8193 0 : *result = state->orig.out.result;
8194 :
8195 0 : tevent_req_received(req);
8196 0 : return NT_STATUS_OK;
8197 : }
8198 :
8199 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfig2A(struct dcerpc_binding_handle *h,
8200 : TALLOC_CTX *mem_ctx,
8201 : struct policy_handle *_handle /* [in] [ref] */,
8202 : enum svcctl_ConfigLevel _info_level /* [in] */,
8203 : uint8_t *_buffer /* [out] */,
8204 : uint32_t _offered /* [in] */,
8205 : uint32_t *_needed /* [out] [ref] */,
8206 : WERROR *result)
8207 : {
8208 : struct svcctl_QueryServiceConfig2A r;
8209 : NTSTATUS status;
8210 :
8211 : /* In parameters */
8212 0 : r.in.handle = _handle;
8213 0 : r.in.info_level = _info_level;
8214 0 : r.in.offered = _offered;
8215 :
8216 : /* Out parameters */
8217 0 : r.out.buffer = _buffer;
8218 0 : r.out.needed = _needed;
8219 :
8220 : /* Result */
8221 0 : NDR_ZERO_STRUCT(r.out.result);
8222 :
8223 0 : status = dcerpc_svcctl_QueryServiceConfig2A_r(h, mem_ctx, &r);
8224 0 : if (!NT_STATUS_IS_OK(status)) {
8225 0 : return status;
8226 : }
8227 :
8228 : /* Return variables */
8229 : {
8230 : size_t _copy_len_buffer;
8231 0 : _copy_len_buffer = r.in.offered;
8232 0 : if (_buffer != r.out.buffer) {
8233 0 : memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
8234 : }
8235 : }
8236 0 : *_needed = *r.out.needed;
8237 :
8238 : /* Return result */
8239 0 : *result = r.out.result;
8240 :
8241 0 : return NT_STATUS_OK;
8242 : }
8243 :
8244 : struct dcerpc_svcctl_QueryServiceConfig2W_r_state {
8245 : TALLOC_CTX *out_mem_ctx;
8246 : };
8247 :
8248 : static void dcerpc_svcctl_QueryServiceConfig2W_r_done(struct tevent_req *subreq);
8249 :
8250 0 : struct tevent_req *dcerpc_svcctl_QueryServiceConfig2W_r_send(TALLOC_CTX *mem_ctx,
8251 : struct tevent_context *ev,
8252 : struct dcerpc_binding_handle *h,
8253 : struct svcctl_QueryServiceConfig2W *r)
8254 : {
8255 : struct tevent_req *req;
8256 : struct dcerpc_svcctl_QueryServiceConfig2W_r_state *state;
8257 : struct tevent_req *subreq;
8258 :
8259 0 : req = tevent_req_create(mem_ctx, &state,
8260 : struct dcerpc_svcctl_QueryServiceConfig2W_r_state);
8261 0 : if (req == NULL) {
8262 0 : return NULL;
8263 : }
8264 :
8265 0 : state->out_mem_ctx = talloc_new(state);
8266 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
8267 0 : return tevent_req_post(req, ev);
8268 : }
8269 :
8270 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
8271 : NULL, &ndr_table_svcctl,
8272 0 : NDR_SVCCTL_QUERYSERVICECONFIG2W, state->out_mem_ctx, r);
8273 0 : if (tevent_req_nomem(subreq, req)) {
8274 0 : return tevent_req_post(req, ev);
8275 : }
8276 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceConfig2W_r_done, req);
8277 :
8278 0 : return req;
8279 : }
8280 :
8281 0 : static void dcerpc_svcctl_QueryServiceConfig2W_r_done(struct tevent_req *subreq)
8282 : {
8283 0 : struct tevent_req *req =
8284 0 : tevent_req_callback_data(subreq,
8285 : struct tevent_req);
8286 : NTSTATUS status;
8287 :
8288 0 : status = dcerpc_binding_handle_call_recv(subreq);
8289 0 : TALLOC_FREE(subreq);
8290 0 : if (tevent_req_nterror(req, status)) {
8291 0 : return;
8292 : }
8293 :
8294 0 : tevent_req_done(req);
8295 : }
8296 :
8297 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfig2W_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8298 : {
8299 0 : struct dcerpc_svcctl_QueryServiceConfig2W_r_state *state =
8300 0 : tevent_req_data(req,
8301 : struct dcerpc_svcctl_QueryServiceConfig2W_r_state);
8302 : NTSTATUS status;
8303 :
8304 0 : if (tevent_req_is_nterror(req, &status)) {
8305 0 : tevent_req_received(req);
8306 0 : return status;
8307 : }
8308 :
8309 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
8310 :
8311 0 : tevent_req_received(req);
8312 0 : return NT_STATUS_OK;
8313 : }
8314 :
8315 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfig2W_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_QueryServiceConfig2W *r)
8316 : {
8317 : NTSTATUS status;
8318 :
8319 0 : status = dcerpc_binding_handle_call(h,
8320 : NULL, &ndr_table_svcctl,
8321 : NDR_SVCCTL_QUERYSERVICECONFIG2W, mem_ctx, r);
8322 :
8323 0 : return status;
8324 : }
8325 :
8326 : struct dcerpc_svcctl_QueryServiceConfig2W_state {
8327 : struct svcctl_QueryServiceConfig2W orig;
8328 : struct svcctl_QueryServiceConfig2W tmp;
8329 : TALLOC_CTX *out_mem_ctx;
8330 : };
8331 :
8332 : static void dcerpc_svcctl_QueryServiceConfig2W_done(struct tevent_req *subreq);
8333 :
8334 0 : struct tevent_req *dcerpc_svcctl_QueryServiceConfig2W_send(TALLOC_CTX *mem_ctx,
8335 : struct tevent_context *ev,
8336 : struct dcerpc_binding_handle *h,
8337 : struct policy_handle *_handle /* [in] [ref] */,
8338 : enum svcctl_ConfigLevel _info_level /* [in] */,
8339 : uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
8340 : uint32_t _offered /* [in] [range(0,8192)] */,
8341 : uint32_t *_needed /* [out] [range(0,8192),ref] */)
8342 : {
8343 : struct tevent_req *req;
8344 : struct dcerpc_svcctl_QueryServiceConfig2W_state *state;
8345 : struct tevent_req *subreq;
8346 :
8347 0 : req = tevent_req_create(mem_ctx, &state,
8348 : struct dcerpc_svcctl_QueryServiceConfig2W_state);
8349 0 : if (req == NULL) {
8350 0 : return NULL;
8351 : }
8352 0 : state->out_mem_ctx = NULL;
8353 :
8354 : /* In parameters */
8355 0 : state->orig.in.handle = _handle;
8356 0 : state->orig.in.info_level = _info_level;
8357 0 : state->orig.in.offered = _offered;
8358 :
8359 : /* Out parameters */
8360 0 : state->orig.out.buffer = _buffer;
8361 0 : state->orig.out.needed = _needed;
8362 :
8363 : /* Result */
8364 0 : NDR_ZERO_STRUCT(state->orig.out.result);
8365 :
8366 0 : state->out_mem_ctx = talloc_named_const(state, 0,
8367 : "dcerpc_svcctl_QueryServiceConfig2W_out_memory");
8368 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
8369 0 : return tevent_req_post(req, ev);
8370 : }
8371 :
8372 : /* make a temporary copy, that we pass to the dispatch function */
8373 0 : state->tmp = state->orig;
8374 :
8375 0 : subreq = dcerpc_svcctl_QueryServiceConfig2W_r_send(state, ev, h, &state->tmp);
8376 0 : if (tevent_req_nomem(subreq, req)) {
8377 0 : return tevent_req_post(req, ev);
8378 : }
8379 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceConfig2W_done, req);
8380 0 : return req;
8381 : }
8382 :
8383 0 : static void dcerpc_svcctl_QueryServiceConfig2W_done(struct tevent_req *subreq)
8384 : {
8385 0 : struct tevent_req *req = tevent_req_callback_data(
8386 : subreq, struct tevent_req);
8387 0 : struct dcerpc_svcctl_QueryServiceConfig2W_state *state = tevent_req_data(
8388 : req, struct dcerpc_svcctl_QueryServiceConfig2W_state);
8389 : NTSTATUS status;
8390 : TALLOC_CTX *mem_ctx;
8391 :
8392 0 : if (state->out_mem_ctx) {
8393 0 : mem_ctx = state->out_mem_ctx;
8394 : } else {
8395 0 : mem_ctx = state;
8396 : }
8397 :
8398 0 : status = dcerpc_svcctl_QueryServiceConfig2W_r_recv(subreq, mem_ctx);
8399 0 : TALLOC_FREE(subreq);
8400 0 : if (tevent_req_nterror(req, status)) {
8401 0 : return;
8402 : }
8403 :
8404 : /* Copy out parameters */
8405 : {
8406 : size_t _copy_len_buffer;
8407 0 : _copy_len_buffer = state->tmp.in.offered;
8408 0 : if (state->orig.out.buffer != state->tmp.out.buffer) {
8409 0 : memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
8410 : }
8411 : }
8412 0 : *state->orig.out.needed = *state->tmp.out.needed;
8413 :
8414 : /* Copy result */
8415 0 : state->orig.out.result = state->tmp.out.result;
8416 :
8417 : /* Reset temporary structure */
8418 0 : NDR_ZERO_STRUCT(state->tmp);
8419 :
8420 0 : tevent_req_done(req);
8421 : }
8422 :
8423 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfig2W_recv(struct tevent_req *req,
8424 : TALLOC_CTX *mem_ctx,
8425 : WERROR *result)
8426 : {
8427 0 : struct dcerpc_svcctl_QueryServiceConfig2W_state *state = tevent_req_data(
8428 : req, struct dcerpc_svcctl_QueryServiceConfig2W_state);
8429 : NTSTATUS status;
8430 :
8431 0 : if (tevent_req_is_nterror(req, &status)) {
8432 0 : tevent_req_received(req);
8433 0 : return status;
8434 : }
8435 :
8436 : /* Steal possible out parameters to the callers context */
8437 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
8438 :
8439 : /* Return result */
8440 0 : *result = state->orig.out.result;
8441 :
8442 0 : tevent_req_received(req);
8443 0 : return NT_STATUS_OK;
8444 : }
8445 :
8446 0 : NTSTATUS dcerpc_svcctl_QueryServiceConfig2W(struct dcerpc_binding_handle *h,
8447 : TALLOC_CTX *mem_ctx,
8448 : struct policy_handle *_handle /* [in] [ref] */,
8449 : enum svcctl_ConfigLevel _info_level /* [in] */,
8450 : uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
8451 : uint32_t _offered /* [in] [range(0,8192)] */,
8452 : uint32_t *_needed /* [out] [range(0,8192),ref] */,
8453 : WERROR *result)
8454 : {
8455 : struct svcctl_QueryServiceConfig2W r;
8456 : NTSTATUS status;
8457 :
8458 : /* In parameters */
8459 0 : r.in.handle = _handle;
8460 0 : r.in.info_level = _info_level;
8461 0 : r.in.offered = _offered;
8462 :
8463 : /* Out parameters */
8464 0 : r.out.buffer = _buffer;
8465 0 : r.out.needed = _needed;
8466 :
8467 : /* Result */
8468 0 : NDR_ZERO_STRUCT(r.out.result);
8469 :
8470 0 : status = dcerpc_svcctl_QueryServiceConfig2W_r(h, mem_ctx, &r);
8471 0 : if (!NT_STATUS_IS_OK(status)) {
8472 0 : return status;
8473 : }
8474 :
8475 : /* Return variables */
8476 : {
8477 : size_t _copy_len_buffer;
8478 0 : _copy_len_buffer = r.in.offered;
8479 0 : if (_buffer != r.out.buffer) {
8480 0 : memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
8481 : }
8482 : }
8483 0 : *_needed = *r.out.needed;
8484 :
8485 : /* Return result */
8486 0 : *result = r.out.result;
8487 :
8488 0 : return NT_STATUS_OK;
8489 : }
8490 :
8491 : struct dcerpc_svcctl_QueryServiceStatusEx_r_state {
8492 : TALLOC_CTX *out_mem_ctx;
8493 : };
8494 :
8495 : static void dcerpc_svcctl_QueryServiceStatusEx_r_done(struct tevent_req *subreq);
8496 :
8497 0 : struct tevent_req *dcerpc_svcctl_QueryServiceStatusEx_r_send(TALLOC_CTX *mem_ctx,
8498 : struct tevent_context *ev,
8499 : struct dcerpc_binding_handle *h,
8500 : struct svcctl_QueryServiceStatusEx *r)
8501 : {
8502 : struct tevent_req *req;
8503 : struct dcerpc_svcctl_QueryServiceStatusEx_r_state *state;
8504 : struct tevent_req *subreq;
8505 :
8506 0 : req = tevent_req_create(mem_ctx, &state,
8507 : struct dcerpc_svcctl_QueryServiceStatusEx_r_state);
8508 0 : if (req == NULL) {
8509 0 : return NULL;
8510 : }
8511 :
8512 0 : state->out_mem_ctx = talloc_new(state);
8513 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
8514 0 : return tevent_req_post(req, ev);
8515 : }
8516 :
8517 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
8518 : NULL, &ndr_table_svcctl,
8519 0 : NDR_SVCCTL_QUERYSERVICESTATUSEX, state->out_mem_ctx, r);
8520 0 : if (tevent_req_nomem(subreq, req)) {
8521 0 : return tevent_req_post(req, ev);
8522 : }
8523 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceStatusEx_r_done, req);
8524 :
8525 0 : return req;
8526 : }
8527 :
8528 0 : static void dcerpc_svcctl_QueryServiceStatusEx_r_done(struct tevent_req *subreq)
8529 : {
8530 0 : struct tevent_req *req =
8531 0 : tevent_req_callback_data(subreq,
8532 : struct tevent_req);
8533 : NTSTATUS status;
8534 :
8535 0 : status = dcerpc_binding_handle_call_recv(subreq);
8536 0 : TALLOC_FREE(subreq);
8537 0 : if (tevent_req_nterror(req, status)) {
8538 0 : return;
8539 : }
8540 :
8541 0 : tevent_req_done(req);
8542 : }
8543 :
8544 0 : NTSTATUS dcerpc_svcctl_QueryServiceStatusEx_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8545 : {
8546 0 : struct dcerpc_svcctl_QueryServiceStatusEx_r_state *state =
8547 0 : tevent_req_data(req,
8548 : struct dcerpc_svcctl_QueryServiceStatusEx_r_state);
8549 : NTSTATUS status;
8550 :
8551 0 : if (tevent_req_is_nterror(req, &status)) {
8552 0 : tevent_req_received(req);
8553 0 : return status;
8554 : }
8555 :
8556 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
8557 :
8558 0 : tevent_req_received(req);
8559 0 : return NT_STATUS_OK;
8560 : }
8561 :
8562 0 : NTSTATUS dcerpc_svcctl_QueryServiceStatusEx_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct svcctl_QueryServiceStatusEx *r)
8563 : {
8564 : NTSTATUS status;
8565 :
8566 0 : status = dcerpc_binding_handle_call(h,
8567 : NULL, &ndr_table_svcctl,
8568 : NDR_SVCCTL_QUERYSERVICESTATUSEX, mem_ctx, r);
8569 :
8570 0 : return status;
8571 : }
8572 :
8573 : struct dcerpc_svcctl_QueryServiceStatusEx_state {
8574 : struct svcctl_QueryServiceStatusEx orig;
8575 : struct svcctl_QueryServiceStatusEx tmp;
8576 : TALLOC_CTX *out_mem_ctx;
8577 : };
8578 :
8579 : static void dcerpc_svcctl_QueryServiceStatusEx_done(struct tevent_req *subreq);
8580 :
8581 0 : struct tevent_req *dcerpc_svcctl_QueryServiceStatusEx_send(TALLOC_CTX *mem_ctx,
8582 : struct tevent_context *ev,
8583 : struct dcerpc_binding_handle *h,
8584 : struct policy_handle *_handle /* [in] [ref] */,
8585 : enum svcctl_StatusLevel _info_level /* [in] */,
8586 : uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
8587 : uint32_t _offered /* [in] [range(0,8192)] */,
8588 : uint32_t *_needed /* [out] [range(0,8192),ref] */)
8589 : {
8590 : struct tevent_req *req;
8591 : struct dcerpc_svcctl_QueryServiceStatusEx_state *state;
8592 : struct tevent_req *subreq;
8593 :
8594 0 : req = tevent_req_create(mem_ctx, &state,
8595 : struct dcerpc_svcctl_QueryServiceStatusEx_state);
8596 0 : if (req == NULL) {
8597 0 : return NULL;
8598 : }
8599 0 : state->out_mem_ctx = NULL;
8600 :
8601 : /* In parameters */
8602 0 : state->orig.in.handle = _handle;
8603 0 : state->orig.in.info_level = _info_level;
8604 0 : state->orig.in.offered = _offered;
8605 :
8606 : /* Out parameters */
8607 0 : state->orig.out.buffer = _buffer;
8608 0 : state->orig.out.needed = _needed;
8609 :
8610 : /* Result */
8611 0 : NDR_ZERO_STRUCT(state->orig.out.result);
8612 :
8613 0 : state->out_mem_ctx = talloc_named_const(state, 0,
8614 : "dcerpc_svcctl_QueryServiceStatusEx_out_memory");
8615 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
8616 0 : return tevent_req_post(req, ev);
8617 : }
8618 :
8619 : /* make a temporary copy, that we pass to the dispatch function */
8620 0 : state->tmp = state->orig;
8621 :
8622 0 : subreq = dcerpc_svcctl_QueryServiceStatusEx_r_send(state, ev, h, &state->tmp);
8623 0 : if (tevent_req_nomem(subreq, req)) {
8624 0 : return tevent_req_post(req, ev);
8625 : }
8626 0 : tevent_req_set_callback(subreq, dcerpc_svcctl_QueryServiceStatusEx_done, req);
8627 0 : return req;
8628 : }
8629 :
8630 0 : static void dcerpc_svcctl_QueryServiceStatusEx_done(struct tevent_req *subreq)
8631 : {
8632 0 : struct tevent_req *req = tevent_req_callback_data(
8633 : subreq, struct tevent_req);
8634 0 : struct dcerpc_svcctl_QueryServiceStatusEx_state *state = tevent_req_data(
8635 : req, struct dcerpc_svcctl_QueryServiceStatusEx_state);
8636 : NTSTATUS status;
8637 : TALLOC_CTX *mem_ctx;
8638 :
8639 0 : if (state->out_mem_ctx) {
8640 0 : mem_ctx = state->out_mem_ctx;
8641 : } else {
8642 0 : mem_ctx = state;
8643 : }
8644 :
8645 0 : status = dcerpc_svcctl_QueryServiceStatusEx_r_recv(subreq, mem_ctx);
8646 0 : TALLOC_FREE(subreq);
8647 0 : if (tevent_req_nterror(req, status)) {
8648 0 : return;
8649 : }
8650 :
8651 : /* Copy out parameters */
8652 : {
8653 : size_t _copy_len_buffer;
8654 0 : _copy_len_buffer = state->tmp.in.offered;
8655 0 : if (state->orig.out.buffer != state->tmp.out.buffer) {
8656 0 : memcpy(state->orig.out.buffer, state->tmp.out.buffer, _copy_len_buffer * sizeof(*state->orig.out.buffer));
8657 : }
8658 : }
8659 0 : *state->orig.out.needed = *state->tmp.out.needed;
8660 :
8661 : /* Copy result */
8662 0 : state->orig.out.result = state->tmp.out.result;
8663 :
8664 : /* Reset temporary structure */
8665 0 : NDR_ZERO_STRUCT(state->tmp);
8666 :
8667 0 : tevent_req_done(req);
8668 : }
8669 :
8670 0 : NTSTATUS dcerpc_svcctl_QueryServiceStatusEx_recv(struct tevent_req *req,
8671 : TALLOC_CTX *mem_ctx,
8672 : WERROR *result)
8673 : {
8674 0 : struct dcerpc_svcctl_QueryServiceStatusEx_state *state = tevent_req_data(
8675 : req, struct dcerpc_svcctl_QueryServiceStatusEx_state);
8676 : NTSTATUS status;
8677 :
8678 0 : if (tevent_req_is_nterror(req, &status)) {
8679 0 : tevent_req_received(req);
8680 0 : return status;
8681 : }
8682 :
8683 : /* Steal possible out parameters to the callers context */
8684 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
8685 :
8686 : /* Return result */
8687 0 : *result = state->orig.out.result;
8688 :
8689 0 : tevent_req_received(req);
8690 0 : return NT_STATUS_OK;
8691 : }
8692 :
8693 0 : NTSTATUS dcerpc_svcctl_QueryServiceStatusEx(struct dcerpc_binding_handle *h,
8694 : TALLOC_CTX *mem_ctx,
8695 : struct policy_handle *_handle /* [in] [ref] */,
8696 : enum svcctl_StatusLevel _info_level /* [in] */,
8697 : uint8_t *_buffer /* [out] [ref,size_is(offered)] */,
8698 : uint32_t _offered /* [in] [range(0,8192)] */,
8699 : uint32_t *_needed /* [out] [range(0,8192),ref] */,
8700 : WERROR *result)
8701 : {
8702 : struct svcctl_QueryServiceStatusEx r;
8703 : NTSTATUS status;
8704 :
8705 : /* In parameters */
8706 0 : r.in.handle = _handle;
8707 0 : r.in.info_level = _info_level;
8708 0 : r.in.offered = _offered;
8709 :
8710 : /* Out parameters */
8711 0 : r.out.buffer = _buffer;
8712 0 : r.out.needed = _needed;
8713 :
8714 : /* Result */
8715 0 : NDR_ZERO_STRUCT(r.out.result);
8716 :
8717 0 : status = dcerpc_svcctl_QueryServiceStatusEx_r(h, mem_ctx, &r);
8718 0 : if (!NT_STATUS_IS_OK(status)) {
8719 0 : return status;
8720 : }
8721 :
8722 : /* Return variables */
8723 : {
8724 : size_t _copy_len_buffer;
8725 0 : _copy_len_buffer = r.in.offered;
8726 0 : if (_buffer != r.out.buffer) {
8727 0 : memcpy(_buffer, r.out.buffer, _copy_len_buffer * sizeof(*_buffer));
8728 : }
8729 : }
8730 0 : *_needed = *r.out.needed;
8731 :
8732 : /* Return result */
8733 0 : *result = r.out.result;
8734 :
8735 0 : return NT_STATUS_OK;
8736 : }
8737 :
8738 : struct dcerpc_EnumServicesStatusExA_r_state {
8739 : TALLOC_CTX *out_mem_ctx;
8740 : };
8741 :
8742 : static void dcerpc_EnumServicesStatusExA_r_done(struct tevent_req *subreq);
8743 :
8744 0 : struct tevent_req *dcerpc_EnumServicesStatusExA_r_send(TALLOC_CTX *mem_ctx,
8745 : struct tevent_context *ev,
8746 : struct dcerpc_binding_handle *h,
8747 : struct EnumServicesStatusExA *r)
8748 : {
8749 : struct tevent_req *req;
8750 : struct dcerpc_EnumServicesStatusExA_r_state *state;
8751 : struct tevent_req *subreq;
8752 :
8753 0 : req = tevent_req_create(mem_ctx, &state,
8754 : struct dcerpc_EnumServicesStatusExA_r_state);
8755 0 : if (req == NULL) {
8756 0 : return NULL;
8757 : }
8758 :
8759 0 : state->out_mem_ctx = talloc_new(state);
8760 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
8761 0 : return tevent_req_post(req, ev);
8762 : }
8763 :
8764 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
8765 : NULL, &ndr_table_svcctl,
8766 0 : NDR_ENUMSERVICESSTATUSEXA, state->out_mem_ctx, r);
8767 0 : if (tevent_req_nomem(subreq, req)) {
8768 0 : return tevent_req_post(req, ev);
8769 : }
8770 0 : tevent_req_set_callback(subreq, dcerpc_EnumServicesStatusExA_r_done, req);
8771 :
8772 0 : return req;
8773 : }
8774 :
8775 0 : static void dcerpc_EnumServicesStatusExA_r_done(struct tevent_req *subreq)
8776 : {
8777 0 : struct tevent_req *req =
8778 0 : tevent_req_callback_data(subreq,
8779 : struct tevent_req);
8780 : NTSTATUS status;
8781 :
8782 0 : status = dcerpc_binding_handle_call_recv(subreq);
8783 0 : TALLOC_FREE(subreq);
8784 0 : if (tevent_req_nterror(req, status)) {
8785 0 : return;
8786 : }
8787 :
8788 0 : tevent_req_done(req);
8789 : }
8790 :
8791 0 : NTSTATUS dcerpc_EnumServicesStatusExA_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
8792 : {
8793 0 : struct dcerpc_EnumServicesStatusExA_r_state *state =
8794 0 : tevent_req_data(req,
8795 : struct dcerpc_EnumServicesStatusExA_r_state);
8796 : NTSTATUS status;
8797 :
8798 0 : if (tevent_req_is_nterror(req, &status)) {
8799 0 : tevent_req_received(req);
8800 0 : return status;
8801 : }
8802 :
8803 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
8804 :
8805 0 : tevent_req_received(req);
8806 0 : return NT_STATUS_OK;
8807 : }
8808 :
8809 0 : NTSTATUS dcerpc_EnumServicesStatusExA_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct EnumServicesStatusExA *r)
8810 : {
8811 : NTSTATUS status;
8812 :
8813 0 : status = dcerpc_binding_handle_call(h,
8814 : NULL, &ndr_table_svcctl,
8815 : NDR_ENUMSERVICESSTATUSEXA, mem_ctx, r);
8816 :
8817 0 : return status;
8818 : }
8819 :
8820 : struct dcerpc_EnumServicesStatusExA_state {
8821 : struct EnumServicesStatusExA orig;
8822 : struct EnumServicesStatusExA tmp;
8823 : TALLOC_CTX *out_mem_ctx;
8824 : };
8825 :
8826 : static void dcerpc_EnumServicesStatusExA_done(struct tevent_req *subreq);
8827 :
8828 0 : struct tevent_req *dcerpc_EnumServicesStatusExA_send(TALLOC_CTX *mem_ctx,
8829 : struct tevent_context *ev,
8830 : struct dcerpc_binding_handle *h,
8831 : struct policy_handle *_scmanager /* [in] [ref] */,
8832 : uint32_t _info_level /* [in] */,
8833 : uint32_t _type /* [in] */,
8834 : enum svcctl_ServiceState _state /* [in] */,
8835 : uint8_t *_services /* [out] */,
8836 : uint32_t _offered /* [in] */,
8837 : uint32_t *_needed /* [out] [ref] */,
8838 : uint32_t *_service_returned /* [out] [ref] */,
8839 : uint32_t *_resume_handle /* [in,out] [unique] */,
8840 : const char **_group_name /* [out] [charset(UTF16),ref] */)
8841 : {
8842 : struct tevent_req *req;
8843 : struct dcerpc_EnumServicesStatusExA_state *state;
8844 : struct tevent_req *subreq;
8845 :
8846 0 : req = tevent_req_create(mem_ctx, &state,
8847 : struct dcerpc_EnumServicesStatusExA_state);
8848 0 : if (req == NULL) {
8849 0 : return NULL;
8850 : }
8851 0 : state->out_mem_ctx = NULL;
8852 :
8853 : /* In parameters */
8854 0 : state->orig.in.scmanager = _scmanager;
8855 0 : state->orig.in.info_level = _info_level;
8856 0 : state->orig.in.type = _type;
8857 0 : state->orig.in.state = _state;
8858 0 : state->orig.in.offered = _offered;
8859 0 : state->orig.in.resume_handle = _resume_handle;
8860 :
8861 : /* Out parameters */
8862 0 : state->orig.out.services = _services;
8863 0 : state->orig.out.needed = _needed;
8864 0 : state->orig.out.service_returned = _service_returned;
8865 0 : state->orig.out.resume_handle = _resume_handle;
8866 0 : state->orig.out.group_name = _group_name;
8867 :
8868 : /* Result */
8869 0 : NDR_ZERO_STRUCT(state->orig.out.result);
8870 :
8871 0 : state->out_mem_ctx = talloc_named_const(state, 0,
8872 : "dcerpc_EnumServicesStatusExA_out_memory");
8873 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
8874 0 : return tevent_req_post(req, ev);
8875 : }
8876 :
8877 : /* make a temporary copy, that we pass to the dispatch function */
8878 0 : state->tmp = state->orig;
8879 :
8880 0 : subreq = dcerpc_EnumServicesStatusExA_r_send(state, ev, h, &state->tmp);
8881 0 : if (tevent_req_nomem(subreq, req)) {
8882 0 : return tevent_req_post(req, ev);
8883 : }
8884 0 : tevent_req_set_callback(subreq, dcerpc_EnumServicesStatusExA_done, req);
8885 0 : return req;
8886 : }
8887 :
8888 0 : static void dcerpc_EnumServicesStatusExA_done(struct tevent_req *subreq)
8889 : {
8890 0 : struct tevent_req *req = tevent_req_callback_data(
8891 : subreq, struct tevent_req);
8892 0 : struct dcerpc_EnumServicesStatusExA_state *state = tevent_req_data(
8893 : req, struct dcerpc_EnumServicesStatusExA_state);
8894 : NTSTATUS status;
8895 : TALLOC_CTX *mem_ctx;
8896 :
8897 0 : if (state->out_mem_ctx) {
8898 0 : mem_ctx = state->out_mem_ctx;
8899 : } else {
8900 0 : mem_ctx = state;
8901 : }
8902 :
8903 0 : status = dcerpc_EnumServicesStatusExA_r_recv(subreq, mem_ctx);
8904 0 : TALLOC_FREE(subreq);
8905 0 : if (tevent_req_nterror(req, status)) {
8906 0 : return;
8907 : }
8908 :
8909 : /* Copy out parameters */
8910 : {
8911 : size_t _copy_len_services;
8912 0 : _copy_len_services = state->tmp.in.offered;
8913 0 : if (state->orig.out.services != state->tmp.out.services) {
8914 0 : memcpy(state->orig.out.services, state->tmp.out.services, _copy_len_services * sizeof(*state->orig.out.services));
8915 : }
8916 : }
8917 0 : *state->orig.out.needed = *state->tmp.out.needed;
8918 0 : *state->orig.out.service_returned = *state->tmp.out.service_returned;
8919 0 : if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
8920 0 : *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
8921 : }
8922 0 : *state->orig.out.group_name = *state->tmp.out.group_name;
8923 :
8924 : /* Copy result */
8925 0 : state->orig.out.result = state->tmp.out.result;
8926 :
8927 : /* Reset temporary structure */
8928 0 : NDR_ZERO_STRUCT(state->tmp);
8929 :
8930 0 : tevent_req_done(req);
8931 : }
8932 :
8933 0 : NTSTATUS dcerpc_EnumServicesStatusExA_recv(struct tevent_req *req,
8934 : TALLOC_CTX *mem_ctx,
8935 : WERROR *result)
8936 : {
8937 0 : struct dcerpc_EnumServicesStatusExA_state *state = tevent_req_data(
8938 : req, struct dcerpc_EnumServicesStatusExA_state);
8939 : NTSTATUS status;
8940 :
8941 0 : if (tevent_req_is_nterror(req, &status)) {
8942 0 : tevent_req_received(req);
8943 0 : return status;
8944 : }
8945 :
8946 : /* Steal possible out parameters to the callers context */
8947 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
8948 :
8949 : /* Return result */
8950 0 : *result = state->orig.out.result;
8951 :
8952 0 : tevent_req_received(req);
8953 0 : return NT_STATUS_OK;
8954 : }
8955 :
8956 0 : NTSTATUS dcerpc_EnumServicesStatusExA(struct dcerpc_binding_handle *h,
8957 : TALLOC_CTX *mem_ctx,
8958 : struct policy_handle *_scmanager /* [in] [ref] */,
8959 : uint32_t _info_level /* [in] */,
8960 : uint32_t _type /* [in] */,
8961 : enum svcctl_ServiceState _state /* [in] */,
8962 : uint8_t *_services /* [out] */,
8963 : uint32_t _offered /* [in] */,
8964 : uint32_t *_needed /* [out] [ref] */,
8965 : uint32_t *_service_returned /* [out] [ref] */,
8966 : uint32_t *_resume_handle /* [in,out] [unique] */,
8967 : const char **_group_name /* [out] [charset(UTF16),ref] */,
8968 : WERROR *result)
8969 : {
8970 : struct EnumServicesStatusExA r;
8971 : NTSTATUS status;
8972 :
8973 : /* In parameters */
8974 0 : r.in.scmanager = _scmanager;
8975 0 : r.in.info_level = _info_level;
8976 0 : r.in.type = _type;
8977 0 : r.in.state = _state;
8978 0 : r.in.offered = _offered;
8979 0 : r.in.resume_handle = _resume_handle;
8980 :
8981 : /* Out parameters */
8982 0 : r.out.services = _services;
8983 0 : r.out.needed = _needed;
8984 0 : r.out.service_returned = _service_returned;
8985 0 : r.out.resume_handle = _resume_handle;
8986 0 : r.out.group_name = _group_name;
8987 :
8988 : /* Result */
8989 0 : NDR_ZERO_STRUCT(r.out.result);
8990 :
8991 0 : status = dcerpc_EnumServicesStatusExA_r(h, mem_ctx, &r);
8992 0 : if (!NT_STATUS_IS_OK(status)) {
8993 0 : return status;
8994 : }
8995 :
8996 : /* Return variables */
8997 : {
8998 : size_t _copy_len_services;
8999 0 : _copy_len_services = r.in.offered;
9000 0 : if (_services != r.out.services) {
9001 0 : memcpy(_services, r.out.services, _copy_len_services * sizeof(*_services));
9002 : }
9003 : }
9004 0 : *_needed = *r.out.needed;
9005 0 : *_service_returned = *r.out.service_returned;
9006 0 : if (_resume_handle && r.out.resume_handle) {
9007 0 : *_resume_handle = *r.out.resume_handle;
9008 : }
9009 0 : *_group_name = *r.out.group_name;
9010 :
9011 : /* Return result */
9012 0 : *result = r.out.result;
9013 :
9014 0 : return NT_STATUS_OK;
9015 : }
9016 :
9017 : struct dcerpc_EnumServicesStatusExW_r_state {
9018 : TALLOC_CTX *out_mem_ctx;
9019 : };
9020 :
9021 : static void dcerpc_EnumServicesStatusExW_r_done(struct tevent_req *subreq);
9022 :
9023 0 : struct tevent_req *dcerpc_EnumServicesStatusExW_r_send(TALLOC_CTX *mem_ctx,
9024 : struct tevent_context *ev,
9025 : struct dcerpc_binding_handle *h,
9026 : struct EnumServicesStatusExW *r)
9027 : {
9028 : struct tevent_req *req;
9029 : struct dcerpc_EnumServicesStatusExW_r_state *state;
9030 : struct tevent_req *subreq;
9031 :
9032 0 : req = tevent_req_create(mem_ctx, &state,
9033 : struct dcerpc_EnumServicesStatusExW_r_state);
9034 0 : if (req == NULL) {
9035 0 : return NULL;
9036 : }
9037 :
9038 0 : state->out_mem_ctx = talloc_new(state);
9039 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
9040 0 : return tevent_req_post(req, ev);
9041 : }
9042 :
9043 0 : subreq = dcerpc_binding_handle_call_send(state, ev, h,
9044 : NULL, &ndr_table_svcctl,
9045 0 : NDR_ENUMSERVICESSTATUSEXW, state->out_mem_ctx, r);
9046 0 : if (tevent_req_nomem(subreq, req)) {
9047 0 : return tevent_req_post(req, ev);
9048 : }
9049 0 : tevent_req_set_callback(subreq, dcerpc_EnumServicesStatusExW_r_done, req);
9050 :
9051 0 : return req;
9052 : }
9053 :
9054 0 : static void dcerpc_EnumServicesStatusExW_r_done(struct tevent_req *subreq)
9055 : {
9056 0 : struct tevent_req *req =
9057 0 : tevent_req_callback_data(subreq,
9058 : struct tevent_req);
9059 : NTSTATUS status;
9060 :
9061 0 : status = dcerpc_binding_handle_call_recv(subreq);
9062 0 : TALLOC_FREE(subreq);
9063 0 : if (tevent_req_nterror(req, status)) {
9064 0 : return;
9065 : }
9066 :
9067 0 : tevent_req_done(req);
9068 : }
9069 :
9070 0 : NTSTATUS dcerpc_EnumServicesStatusExW_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
9071 : {
9072 0 : struct dcerpc_EnumServicesStatusExW_r_state *state =
9073 0 : tevent_req_data(req,
9074 : struct dcerpc_EnumServicesStatusExW_r_state);
9075 : NTSTATUS status;
9076 :
9077 0 : if (tevent_req_is_nterror(req, &status)) {
9078 0 : tevent_req_received(req);
9079 0 : return status;
9080 : }
9081 :
9082 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
9083 :
9084 0 : tevent_req_received(req);
9085 0 : return NT_STATUS_OK;
9086 : }
9087 :
9088 0 : NTSTATUS dcerpc_EnumServicesStatusExW_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct EnumServicesStatusExW *r)
9089 : {
9090 : NTSTATUS status;
9091 :
9092 0 : status = dcerpc_binding_handle_call(h,
9093 : NULL, &ndr_table_svcctl,
9094 : NDR_ENUMSERVICESSTATUSEXW, mem_ctx, r);
9095 :
9096 0 : return status;
9097 : }
9098 :
9099 : struct dcerpc_EnumServicesStatusExW_state {
9100 : struct EnumServicesStatusExW orig;
9101 : struct EnumServicesStatusExW tmp;
9102 : TALLOC_CTX *out_mem_ctx;
9103 : };
9104 :
9105 : static void dcerpc_EnumServicesStatusExW_done(struct tevent_req *subreq);
9106 :
9107 0 : struct tevent_req *dcerpc_EnumServicesStatusExW_send(TALLOC_CTX *mem_ctx,
9108 : struct tevent_context *ev,
9109 : struct dcerpc_binding_handle *h,
9110 : struct policy_handle *_scmanager /* [in] [ref] */,
9111 : uint32_t _info_level /* [in] */,
9112 : uint32_t _type /* [in] */,
9113 : enum svcctl_ServiceState _state /* [in] */,
9114 : uint8_t *_services /* [out] [ref,size_is(offered)] */,
9115 : uint32_t _offered /* [in] [range(0,0x40000)] */,
9116 : uint32_t *_needed /* [out] [range(0,0x40000),ref] */,
9117 : uint32_t *_service_returned /* [out] [range(0,0x40000),ref] */,
9118 : uint32_t *_resume_handle /* [in,out] [range(0,0x40000),unique] */,
9119 : const char *_group_name /* [in] [charset(UTF16),unique] */)
9120 : {
9121 : struct tevent_req *req;
9122 : struct dcerpc_EnumServicesStatusExW_state *state;
9123 : struct tevent_req *subreq;
9124 :
9125 0 : req = tevent_req_create(mem_ctx, &state,
9126 : struct dcerpc_EnumServicesStatusExW_state);
9127 0 : if (req == NULL) {
9128 0 : return NULL;
9129 : }
9130 0 : state->out_mem_ctx = NULL;
9131 :
9132 : /* In parameters */
9133 0 : state->orig.in.scmanager = _scmanager;
9134 0 : state->orig.in.info_level = _info_level;
9135 0 : state->orig.in.type = _type;
9136 0 : state->orig.in.state = _state;
9137 0 : state->orig.in.offered = _offered;
9138 0 : state->orig.in.resume_handle = _resume_handle;
9139 0 : state->orig.in.group_name = _group_name;
9140 :
9141 : /* Out parameters */
9142 0 : state->orig.out.services = _services;
9143 0 : state->orig.out.needed = _needed;
9144 0 : state->orig.out.service_returned = _service_returned;
9145 0 : state->orig.out.resume_handle = _resume_handle;
9146 :
9147 : /* Result */
9148 0 : NDR_ZERO_STRUCT(state->orig.out.result);
9149 :
9150 0 : state->out_mem_ctx = talloc_named_const(state, 0,
9151 : "dcerpc_EnumServicesStatusExW_out_memory");
9152 0 : if (tevent_req_nomem(state->out_mem_ctx, req)) {
9153 0 : return tevent_req_post(req, ev);
9154 : }
9155 :
9156 : /* make a temporary copy, that we pass to the dispatch function */
9157 0 : state->tmp = state->orig;
9158 :
9159 0 : subreq = dcerpc_EnumServicesStatusExW_r_send(state, ev, h, &state->tmp);
9160 0 : if (tevent_req_nomem(subreq, req)) {
9161 0 : return tevent_req_post(req, ev);
9162 : }
9163 0 : tevent_req_set_callback(subreq, dcerpc_EnumServicesStatusExW_done, req);
9164 0 : return req;
9165 : }
9166 :
9167 0 : static void dcerpc_EnumServicesStatusExW_done(struct tevent_req *subreq)
9168 : {
9169 0 : struct tevent_req *req = tevent_req_callback_data(
9170 : subreq, struct tevent_req);
9171 0 : struct dcerpc_EnumServicesStatusExW_state *state = tevent_req_data(
9172 : req, struct dcerpc_EnumServicesStatusExW_state);
9173 : NTSTATUS status;
9174 : TALLOC_CTX *mem_ctx;
9175 :
9176 0 : if (state->out_mem_ctx) {
9177 0 : mem_ctx = state->out_mem_ctx;
9178 : } else {
9179 0 : mem_ctx = state;
9180 : }
9181 :
9182 0 : status = dcerpc_EnumServicesStatusExW_r_recv(subreq, mem_ctx);
9183 0 : TALLOC_FREE(subreq);
9184 0 : if (tevent_req_nterror(req, status)) {
9185 0 : return;
9186 : }
9187 :
9188 : /* Copy out parameters */
9189 : {
9190 : size_t _copy_len_services;
9191 0 : _copy_len_services = state->tmp.in.offered;
9192 0 : if (state->orig.out.services != state->tmp.out.services) {
9193 0 : memcpy(state->orig.out.services, state->tmp.out.services, _copy_len_services * sizeof(*state->orig.out.services));
9194 : }
9195 : }
9196 0 : *state->orig.out.needed = *state->tmp.out.needed;
9197 0 : *state->orig.out.service_returned = *state->tmp.out.service_returned;
9198 0 : if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
9199 0 : *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
9200 : }
9201 :
9202 : /* Copy result */
9203 0 : state->orig.out.result = state->tmp.out.result;
9204 :
9205 : /* Reset temporary structure */
9206 0 : NDR_ZERO_STRUCT(state->tmp);
9207 :
9208 0 : tevent_req_done(req);
9209 : }
9210 :
9211 0 : NTSTATUS dcerpc_EnumServicesStatusExW_recv(struct tevent_req *req,
9212 : TALLOC_CTX *mem_ctx,
9213 : WERROR *result)
9214 : {
9215 0 : struct dcerpc_EnumServicesStatusExW_state *state = tevent_req_data(
9216 : req, struct dcerpc_EnumServicesStatusExW_state);
9217 : NTSTATUS status;
9218 :
9219 0 : if (tevent_req_is_nterror(req, &status)) {
9220 0 : tevent_req_received(req);
9221 0 : return status;
9222 : }
9223 :
9224 : /* Steal possible out parameters to the callers context */
9225 0 : talloc_steal(mem_ctx, state->out_mem_ctx);
9226 :
9227 : /* Return result */
9228 0 : *result = state->orig.out.result;
9229 :
9230 0 : tevent_req_received(req);
9231 0 : return NT_STATUS_OK;
9232 : }
9233 :
9234 0 : NTSTATUS dcerpc_EnumServicesStatusExW(struct dcerpc_binding_handle *h,
9235 : TALLOC_CTX *mem_ctx,
9236 : struct policy_handle *_scmanager /* [in] [ref] */,
9237 : uint32_t _info_level /* [in] */,
9238 : uint32_t _type /* [in] */,
9239 : enum svcctl_ServiceState _state /* [in] */,
9240 : uint8_t *_services /* [out] [ref,size_is(offered)] */,
9241 : uint32_t _offered /* [in] [range(0,0x40000)] */,
9242 : uint32_t *_needed /* [out] [range(0,0x40000),ref] */,
9243 : uint32_t *_service_returned /* [out] [range(0,0x40000),ref] */,
9244 : uint32_t *_resume_handle /* [in,out] [range(0,0x40000),unique] */,
9245 : const char *_group_name /* [in] [charset(UTF16),unique] */,
9246 : WERROR *result)
9247 : {
9248 : struct EnumServicesStatusExW r;
9249 : NTSTATUS status;
9250 :
9251 : /* In parameters */
9252 0 : r.in.scmanager = _scmanager;
9253 0 : r.in.info_level = _info_level;
9254 0 : r.in.type = _type;
9255 0 : r.in.state = _state;
9256 0 : r.in.offered = _offered;
9257 0 : r.in.resume_handle = _resume_handle;
9258 0 : r.in.group_name = _group_name;
9259 :
9260 : /* Out parameters */
9261 0 : r.out.services = _services;
9262 0 : r.out.needed = _needed;
9263 0 : r.out.service_returned = _service_returned;
9264 0 : r.out.resume_handle = _resume_handle;
9265 :
9266 : /* Result */
9267 0 : NDR_ZERO_STRUCT(r.out.result);
9268 :
9269 0 : status = dcerpc_EnumServicesStatusExW_r(h, mem_ctx, &r);
9270 0 : if (!NT_STATUS_IS_OK(status)) {
9271 0 : return status;
9272 : }
9273 :
9274 : /* Return variables */
9275 : {
9276 : size_t _copy_len_services;
9277 0 : _copy_len_services = r.in.offered;
9278 0 : if (_services != r.out.services) {
9279 0 : memcpy(_services, r.out.services, _copy_len_services * sizeof(*_services));
9280 : }
9281 : }
9282 0 : *_needed = *r.out.needed;
9283 0 : *_service_returned = *r.out.service_returned;
9284 0 : if (_resume_handle && r.out.resume_handle) {
9285 0 : *_resume_handle = *r.out.resume_handle;
9286 : }
9287 :
9288 : /* Return result */
9289 0 : *result = r.out.result;
9290 :
9291 0 : return NT_STATUS_OK;
9292 : }
9293 :
|