Line data Source code
1 : /* s3 compat server functions auto-generated by pidl */
2 : #include "bin/default/librpc/gen_ndr/ndr_svcctl.h"
3 : #include "bin/default/librpc/gen_ndr/ndr_svcctl_scompat.h"
4 : #include <librpc/rpc/dcesrv_core.h>
5 : #include <rpc_server/rpc_config.h>
6 : #include <rpc_server/rpc_server.h>
7 : #include <util/debug.h>
8 :
9 : enum s3compat_rpc_dispatch {
10 : S3COMPAT_RPC_DISPATCH_EXTERNAL = 0x00000001,
11 : S3COMPAT_RPC_DISPATCH_INTERNAL = 0x00000002,
12 : };
13 :
14 : /* svcctl - dcerpc server boilerplate generated by pidl */
15 0 : static NTSTATUS svcctl__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
16 : {
17 : #ifdef DCESRV_INTERFACE_SVCCTL_BIND
18 : return DCESRV_INTERFACE_SVCCTL_BIND(context,iface);
19 : #else
20 0 : return NT_STATUS_OK;
21 : #endif
22 : }
23 :
24 0 : static void svcctl__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
25 : {
26 : #ifdef DCESRV_INTERFACE_SVCCTL_UNBIND
27 : DCESRV_INTERFACE_SVCCTL_UNBIND(context, iface);
28 : #else
29 0 : return;
30 : #endif
31 : }
32 :
33 0 : NTSTATUS svcctl__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
34 : {
35 : enum ndr_err_code ndr_err;
36 0 : uint16_t opnum = dce_call->pkt.u.request.opnum;
37 :
38 0 : dce_call->fault_code = 0;
39 :
40 0 : if (opnum >= ndr_table_svcctl.num_calls) {
41 0 : dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
42 0 : return NT_STATUS_NET_WRITE_FAULT;
43 : }
44 :
45 0 : *r = talloc_named(mem_ctx, ndr_table_svcctl.calls[opnum].struct_size, "struct %s", ndr_table_svcctl.calls[opnum].name);
46 0 : NT_STATUS_HAVE_NO_MEMORY(*r);
47 :
48 : /* unravel the NDR for the packet */
49 0 : ndr_err = ndr_table_svcctl.calls[opnum].ndr_pull(pull, NDR_IN, *r);
50 0 : if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
51 0 : dce_call->fault_code = DCERPC_FAULT_NDR;
52 0 : return NT_STATUS_NET_WRITE_FAULT;
53 : }
54 :
55 0 : return NT_STATUS_OK;
56 : }
57 :
58 0 : static NTSTATUS svcctl__op_dispatch_internal(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, enum s3compat_rpc_dispatch dispatch)
59 : {
60 0 : uint16_t opnum = dce_call->pkt.u.request.opnum;
61 0 : struct pipes_struct *p = NULL;
62 0 : NTSTATUS status = NT_STATUS_OK;
63 0 : bool impersonated = false;
64 :
65 : /* Retrieve pipes struct */
66 0 : p = dcesrv_get_pipes_struct(dce_call->conn);
67 0 : p->dce_call = dce_call;
68 0 : p->mem_ctx = mem_ctx;
69 : /* Reset pipes struct fault state */
70 0 : p->fault_state = 0;
71 :
72 : /* Impersonate */
73 0 : if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) {
74 0 : impersonated = become_authenticated_pipe_user(dce_call->auth_state->session_info);
75 0 : if (!impersonated) {
76 0 : dce_call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
77 0 : status = NT_STATUS_NET_WRITE_FAULT;
78 0 : goto fail;
79 : }
80 : }
81 :
82 0 : switch (opnum) {
83 0 : case 0: { /* svcctl_CloseServiceHandle */
84 0 : struct svcctl_CloseServiceHandle *r2 = (struct svcctl_CloseServiceHandle *)r;
85 0 : if (DEBUGLEVEL >= 10) {
86 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_CloseServiceHandle, NDR_IN, r2);
87 : }
88 0 : NDR_ZERO_STRUCT(r2->out);
89 0 : r2->out.handle = r2->in.handle;
90 0 : r2->out.result = _svcctl_CloseServiceHandle(p, r2);
91 0 : break;
92 : }
93 0 : case 1: { /* svcctl_ControlService */
94 0 : struct svcctl_ControlService *r2 = (struct svcctl_ControlService *)r;
95 0 : if (DEBUGLEVEL >= 10) {
96 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ControlService, NDR_IN, r2);
97 : }
98 0 : NDR_ZERO_STRUCT(r2->out);
99 0 : r2->out.service_status = talloc_zero(r2, struct SERVICE_STATUS);
100 0 : if (r2->out.service_status == NULL) {
101 0 : status = NT_STATUS_NO_MEMORY;
102 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
103 0 : goto fail;
104 : }
105 :
106 0 : r2->out.result = _svcctl_ControlService(p, r2);
107 0 : break;
108 : }
109 0 : case 2: { /* svcctl_DeleteService */
110 0 : struct svcctl_DeleteService *r2 = (struct svcctl_DeleteService *)r;
111 0 : if (DEBUGLEVEL >= 10) {
112 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_DeleteService, NDR_IN, r2);
113 : }
114 0 : r2->out.result = _svcctl_DeleteService(p, r2);
115 0 : break;
116 : }
117 0 : case 3: { /* svcctl_LockServiceDatabase */
118 0 : struct svcctl_LockServiceDatabase *r2 = (struct svcctl_LockServiceDatabase *)r;
119 0 : if (DEBUGLEVEL >= 10) {
120 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_LockServiceDatabase, NDR_IN, r2);
121 : }
122 0 : NDR_ZERO_STRUCT(r2->out);
123 0 : r2->out.lock = talloc_zero(r2, struct policy_handle);
124 0 : if (r2->out.lock == NULL) {
125 0 : status = NT_STATUS_NO_MEMORY;
126 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
127 0 : goto fail;
128 : }
129 :
130 0 : r2->out.result = _svcctl_LockServiceDatabase(p, r2);
131 0 : break;
132 : }
133 0 : case 4: { /* svcctl_QueryServiceObjectSecurity */
134 0 : struct svcctl_QueryServiceObjectSecurity *r2 = (struct svcctl_QueryServiceObjectSecurity *)r;
135 0 : if (DEBUGLEVEL >= 10) {
136 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceObjectSecurity, NDR_IN, r2);
137 : }
138 0 : NDR_ZERO_STRUCT(r2->out);
139 0 : r2->out.buffer = talloc_zero_array(r2, uint8_t, r2->in.offered);
140 0 : if (r2->out.buffer == NULL) {
141 0 : status = NT_STATUS_NO_MEMORY;
142 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
143 0 : goto fail;
144 : }
145 :
146 0 : r2->out.needed = talloc_zero(r2, uint32_t);
147 0 : if (r2->out.needed == NULL) {
148 0 : status = NT_STATUS_NO_MEMORY;
149 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
150 0 : goto fail;
151 : }
152 :
153 0 : r2->out.result = _svcctl_QueryServiceObjectSecurity(p, r2);
154 0 : break;
155 : }
156 0 : case 5: { /* svcctl_SetServiceObjectSecurity */
157 0 : struct svcctl_SetServiceObjectSecurity *r2 = (struct svcctl_SetServiceObjectSecurity *)r;
158 0 : if (DEBUGLEVEL >= 10) {
159 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SetServiceObjectSecurity, NDR_IN, r2);
160 : }
161 0 : r2->out.result = _svcctl_SetServiceObjectSecurity(p, r2);
162 0 : break;
163 : }
164 0 : case 6: { /* svcctl_QueryServiceStatus */
165 0 : struct svcctl_QueryServiceStatus *r2 = (struct svcctl_QueryServiceStatus *)r;
166 0 : if (DEBUGLEVEL >= 10) {
167 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceStatus, NDR_IN, r2);
168 : }
169 0 : NDR_ZERO_STRUCT(r2->out);
170 0 : r2->out.service_status = talloc_zero(r2, struct SERVICE_STATUS);
171 0 : if (r2->out.service_status == NULL) {
172 0 : status = NT_STATUS_NO_MEMORY;
173 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
174 0 : goto fail;
175 : }
176 :
177 0 : r2->out.result = _svcctl_QueryServiceStatus(p, r2);
178 0 : break;
179 : }
180 0 : case 7: { /* svcctl_SetServiceStatus */
181 0 : struct svcctl_SetServiceStatus *r2 = (struct svcctl_SetServiceStatus *)r;
182 0 : if (DEBUGLEVEL >= 10) {
183 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SetServiceStatus, NDR_IN, r2);
184 : }
185 0 : r2->out.result = _svcctl_SetServiceStatus(p, r2);
186 0 : break;
187 : }
188 0 : case 8: { /* svcctl_UnlockServiceDatabase */
189 0 : struct svcctl_UnlockServiceDatabase *r2 = (struct svcctl_UnlockServiceDatabase *)r;
190 0 : if (DEBUGLEVEL >= 10) {
191 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_UnlockServiceDatabase, NDR_IN, r2);
192 : }
193 0 : NDR_ZERO_STRUCT(r2->out);
194 0 : r2->out.lock = r2->in.lock;
195 0 : r2->out.result = _svcctl_UnlockServiceDatabase(p, r2);
196 0 : break;
197 : }
198 0 : case 9: { /* svcctl_NotifyBootConfigStatus */
199 0 : struct svcctl_NotifyBootConfigStatus *r2 = (struct svcctl_NotifyBootConfigStatus *)r;
200 0 : if (DEBUGLEVEL >= 10) {
201 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_NotifyBootConfigStatus, NDR_IN, r2);
202 : }
203 0 : r2->out.result = _svcctl_NotifyBootConfigStatus(p, r2);
204 0 : break;
205 : }
206 0 : case 10: { /* svcctl_SCSetServiceBitsW */
207 0 : struct svcctl_SCSetServiceBitsW *r2 = (struct svcctl_SCSetServiceBitsW *)r;
208 0 : if (DEBUGLEVEL >= 10) {
209 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SCSetServiceBitsW, NDR_IN, r2);
210 : }
211 0 : r2->out.result = _svcctl_SCSetServiceBitsW(p, r2);
212 0 : break;
213 : }
214 0 : case 11: { /* svcctl_ChangeServiceConfigW */
215 0 : struct svcctl_ChangeServiceConfigW *r2 = (struct svcctl_ChangeServiceConfigW *)r;
216 0 : if (DEBUGLEVEL >= 10) {
217 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfigW, NDR_IN, r2);
218 : }
219 0 : NDR_ZERO_STRUCT(r2->out);
220 0 : r2->out.tag_id = r2->in.tag_id;
221 0 : r2->out.result = _svcctl_ChangeServiceConfigW(p, r2);
222 0 : break;
223 : }
224 0 : case 12: { /* svcctl_CreateServiceW */
225 0 : struct svcctl_CreateServiceW *r2 = (struct svcctl_CreateServiceW *)r;
226 0 : if (DEBUGLEVEL >= 10) {
227 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceW, NDR_IN, r2);
228 : }
229 0 : NDR_ZERO_STRUCT(r2->out);
230 0 : r2->out.TagId = r2->in.TagId;
231 0 : r2->out.handle = talloc_zero(r2, struct policy_handle);
232 0 : if (r2->out.handle == NULL) {
233 0 : status = NT_STATUS_NO_MEMORY;
234 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
235 0 : goto fail;
236 : }
237 :
238 0 : r2->out.result = _svcctl_CreateServiceW(p, r2);
239 0 : break;
240 : }
241 0 : case 13: { /* svcctl_EnumDependentServicesW */
242 0 : struct svcctl_EnumDependentServicesW *r2 = (struct svcctl_EnumDependentServicesW *)r;
243 0 : if (DEBUGLEVEL >= 10) {
244 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumDependentServicesW, NDR_IN, r2);
245 : }
246 0 : NDR_ZERO_STRUCT(r2->out);
247 0 : r2->out.service_status = talloc_zero_array(r2, uint8_t, r2->in.offered);
248 0 : if (r2->out.service_status == NULL) {
249 0 : status = NT_STATUS_NO_MEMORY;
250 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
251 0 : goto fail;
252 : }
253 :
254 0 : r2->out.needed = talloc_zero(r2, uint32_t);
255 0 : if (r2->out.needed == NULL) {
256 0 : status = NT_STATUS_NO_MEMORY;
257 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
258 0 : goto fail;
259 : }
260 :
261 0 : r2->out.services_returned = talloc_zero(r2, uint32_t);
262 0 : if (r2->out.services_returned == NULL) {
263 0 : status = NT_STATUS_NO_MEMORY;
264 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
265 0 : goto fail;
266 : }
267 :
268 0 : r2->out.result = _svcctl_EnumDependentServicesW(p, r2);
269 0 : break;
270 : }
271 0 : case 14: { /* svcctl_EnumServicesStatusW */
272 0 : struct svcctl_EnumServicesStatusW *r2 = (struct svcctl_EnumServicesStatusW *)r;
273 0 : if (DEBUGLEVEL >= 10) {
274 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServicesStatusW, NDR_IN, r2);
275 : }
276 0 : NDR_ZERO_STRUCT(r2->out);
277 0 : r2->out.resume_handle = r2->in.resume_handle;
278 0 : r2->out.service = talloc_zero_array(r2, uint8_t, r2->in.offered);
279 0 : if (r2->out.service == NULL) {
280 0 : status = NT_STATUS_NO_MEMORY;
281 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
282 0 : goto fail;
283 : }
284 :
285 0 : r2->out.needed = talloc_zero(r2, uint32_t);
286 0 : if (r2->out.needed == NULL) {
287 0 : status = NT_STATUS_NO_MEMORY;
288 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
289 0 : goto fail;
290 : }
291 :
292 0 : r2->out.services_returned = talloc_zero(r2, uint32_t);
293 0 : if (r2->out.services_returned == NULL) {
294 0 : status = NT_STATUS_NO_MEMORY;
295 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
296 0 : goto fail;
297 : }
298 :
299 0 : r2->out.result = _svcctl_EnumServicesStatusW(p, r2);
300 0 : break;
301 : }
302 0 : case 15: { /* svcctl_OpenSCManagerW */
303 0 : struct svcctl_OpenSCManagerW *r2 = (struct svcctl_OpenSCManagerW *)r;
304 0 : if (DEBUGLEVEL >= 10) {
305 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenSCManagerW, NDR_IN, r2);
306 : }
307 0 : NDR_ZERO_STRUCT(r2->out);
308 0 : r2->out.handle = talloc_zero(r2, struct policy_handle);
309 0 : if (r2->out.handle == NULL) {
310 0 : status = NT_STATUS_NO_MEMORY;
311 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
312 0 : goto fail;
313 : }
314 :
315 0 : r2->out.result = _svcctl_OpenSCManagerW(p, r2);
316 0 : break;
317 : }
318 0 : case 16: { /* svcctl_OpenServiceW */
319 0 : struct svcctl_OpenServiceW *r2 = (struct svcctl_OpenServiceW *)r;
320 0 : if (DEBUGLEVEL >= 10) {
321 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenServiceW, NDR_IN, r2);
322 : }
323 0 : NDR_ZERO_STRUCT(r2->out);
324 0 : r2->out.handle = talloc_zero(r2, struct policy_handle);
325 0 : if (r2->out.handle == NULL) {
326 0 : status = NT_STATUS_NO_MEMORY;
327 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
328 0 : goto fail;
329 : }
330 :
331 0 : r2->out.result = _svcctl_OpenServiceW(p, r2);
332 0 : break;
333 : }
334 0 : case 17: { /* svcctl_QueryServiceConfigW */
335 0 : struct svcctl_QueryServiceConfigW *r2 = (struct svcctl_QueryServiceConfigW *)r;
336 0 : if (DEBUGLEVEL >= 10) {
337 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfigW, NDR_IN, r2);
338 : }
339 0 : NDR_ZERO_STRUCT(r2->out);
340 0 : r2->out.query = talloc_zero(r2, struct QUERY_SERVICE_CONFIG);
341 0 : if (r2->out.query == NULL) {
342 0 : status = NT_STATUS_NO_MEMORY;
343 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
344 0 : goto fail;
345 : }
346 :
347 0 : r2->out.needed = talloc_zero(r2, uint32_t);
348 0 : if (r2->out.needed == NULL) {
349 0 : status = NT_STATUS_NO_MEMORY;
350 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
351 0 : goto fail;
352 : }
353 :
354 0 : r2->out.result = _svcctl_QueryServiceConfigW(p, r2);
355 0 : break;
356 : }
357 0 : case 18: { /* svcctl_QueryServiceLockStatusW */
358 0 : struct svcctl_QueryServiceLockStatusW *r2 = (struct svcctl_QueryServiceLockStatusW *)r;
359 0 : if (DEBUGLEVEL >= 10) {
360 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceLockStatusW, NDR_IN, r2);
361 : }
362 0 : NDR_ZERO_STRUCT(r2->out);
363 0 : r2->out.lock_status = talloc_zero(r2, struct SERVICE_LOCK_STATUS);
364 0 : if (r2->out.lock_status == NULL) {
365 0 : status = NT_STATUS_NO_MEMORY;
366 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
367 0 : goto fail;
368 : }
369 :
370 0 : r2->out.needed = talloc_zero(r2, uint32_t);
371 0 : if (r2->out.needed == NULL) {
372 0 : status = NT_STATUS_NO_MEMORY;
373 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
374 0 : goto fail;
375 : }
376 :
377 0 : r2->out.result = _svcctl_QueryServiceLockStatusW(p, r2);
378 0 : break;
379 : }
380 0 : case 19: { /* svcctl_StartServiceW */
381 0 : struct svcctl_StartServiceW *r2 = (struct svcctl_StartServiceW *)r;
382 0 : if (DEBUGLEVEL >= 10) {
383 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_StartServiceW, NDR_IN, r2);
384 : }
385 0 : r2->out.result = _svcctl_StartServiceW(p, r2);
386 0 : break;
387 : }
388 0 : case 20: { /* svcctl_GetServiceDisplayNameW */
389 0 : struct svcctl_GetServiceDisplayNameW *r2 = (struct svcctl_GetServiceDisplayNameW *)r;
390 0 : if (DEBUGLEVEL >= 10) {
391 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceDisplayNameW, NDR_IN, r2);
392 : }
393 0 : NDR_ZERO_STRUCT(r2->out);
394 0 : r2->out.display_name_length = r2->in.display_name_length;
395 0 : r2->out.display_name = talloc_zero(r2, const char *);
396 0 : if (r2->out.display_name == NULL) {
397 0 : status = NT_STATUS_NO_MEMORY;
398 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
399 0 : goto fail;
400 : }
401 :
402 0 : r2->out.result = _svcctl_GetServiceDisplayNameW(p, r2);
403 0 : break;
404 : }
405 0 : case 21: { /* svcctl_GetServiceKeyNameW */
406 0 : struct svcctl_GetServiceKeyNameW *r2 = (struct svcctl_GetServiceKeyNameW *)r;
407 0 : if (DEBUGLEVEL >= 10) {
408 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceKeyNameW, NDR_IN, r2);
409 : }
410 0 : NDR_ZERO_STRUCT(r2->out);
411 0 : r2->out.display_name_length = r2->in.display_name_length;
412 0 : r2->out.key_name = talloc_zero(r2, const char *);
413 0 : if (r2->out.key_name == NULL) {
414 0 : status = NT_STATUS_NO_MEMORY;
415 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
416 0 : goto fail;
417 : }
418 :
419 0 : r2->out.result = _svcctl_GetServiceKeyNameW(p, r2);
420 0 : break;
421 : }
422 0 : case 22: { /* svcctl_SCSetServiceBitsA */
423 0 : struct svcctl_SCSetServiceBitsA *r2 = (struct svcctl_SCSetServiceBitsA *)r;
424 0 : if (DEBUGLEVEL >= 10) {
425 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SCSetServiceBitsA, NDR_IN, r2);
426 : }
427 0 : r2->out.result = _svcctl_SCSetServiceBitsA(p, r2);
428 0 : break;
429 : }
430 0 : case 23: { /* svcctl_ChangeServiceConfigA */
431 0 : struct svcctl_ChangeServiceConfigA *r2 = (struct svcctl_ChangeServiceConfigA *)r;
432 0 : if (DEBUGLEVEL >= 10) {
433 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfigA, NDR_IN, r2);
434 : }
435 0 : NDR_ZERO_STRUCT(r2->out);
436 0 : r2->out.tag_id = talloc_zero(r2, uint32_t);
437 0 : if (r2->out.tag_id == NULL) {
438 0 : status = NT_STATUS_NO_MEMORY;
439 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
440 0 : goto fail;
441 : }
442 :
443 0 : r2->out.result = _svcctl_ChangeServiceConfigA(p, r2);
444 0 : break;
445 : }
446 0 : case 24: { /* svcctl_CreateServiceA */
447 0 : struct svcctl_CreateServiceA *r2 = (struct svcctl_CreateServiceA *)r;
448 0 : if (DEBUGLEVEL >= 10) {
449 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceA, NDR_IN, r2);
450 : }
451 0 : NDR_ZERO_STRUCT(r2->out);
452 0 : r2->out.TagId = talloc_zero(r2, uint32_t);
453 0 : if (r2->out.TagId == NULL) {
454 0 : status = NT_STATUS_NO_MEMORY;
455 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
456 0 : goto fail;
457 : }
458 :
459 0 : r2->out.result = _svcctl_CreateServiceA(p, r2);
460 0 : break;
461 : }
462 0 : case 25: { /* svcctl_EnumDependentServicesA */
463 0 : struct svcctl_EnumDependentServicesA *r2 = (struct svcctl_EnumDependentServicesA *)r;
464 0 : if (DEBUGLEVEL >= 10) {
465 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumDependentServicesA, NDR_IN, r2);
466 : }
467 0 : NDR_ZERO_STRUCT(r2->out);
468 0 : r2->out.service_status = talloc_zero(r2, struct ENUM_SERVICE_STATUSA);
469 0 : if (r2->out.service_status == NULL) {
470 0 : status = NT_STATUS_NO_MEMORY;
471 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
472 0 : goto fail;
473 : }
474 :
475 0 : r2->out.needed = talloc_zero(r2, uint32_t);
476 0 : if (r2->out.needed == NULL) {
477 0 : status = NT_STATUS_NO_MEMORY;
478 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
479 0 : goto fail;
480 : }
481 :
482 0 : r2->out.services_returned = talloc_zero(r2, uint32_t);
483 0 : if (r2->out.services_returned == NULL) {
484 0 : status = NT_STATUS_NO_MEMORY;
485 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
486 0 : goto fail;
487 : }
488 :
489 0 : r2->out.result = _svcctl_EnumDependentServicesA(p, r2);
490 0 : break;
491 : }
492 0 : case 26: { /* svcctl_EnumServicesStatusA */
493 0 : struct svcctl_EnumServicesStatusA *r2 = (struct svcctl_EnumServicesStatusA *)r;
494 0 : if (DEBUGLEVEL >= 10) {
495 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServicesStatusA, NDR_IN, r2);
496 : }
497 0 : NDR_ZERO_STRUCT(r2->out);
498 0 : r2->out.resume_handle = r2->in.resume_handle;
499 0 : r2->out.service = talloc_zero_array(r2, uint8_t, r2->in.offered);
500 0 : if (r2->out.service == NULL) {
501 0 : status = NT_STATUS_NO_MEMORY;
502 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
503 0 : goto fail;
504 : }
505 :
506 0 : r2->out.needed = talloc_zero(r2, uint32_t);
507 0 : if (r2->out.needed == NULL) {
508 0 : status = NT_STATUS_NO_MEMORY;
509 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
510 0 : goto fail;
511 : }
512 :
513 0 : r2->out.services_returned = talloc_zero(r2, uint32_t);
514 0 : if (r2->out.services_returned == NULL) {
515 0 : status = NT_STATUS_NO_MEMORY;
516 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
517 0 : goto fail;
518 : }
519 :
520 0 : r2->out.result = _svcctl_EnumServicesStatusA(p, r2);
521 0 : break;
522 : }
523 0 : case 27: { /* svcctl_OpenSCManagerA */
524 0 : struct svcctl_OpenSCManagerA *r2 = (struct svcctl_OpenSCManagerA *)r;
525 0 : if (DEBUGLEVEL >= 10) {
526 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenSCManagerA, NDR_IN, r2);
527 : }
528 0 : NDR_ZERO_STRUCT(r2->out);
529 0 : r2->out.handle = talloc_zero(r2, struct policy_handle);
530 0 : if (r2->out.handle == NULL) {
531 0 : status = NT_STATUS_NO_MEMORY;
532 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
533 0 : goto fail;
534 : }
535 :
536 0 : r2->out.result = _svcctl_OpenSCManagerA(p, r2);
537 0 : break;
538 : }
539 0 : case 28: { /* svcctl_OpenServiceA */
540 0 : struct svcctl_OpenServiceA *r2 = (struct svcctl_OpenServiceA *)r;
541 0 : if (DEBUGLEVEL >= 10) {
542 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenServiceA, NDR_IN, r2);
543 : }
544 0 : NDR_ZERO_STRUCT(r2->out);
545 0 : r2->out.handle = talloc_zero(r2, struct policy_handle);
546 0 : if (r2->out.handle == NULL) {
547 0 : status = NT_STATUS_NO_MEMORY;
548 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
549 0 : goto fail;
550 : }
551 :
552 0 : r2->out.result = _svcctl_OpenServiceA(p, r2);
553 0 : break;
554 : }
555 0 : case 29: { /* svcctl_QueryServiceConfigA */
556 0 : struct svcctl_QueryServiceConfigA *r2 = (struct svcctl_QueryServiceConfigA *)r;
557 0 : if (DEBUGLEVEL >= 10) {
558 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfigA, NDR_IN, r2);
559 : }
560 0 : NDR_ZERO_STRUCT(r2->out);
561 0 : r2->out.query = talloc_zero_array(r2, uint8_t, r2->in.offered);
562 0 : if (r2->out.query == NULL) {
563 0 : status = NT_STATUS_NO_MEMORY;
564 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
565 0 : goto fail;
566 : }
567 :
568 0 : r2->out.needed = talloc_zero(r2, uint32_t);
569 0 : if (r2->out.needed == NULL) {
570 0 : status = NT_STATUS_NO_MEMORY;
571 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
572 0 : goto fail;
573 : }
574 :
575 0 : r2->out.result = _svcctl_QueryServiceConfigA(p, r2);
576 0 : break;
577 : }
578 0 : case 30: { /* svcctl_QueryServiceLockStatusA */
579 0 : struct svcctl_QueryServiceLockStatusA *r2 = (struct svcctl_QueryServiceLockStatusA *)r;
580 0 : if (DEBUGLEVEL >= 10) {
581 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceLockStatusA, NDR_IN, r2);
582 : }
583 0 : NDR_ZERO_STRUCT(r2->out);
584 0 : r2->out.lock_status = talloc_zero(r2, struct SERVICE_LOCK_STATUS);
585 0 : if (r2->out.lock_status == NULL) {
586 0 : status = NT_STATUS_NO_MEMORY;
587 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
588 0 : goto fail;
589 : }
590 :
591 0 : r2->out.needed = talloc_zero(r2, uint32_t);
592 0 : if (r2->out.needed == NULL) {
593 0 : status = NT_STATUS_NO_MEMORY;
594 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
595 0 : goto fail;
596 : }
597 :
598 0 : r2->out.result = _svcctl_QueryServiceLockStatusA(p, r2);
599 0 : break;
600 : }
601 0 : case 31: { /* svcctl_StartServiceA */
602 0 : struct svcctl_StartServiceA *r2 = (struct svcctl_StartServiceA *)r;
603 0 : if (DEBUGLEVEL >= 10) {
604 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_StartServiceA, NDR_IN, r2);
605 : }
606 0 : r2->out.result = _svcctl_StartServiceA(p, r2);
607 0 : break;
608 : }
609 0 : case 32: { /* svcctl_GetServiceDisplayNameA */
610 0 : struct svcctl_GetServiceDisplayNameA *r2 = (struct svcctl_GetServiceDisplayNameA *)r;
611 0 : if (DEBUGLEVEL >= 10) {
612 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceDisplayNameA, NDR_IN, r2);
613 : }
614 0 : NDR_ZERO_STRUCT(r2->out);
615 0 : r2->out.display_name_length = r2->in.display_name_length;
616 0 : r2->out.display_name = talloc_zero(r2, const char *);
617 0 : if (r2->out.display_name == NULL) {
618 0 : status = NT_STATUS_NO_MEMORY;
619 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
620 0 : goto fail;
621 : }
622 :
623 0 : r2->out.result = _svcctl_GetServiceDisplayNameA(p, r2);
624 0 : break;
625 : }
626 0 : case 33: { /* svcctl_GetServiceKeyNameA */
627 0 : struct svcctl_GetServiceKeyNameA *r2 = (struct svcctl_GetServiceKeyNameA *)r;
628 0 : if (DEBUGLEVEL >= 10) {
629 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceKeyNameA, NDR_IN, r2);
630 : }
631 0 : NDR_ZERO_STRUCT(r2->out);
632 0 : r2->out.display_name_length = r2->in.display_name_length;
633 0 : r2->out.key_name = talloc_zero(r2, const char *);
634 0 : if (r2->out.key_name == NULL) {
635 0 : status = NT_STATUS_NO_MEMORY;
636 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
637 0 : goto fail;
638 : }
639 :
640 0 : r2->out.result = _svcctl_GetServiceKeyNameA(p, r2);
641 0 : break;
642 : }
643 0 : case 34: { /* svcctl_GetCurrentGroupeStateW */
644 0 : struct svcctl_GetCurrentGroupeStateW *r2 = (struct svcctl_GetCurrentGroupeStateW *)r;
645 0 : if (DEBUGLEVEL >= 10) {
646 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetCurrentGroupeStateW, NDR_IN, r2);
647 : }
648 0 : r2->out.result = _svcctl_GetCurrentGroupeStateW(p, r2);
649 0 : break;
650 : }
651 0 : case 35: { /* svcctl_EnumServiceGroupW */
652 0 : struct svcctl_EnumServiceGroupW *r2 = (struct svcctl_EnumServiceGroupW *)r;
653 0 : if (DEBUGLEVEL >= 10) {
654 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServiceGroupW, NDR_IN, r2);
655 : }
656 0 : r2->out.result = _svcctl_EnumServiceGroupW(p, r2);
657 0 : break;
658 : }
659 0 : case 36: { /* svcctl_ChangeServiceConfig2A */
660 0 : struct svcctl_ChangeServiceConfig2A *r2 = (struct svcctl_ChangeServiceConfig2A *)r;
661 0 : if (DEBUGLEVEL >= 10) {
662 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfig2A, NDR_IN, r2);
663 : }
664 0 : r2->out.result = _svcctl_ChangeServiceConfig2A(p, r2);
665 0 : break;
666 : }
667 0 : case 37: { /* svcctl_ChangeServiceConfig2W */
668 0 : struct svcctl_ChangeServiceConfig2W *r2 = (struct svcctl_ChangeServiceConfig2W *)r;
669 0 : if (DEBUGLEVEL >= 10) {
670 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfig2W, NDR_IN, r2);
671 : }
672 0 : r2->out.result = _svcctl_ChangeServiceConfig2W(p, r2);
673 0 : break;
674 : }
675 0 : case 38: { /* svcctl_QueryServiceConfig2A */
676 0 : struct svcctl_QueryServiceConfig2A *r2 = (struct svcctl_QueryServiceConfig2A *)r;
677 0 : if (DEBUGLEVEL >= 10) {
678 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfig2A, NDR_IN, r2);
679 : }
680 0 : NDR_ZERO_STRUCT(r2->out);
681 0 : r2->out.buffer = talloc_zero_array(r2, uint8_t, r2->in.offered);
682 0 : if (r2->out.buffer == NULL) {
683 0 : status = NT_STATUS_NO_MEMORY;
684 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
685 0 : goto fail;
686 : }
687 :
688 0 : r2->out.needed = talloc_zero(r2, uint32_t);
689 0 : if (r2->out.needed == NULL) {
690 0 : status = NT_STATUS_NO_MEMORY;
691 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
692 0 : goto fail;
693 : }
694 :
695 0 : r2->out.result = _svcctl_QueryServiceConfig2A(p, r2);
696 0 : break;
697 : }
698 0 : case 39: { /* svcctl_QueryServiceConfig2W */
699 0 : struct svcctl_QueryServiceConfig2W *r2 = (struct svcctl_QueryServiceConfig2W *)r;
700 0 : if (DEBUGLEVEL >= 10) {
701 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfig2W, NDR_IN, r2);
702 : }
703 0 : NDR_ZERO_STRUCT(r2->out);
704 0 : r2->out.buffer = talloc_zero_array(r2, uint8_t, r2->in.offered);
705 0 : if (r2->out.buffer == NULL) {
706 0 : status = NT_STATUS_NO_MEMORY;
707 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
708 0 : goto fail;
709 : }
710 :
711 0 : r2->out.needed = talloc_zero(r2, uint32_t);
712 0 : if (r2->out.needed == NULL) {
713 0 : status = NT_STATUS_NO_MEMORY;
714 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
715 0 : goto fail;
716 : }
717 :
718 0 : r2->out.result = _svcctl_QueryServiceConfig2W(p, r2);
719 0 : break;
720 : }
721 0 : case 40: { /* svcctl_QueryServiceStatusEx */
722 0 : struct svcctl_QueryServiceStatusEx *r2 = (struct svcctl_QueryServiceStatusEx *)r;
723 0 : if (DEBUGLEVEL >= 10) {
724 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceStatusEx, NDR_IN, r2);
725 : }
726 0 : NDR_ZERO_STRUCT(r2->out);
727 0 : r2->out.buffer = talloc_zero_array(r2, uint8_t, r2->in.offered);
728 0 : if (r2->out.buffer == NULL) {
729 0 : status = NT_STATUS_NO_MEMORY;
730 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
731 0 : goto fail;
732 : }
733 :
734 0 : r2->out.needed = talloc_zero(r2, uint32_t);
735 0 : if (r2->out.needed == NULL) {
736 0 : status = NT_STATUS_NO_MEMORY;
737 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
738 0 : goto fail;
739 : }
740 :
741 0 : r2->out.result = _svcctl_QueryServiceStatusEx(p, r2);
742 0 : break;
743 : }
744 0 : case 41: { /* EnumServicesStatusExA */
745 0 : struct EnumServicesStatusExA *r2 = (struct EnumServicesStatusExA *)r;
746 0 : if (DEBUGLEVEL >= 10) {
747 0 : NDR_PRINT_FUNCTION_DEBUG(EnumServicesStatusExA, NDR_IN, r2);
748 : }
749 0 : NDR_ZERO_STRUCT(r2->out);
750 0 : r2->out.resume_handle = r2->in.resume_handle;
751 0 : r2->out.services = talloc_zero_array(r2, uint8_t, r2->in.offered);
752 0 : if (r2->out.services == NULL) {
753 0 : status = NT_STATUS_NO_MEMORY;
754 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
755 0 : goto fail;
756 : }
757 :
758 0 : r2->out.needed = talloc_zero(r2, uint32_t);
759 0 : if (r2->out.needed == NULL) {
760 0 : status = NT_STATUS_NO_MEMORY;
761 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
762 0 : goto fail;
763 : }
764 :
765 0 : r2->out.service_returned = talloc_zero(r2, uint32_t);
766 0 : if (r2->out.service_returned == NULL) {
767 0 : status = NT_STATUS_NO_MEMORY;
768 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
769 0 : goto fail;
770 : }
771 :
772 0 : r2->out.group_name = talloc_zero(r2, const char *);
773 0 : if (r2->out.group_name == NULL) {
774 0 : status = NT_STATUS_NO_MEMORY;
775 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
776 0 : goto fail;
777 : }
778 :
779 0 : r2->out.result = _EnumServicesStatusExA(p, r2);
780 0 : break;
781 : }
782 0 : case 42: { /* EnumServicesStatusExW */
783 0 : struct EnumServicesStatusExW *r2 = (struct EnumServicesStatusExW *)r;
784 0 : if (DEBUGLEVEL >= 10) {
785 0 : NDR_PRINT_FUNCTION_DEBUG(EnumServicesStatusExW, NDR_IN, r2);
786 : }
787 0 : NDR_ZERO_STRUCT(r2->out);
788 0 : r2->out.resume_handle = r2->in.resume_handle;
789 0 : r2->out.services = talloc_zero_array(r2, uint8_t, r2->in.offered);
790 0 : if (r2->out.services == NULL) {
791 0 : status = NT_STATUS_NO_MEMORY;
792 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
793 0 : goto fail;
794 : }
795 :
796 0 : r2->out.needed = talloc_zero(r2, uint32_t);
797 0 : if (r2->out.needed == NULL) {
798 0 : status = NT_STATUS_NO_MEMORY;
799 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
800 0 : goto fail;
801 : }
802 :
803 0 : r2->out.service_returned = talloc_zero(r2, uint32_t);
804 0 : if (r2->out.service_returned == NULL) {
805 0 : status = NT_STATUS_NO_MEMORY;
806 0 : p->fault_state = DCERPC_FAULT_CANT_PERFORM;
807 0 : goto fail;
808 : }
809 :
810 0 : r2->out.result = _EnumServicesStatusExW(p, r2);
811 0 : break;
812 : }
813 0 : case 43: { /* svcctl_SCSendTSMessage */
814 0 : struct svcctl_SCSendTSMessage *r2 = (struct svcctl_SCSendTSMessage *)r;
815 0 : if (DEBUGLEVEL >= 10) {
816 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SCSendTSMessage, NDR_IN, r2);
817 : }
818 0 : r2->out.result = _svcctl_SCSendTSMessage(p, r2);
819 0 : break;
820 : }
821 0 : default:
822 0 : dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
823 0 : break;
824 : }
825 :
826 0 : fail:
827 : /* Unimpersonate */
828 0 : if (impersonated) {
829 0 : unbecome_authenticated_pipe_user();
830 : }
831 :
832 0 : p->dce_call = NULL;
833 0 : p->mem_ctx = NULL;
834 : /* Check pipes struct fault state */
835 0 : if (p->fault_state != 0) {
836 0 : dce_call->fault_code = p->fault_state;
837 : }
838 0 : if (dce_call->fault_code != 0) {
839 0 : status = NT_STATUS_NET_WRITE_FAULT;
840 : }
841 :
842 0 : return status;
843 : }
844 :
845 0 : NTSTATUS svcctl__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
846 : {
847 0 : return svcctl__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL);
848 : }
849 :
850 0 : NTSTATUS svcctl__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
851 : {
852 0 : uint16_t opnum = dce_call->pkt.u.request.opnum;
853 :
854 0 : switch (opnum) {
855 0 : case 0: { /* svcctl_CloseServiceHandle */
856 0 : struct svcctl_CloseServiceHandle *r2 = (struct svcctl_CloseServiceHandle *)r;
857 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
858 0 : DEBUG(5,("function svcctl_CloseServiceHandle replied async\n"));
859 : }
860 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
861 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_CloseServiceHandle, NDR_OUT | NDR_SET_VALUES, r2);
862 : }
863 0 : if (dce_call->fault_code != 0) {
864 0 : DBG_WARNING("dcerpc_fault %s in svcctl_CloseServiceHandle\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
865 : }
866 0 : break;
867 : }
868 0 : case 1: { /* svcctl_ControlService */
869 0 : struct svcctl_ControlService *r2 = (struct svcctl_ControlService *)r;
870 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
871 0 : DEBUG(5,("function svcctl_ControlService replied async\n"));
872 : }
873 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
874 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ControlService, NDR_OUT | NDR_SET_VALUES, r2);
875 : }
876 0 : if (dce_call->fault_code != 0) {
877 0 : DBG_WARNING("dcerpc_fault %s in svcctl_ControlService\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
878 : }
879 0 : break;
880 : }
881 0 : case 2: { /* svcctl_DeleteService */
882 0 : struct svcctl_DeleteService *r2 = (struct svcctl_DeleteService *)r;
883 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
884 0 : DEBUG(5,("function svcctl_DeleteService replied async\n"));
885 : }
886 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
887 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_DeleteService, NDR_OUT | NDR_SET_VALUES, r2);
888 : }
889 0 : if (dce_call->fault_code != 0) {
890 0 : DBG_WARNING("dcerpc_fault %s in svcctl_DeleteService\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
891 : }
892 0 : break;
893 : }
894 0 : case 3: { /* svcctl_LockServiceDatabase */
895 0 : struct svcctl_LockServiceDatabase *r2 = (struct svcctl_LockServiceDatabase *)r;
896 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
897 0 : DEBUG(5,("function svcctl_LockServiceDatabase replied async\n"));
898 : }
899 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
900 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_LockServiceDatabase, NDR_OUT | NDR_SET_VALUES, r2);
901 : }
902 0 : if (dce_call->fault_code != 0) {
903 0 : DBG_WARNING("dcerpc_fault %s in svcctl_LockServiceDatabase\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
904 : }
905 0 : break;
906 : }
907 0 : case 4: { /* svcctl_QueryServiceObjectSecurity */
908 0 : struct svcctl_QueryServiceObjectSecurity *r2 = (struct svcctl_QueryServiceObjectSecurity *)r;
909 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
910 0 : DEBUG(5,("function svcctl_QueryServiceObjectSecurity replied async\n"));
911 : }
912 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
913 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceObjectSecurity, NDR_OUT | NDR_SET_VALUES, r2);
914 : }
915 0 : if (dce_call->fault_code != 0) {
916 0 : DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceObjectSecurity\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
917 : }
918 0 : break;
919 : }
920 0 : case 5: { /* svcctl_SetServiceObjectSecurity */
921 0 : struct svcctl_SetServiceObjectSecurity *r2 = (struct svcctl_SetServiceObjectSecurity *)r;
922 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
923 0 : DEBUG(5,("function svcctl_SetServiceObjectSecurity replied async\n"));
924 : }
925 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
926 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SetServiceObjectSecurity, NDR_OUT | NDR_SET_VALUES, r2);
927 : }
928 0 : if (dce_call->fault_code != 0) {
929 0 : DBG_WARNING("dcerpc_fault %s in svcctl_SetServiceObjectSecurity\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
930 : }
931 0 : break;
932 : }
933 0 : case 6: { /* svcctl_QueryServiceStatus */
934 0 : struct svcctl_QueryServiceStatus *r2 = (struct svcctl_QueryServiceStatus *)r;
935 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
936 0 : DEBUG(5,("function svcctl_QueryServiceStatus replied async\n"));
937 : }
938 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
939 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceStatus, NDR_OUT | NDR_SET_VALUES, r2);
940 : }
941 0 : if (dce_call->fault_code != 0) {
942 0 : DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceStatus\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
943 : }
944 0 : break;
945 : }
946 0 : case 7: { /* svcctl_SetServiceStatus */
947 0 : struct svcctl_SetServiceStatus *r2 = (struct svcctl_SetServiceStatus *)r;
948 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
949 0 : DEBUG(5,("function svcctl_SetServiceStatus replied async\n"));
950 : }
951 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
952 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SetServiceStatus, NDR_OUT | NDR_SET_VALUES, r2);
953 : }
954 0 : if (dce_call->fault_code != 0) {
955 0 : DBG_WARNING("dcerpc_fault %s in svcctl_SetServiceStatus\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
956 : }
957 0 : break;
958 : }
959 0 : case 8: { /* svcctl_UnlockServiceDatabase */
960 0 : struct svcctl_UnlockServiceDatabase *r2 = (struct svcctl_UnlockServiceDatabase *)r;
961 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
962 0 : DEBUG(5,("function svcctl_UnlockServiceDatabase replied async\n"));
963 : }
964 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
965 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_UnlockServiceDatabase, NDR_OUT | NDR_SET_VALUES, r2);
966 : }
967 0 : if (dce_call->fault_code != 0) {
968 0 : DBG_WARNING("dcerpc_fault %s in svcctl_UnlockServiceDatabase\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
969 : }
970 0 : break;
971 : }
972 0 : case 9: { /* svcctl_NotifyBootConfigStatus */
973 0 : struct svcctl_NotifyBootConfigStatus *r2 = (struct svcctl_NotifyBootConfigStatus *)r;
974 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
975 0 : DEBUG(5,("function svcctl_NotifyBootConfigStatus replied async\n"));
976 : }
977 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
978 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_NotifyBootConfigStatus, NDR_OUT | NDR_SET_VALUES, r2);
979 : }
980 0 : if (dce_call->fault_code != 0) {
981 0 : DBG_WARNING("dcerpc_fault %s in svcctl_NotifyBootConfigStatus\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
982 : }
983 0 : break;
984 : }
985 0 : case 10: { /* svcctl_SCSetServiceBitsW */
986 0 : struct svcctl_SCSetServiceBitsW *r2 = (struct svcctl_SCSetServiceBitsW *)r;
987 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
988 0 : DEBUG(5,("function svcctl_SCSetServiceBitsW replied async\n"));
989 : }
990 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
991 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SCSetServiceBitsW, NDR_OUT | NDR_SET_VALUES, r2);
992 : }
993 0 : if (dce_call->fault_code != 0) {
994 0 : DBG_WARNING("dcerpc_fault %s in svcctl_SCSetServiceBitsW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
995 : }
996 0 : break;
997 : }
998 0 : case 11: { /* svcctl_ChangeServiceConfigW */
999 0 : struct svcctl_ChangeServiceConfigW *r2 = (struct svcctl_ChangeServiceConfigW *)r;
1000 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1001 0 : DEBUG(5,("function svcctl_ChangeServiceConfigW replied async\n"));
1002 : }
1003 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1004 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfigW, NDR_OUT | NDR_SET_VALUES, r2);
1005 : }
1006 0 : if (dce_call->fault_code != 0) {
1007 0 : DBG_WARNING("dcerpc_fault %s in svcctl_ChangeServiceConfigW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1008 : }
1009 0 : break;
1010 : }
1011 0 : case 12: { /* svcctl_CreateServiceW */
1012 0 : struct svcctl_CreateServiceW *r2 = (struct svcctl_CreateServiceW *)r;
1013 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1014 0 : DEBUG(5,("function svcctl_CreateServiceW replied async\n"));
1015 : }
1016 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1017 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceW, NDR_OUT | NDR_SET_VALUES, r2);
1018 : }
1019 0 : if (dce_call->fault_code != 0) {
1020 0 : DBG_WARNING("dcerpc_fault %s in svcctl_CreateServiceW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1021 : }
1022 0 : break;
1023 : }
1024 0 : case 13: { /* svcctl_EnumDependentServicesW */
1025 0 : struct svcctl_EnumDependentServicesW *r2 = (struct svcctl_EnumDependentServicesW *)r;
1026 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1027 0 : DEBUG(5,("function svcctl_EnumDependentServicesW replied async\n"));
1028 : }
1029 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1030 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumDependentServicesW, NDR_OUT | NDR_SET_VALUES, r2);
1031 : }
1032 0 : if (dce_call->fault_code != 0) {
1033 0 : DBG_WARNING("dcerpc_fault %s in svcctl_EnumDependentServicesW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1034 : }
1035 0 : break;
1036 : }
1037 0 : case 14: { /* svcctl_EnumServicesStatusW */
1038 0 : struct svcctl_EnumServicesStatusW *r2 = (struct svcctl_EnumServicesStatusW *)r;
1039 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1040 0 : DEBUG(5,("function svcctl_EnumServicesStatusW replied async\n"));
1041 : }
1042 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1043 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServicesStatusW, NDR_OUT | NDR_SET_VALUES, r2);
1044 : }
1045 0 : if (dce_call->fault_code != 0) {
1046 0 : DBG_WARNING("dcerpc_fault %s in svcctl_EnumServicesStatusW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1047 : }
1048 0 : break;
1049 : }
1050 0 : case 15: { /* svcctl_OpenSCManagerW */
1051 0 : struct svcctl_OpenSCManagerW *r2 = (struct svcctl_OpenSCManagerW *)r;
1052 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1053 0 : DEBUG(5,("function svcctl_OpenSCManagerW replied async\n"));
1054 : }
1055 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1056 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenSCManagerW, NDR_OUT | NDR_SET_VALUES, r2);
1057 : }
1058 0 : if (dce_call->fault_code != 0) {
1059 0 : DBG_WARNING("dcerpc_fault %s in svcctl_OpenSCManagerW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1060 : }
1061 0 : break;
1062 : }
1063 0 : case 16: { /* svcctl_OpenServiceW */
1064 0 : struct svcctl_OpenServiceW *r2 = (struct svcctl_OpenServiceW *)r;
1065 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1066 0 : DEBUG(5,("function svcctl_OpenServiceW replied async\n"));
1067 : }
1068 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1069 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenServiceW, NDR_OUT | NDR_SET_VALUES, r2);
1070 : }
1071 0 : if (dce_call->fault_code != 0) {
1072 0 : DBG_WARNING("dcerpc_fault %s in svcctl_OpenServiceW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1073 : }
1074 0 : break;
1075 : }
1076 0 : case 17: { /* svcctl_QueryServiceConfigW */
1077 0 : struct svcctl_QueryServiceConfigW *r2 = (struct svcctl_QueryServiceConfigW *)r;
1078 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1079 0 : DEBUG(5,("function svcctl_QueryServiceConfigW replied async\n"));
1080 : }
1081 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1082 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfigW, NDR_OUT | NDR_SET_VALUES, r2);
1083 : }
1084 0 : if (dce_call->fault_code != 0) {
1085 0 : DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceConfigW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1086 : }
1087 0 : break;
1088 : }
1089 0 : case 18: { /* svcctl_QueryServiceLockStatusW */
1090 0 : struct svcctl_QueryServiceLockStatusW *r2 = (struct svcctl_QueryServiceLockStatusW *)r;
1091 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1092 0 : DEBUG(5,("function svcctl_QueryServiceLockStatusW replied async\n"));
1093 : }
1094 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1095 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceLockStatusW, NDR_OUT | NDR_SET_VALUES, r2);
1096 : }
1097 0 : if (dce_call->fault_code != 0) {
1098 0 : DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceLockStatusW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1099 : }
1100 0 : break;
1101 : }
1102 0 : case 19: { /* svcctl_StartServiceW */
1103 0 : struct svcctl_StartServiceW *r2 = (struct svcctl_StartServiceW *)r;
1104 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1105 0 : DEBUG(5,("function svcctl_StartServiceW replied async\n"));
1106 : }
1107 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1108 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_StartServiceW, NDR_OUT | NDR_SET_VALUES, r2);
1109 : }
1110 0 : if (dce_call->fault_code != 0) {
1111 0 : DBG_WARNING("dcerpc_fault %s in svcctl_StartServiceW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1112 : }
1113 0 : break;
1114 : }
1115 0 : case 20: { /* svcctl_GetServiceDisplayNameW */
1116 0 : struct svcctl_GetServiceDisplayNameW *r2 = (struct svcctl_GetServiceDisplayNameW *)r;
1117 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1118 0 : DEBUG(5,("function svcctl_GetServiceDisplayNameW replied async\n"));
1119 : }
1120 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1121 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceDisplayNameW, NDR_OUT | NDR_SET_VALUES, r2);
1122 : }
1123 0 : if (dce_call->fault_code != 0) {
1124 0 : DBG_WARNING("dcerpc_fault %s in svcctl_GetServiceDisplayNameW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1125 : }
1126 0 : break;
1127 : }
1128 0 : case 21: { /* svcctl_GetServiceKeyNameW */
1129 0 : struct svcctl_GetServiceKeyNameW *r2 = (struct svcctl_GetServiceKeyNameW *)r;
1130 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1131 0 : DEBUG(5,("function svcctl_GetServiceKeyNameW replied async\n"));
1132 : }
1133 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1134 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceKeyNameW, NDR_OUT | NDR_SET_VALUES, r2);
1135 : }
1136 0 : if (dce_call->fault_code != 0) {
1137 0 : DBG_WARNING("dcerpc_fault %s in svcctl_GetServiceKeyNameW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1138 : }
1139 0 : break;
1140 : }
1141 0 : case 22: { /* svcctl_SCSetServiceBitsA */
1142 0 : struct svcctl_SCSetServiceBitsA *r2 = (struct svcctl_SCSetServiceBitsA *)r;
1143 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1144 0 : DEBUG(5,("function svcctl_SCSetServiceBitsA replied async\n"));
1145 : }
1146 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1147 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SCSetServiceBitsA, NDR_OUT | NDR_SET_VALUES, r2);
1148 : }
1149 0 : if (dce_call->fault_code != 0) {
1150 0 : DBG_WARNING("dcerpc_fault %s in svcctl_SCSetServiceBitsA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1151 : }
1152 0 : break;
1153 : }
1154 0 : case 23: { /* svcctl_ChangeServiceConfigA */
1155 0 : struct svcctl_ChangeServiceConfigA *r2 = (struct svcctl_ChangeServiceConfigA *)r;
1156 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1157 0 : DEBUG(5,("function svcctl_ChangeServiceConfigA replied async\n"));
1158 : }
1159 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1160 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfigA, NDR_OUT | NDR_SET_VALUES, r2);
1161 : }
1162 0 : if (dce_call->fault_code != 0) {
1163 0 : DBG_WARNING("dcerpc_fault %s in svcctl_ChangeServiceConfigA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1164 : }
1165 0 : break;
1166 : }
1167 0 : case 24: { /* svcctl_CreateServiceA */
1168 0 : struct svcctl_CreateServiceA *r2 = (struct svcctl_CreateServiceA *)r;
1169 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1170 0 : DEBUG(5,("function svcctl_CreateServiceA replied async\n"));
1171 : }
1172 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1173 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceA, NDR_OUT | NDR_SET_VALUES, r2);
1174 : }
1175 0 : if (dce_call->fault_code != 0) {
1176 0 : DBG_WARNING("dcerpc_fault %s in svcctl_CreateServiceA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1177 : }
1178 0 : break;
1179 : }
1180 0 : case 25: { /* svcctl_EnumDependentServicesA */
1181 0 : struct svcctl_EnumDependentServicesA *r2 = (struct svcctl_EnumDependentServicesA *)r;
1182 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1183 0 : DEBUG(5,("function svcctl_EnumDependentServicesA replied async\n"));
1184 : }
1185 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1186 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumDependentServicesA, NDR_OUT | NDR_SET_VALUES, r2);
1187 : }
1188 0 : if (dce_call->fault_code != 0) {
1189 0 : DBG_WARNING("dcerpc_fault %s in svcctl_EnumDependentServicesA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1190 : }
1191 0 : break;
1192 : }
1193 0 : case 26: { /* svcctl_EnumServicesStatusA */
1194 0 : struct svcctl_EnumServicesStatusA *r2 = (struct svcctl_EnumServicesStatusA *)r;
1195 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1196 0 : DEBUG(5,("function svcctl_EnumServicesStatusA replied async\n"));
1197 : }
1198 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1199 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServicesStatusA, NDR_OUT | NDR_SET_VALUES, r2);
1200 : }
1201 0 : if (dce_call->fault_code != 0) {
1202 0 : DBG_WARNING("dcerpc_fault %s in svcctl_EnumServicesStatusA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1203 : }
1204 0 : break;
1205 : }
1206 0 : case 27: { /* svcctl_OpenSCManagerA */
1207 0 : struct svcctl_OpenSCManagerA *r2 = (struct svcctl_OpenSCManagerA *)r;
1208 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1209 0 : DEBUG(5,("function svcctl_OpenSCManagerA replied async\n"));
1210 : }
1211 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1212 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenSCManagerA, NDR_OUT | NDR_SET_VALUES, r2);
1213 : }
1214 0 : if (dce_call->fault_code != 0) {
1215 0 : DBG_WARNING("dcerpc_fault %s in svcctl_OpenSCManagerA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1216 : }
1217 0 : break;
1218 : }
1219 0 : case 28: { /* svcctl_OpenServiceA */
1220 0 : struct svcctl_OpenServiceA *r2 = (struct svcctl_OpenServiceA *)r;
1221 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1222 0 : DEBUG(5,("function svcctl_OpenServiceA replied async\n"));
1223 : }
1224 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1225 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenServiceA, NDR_OUT | NDR_SET_VALUES, r2);
1226 : }
1227 0 : if (dce_call->fault_code != 0) {
1228 0 : DBG_WARNING("dcerpc_fault %s in svcctl_OpenServiceA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1229 : }
1230 0 : break;
1231 : }
1232 0 : case 29: { /* svcctl_QueryServiceConfigA */
1233 0 : struct svcctl_QueryServiceConfigA *r2 = (struct svcctl_QueryServiceConfigA *)r;
1234 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1235 0 : DEBUG(5,("function svcctl_QueryServiceConfigA replied async\n"));
1236 : }
1237 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1238 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfigA, NDR_OUT | NDR_SET_VALUES, r2);
1239 : }
1240 0 : if (dce_call->fault_code != 0) {
1241 0 : DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceConfigA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1242 : }
1243 0 : break;
1244 : }
1245 0 : case 30: { /* svcctl_QueryServiceLockStatusA */
1246 0 : struct svcctl_QueryServiceLockStatusA *r2 = (struct svcctl_QueryServiceLockStatusA *)r;
1247 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1248 0 : DEBUG(5,("function svcctl_QueryServiceLockStatusA replied async\n"));
1249 : }
1250 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1251 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceLockStatusA, NDR_OUT | NDR_SET_VALUES, r2);
1252 : }
1253 0 : if (dce_call->fault_code != 0) {
1254 0 : DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceLockStatusA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1255 : }
1256 0 : break;
1257 : }
1258 0 : case 31: { /* svcctl_StartServiceA */
1259 0 : struct svcctl_StartServiceA *r2 = (struct svcctl_StartServiceA *)r;
1260 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1261 0 : DEBUG(5,("function svcctl_StartServiceA replied async\n"));
1262 : }
1263 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1264 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_StartServiceA, NDR_OUT | NDR_SET_VALUES, r2);
1265 : }
1266 0 : if (dce_call->fault_code != 0) {
1267 0 : DBG_WARNING("dcerpc_fault %s in svcctl_StartServiceA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1268 : }
1269 0 : break;
1270 : }
1271 0 : case 32: { /* svcctl_GetServiceDisplayNameA */
1272 0 : struct svcctl_GetServiceDisplayNameA *r2 = (struct svcctl_GetServiceDisplayNameA *)r;
1273 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1274 0 : DEBUG(5,("function svcctl_GetServiceDisplayNameA replied async\n"));
1275 : }
1276 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1277 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceDisplayNameA, NDR_OUT | NDR_SET_VALUES, r2);
1278 : }
1279 0 : if (dce_call->fault_code != 0) {
1280 0 : DBG_WARNING("dcerpc_fault %s in svcctl_GetServiceDisplayNameA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1281 : }
1282 0 : break;
1283 : }
1284 0 : case 33: { /* svcctl_GetServiceKeyNameA */
1285 0 : struct svcctl_GetServiceKeyNameA *r2 = (struct svcctl_GetServiceKeyNameA *)r;
1286 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1287 0 : DEBUG(5,("function svcctl_GetServiceKeyNameA replied async\n"));
1288 : }
1289 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1290 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceKeyNameA, NDR_OUT | NDR_SET_VALUES, r2);
1291 : }
1292 0 : if (dce_call->fault_code != 0) {
1293 0 : DBG_WARNING("dcerpc_fault %s in svcctl_GetServiceKeyNameA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1294 : }
1295 0 : break;
1296 : }
1297 0 : case 34: { /* svcctl_GetCurrentGroupeStateW */
1298 0 : struct svcctl_GetCurrentGroupeStateW *r2 = (struct svcctl_GetCurrentGroupeStateW *)r;
1299 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1300 0 : DEBUG(5,("function svcctl_GetCurrentGroupeStateW replied async\n"));
1301 : }
1302 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1303 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_GetCurrentGroupeStateW, NDR_OUT | NDR_SET_VALUES, r2);
1304 : }
1305 0 : if (dce_call->fault_code != 0) {
1306 0 : DBG_WARNING("dcerpc_fault %s in svcctl_GetCurrentGroupeStateW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1307 : }
1308 0 : break;
1309 : }
1310 0 : case 35: { /* svcctl_EnumServiceGroupW */
1311 0 : struct svcctl_EnumServiceGroupW *r2 = (struct svcctl_EnumServiceGroupW *)r;
1312 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1313 0 : DEBUG(5,("function svcctl_EnumServiceGroupW replied async\n"));
1314 : }
1315 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1316 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServiceGroupW, NDR_OUT | NDR_SET_VALUES, r2);
1317 : }
1318 0 : if (dce_call->fault_code != 0) {
1319 0 : DBG_WARNING("dcerpc_fault %s in svcctl_EnumServiceGroupW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1320 : }
1321 0 : break;
1322 : }
1323 0 : case 36: { /* svcctl_ChangeServiceConfig2A */
1324 0 : struct svcctl_ChangeServiceConfig2A *r2 = (struct svcctl_ChangeServiceConfig2A *)r;
1325 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1326 0 : DEBUG(5,("function svcctl_ChangeServiceConfig2A replied async\n"));
1327 : }
1328 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1329 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfig2A, NDR_OUT | NDR_SET_VALUES, r2);
1330 : }
1331 0 : if (dce_call->fault_code != 0) {
1332 0 : DBG_WARNING("dcerpc_fault %s in svcctl_ChangeServiceConfig2A\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1333 : }
1334 0 : break;
1335 : }
1336 0 : case 37: { /* svcctl_ChangeServiceConfig2W */
1337 0 : struct svcctl_ChangeServiceConfig2W *r2 = (struct svcctl_ChangeServiceConfig2W *)r;
1338 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1339 0 : DEBUG(5,("function svcctl_ChangeServiceConfig2W replied async\n"));
1340 : }
1341 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1342 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfig2W, NDR_OUT | NDR_SET_VALUES, r2);
1343 : }
1344 0 : if (dce_call->fault_code != 0) {
1345 0 : DBG_WARNING("dcerpc_fault %s in svcctl_ChangeServiceConfig2W\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1346 : }
1347 0 : break;
1348 : }
1349 0 : case 38: { /* svcctl_QueryServiceConfig2A */
1350 0 : struct svcctl_QueryServiceConfig2A *r2 = (struct svcctl_QueryServiceConfig2A *)r;
1351 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1352 0 : DEBUG(5,("function svcctl_QueryServiceConfig2A replied async\n"));
1353 : }
1354 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1355 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfig2A, NDR_OUT | NDR_SET_VALUES, r2);
1356 : }
1357 0 : if (dce_call->fault_code != 0) {
1358 0 : DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceConfig2A\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1359 : }
1360 0 : break;
1361 : }
1362 0 : case 39: { /* svcctl_QueryServiceConfig2W */
1363 0 : struct svcctl_QueryServiceConfig2W *r2 = (struct svcctl_QueryServiceConfig2W *)r;
1364 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1365 0 : DEBUG(5,("function svcctl_QueryServiceConfig2W replied async\n"));
1366 : }
1367 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1368 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfig2W, NDR_OUT | NDR_SET_VALUES, r2);
1369 : }
1370 0 : if (dce_call->fault_code != 0) {
1371 0 : DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceConfig2W\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1372 : }
1373 0 : break;
1374 : }
1375 0 : case 40: { /* svcctl_QueryServiceStatusEx */
1376 0 : struct svcctl_QueryServiceStatusEx *r2 = (struct svcctl_QueryServiceStatusEx *)r;
1377 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1378 0 : DEBUG(5,("function svcctl_QueryServiceStatusEx replied async\n"));
1379 : }
1380 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1381 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceStatusEx, NDR_OUT | NDR_SET_VALUES, r2);
1382 : }
1383 0 : if (dce_call->fault_code != 0) {
1384 0 : DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceStatusEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1385 : }
1386 0 : break;
1387 : }
1388 0 : case 41: { /* EnumServicesStatusExA */
1389 0 : struct EnumServicesStatusExA *r2 = (struct EnumServicesStatusExA *)r;
1390 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1391 0 : DEBUG(5,("function EnumServicesStatusExA replied async\n"));
1392 : }
1393 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1394 0 : NDR_PRINT_FUNCTION_DEBUG(EnumServicesStatusExA, NDR_OUT | NDR_SET_VALUES, r2);
1395 : }
1396 0 : if (dce_call->fault_code != 0) {
1397 0 : DBG_WARNING("dcerpc_fault %s in EnumServicesStatusExA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1398 : }
1399 0 : break;
1400 : }
1401 0 : case 42: { /* EnumServicesStatusExW */
1402 0 : struct EnumServicesStatusExW *r2 = (struct EnumServicesStatusExW *)r;
1403 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1404 0 : DEBUG(5,("function EnumServicesStatusExW replied async\n"));
1405 : }
1406 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1407 0 : NDR_PRINT_FUNCTION_DEBUG(EnumServicesStatusExW, NDR_OUT | NDR_SET_VALUES, r2);
1408 : }
1409 0 : if (dce_call->fault_code != 0) {
1410 0 : DBG_WARNING("dcerpc_fault %s in EnumServicesStatusExW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1411 : }
1412 0 : break;
1413 : }
1414 0 : case 43: { /* svcctl_SCSendTSMessage */
1415 0 : struct svcctl_SCSendTSMessage *r2 = (struct svcctl_SCSendTSMessage *)r;
1416 0 : if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
1417 0 : DEBUG(5,("function svcctl_SCSendTSMessage replied async\n"));
1418 : }
1419 0 : if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
1420 0 : NDR_PRINT_FUNCTION_DEBUG(svcctl_SCSendTSMessage, NDR_OUT | NDR_SET_VALUES, r2);
1421 : }
1422 0 : if (dce_call->fault_code != 0) {
1423 0 : DBG_WARNING("dcerpc_fault %s in svcctl_SCSendTSMessage\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
1424 : }
1425 0 : break;
1426 : }
1427 0 : default:
1428 0 : dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
1429 0 : break;
1430 : }
1431 :
1432 0 : if (dce_call->fault_code != 0) {
1433 0 : return NT_STATUS_NET_WRITE_FAULT;
1434 : }
1435 :
1436 0 : return NT_STATUS_OK;
1437 : }
1438 :
1439 0 : NTSTATUS svcctl__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
1440 : {
1441 : enum ndr_err_code ndr_err;
1442 0 : uint16_t opnum = dce_call->pkt.u.request.opnum;
1443 :
1444 0 : ndr_err = ndr_table_svcctl.calls[opnum].ndr_push(push, NDR_OUT, r);
1445 0 : if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1446 0 : dce_call->fault_code = DCERPC_FAULT_NDR;
1447 0 : return NT_STATUS_NET_WRITE_FAULT;
1448 : }
1449 :
1450 0 : return NT_STATUS_OK;
1451 : }
1452 :
1453 0 : NTSTATUS svcctl__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
1454 : {
1455 0 : return svcctl__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL);
1456 : }
1457 :
1458 : static const struct dcesrv_interface dcesrv_svcctl_interface = {
1459 : .name = "svcctl",
1460 : .syntax_id = {{0x367abb81,0x9844,0x35f1,{0xad,0x32},{0x98,0xf0,0x38,0x00,0x10,0x03}},2.0},
1461 : .bind = svcctl__op_bind,
1462 : .unbind = svcctl__op_unbind,
1463 : .ndr_pull = svcctl__op_ndr_pull,
1464 : .dispatch = svcctl__op_dispatch,
1465 : .reply = svcctl__op_reply,
1466 : .ndr_push = svcctl__op_ndr_push,
1467 : .local = svcctl__op_local,
1468 : #ifdef DCESRV_INTERFACE_SVCCTL_FLAGS
1469 : .flags = DCESRV_INTERFACE_SVCCTL_FLAGS
1470 : #else
1471 : .flags = 0
1472 : #endif
1473 : };
1474 :
1475 31 : static NTSTATUS svcctl__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
1476 : {
1477 : uint32_t i;
1478 : NTSTATUS ret;
1479 :
1480 : #ifdef DCESRV_INTERFACE_SVCCTL_NCACN_NP_SECONDARY_ENDPOINT
1481 : const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_SVCCTL_NCACN_NP_SECONDARY_ENDPOINT;
1482 : #else
1483 31 : const char *ncacn_np_secondary_endpoint = NULL;
1484 : #endif
1485 :
1486 93 : for (i=0;i<ndr_table_svcctl.endpoints->count;i++) {
1487 62 : const char *name = ndr_table_svcctl.endpoints->names[i];
1488 :
1489 62 : ret = dcesrv_interface_register(dce_ctx, name, ncacn_np_secondary_endpoint, &dcesrv_svcctl_interface, NULL);
1490 62 : if (!NT_STATUS_IS_OK(ret)) {
1491 0 : DBG_ERR("Failed to register endpoint '%s'\n",name);
1492 0 : return ret;
1493 : }
1494 : }
1495 :
1496 31 : return NT_STATUS_OK;
1497 : }
1498 :
1499 30 : static NTSTATUS svcctl__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
1500 : {
1501 30 : return NT_STATUS_OK;
1502 : }
1503 :
1504 0 : static bool svcctl__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
1505 : {
1506 0 : if (dcesrv_svcctl_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_svcctl_interface.syntax_id.uuid, uuid)) {
1507 0 : memcpy(iface,&dcesrv_svcctl_interface, sizeof(*iface));
1508 0 : return true;
1509 : }
1510 :
1511 0 : return false;
1512 : }
1513 :
1514 0 : static bool svcctl__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
1515 : {
1516 0 : if (strcmp(dcesrv_svcctl_interface.name, name)==0) {
1517 0 : memcpy(iface, &dcesrv_svcctl_interface, sizeof(*iface));
1518 0 : return true;
1519 : }
1520 :
1521 0 : return false;
1522 : }
1523 :
1524 : static const struct dcesrv_endpoint_server svcctl_ep_server = {
1525 : /* fill in our name */
1526 : .name = "svcctl",
1527 :
1528 : /* Initialization flag */
1529 : .initialized = false,
1530 :
1531 : /* fill in all the operations */
1532 : #ifdef DCESRV_INTERFACE_SVCCTL_INIT_SERVER
1533 : .init_server = DCESRV_INTERFACE_SVCCTL_INIT_SERVER,
1534 : #else
1535 : .init_server = svcctl__op_init_server,
1536 : #endif
1537 : #ifdef DCESRV_INTERFACE_SVCCTL_SHUTDOWN_SERVER
1538 : .shutdown_server = DCESRV_INTERFACE_SVCCTL_SHUTDOWN_SERVER,
1539 : #else
1540 : .shutdown_server = svcctl__op_shutdown_server,
1541 : #endif
1542 : .interface_by_uuid = svcctl__op_interface_by_uuid,
1543 : .interface_by_name = svcctl__op_interface_by_name
1544 : };
1545 :
1546 31 : const struct dcesrv_endpoint_server *svcctl_get_ep_server(void)
1547 : {
1548 31 : return &svcctl_ep_server;
1549 : }
|