LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_svcctl_scompat.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 274 1385 19.8 %
Date: 2024-04-21 15:09:00 Functions: 10 13 76.9 %

          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           4 : 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           4 :         return NT_STATUS_OK;
      21             : #endif
      22             : }
      23             : 
      24           4 : 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           4 :         return;
      30             : #endif
      31             : }
      32             : 
      33         296 : NTSTATUS svcctl__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
      34             : {
      35           0 :         enum ndr_err_code ndr_err;
      36         296 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      37             : 
      38         296 :         dce_call->fault_code = 0;
      39             : 
      40         296 :         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         296 :         *r = talloc_named(mem_ctx, ndr_table_svcctl.calls[opnum].struct_size, "struct %s", ndr_table_svcctl.calls[opnum].name);
      46         296 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      47             : 
      48             :         /* unravel the NDR for the packet */
      49         296 :         ndr_err = ndr_table_svcctl.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      50         296 :         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         296 :         return NT_STATUS_OK;
      56             : }
      57             : 
      58         296 : 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         296 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      61         296 :         struct pipes_struct *p = NULL;
      62         296 :         NTSTATUS status = NT_STATUS_OK;
      63         296 :         bool impersonated = false;
      64             : 
      65             :         /* Retrieve pipes struct */
      66         296 :         p = dcesrv_get_pipes_struct(dce_call->conn);
      67         296 :         p->dce_call = dce_call;
      68         296 :         p->mem_ctx = mem_ctx;
      69             :         /* Reset pipes struct fault state */
      70         296 :         p->fault_state = 0;
      71             : 
      72             :         /* Impersonate */
      73         296 :         if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) {
      74         296 :                 impersonated = become_authenticated_pipe_user(dce_call->auth_state->session_info);
      75         296 :                 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         296 :         switch (opnum) {
      83          80 :         case 0: { /* svcctl_CloseServiceHandle */
      84          80 :                 struct svcctl_CloseServiceHandle *r2 = (struct svcctl_CloseServiceHandle *)r;
      85          80 :                 if (DEBUGLEVEL >= 10) {
      86           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CloseServiceHandle, NDR_IN, r2);
      87             :                 }
      88          80 :                 NDR_ZERO_STRUCT(r2->out);
      89          80 :                 r2->out.handle = r2->in.handle;
      90          80 :                 r2->out.result = _svcctl_CloseServiceHandle(p, r2);
      91          80 :                 break;
      92             :         }
      93           4 :         case 1: { /* svcctl_ControlService */
      94           4 :                 struct svcctl_ControlService *r2 = (struct svcctl_ControlService *)r;
      95           4 :                 if (DEBUGLEVEL >= 10) {
      96           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ControlService, NDR_IN, r2);
      97             :                 }
      98           4 :                 NDR_ZERO_STRUCT(r2->out);
      99           4 :                 r2->out.service_status = talloc_zero(r2, struct SERVICE_STATUS);
     100           4 :                 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           4 :                 r2->out.result = _svcctl_ControlService(p, r2);
     107           4 :                 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          20 :         case 4: { /* svcctl_QueryServiceObjectSecurity */
     134          20 :                 struct svcctl_QueryServiceObjectSecurity *r2 = (struct svcctl_QueryServiceObjectSecurity *)r;
     135          20 :                 if (DEBUGLEVEL >= 10) {
     136           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceObjectSecurity, NDR_IN, r2);
     137             :                 }
     138          20 :                 NDR_ZERO_STRUCT(r2->out);
     139          20 :                 r2->out.buffer = talloc_zero_array(r2, uint8_t, r2->in.offered);
     140          20 :                 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          20 :                 r2->out.needed = talloc_zero(r2, uint32_t);
     147          20 :                 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          20 :                 r2->out.result = _svcctl_QueryServiceObjectSecurity(p, r2);
     154          20 :                 break;
     155             :         }
     156           4 :         case 5: { /* svcctl_SetServiceObjectSecurity */
     157           4 :                 struct svcctl_SetServiceObjectSecurity *r2 = (struct svcctl_SetServiceObjectSecurity *)r;
     158           4 :                 if (DEBUGLEVEL >= 10) {
     159           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_SetServiceObjectSecurity, NDR_IN, r2);
     160             :                 }
     161           4 :                 r2->out.result = _svcctl_SetServiceObjectSecurity(p, r2);
     162           4 :                 break;
     163             :         }
     164           4 :         case 6: { /* svcctl_QueryServiceStatus */
     165           4 :                 struct svcctl_QueryServiceStatus *r2 = (struct svcctl_QueryServiceStatus *)r;
     166           4 :                 if (DEBUGLEVEL >= 10) {
     167           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceStatus, NDR_IN, r2);
     168             :                 }
     169           4 :                 NDR_ZERO_STRUCT(r2->out);
     170           4 :                 r2->out.service_status = talloc_zero(r2, struct SERVICE_STATUS);
     171           4 :                 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           4 :                 r2->out.result = _svcctl_QueryServiceStatus(p, r2);
     178           4 :                 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           4 :         case 11: { /* svcctl_ChangeServiceConfigW */
     215           4 :                 struct svcctl_ChangeServiceConfigW *r2 = (struct svcctl_ChangeServiceConfigW *)r;
     216           4 :                 if (DEBUGLEVEL >= 10) {
     217           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfigW, NDR_IN, r2);
     218             :                 }
     219           4 :                 NDR_ZERO_STRUCT(r2->out);
     220           4 :                 r2->out.tag_id = r2->in.tag_id;
     221           4 :                 r2->out.result = _svcctl_ChangeServiceConfigW(p, r2);
     222           4 :                 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          16 :         case 13: { /* svcctl_EnumDependentServicesW */
     242          16 :                 struct svcctl_EnumDependentServicesW *r2 = (struct svcctl_EnumDependentServicesW *)r;
     243          16 :                 if (DEBUGLEVEL >= 10) {
     244           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumDependentServicesW, NDR_IN, r2);
     245             :                 }
     246          16 :                 NDR_ZERO_STRUCT(r2->out);
     247          16 :                 r2->out.service_status = talloc_zero_array(r2, uint8_t, r2->in.offered);
     248          16 :                 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          16 :                 r2->out.needed = talloc_zero(r2, uint32_t);
     255          16 :                 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          16 :                 r2->out.services_returned = talloc_zero(r2, uint32_t);
     262          16 :                 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          16 :                 r2->out.result = _svcctl_EnumDependentServicesW(p, r2);
     269          16 :                 break;
     270             :         }
     271           8 :         case 14: { /* svcctl_EnumServicesStatusW */
     272           8 :                 struct svcctl_EnumServicesStatusW *r2 = (struct svcctl_EnumServicesStatusW *)r;
     273           8 :                 if (DEBUGLEVEL >= 10) {
     274           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServicesStatusW, NDR_IN, r2);
     275             :                 }
     276           8 :                 NDR_ZERO_STRUCT(r2->out);
     277           8 :                 r2->out.resume_handle = r2->in.resume_handle;
     278           8 :                 r2->out.service = talloc_zero_array(r2, uint8_t, r2->in.offered);
     279           8 :                 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           8 :                 r2->out.needed = talloc_zero(r2, uint32_t);
     286           8 :                 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           8 :                 r2->out.services_returned = talloc_zero(r2, uint32_t);
     293           8 :                 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           8 :                 r2->out.result = _svcctl_EnumServicesStatusW(p, r2);
     300           8 :                 break;
     301             :         }
     302          56 :         case 15: { /* svcctl_OpenSCManagerW */
     303          56 :                 struct svcctl_OpenSCManagerW *r2 = (struct svcctl_OpenSCManagerW *)r;
     304          56 :                 if (DEBUGLEVEL >= 10) {
     305           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenSCManagerW, NDR_IN, r2);
     306             :                 }
     307          56 :                 NDR_ZERO_STRUCT(r2->out);
     308          56 :                 r2->out.handle = talloc_zero(r2, struct policy_handle);
     309          56 :                 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          56 :                 r2->out.result = _svcctl_OpenSCManagerW(p, r2);
     316          56 :                 break;
     317             :         }
     318          48 :         case 16: { /* svcctl_OpenServiceW */
     319          48 :                 struct svcctl_OpenServiceW *r2 = (struct svcctl_OpenServiceW *)r;
     320          48 :                 if (DEBUGLEVEL >= 10) {
     321           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenServiceW, NDR_IN, r2);
     322             :                 }
     323          48 :                 NDR_ZERO_STRUCT(r2->out);
     324          48 :                 r2->out.handle = talloc_zero(r2, struct policy_handle);
     325          48 :                 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          48 :                 r2->out.result = _svcctl_OpenServiceW(p, r2);
     332          48 :                 break;
     333             :         }
     334          16 :         case 17: { /* svcctl_QueryServiceConfigW */
     335          16 :                 struct svcctl_QueryServiceConfigW *r2 = (struct svcctl_QueryServiceConfigW *)r;
     336          16 :                 if (DEBUGLEVEL >= 10) {
     337           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfigW, NDR_IN, r2);
     338             :                 }
     339          16 :                 NDR_ZERO_STRUCT(r2->out);
     340          16 :                 r2->out.query = talloc_zero(r2, struct QUERY_SERVICE_CONFIG);
     341          16 :                 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          16 :                 r2->out.needed = talloc_zero(r2, uint32_t);
     348          16 :                 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          16 :                 r2->out.result = _svcctl_QueryServiceConfigW(p, r2);
     355          16 :                 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           4 :         case 19: { /* svcctl_StartServiceW */
     381           4 :                 struct svcctl_StartServiceW *r2 = (struct svcctl_StartServiceW *)r;
     382           4 :                 if (DEBUGLEVEL >= 10) {
     383           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_StartServiceW, NDR_IN, r2);
     384             :                 }
     385           4 :                 r2->out.result = _svcctl_StartServiceW(p, r2);
     386           4 :                 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          16 :         case 39: { /* svcctl_QueryServiceConfig2W */
     699          16 :                 struct svcctl_QueryServiceConfig2W *r2 = (struct svcctl_QueryServiceConfig2W *)r;
     700          16 :                 if (DEBUGLEVEL >= 10) {
     701           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfig2W, NDR_IN, r2);
     702             :                 }
     703          16 :                 NDR_ZERO_STRUCT(r2->out);
     704          16 :                 r2->out.buffer = talloc_zero_array(r2, uint8_t, r2->in.offered);
     705          16 :                 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          16 :                 r2->out.needed = talloc_zero(r2, uint32_t);
     712          16 :                 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          16 :                 r2->out.result = _svcctl_QueryServiceConfig2W(p, r2);
     719          16 :                 break;
     720             :         }
     721           8 :         case 40: { /* svcctl_QueryServiceStatusEx */
     722           8 :                 struct svcctl_QueryServiceStatusEx *r2 = (struct svcctl_QueryServiceStatusEx *)r;
     723           8 :                 if (DEBUGLEVEL >= 10) {
     724           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceStatusEx, NDR_IN, r2);
     725             :                 }
     726           8 :                 NDR_ZERO_STRUCT(r2->out);
     727           8 :                 r2->out.buffer = talloc_zero_array(r2, uint8_t, r2->in.offered);
     728           8 :                 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           8 :                 r2->out.needed = talloc_zero(r2, uint32_t);
     735           8 :                 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           8 :                 r2->out.result = _svcctl_QueryServiceStatusEx(p, r2);
     742           8 :                 break;
     743             :         }
     744           0 :         case 41: { /* svcctl_EnumServicesStatusExA */
     745           0 :                 struct svcctl_EnumServicesStatusExA *r2 = (struct svcctl_EnumServicesStatusExA *)r;
     746           0 :                 if (DEBUGLEVEL >= 10) {
     747           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_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 = _svcctl_EnumServicesStatusExA(p, r2);
     780           0 :                 break;
     781             :         }
     782           0 :         case 42: { /* svcctl_EnumServicesStatusExW */
     783           0 :                 struct svcctl_EnumServicesStatusExW *r2 = (struct svcctl_EnumServicesStatusExW *)r;
     784           0 :                 if (DEBUGLEVEL >= 10) {
     785           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_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 = _svcctl_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 :         case 44: { /* svcctl_CreateServiceWOW64A */
     822           0 :                 struct svcctl_CreateServiceWOW64A *r2 = (struct svcctl_CreateServiceWOW64A *)r;
     823           0 :                 if (DEBUGLEVEL >= 10) {
     824           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceWOW64A, NDR_IN, r2);
     825             :                 }
     826           0 :                 NDR_ZERO_STRUCT(r2->out);
     827           0 :                 r2->out.lpdwTagId = r2->in.lpdwTagId;
     828           0 :                 r2->out.lpServiceHandle = talloc_zero(r2, struct policy_handle);
     829           0 :                 if (r2->out.lpServiceHandle == NULL) {
     830           0 :                         status = NT_STATUS_NO_MEMORY;
     831           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     832           0 :                         goto fail;
     833             :                 }
     834             : 
     835           0 :                 r2->out.result = _svcctl_CreateServiceWOW64A(p, r2);
     836           0 :                 break;
     837             :         }
     838           0 :         case 45: { /* svcctl_CreateServiceWOW64W */
     839           0 :                 struct svcctl_CreateServiceWOW64W *r2 = (struct svcctl_CreateServiceWOW64W *)r;
     840           0 :                 if (DEBUGLEVEL >= 10) {
     841           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceWOW64W, NDR_IN, r2);
     842             :                 }
     843           0 :                 NDR_ZERO_STRUCT(r2->out);
     844           0 :                 r2->out.lpdwTagId = r2->in.lpdwTagId;
     845           0 :                 r2->out.lpServiceHandle = talloc_zero(r2, struct policy_handle);
     846           0 :                 if (r2->out.lpServiceHandle == NULL) {
     847           0 :                         status = NT_STATUS_NO_MEMORY;
     848           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     849           0 :                         goto fail;
     850             :                 }
     851             : 
     852           0 :                 r2->out.result = _svcctl_CreateServiceWOW64W(p, r2);
     853           0 :                 break;
     854             :         }
     855           0 :         case 46: { /* Opnum46NotUsedOnWire */
     856           0 :                 struct Opnum46NotUsedOnWire *r2 = (struct Opnum46NotUsedOnWire *)r;
     857           0 :                 if (DEBUGLEVEL >= 10) {
     858           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum46NotUsedOnWire, NDR_IN, r2);
     859             :                 }
     860           0 :                 _Opnum46NotUsedOnWire(p, r2);
     861           0 :                 break;
     862             :         }
     863           0 :         case 47: { /* svcctl_NotifyServiceStatusChange */
     864           0 :                 struct svcctl_NotifyServiceStatusChange *r2 = (struct svcctl_NotifyServiceStatusChange *)r;
     865           0 :                 if (DEBUGLEVEL >= 10) {
     866           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_NotifyServiceStatusChange, NDR_IN, r2);
     867             :                 }
     868           0 :                 NDR_ZERO_STRUCT(r2->out);
     869           0 :                 r2->out.pSCMProcessGuid = talloc_zero(r2, struct GUID);
     870           0 :                 if (r2->out.pSCMProcessGuid == NULL) {
     871           0 :                         status = NT_STATUS_NO_MEMORY;
     872           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     873           0 :                         goto fail;
     874             :                 }
     875             : 
     876           0 :                 r2->out.pfCreateRemoteQueue = talloc_zero(r2, uint32_t);
     877           0 :                 if (r2->out.pfCreateRemoteQueue == NULL) {
     878           0 :                         status = NT_STATUS_NO_MEMORY;
     879           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     880           0 :                         goto fail;
     881             :                 }
     882             : 
     883           0 :                 r2->out.phNotify = talloc_zero(r2, struct policy_handle);
     884           0 :                 if (r2->out.phNotify == NULL) {
     885           0 :                         status = NT_STATUS_NO_MEMORY;
     886           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     887           0 :                         goto fail;
     888             :                 }
     889             : 
     890           0 :                 r2->out.result = _svcctl_NotifyServiceStatusChange(p, r2);
     891           0 :                 break;
     892             :         }
     893           0 :         case 48: { /* svcctl_GetNotifyResults */
     894           0 :                 struct svcctl_GetNotifyResults *r2 = (struct svcctl_GetNotifyResults *)r;
     895           0 :                 if (DEBUGLEVEL >= 10) {
     896           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_GetNotifyResults, NDR_IN, r2);
     897             :                 }
     898           0 :                 NDR_ZERO_STRUCT(r2->out);
     899           0 :                 r2->out.ppNotifyParams = talloc_zero(r2, struct SC_RPC_NOTIFY_PARAMS_LIST);
     900           0 :                 if (r2->out.ppNotifyParams == NULL) {
     901           0 :                         status = NT_STATUS_NO_MEMORY;
     902           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     903           0 :                         goto fail;
     904             :                 }
     905             : 
     906           0 :                 r2->out.result = _svcctl_GetNotifyResults(p, r2);
     907           0 :                 break;
     908             :         }
     909           0 :         case 49: { /* svcctl_CloseNotifyHandle */
     910           0 :                 struct svcctl_CloseNotifyHandle *r2 = (struct svcctl_CloseNotifyHandle *)r;
     911           0 :                 if (DEBUGLEVEL >= 10) {
     912           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CloseNotifyHandle, NDR_IN, r2);
     913             :                 }
     914           0 :                 NDR_ZERO_STRUCT(r2->out);
     915           0 :                 r2->out.phNotify = r2->in.phNotify;
     916           0 :                 r2->out.pfApcFired = talloc_zero(r2, uint32_t);
     917           0 :                 if (r2->out.pfApcFired == NULL) {
     918           0 :                         status = NT_STATUS_NO_MEMORY;
     919           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     920           0 :                         goto fail;
     921             :                 }
     922             : 
     923           0 :                 r2->out.result = _svcctl_CloseNotifyHandle(p, r2);
     924           0 :                 break;
     925             :         }
     926           0 :         case 50: { /* svcctl_ControlServiceExA */
     927           0 :                 struct svcctl_ControlServiceExA *r2 = (struct svcctl_ControlServiceExA *)r;
     928           0 :                 if (DEBUGLEVEL >= 10) {
     929           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ControlServiceExA, NDR_IN, r2);
     930             :                 }
     931           0 :                 NDR_ZERO_STRUCT(r2->out);
     932           0 :                 r2->out.pControlOutParams = talloc_zero(r2, union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA);
     933           0 :                 if (r2->out.pControlOutParams == NULL) {
     934           0 :                         status = NT_STATUS_NO_MEMORY;
     935           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     936           0 :                         goto fail;
     937             :                 }
     938             : 
     939           0 :                 r2->out.result = _svcctl_ControlServiceExA(p, r2);
     940           0 :                 break;
     941             :         }
     942           4 :         case 51: { /* svcctl_ControlServiceExW */
     943           4 :                 struct svcctl_ControlServiceExW *r2 = (struct svcctl_ControlServiceExW *)r;
     944           4 :                 if (DEBUGLEVEL >= 10) {
     945           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ControlServiceExW, NDR_IN, r2);
     946             :                 }
     947           4 :                 NDR_ZERO_STRUCT(r2->out);
     948           4 :                 r2->out.pControlOutParams = talloc_zero(r2, union SC_RPC_SERVICE_CONTROL_OUT_PARAMSW);
     949           4 :                 if (r2->out.pControlOutParams == NULL) {
     950           0 :                         status = NT_STATUS_NO_MEMORY;
     951           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     952           0 :                         goto fail;
     953             :                 }
     954             : 
     955           4 :                 r2->out.result = _svcctl_ControlServiceExW(p, r2);
     956           4 :                 break;
     957             :         }
     958           0 :         case 52: { /* Opnum52NotUsedOnWire */
     959           0 :                 struct Opnum52NotUsedOnWire *r2 = (struct Opnum52NotUsedOnWire *)r;
     960           0 :                 if (DEBUGLEVEL >= 10) {
     961           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum52NotUsedOnWire, NDR_IN, r2);
     962             :                 }
     963           0 :                 _Opnum52NotUsedOnWire(p, r2);
     964           0 :                 break;
     965             :         }
     966           0 :         case 53: { /* Opnum53NotUsedOnWire */
     967           0 :                 struct Opnum53NotUsedOnWire *r2 = (struct Opnum53NotUsedOnWire *)r;
     968           0 :                 if (DEBUGLEVEL >= 10) {
     969           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum53NotUsedOnWire, NDR_IN, r2);
     970             :                 }
     971           0 :                 _Opnum53NotUsedOnWire(p, r2);
     972           0 :                 break;
     973             :         }
     974           0 :         case 54: { /* Opnum54NotUsedOnWire */
     975           0 :                 struct Opnum54NotUsedOnWire *r2 = (struct Opnum54NotUsedOnWire *)r;
     976           0 :                 if (DEBUGLEVEL >= 10) {
     977           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum54NotUsedOnWire, NDR_IN, r2);
     978             :                 }
     979           0 :                 _Opnum54NotUsedOnWire(p, r2);
     980           0 :                 break;
     981             :         }
     982           0 :         case 55: { /* Opnum55NotUsedOnWire */
     983           0 :                 struct Opnum55NotUsedOnWire *r2 = (struct Opnum55NotUsedOnWire *)r;
     984           0 :                 if (DEBUGLEVEL >= 10) {
     985           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum55NotUsedOnWire, NDR_IN, r2);
     986             :                 }
     987           0 :                 _Opnum55NotUsedOnWire(p, r2);
     988           0 :                 break;
     989             :         }
     990           4 :         case 56: { /* svcctl_QueryServiceConfigEx */
     991           4 :                 struct svcctl_QueryServiceConfigEx *r2 = (struct svcctl_QueryServiceConfigEx *)r;
     992           4 :                 if (DEBUGLEVEL >= 10) {
     993           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfigEx, NDR_IN, r2);
     994             :                 }
     995           4 :                 NDR_ZERO_STRUCT(r2->out);
     996           4 :                 r2->out.pInfo = talloc_zero(r2, struct SC_RPC_CONFIG_INFOW);
     997           4 :                 if (r2->out.pInfo == NULL) {
     998           0 :                         status = NT_STATUS_NO_MEMORY;
     999           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1000           0 :                         goto fail;
    1001             :                 }
    1002             : 
    1003           4 :                 r2->out.result = _svcctl_QueryServiceConfigEx(p, r2);
    1004           4 :                 break;
    1005             :         }
    1006           0 :         case 57: { /* Opnum57NotUsedOnWire */
    1007           0 :                 struct Opnum57NotUsedOnWire *r2 = (struct Opnum57NotUsedOnWire *)r;
    1008           0 :                 if (DEBUGLEVEL >= 10) {
    1009           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum57NotUsedOnWire, NDR_IN, r2);
    1010             :                 }
    1011           0 :                 _Opnum57NotUsedOnWire(p, r2);
    1012           0 :                 break;
    1013             :         }
    1014           0 :         case 58: { /* Opnum58NotUsedOnWire */
    1015           0 :                 struct Opnum58NotUsedOnWire *r2 = (struct Opnum58NotUsedOnWire *)r;
    1016           0 :                 if (DEBUGLEVEL >= 10) {
    1017           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum58NotUsedOnWire, NDR_IN, r2);
    1018             :                 }
    1019           0 :                 _Opnum58NotUsedOnWire(p, r2);
    1020           0 :                 break;
    1021             :         }
    1022           0 :         case 59: { /* Opnum59NotUsedOnWire */
    1023           0 :                 struct Opnum59NotUsedOnWire *r2 = (struct Opnum59NotUsedOnWire *)r;
    1024           0 :                 if (DEBUGLEVEL >= 10) {
    1025           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum59NotUsedOnWire, NDR_IN, r2);
    1026             :                 }
    1027           0 :                 _Opnum59NotUsedOnWire(p, r2);
    1028           0 :                 break;
    1029             :         }
    1030           0 :         case 60: { /* svcctl_CreateWowService */
    1031           0 :                 struct svcctl_CreateWowService *r2 = (struct svcctl_CreateWowService *)r;
    1032           0 :                 if (DEBUGLEVEL >= 10) {
    1033           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateWowService, NDR_IN, r2);
    1034             :                 }
    1035           0 :                 NDR_ZERO_STRUCT(r2->out);
    1036           0 :                 r2->out.lpdwTagId = r2->in.lpdwTagId;
    1037           0 :                 r2->out.lpServiceHandle = talloc_zero(r2, struct policy_handle);
    1038           0 :                 if (r2->out.lpServiceHandle == NULL) {
    1039           0 :                         status = NT_STATUS_NO_MEMORY;
    1040           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1041           0 :                         goto fail;
    1042             :                 }
    1043             : 
    1044           0 :                 r2->out.result = _svcctl_CreateWowService(p, r2);
    1045           0 :                 break;
    1046             :         }
    1047           0 :         case 61: { /* svcctl_OpenSCManager2 */
    1048           0 :                 struct svcctl_OpenSCManager2 *r2 = (struct svcctl_OpenSCManager2 *)r;
    1049           0 :                 if (DEBUGLEVEL >= 10) {
    1050           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenSCManager2, NDR_IN, r2);
    1051             :                 }
    1052           0 :                 NDR_ZERO_STRUCT(r2->out);
    1053           0 :                 r2->out.ScmHandle = talloc_zero(r2, struct policy_handle);
    1054           0 :                 if (r2->out.ScmHandle == NULL) {
    1055           0 :                         status = NT_STATUS_NO_MEMORY;
    1056           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1057           0 :                         goto fail;
    1058             :                 }
    1059             : 
    1060           0 :                 r2->out.result = _svcctl_OpenSCManager2(p, r2);
    1061           0 :                 break;
    1062             :         }
    1063           0 :         default:
    1064           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
    1065           0 :                 break;
    1066             :         }
    1067             : 
    1068         296 : fail:
    1069             :         /* Unimpersonate */
    1070         296 :         if (impersonated) {
    1071         296 :                 unbecome_authenticated_pipe_user();
    1072             :         }
    1073             : 
    1074         296 :         p->dce_call = NULL;
    1075         296 :         p->mem_ctx = NULL;
    1076             :         /* Check pipes struct fault state */
    1077         296 :         if (p->fault_state != 0) {
    1078          12 :                 dce_call->fault_code = p->fault_state;
    1079             :         }
    1080         296 :         if (dce_call->fault_code != 0) {
    1081          12 :                 status = NT_STATUS_NET_WRITE_FAULT;
    1082             :         }
    1083             : 
    1084         296 :         return status;
    1085             : }
    1086             : 
    1087         296 : NTSTATUS svcctl__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    1088             : {
    1089         296 :         return svcctl__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL);
    1090             : }
    1091             : 
    1092         284 : NTSTATUS svcctl__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    1093             : {
    1094         284 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
    1095             : 
    1096         284 :         switch (opnum) {
    1097          80 :         case 0: { /* svcctl_CloseServiceHandle */
    1098          80 :                 struct svcctl_CloseServiceHandle *r2 = (struct svcctl_CloseServiceHandle *)r;
    1099          80 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1100           0 :                         DEBUG(5,("function svcctl_CloseServiceHandle replied async\n"));
    1101             :                 }
    1102          80 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1103           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CloseServiceHandle, NDR_OUT | NDR_SET_VALUES, r2);
    1104             :                 }
    1105          80 :                 if (dce_call->fault_code != 0) {
    1106           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_CloseServiceHandle\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1107             :                 }
    1108          80 :                 break;
    1109             :         }
    1110           4 :         case 1: { /* svcctl_ControlService */
    1111           4 :                 struct svcctl_ControlService *r2 = (struct svcctl_ControlService *)r;
    1112           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1113           0 :                         DEBUG(5,("function svcctl_ControlService replied async\n"));
    1114             :                 }
    1115           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1116           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ControlService, NDR_OUT | NDR_SET_VALUES, r2);
    1117             :                 }
    1118           4 :                 if (dce_call->fault_code != 0) {
    1119           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_ControlService\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1120             :                 }
    1121           4 :                 break;
    1122             :         }
    1123           0 :         case 2: { /* svcctl_DeleteService */
    1124           0 :                 struct svcctl_DeleteService *r2 = (struct svcctl_DeleteService *)r;
    1125           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1126           0 :                         DEBUG(5,("function svcctl_DeleteService replied async\n"));
    1127             :                 }
    1128           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1129           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_DeleteService, NDR_OUT | NDR_SET_VALUES, r2);
    1130             :                 }
    1131           0 :                 if (dce_call->fault_code != 0) {
    1132           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_DeleteService\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1133             :                 }
    1134           0 :                 break;
    1135             :         }
    1136           0 :         case 3: { /* svcctl_LockServiceDatabase */
    1137           0 :                 struct svcctl_LockServiceDatabase *r2 = (struct svcctl_LockServiceDatabase *)r;
    1138           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1139           0 :                         DEBUG(5,("function svcctl_LockServiceDatabase replied async\n"));
    1140             :                 }
    1141           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1142           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_LockServiceDatabase, NDR_OUT | NDR_SET_VALUES, r2);
    1143             :                 }
    1144           0 :                 if (dce_call->fault_code != 0) {
    1145           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_LockServiceDatabase\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1146             :                 }
    1147           0 :                 break;
    1148             :         }
    1149          20 :         case 4: { /* svcctl_QueryServiceObjectSecurity */
    1150          20 :                 struct svcctl_QueryServiceObjectSecurity *r2 = (struct svcctl_QueryServiceObjectSecurity *)r;
    1151          20 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1152           0 :                         DEBUG(5,("function svcctl_QueryServiceObjectSecurity replied async\n"));
    1153             :                 }
    1154          20 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1155           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceObjectSecurity, NDR_OUT | NDR_SET_VALUES, r2);
    1156             :                 }
    1157          20 :                 if (dce_call->fault_code != 0) {
    1158           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceObjectSecurity\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1159             :                 }
    1160          20 :                 break;
    1161             :         }
    1162           4 :         case 5: { /* svcctl_SetServiceObjectSecurity */
    1163           4 :                 struct svcctl_SetServiceObjectSecurity *r2 = (struct svcctl_SetServiceObjectSecurity *)r;
    1164           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1165           0 :                         DEBUG(5,("function svcctl_SetServiceObjectSecurity replied async\n"));
    1166             :                 }
    1167           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1168           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_SetServiceObjectSecurity, NDR_OUT | NDR_SET_VALUES, r2);
    1169             :                 }
    1170           4 :                 if (dce_call->fault_code != 0) {
    1171           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_SetServiceObjectSecurity\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1172             :                 }
    1173           4 :                 break;
    1174             :         }
    1175           4 :         case 6: { /* svcctl_QueryServiceStatus */
    1176           4 :                 struct svcctl_QueryServiceStatus *r2 = (struct svcctl_QueryServiceStatus *)r;
    1177           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1178           0 :                         DEBUG(5,("function svcctl_QueryServiceStatus replied async\n"));
    1179             :                 }
    1180           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1181           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceStatus, NDR_OUT | NDR_SET_VALUES, r2);
    1182             :                 }
    1183           4 :                 if (dce_call->fault_code != 0) {
    1184           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceStatus\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1185             :                 }
    1186           4 :                 break;
    1187             :         }
    1188           0 :         case 7: { /* svcctl_SetServiceStatus */
    1189           0 :                 struct svcctl_SetServiceStatus *r2 = (struct svcctl_SetServiceStatus *)r;
    1190           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1191           0 :                         DEBUG(5,("function svcctl_SetServiceStatus replied async\n"));
    1192             :                 }
    1193           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1194           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_SetServiceStatus, NDR_OUT | NDR_SET_VALUES, r2);
    1195             :                 }
    1196           0 :                 if (dce_call->fault_code != 0) {
    1197           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_SetServiceStatus\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1198             :                 }
    1199           0 :                 break;
    1200             :         }
    1201           0 :         case 8: { /* svcctl_UnlockServiceDatabase */
    1202           0 :                 struct svcctl_UnlockServiceDatabase *r2 = (struct svcctl_UnlockServiceDatabase *)r;
    1203           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1204           0 :                         DEBUG(5,("function svcctl_UnlockServiceDatabase replied async\n"));
    1205             :                 }
    1206           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1207           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_UnlockServiceDatabase, NDR_OUT | NDR_SET_VALUES, r2);
    1208             :                 }
    1209           0 :                 if (dce_call->fault_code != 0) {
    1210           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_UnlockServiceDatabase\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1211             :                 }
    1212           0 :                 break;
    1213             :         }
    1214           0 :         case 9: { /* svcctl_NotifyBootConfigStatus */
    1215           0 :                 struct svcctl_NotifyBootConfigStatus *r2 = (struct svcctl_NotifyBootConfigStatus *)r;
    1216           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1217           0 :                         DEBUG(5,("function svcctl_NotifyBootConfigStatus replied async\n"));
    1218             :                 }
    1219           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1220           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_NotifyBootConfigStatus, NDR_OUT | NDR_SET_VALUES, r2);
    1221             :                 }
    1222           0 :                 if (dce_call->fault_code != 0) {
    1223           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_NotifyBootConfigStatus\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1224             :                 }
    1225           0 :                 break;
    1226             :         }
    1227           0 :         case 10: { /* svcctl_SCSetServiceBitsW */
    1228           0 :                 struct svcctl_SCSetServiceBitsW *r2 = (struct svcctl_SCSetServiceBitsW *)r;
    1229           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1230           0 :                         DEBUG(5,("function svcctl_SCSetServiceBitsW replied async\n"));
    1231             :                 }
    1232           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1233           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_SCSetServiceBitsW, NDR_OUT | NDR_SET_VALUES, r2);
    1234             :                 }
    1235           0 :                 if (dce_call->fault_code != 0) {
    1236           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_SCSetServiceBitsW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1237             :                 }
    1238           0 :                 break;
    1239             :         }
    1240           0 :         case 11: { /* svcctl_ChangeServiceConfigW */
    1241           0 :                 struct svcctl_ChangeServiceConfigW *r2 = (struct svcctl_ChangeServiceConfigW *)r;
    1242           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1243           0 :                         DEBUG(5,("function svcctl_ChangeServiceConfigW replied async\n"));
    1244             :                 }
    1245           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1246           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfigW, NDR_OUT | NDR_SET_VALUES, r2);
    1247             :                 }
    1248           0 :                 if (dce_call->fault_code != 0) {
    1249           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_ChangeServiceConfigW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1250             :                 }
    1251           0 :                 break;
    1252             :         }
    1253           0 :         case 12: { /* svcctl_CreateServiceW */
    1254           0 :                 struct svcctl_CreateServiceW *r2 = (struct svcctl_CreateServiceW *)r;
    1255           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1256           0 :                         DEBUG(5,("function svcctl_CreateServiceW replied async\n"));
    1257             :                 }
    1258           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1259           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceW, NDR_OUT | NDR_SET_VALUES, r2);
    1260             :                 }
    1261           0 :                 if (dce_call->fault_code != 0) {
    1262           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_CreateServiceW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1263             :                 }
    1264           0 :                 break;
    1265             :         }
    1266          16 :         case 13: { /* svcctl_EnumDependentServicesW */
    1267          16 :                 struct svcctl_EnumDependentServicesW *r2 = (struct svcctl_EnumDependentServicesW *)r;
    1268          16 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1269           0 :                         DEBUG(5,("function svcctl_EnumDependentServicesW replied async\n"));
    1270             :                 }
    1271          16 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1272           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumDependentServicesW, NDR_OUT | NDR_SET_VALUES, r2);
    1273             :                 }
    1274          16 :                 if (dce_call->fault_code != 0) {
    1275           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_EnumDependentServicesW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1276             :                 }
    1277          16 :                 break;
    1278             :         }
    1279           8 :         case 14: { /* svcctl_EnumServicesStatusW */
    1280           8 :                 struct svcctl_EnumServicesStatusW *r2 = (struct svcctl_EnumServicesStatusW *)r;
    1281           8 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1282           0 :                         DEBUG(5,("function svcctl_EnumServicesStatusW replied async\n"));
    1283             :                 }
    1284           8 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1285           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServicesStatusW, NDR_OUT | NDR_SET_VALUES, r2);
    1286             :                 }
    1287           8 :                 if (dce_call->fault_code != 0) {
    1288           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_EnumServicesStatusW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1289             :                 }
    1290           8 :                 break;
    1291             :         }
    1292          56 :         case 15: { /* svcctl_OpenSCManagerW */
    1293          56 :                 struct svcctl_OpenSCManagerW *r2 = (struct svcctl_OpenSCManagerW *)r;
    1294          56 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1295           0 :                         DEBUG(5,("function svcctl_OpenSCManagerW replied async\n"));
    1296             :                 }
    1297          56 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1298           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenSCManagerW, NDR_OUT | NDR_SET_VALUES, r2);
    1299             :                 }
    1300          56 :                 if (dce_call->fault_code != 0) {
    1301           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_OpenSCManagerW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1302             :                 }
    1303          56 :                 break;
    1304             :         }
    1305          48 :         case 16: { /* svcctl_OpenServiceW */
    1306          48 :                 struct svcctl_OpenServiceW *r2 = (struct svcctl_OpenServiceW *)r;
    1307          48 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1308           0 :                         DEBUG(5,("function svcctl_OpenServiceW replied async\n"));
    1309             :                 }
    1310          48 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1311           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenServiceW, NDR_OUT | NDR_SET_VALUES, r2);
    1312             :                 }
    1313          48 :                 if (dce_call->fault_code != 0) {
    1314           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_OpenServiceW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1315             :                 }
    1316          48 :                 break;
    1317             :         }
    1318          16 :         case 17: { /* svcctl_QueryServiceConfigW */
    1319          16 :                 struct svcctl_QueryServiceConfigW *r2 = (struct svcctl_QueryServiceConfigW *)r;
    1320          16 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1321           0 :                         DEBUG(5,("function svcctl_QueryServiceConfigW replied async\n"));
    1322             :                 }
    1323          16 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1324           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfigW, NDR_OUT | NDR_SET_VALUES, r2);
    1325             :                 }
    1326          16 :                 if (dce_call->fault_code != 0) {
    1327           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceConfigW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1328             :                 }
    1329          16 :                 break;
    1330             :         }
    1331           0 :         case 18: { /* svcctl_QueryServiceLockStatusW */
    1332           0 :                 struct svcctl_QueryServiceLockStatusW *r2 = (struct svcctl_QueryServiceLockStatusW *)r;
    1333           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1334           0 :                         DEBUG(5,("function svcctl_QueryServiceLockStatusW replied async\n"));
    1335             :                 }
    1336           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1337           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceLockStatusW, NDR_OUT | NDR_SET_VALUES, r2);
    1338             :                 }
    1339           0 :                 if (dce_call->fault_code != 0) {
    1340           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceLockStatusW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1341             :                 }
    1342           0 :                 break;
    1343             :         }
    1344           4 :         case 19: { /* svcctl_StartServiceW */
    1345           4 :                 struct svcctl_StartServiceW *r2 = (struct svcctl_StartServiceW *)r;
    1346           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1347           0 :                         DEBUG(5,("function svcctl_StartServiceW replied async\n"));
    1348             :                 }
    1349           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1350           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_StartServiceW, NDR_OUT | NDR_SET_VALUES, r2);
    1351             :                 }
    1352           4 :                 if (dce_call->fault_code != 0) {
    1353           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_StartServiceW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1354             :                 }
    1355           4 :                 break;
    1356             :         }
    1357           0 :         case 20: { /* svcctl_GetServiceDisplayNameW */
    1358           0 :                 struct svcctl_GetServiceDisplayNameW *r2 = (struct svcctl_GetServiceDisplayNameW *)r;
    1359           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1360           0 :                         DEBUG(5,("function svcctl_GetServiceDisplayNameW replied async\n"));
    1361             :                 }
    1362           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1363           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceDisplayNameW, NDR_OUT | NDR_SET_VALUES, r2);
    1364             :                 }
    1365           0 :                 if (dce_call->fault_code != 0) {
    1366           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_GetServiceDisplayNameW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1367             :                 }
    1368           0 :                 break;
    1369             :         }
    1370           0 :         case 21: { /* svcctl_GetServiceKeyNameW */
    1371           0 :                 struct svcctl_GetServiceKeyNameW *r2 = (struct svcctl_GetServiceKeyNameW *)r;
    1372           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1373           0 :                         DEBUG(5,("function svcctl_GetServiceKeyNameW replied async\n"));
    1374             :                 }
    1375           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1376           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceKeyNameW, NDR_OUT | NDR_SET_VALUES, r2);
    1377             :                 }
    1378           0 :                 if (dce_call->fault_code != 0) {
    1379           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_GetServiceKeyNameW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1380             :                 }
    1381           0 :                 break;
    1382             :         }
    1383           0 :         case 22: { /* svcctl_SCSetServiceBitsA */
    1384           0 :                 struct svcctl_SCSetServiceBitsA *r2 = (struct svcctl_SCSetServiceBitsA *)r;
    1385           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1386           0 :                         DEBUG(5,("function svcctl_SCSetServiceBitsA replied async\n"));
    1387             :                 }
    1388           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1389           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_SCSetServiceBitsA, NDR_OUT | NDR_SET_VALUES, r2);
    1390             :                 }
    1391           0 :                 if (dce_call->fault_code != 0) {
    1392           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_SCSetServiceBitsA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1393             :                 }
    1394           0 :                 break;
    1395             :         }
    1396           0 :         case 23: { /* svcctl_ChangeServiceConfigA */
    1397           0 :                 struct svcctl_ChangeServiceConfigA *r2 = (struct svcctl_ChangeServiceConfigA *)r;
    1398           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1399           0 :                         DEBUG(5,("function svcctl_ChangeServiceConfigA replied async\n"));
    1400             :                 }
    1401           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1402           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfigA, NDR_OUT | NDR_SET_VALUES, r2);
    1403             :                 }
    1404           0 :                 if (dce_call->fault_code != 0) {
    1405           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_ChangeServiceConfigA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1406             :                 }
    1407           0 :                 break;
    1408             :         }
    1409           0 :         case 24: { /* svcctl_CreateServiceA */
    1410           0 :                 struct svcctl_CreateServiceA *r2 = (struct svcctl_CreateServiceA *)r;
    1411           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1412           0 :                         DEBUG(5,("function svcctl_CreateServiceA replied async\n"));
    1413             :                 }
    1414           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1415           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceA, NDR_OUT | NDR_SET_VALUES, r2);
    1416             :                 }
    1417           0 :                 if (dce_call->fault_code != 0) {
    1418           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_CreateServiceA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1419             :                 }
    1420           0 :                 break;
    1421             :         }
    1422           0 :         case 25: { /* svcctl_EnumDependentServicesA */
    1423           0 :                 struct svcctl_EnumDependentServicesA *r2 = (struct svcctl_EnumDependentServicesA *)r;
    1424           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1425           0 :                         DEBUG(5,("function svcctl_EnumDependentServicesA replied async\n"));
    1426             :                 }
    1427           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1428           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumDependentServicesA, NDR_OUT | NDR_SET_VALUES, r2);
    1429             :                 }
    1430           0 :                 if (dce_call->fault_code != 0) {
    1431           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_EnumDependentServicesA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1432             :                 }
    1433           0 :                 break;
    1434             :         }
    1435           0 :         case 26: { /* svcctl_EnumServicesStatusA */
    1436           0 :                 struct svcctl_EnumServicesStatusA *r2 = (struct svcctl_EnumServicesStatusA *)r;
    1437           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1438           0 :                         DEBUG(5,("function svcctl_EnumServicesStatusA replied async\n"));
    1439             :                 }
    1440           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1441           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServicesStatusA, NDR_OUT | NDR_SET_VALUES, r2);
    1442             :                 }
    1443           0 :                 if (dce_call->fault_code != 0) {
    1444           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_EnumServicesStatusA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1445             :                 }
    1446           0 :                 break;
    1447             :         }
    1448           0 :         case 27: { /* svcctl_OpenSCManagerA */
    1449           0 :                 struct svcctl_OpenSCManagerA *r2 = (struct svcctl_OpenSCManagerA *)r;
    1450           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1451           0 :                         DEBUG(5,("function svcctl_OpenSCManagerA replied async\n"));
    1452             :                 }
    1453           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1454           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenSCManagerA, NDR_OUT | NDR_SET_VALUES, r2);
    1455             :                 }
    1456           0 :                 if (dce_call->fault_code != 0) {
    1457           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_OpenSCManagerA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1458             :                 }
    1459           0 :                 break;
    1460             :         }
    1461           0 :         case 28: { /* svcctl_OpenServiceA */
    1462           0 :                 struct svcctl_OpenServiceA *r2 = (struct svcctl_OpenServiceA *)r;
    1463           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1464           0 :                         DEBUG(5,("function svcctl_OpenServiceA replied async\n"));
    1465             :                 }
    1466           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1467           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenServiceA, NDR_OUT | NDR_SET_VALUES, r2);
    1468             :                 }
    1469           0 :                 if (dce_call->fault_code != 0) {
    1470           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_OpenServiceA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1471             :                 }
    1472           0 :                 break;
    1473             :         }
    1474           0 :         case 29: { /* svcctl_QueryServiceConfigA */
    1475           0 :                 struct svcctl_QueryServiceConfigA *r2 = (struct svcctl_QueryServiceConfigA *)r;
    1476           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1477           0 :                         DEBUG(5,("function svcctl_QueryServiceConfigA replied async\n"));
    1478             :                 }
    1479           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1480           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfigA, NDR_OUT | NDR_SET_VALUES, r2);
    1481             :                 }
    1482           0 :                 if (dce_call->fault_code != 0) {
    1483           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceConfigA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1484             :                 }
    1485           0 :                 break;
    1486             :         }
    1487           0 :         case 30: { /* svcctl_QueryServiceLockStatusA */
    1488           0 :                 struct svcctl_QueryServiceLockStatusA *r2 = (struct svcctl_QueryServiceLockStatusA *)r;
    1489           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1490           0 :                         DEBUG(5,("function svcctl_QueryServiceLockStatusA replied async\n"));
    1491             :                 }
    1492           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1493           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceLockStatusA, NDR_OUT | NDR_SET_VALUES, r2);
    1494             :                 }
    1495           0 :                 if (dce_call->fault_code != 0) {
    1496           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceLockStatusA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1497             :                 }
    1498           0 :                 break;
    1499             :         }
    1500           0 :         case 31: { /* svcctl_StartServiceA */
    1501           0 :                 struct svcctl_StartServiceA *r2 = (struct svcctl_StartServiceA *)r;
    1502           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1503           0 :                         DEBUG(5,("function svcctl_StartServiceA replied async\n"));
    1504             :                 }
    1505           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1506           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_StartServiceA, NDR_OUT | NDR_SET_VALUES, r2);
    1507             :                 }
    1508           0 :                 if (dce_call->fault_code != 0) {
    1509           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_StartServiceA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1510             :                 }
    1511           0 :                 break;
    1512             :         }
    1513           0 :         case 32: { /* svcctl_GetServiceDisplayNameA */
    1514           0 :                 struct svcctl_GetServiceDisplayNameA *r2 = (struct svcctl_GetServiceDisplayNameA *)r;
    1515           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1516           0 :                         DEBUG(5,("function svcctl_GetServiceDisplayNameA replied async\n"));
    1517             :                 }
    1518           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1519           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceDisplayNameA, NDR_OUT | NDR_SET_VALUES, r2);
    1520             :                 }
    1521           0 :                 if (dce_call->fault_code != 0) {
    1522           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_GetServiceDisplayNameA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1523             :                 }
    1524           0 :                 break;
    1525             :         }
    1526           0 :         case 33: { /* svcctl_GetServiceKeyNameA */
    1527           0 :                 struct svcctl_GetServiceKeyNameA *r2 = (struct svcctl_GetServiceKeyNameA *)r;
    1528           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1529           0 :                         DEBUG(5,("function svcctl_GetServiceKeyNameA replied async\n"));
    1530             :                 }
    1531           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1532           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_GetServiceKeyNameA, NDR_OUT | NDR_SET_VALUES, r2);
    1533             :                 }
    1534           0 :                 if (dce_call->fault_code != 0) {
    1535           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_GetServiceKeyNameA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1536             :                 }
    1537           0 :                 break;
    1538             :         }
    1539           0 :         case 34: { /* svcctl_GetCurrentGroupeStateW */
    1540           0 :                 struct svcctl_GetCurrentGroupeStateW *r2 = (struct svcctl_GetCurrentGroupeStateW *)r;
    1541           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1542           0 :                         DEBUG(5,("function svcctl_GetCurrentGroupeStateW replied async\n"));
    1543             :                 }
    1544           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1545           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_GetCurrentGroupeStateW, NDR_OUT | NDR_SET_VALUES, r2);
    1546             :                 }
    1547           0 :                 if (dce_call->fault_code != 0) {
    1548           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_GetCurrentGroupeStateW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1549             :                 }
    1550           0 :                 break;
    1551             :         }
    1552           0 :         case 35: { /* svcctl_EnumServiceGroupW */
    1553           0 :                 struct svcctl_EnumServiceGroupW *r2 = (struct svcctl_EnumServiceGroupW *)r;
    1554           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1555           0 :                         DEBUG(5,("function svcctl_EnumServiceGroupW replied async\n"));
    1556             :                 }
    1557           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1558           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServiceGroupW, NDR_OUT | NDR_SET_VALUES, r2);
    1559             :                 }
    1560           0 :                 if (dce_call->fault_code != 0) {
    1561           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_EnumServiceGroupW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1562             :                 }
    1563           0 :                 break;
    1564             :         }
    1565           0 :         case 36: { /* svcctl_ChangeServiceConfig2A */
    1566           0 :                 struct svcctl_ChangeServiceConfig2A *r2 = (struct svcctl_ChangeServiceConfig2A *)r;
    1567           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1568           0 :                         DEBUG(5,("function svcctl_ChangeServiceConfig2A replied async\n"));
    1569             :                 }
    1570           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1571           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfig2A, NDR_OUT | NDR_SET_VALUES, r2);
    1572             :                 }
    1573           0 :                 if (dce_call->fault_code != 0) {
    1574           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_ChangeServiceConfig2A\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1575             :                 }
    1576           0 :                 break;
    1577             :         }
    1578           0 :         case 37: { /* svcctl_ChangeServiceConfig2W */
    1579           0 :                 struct svcctl_ChangeServiceConfig2W *r2 = (struct svcctl_ChangeServiceConfig2W *)r;
    1580           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1581           0 :                         DEBUG(5,("function svcctl_ChangeServiceConfig2W replied async\n"));
    1582             :                 }
    1583           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1584           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ChangeServiceConfig2W, NDR_OUT | NDR_SET_VALUES, r2);
    1585             :                 }
    1586           0 :                 if (dce_call->fault_code != 0) {
    1587           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_ChangeServiceConfig2W\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1588             :                 }
    1589           0 :                 break;
    1590             :         }
    1591           0 :         case 38: { /* svcctl_QueryServiceConfig2A */
    1592           0 :                 struct svcctl_QueryServiceConfig2A *r2 = (struct svcctl_QueryServiceConfig2A *)r;
    1593           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1594           0 :                         DEBUG(5,("function svcctl_QueryServiceConfig2A replied async\n"));
    1595             :                 }
    1596           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1597           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfig2A, NDR_OUT | NDR_SET_VALUES, r2);
    1598             :                 }
    1599           0 :                 if (dce_call->fault_code != 0) {
    1600           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceConfig2A\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1601             :                 }
    1602           0 :                 break;
    1603             :         }
    1604          16 :         case 39: { /* svcctl_QueryServiceConfig2W */
    1605          16 :                 struct svcctl_QueryServiceConfig2W *r2 = (struct svcctl_QueryServiceConfig2W *)r;
    1606          16 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1607           0 :                         DEBUG(5,("function svcctl_QueryServiceConfig2W replied async\n"));
    1608             :                 }
    1609          16 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1610           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfig2W, NDR_OUT | NDR_SET_VALUES, r2);
    1611             :                 }
    1612          16 :                 if (dce_call->fault_code != 0) {
    1613           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceConfig2W\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1614             :                 }
    1615          16 :                 break;
    1616             :         }
    1617           8 :         case 40: { /* svcctl_QueryServiceStatusEx */
    1618           8 :                 struct svcctl_QueryServiceStatusEx *r2 = (struct svcctl_QueryServiceStatusEx *)r;
    1619           8 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1620           0 :                         DEBUG(5,("function svcctl_QueryServiceStatusEx replied async\n"));
    1621             :                 }
    1622           8 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1623           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceStatusEx, NDR_OUT | NDR_SET_VALUES, r2);
    1624             :                 }
    1625           8 :                 if (dce_call->fault_code != 0) {
    1626           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceStatusEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1627             :                 }
    1628           8 :                 break;
    1629             :         }
    1630           0 :         case 41: { /* svcctl_EnumServicesStatusExA */
    1631           0 :                 struct svcctl_EnumServicesStatusExA *r2 = (struct svcctl_EnumServicesStatusExA *)r;
    1632           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1633           0 :                         DEBUG(5,("function svcctl_EnumServicesStatusExA replied async\n"));
    1634             :                 }
    1635           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1636           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServicesStatusExA, NDR_OUT | NDR_SET_VALUES, r2);
    1637             :                 }
    1638           0 :                 if (dce_call->fault_code != 0) {
    1639           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_EnumServicesStatusExA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1640             :                 }
    1641           0 :                 break;
    1642             :         }
    1643           0 :         case 42: { /* svcctl_EnumServicesStatusExW */
    1644           0 :                 struct svcctl_EnumServicesStatusExW *r2 = (struct svcctl_EnumServicesStatusExW *)r;
    1645           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1646           0 :                         DEBUG(5,("function svcctl_EnumServicesStatusExW replied async\n"));
    1647             :                 }
    1648           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1649           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_EnumServicesStatusExW, NDR_OUT | NDR_SET_VALUES, r2);
    1650             :                 }
    1651           0 :                 if (dce_call->fault_code != 0) {
    1652           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_EnumServicesStatusExW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1653             :                 }
    1654           0 :                 break;
    1655             :         }
    1656           0 :         case 43: { /* svcctl_SCSendTSMessage */
    1657           0 :                 struct svcctl_SCSendTSMessage *r2 = (struct svcctl_SCSendTSMessage *)r;
    1658           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1659           0 :                         DEBUG(5,("function svcctl_SCSendTSMessage replied async\n"));
    1660             :                 }
    1661           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1662           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_SCSendTSMessage, NDR_OUT | NDR_SET_VALUES, r2);
    1663             :                 }
    1664           0 :                 if (dce_call->fault_code != 0) {
    1665           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_SCSendTSMessage\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1666             :                 }
    1667           0 :                 break;
    1668             :         }
    1669           0 :         case 44: { /* svcctl_CreateServiceWOW64A */
    1670           0 :                 struct svcctl_CreateServiceWOW64A *r2 = (struct svcctl_CreateServiceWOW64A *)r;
    1671           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1672           0 :                         DEBUG(5,("function svcctl_CreateServiceWOW64A replied async\n"));
    1673             :                 }
    1674           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1675           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceWOW64A, NDR_OUT | NDR_SET_VALUES, r2);
    1676             :                 }
    1677           0 :                 if (dce_call->fault_code != 0) {
    1678           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_CreateServiceWOW64A\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1679             :                 }
    1680           0 :                 break;
    1681             :         }
    1682           0 :         case 45: { /* svcctl_CreateServiceWOW64W */
    1683           0 :                 struct svcctl_CreateServiceWOW64W *r2 = (struct svcctl_CreateServiceWOW64W *)r;
    1684           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1685           0 :                         DEBUG(5,("function svcctl_CreateServiceWOW64W replied async\n"));
    1686             :                 }
    1687           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1688           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateServiceWOW64W, NDR_OUT | NDR_SET_VALUES, r2);
    1689             :                 }
    1690           0 :                 if (dce_call->fault_code != 0) {
    1691           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_CreateServiceWOW64W\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1692             :                 }
    1693           0 :                 break;
    1694             :         }
    1695           0 :         case 46: { /* Opnum46NotUsedOnWire */
    1696           0 :                 struct Opnum46NotUsedOnWire *r2 = (struct Opnum46NotUsedOnWire *)r;
    1697           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1698           0 :                         DEBUG(5,("function Opnum46NotUsedOnWire replied async\n"));
    1699             :                 }
    1700           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1701           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum46NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    1702             :                 }
    1703           0 :                 if (dce_call->fault_code != 0) {
    1704           0 :                         DBG_WARNING("dcerpc_fault %s in Opnum46NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1705             :                 }
    1706           0 :                 break;
    1707             :         }
    1708           0 :         case 47: { /* svcctl_NotifyServiceStatusChange */
    1709           0 :                 struct svcctl_NotifyServiceStatusChange *r2 = (struct svcctl_NotifyServiceStatusChange *)r;
    1710           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1711           0 :                         DEBUG(5,("function svcctl_NotifyServiceStatusChange replied async\n"));
    1712             :                 }
    1713           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1714           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_NotifyServiceStatusChange, NDR_OUT | NDR_SET_VALUES, r2);
    1715             :                 }
    1716           0 :                 if (dce_call->fault_code != 0) {
    1717           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_NotifyServiceStatusChange\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1718             :                 }
    1719           0 :                 break;
    1720             :         }
    1721           0 :         case 48: { /* svcctl_GetNotifyResults */
    1722           0 :                 struct svcctl_GetNotifyResults *r2 = (struct svcctl_GetNotifyResults *)r;
    1723           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1724           0 :                         DEBUG(5,("function svcctl_GetNotifyResults replied async\n"));
    1725             :                 }
    1726           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1727           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_GetNotifyResults, NDR_OUT | NDR_SET_VALUES, r2);
    1728             :                 }
    1729           0 :                 if (dce_call->fault_code != 0) {
    1730           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_GetNotifyResults\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1731             :                 }
    1732           0 :                 break;
    1733             :         }
    1734           0 :         case 49: { /* svcctl_CloseNotifyHandle */
    1735           0 :                 struct svcctl_CloseNotifyHandle *r2 = (struct svcctl_CloseNotifyHandle *)r;
    1736           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1737           0 :                         DEBUG(5,("function svcctl_CloseNotifyHandle replied async\n"));
    1738             :                 }
    1739           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1740           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CloseNotifyHandle, NDR_OUT | NDR_SET_VALUES, r2);
    1741             :                 }
    1742           0 :                 if (dce_call->fault_code != 0) {
    1743           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_CloseNotifyHandle\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1744             :                 }
    1745           0 :                 break;
    1746             :         }
    1747           0 :         case 50: { /* svcctl_ControlServiceExA */
    1748           0 :                 struct svcctl_ControlServiceExA *r2 = (struct svcctl_ControlServiceExA *)r;
    1749           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1750           0 :                         DEBUG(5,("function svcctl_ControlServiceExA replied async\n"));
    1751             :                 }
    1752           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1753           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ControlServiceExA, NDR_OUT | NDR_SET_VALUES, r2);
    1754             :                 }
    1755           0 :                 if (dce_call->fault_code != 0) {
    1756           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_ControlServiceExA\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1757             :                 }
    1758           0 :                 break;
    1759             :         }
    1760           0 :         case 51: { /* svcctl_ControlServiceExW */
    1761           0 :                 struct svcctl_ControlServiceExW *r2 = (struct svcctl_ControlServiceExW *)r;
    1762           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1763           0 :                         DEBUG(5,("function svcctl_ControlServiceExW replied async\n"));
    1764             :                 }
    1765           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1766           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_ControlServiceExW, NDR_OUT | NDR_SET_VALUES, r2);
    1767             :                 }
    1768           0 :                 if (dce_call->fault_code != 0) {
    1769           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_ControlServiceExW\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1770             :                 }
    1771           0 :                 break;
    1772             :         }
    1773           0 :         case 52: { /* Opnum52NotUsedOnWire */
    1774           0 :                 struct Opnum52NotUsedOnWire *r2 = (struct Opnum52NotUsedOnWire *)r;
    1775           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1776           0 :                         DEBUG(5,("function Opnum52NotUsedOnWire replied async\n"));
    1777             :                 }
    1778           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1779           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum52NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    1780             :                 }
    1781           0 :                 if (dce_call->fault_code != 0) {
    1782           0 :                         DBG_WARNING("dcerpc_fault %s in Opnum52NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1783             :                 }
    1784           0 :                 break;
    1785             :         }
    1786           0 :         case 53: { /* Opnum53NotUsedOnWire */
    1787           0 :                 struct Opnum53NotUsedOnWire *r2 = (struct Opnum53NotUsedOnWire *)r;
    1788           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1789           0 :                         DEBUG(5,("function Opnum53NotUsedOnWire replied async\n"));
    1790             :                 }
    1791           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1792           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum53NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    1793             :                 }
    1794           0 :                 if (dce_call->fault_code != 0) {
    1795           0 :                         DBG_WARNING("dcerpc_fault %s in Opnum53NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1796             :                 }
    1797           0 :                 break;
    1798             :         }
    1799           0 :         case 54: { /* Opnum54NotUsedOnWire */
    1800           0 :                 struct Opnum54NotUsedOnWire *r2 = (struct Opnum54NotUsedOnWire *)r;
    1801           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1802           0 :                         DEBUG(5,("function Opnum54NotUsedOnWire replied async\n"));
    1803             :                 }
    1804           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1805           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum54NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    1806             :                 }
    1807           0 :                 if (dce_call->fault_code != 0) {
    1808           0 :                         DBG_WARNING("dcerpc_fault %s in Opnum54NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1809             :                 }
    1810           0 :                 break;
    1811             :         }
    1812           0 :         case 55: { /* Opnum55NotUsedOnWire */
    1813           0 :                 struct Opnum55NotUsedOnWire *r2 = (struct Opnum55NotUsedOnWire *)r;
    1814           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1815           0 :                         DEBUG(5,("function Opnum55NotUsedOnWire replied async\n"));
    1816             :                 }
    1817           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1818           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum55NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    1819             :                 }
    1820           0 :                 if (dce_call->fault_code != 0) {
    1821           0 :                         DBG_WARNING("dcerpc_fault %s in Opnum55NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1822             :                 }
    1823           0 :                 break;
    1824             :         }
    1825           0 :         case 56: { /* svcctl_QueryServiceConfigEx */
    1826           0 :                 struct svcctl_QueryServiceConfigEx *r2 = (struct svcctl_QueryServiceConfigEx *)r;
    1827           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1828           0 :                         DEBUG(5,("function svcctl_QueryServiceConfigEx replied async\n"));
    1829             :                 }
    1830           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1831           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_QueryServiceConfigEx, NDR_OUT | NDR_SET_VALUES, r2);
    1832             :                 }
    1833           0 :                 if (dce_call->fault_code != 0) {
    1834           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_QueryServiceConfigEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1835             :                 }
    1836           0 :                 break;
    1837             :         }
    1838           0 :         case 57: { /* Opnum57NotUsedOnWire */
    1839           0 :                 struct Opnum57NotUsedOnWire *r2 = (struct Opnum57NotUsedOnWire *)r;
    1840           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1841           0 :                         DEBUG(5,("function Opnum57NotUsedOnWire replied async\n"));
    1842             :                 }
    1843           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1844           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum57NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    1845             :                 }
    1846           0 :                 if (dce_call->fault_code != 0) {
    1847           0 :                         DBG_WARNING("dcerpc_fault %s in Opnum57NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1848             :                 }
    1849           0 :                 break;
    1850             :         }
    1851           0 :         case 58: { /* Opnum58NotUsedOnWire */
    1852           0 :                 struct Opnum58NotUsedOnWire *r2 = (struct Opnum58NotUsedOnWire *)r;
    1853           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1854           0 :                         DEBUG(5,("function Opnum58NotUsedOnWire replied async\n"));
    1855             :                 }
    1856           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1857           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum58NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    1858             :                 }
    1859           0 :                 if (dce_call->fault_code != 0) {
    1860           0 :                         DBG_WARNING("dcerpc_fault %s in Opnum58NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1861             :                 }
    1862           0 :                 break;
    1863             :         }
    1864           0 :         case 59: { /* Opnum59NotUsedOnWire */
    1865           0 :                 struct Opnum59NotUsedOnWire *r2 = (struct Opnum59NotUsedOnWire *)r;
    1866           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1867           0 :                         DEBUG(5,("function Opnum59NotUsedOnWire replied async\n"));
    1868             :                 }
    1869           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1870           0 :                         NDR_PRINT_FUNCTION_DEBUG(Opnum59NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    1871             :                 }
    1872           0 :                 if (dce_call->fault_code != 0) {
    1873           0 :                         DBG_WARNING("dcerpc_fault %s in Opnum59NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1874             :                 }
    1875           0 :                 break;
    1876             :         }
    1877           0 :         case 60: { /* svcctl_CreateWowService */
    1878           0 :                 struct svcctl_CreateWowService *r2 = (struct svcctl_CreateWowService *)r;
    1879           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1880           0 :                         DEBUG(5,("function svcctl_CreateWowService replied async\n"));
    1881             :                 }
    1882           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1883           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_CreateWowService, NDR_OUT | NDR_SET_VALUES, r2);
    1884             :                 }
    1885           0 :                 if (dce_call->fault_code != 0) {
    1886           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_CreateWowService\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1887             :                 }
    1888           0 :                 break;
    1889             :         }
    1890           0 :         case 61: { /* svcctl_OpenSCManager2 */
    1891           0 :                 struct svcctl_OpenSCManager2 *r2 = (struct svcctl_OpenSCManager2 *)r;
    1892           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1893           0 :                         DEBUG(5,("function svcctl_OpenSCManager2 replied async\n"));
    1894             :                 }
    1895           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1896           0 :                         NDR_PRINT_FUNCTION_DEBUG(svcctl_OpenSCManager2, NDR_OUT | NDR_SET_VALUES, r2);
    1897             :                 }
    1898           0 :                 if (dce_call->fault_code != 0) {
    1899           0 :                         DBG_WARNING("dcerpc_fault %s in svcctl_OpenSCManager2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1900             :                 }
    1901           0 :                 break;
    1902             :         }
    1903           0 :         default:
    1904           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
    1905           0 :                 break;
    1906             :         }
    1907             : 
    1908         284 :         if (dce_call->fault_code != 0) {
    1909           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    1910             :         }
    1911             : 
    1912         284 :         return NT_STATUS_OK;
    1913             : }
    1914             : 
    1915         284 : NTSTATUS svcctl__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
    1916             : {
    1917           0 :         enum ndr_err_code ndr_err;
    1918         284 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
    1919             : 
    1920         284 :         ndr_err = ndr_table_svcctl.calls[opnum].ndr_push(push, NDR_OUT, r);
    1921         284 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
    1922           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
    1923           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    1924             :         }
    1925             : 
    1926         284 :         return NT_STATUS_OK;
    1927             : }
    1928             : 
    1929           0 : NTSTATUS svcctl__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    1930             : {
    1931           0 :         return svcctl__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL);
    1932             : }
    1933             : 
    1934             : static const struct dcesrv_interface dcesrv_svcctl_interface = {
    1935             :         .name      = "svcctl",
    1936             :         .syntax_id = {{0x367abb81,0x9844,0x35f1,{0xad,0x32},{0x98,0xf0,0x38,0x00,0x10,0x03}},2.0},
    1937             :         .bind      = svcctl__op_bind,
    1938             :         .unbind    = svcctl__op_unbind,
    1939             :         .ndr_pull  = svcctl__op_ndr_pull,
    1940             :         .dispatch  = svcctl__op_dispatch,
    1941             :         .reply     = svcctl__op_reply,
    1942             :         .ndr_push  = svcctl__op_ndr_push,
    1943             :         .local     = svcctl__op_local,
    1944             : #ifdef DCESRV_INTERFACE_SVCCTL_FLAGS
    1945             :         .flags     = DCESRV_INTERFACE_SVCCTL_FLAGS
    1946             : #else
    1947             :         .flags     = 0
    1948             : #endif
    1949             : };
    1950             : 
    1951         126 : static NTSTATUS svcctl__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    1952             : {
    1953           0 :         uint32_t i;
    1954           0 :         NTSTATUS ret;
    1955             : 
    1956             : #ifdef DCESRV_INTERFACE_SVCCTL_NCACN_NP_SECONDARY_ENDPOINT
    1957             :         const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_SVCCTL_NCACN_NP_SECONDARY_ENDPOINT;
    1958             : #else
    1959         126 :         const char *ncacn_np_secondary_endpoint = NULL;
    1960             : #endif
    1961             : 
    1962         378 :         for (i=0;i<ndr_table_svcctl.endpoints->count;i++) {
    1963         252 :                 const char *name = ndr_table_svcctl.endpoints->names[i];
    1964             : 
    1965         252 :                 ret = dcesrv_interface_register(dce_ctx, name, ncacn_np_secondary_endpoint, &dcesrv_svcctl_interface, NULL);
    1966         252 :                 if (!NT_STATUS_IS_OK(ret)) {
    1967           0 :                         DBG_ERR("Failed to register endpoint '%s'\n",name);
    1968           0 :                         return ret;
    1969             :                 }
    1970             :         }
    1971             : 
    1972         126 :         return NT_STATUS_OK;
    1973             : }
    1974             : 
    1975         126 : static NTSTATUS svcctl__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    1976             : {
    1977         126 :         return NT_STATUS_OK;
    1978             : }
    1979             : 
    1980           0 : static bool svcctl__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
    1981             : {
    1982           0 :         if (dcesrv_svcctl_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_svcctl_interface.syntax_id.uuid, uuid)) {
    1983           0 :                 memcpy(iface,&dcesrv_svcctl_interface, sizeof(*iface));
    1984           0 :                 return true;
    1985             :         }
    1986             : 
    1987           0 :         return false;
    1988             : }
    1989             : 
    1990           0 : static bool svcctl__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
    1991             : {
    1992           0 :         if (strcmp(dcesrv_svcctl_interface.name, name)==0) {
    1993           0 :                 memcpy(iface, &dcesrv_svcctl_interface, sizeof(*iface));
    1994           0 :                 return true;
    1995             :         }
    1996             : 
    1997           0 :         return false;
    1998             : }
    1999             : 
    2000             : static const struct dcesrv_endpoint_server svcctl_ep_server = {
    2001             :         /* fill in our name */
    2002             :         .name = "svcctl",
    2003             : 
    2004             :         /* Initialization flag */
    2005             :         .initialized = false,
    2006             : 
    2007             :         /* fill in all the operations */
    2008             : #ifdef DCESRV_INTERFACE_SVCCTL_INIT_SERVER
    2009             :         .init_server = DCESRV_INTERFACE_SVCCTL_INIT_SERVER,
    2010             : #else
    2011             :         .init_server = svcctl__op_init_server,
    2012             : #endif
    2013             : #ifdef DCESRV_INTERFACE_SVCCTL_SHUTDOWN_SERVER
    2014             :         .shutdown_server = DCESRV_INTERFACE_SVCCTL_SHUTDOWN_SERVER,
    2015             : #else
    2016             :         .shutdown_server = svcctl__op_shutdown_server,
    2017             : #endif
    2018             :         .interface_by_uuid = svcctl__op_interface_by_uuid,
    2019             :         .interface_by_name = svcctl__op_interface_by_name
    2020             : };
    2021             : 
    2022         126 : const struct dcesrv_endpoint_server *svcctl_get_ep_server(void)
    2023             : {
    2024         126 :         return &svcctl_ep_server;
    2025             : }

Generated by: LCOV version 1.14