LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_ntsvcs_scompat.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 145 1145 12.7 %
Date: 2021-09-23 10:06:22 Functions: 11 14 78.6 %

          Line data    Source code
       1             : /* s3 compat server functions auto-generated by pidl */
       2             : #include "bin/default/librpc/gen_ndr/ndr_ntsvcs.h"
       3             : #include "bin/default/librpc/gen_ndr/ndr_ntsvcs_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             : /* ntsvcs - dcerpc server boilerplate generated by pidl */
      15           4 : static NTSTATUS ntsvcs__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      16             : {
      17           4 :         struct pipes_struct *p = NULL;
      18             : 
      19             :         /* Retrieve pipes struct */
      20           4 :         p = dcesrv_get_pipes_struct(context->conn);
      21           4 :         p->pipe_bound = true;
      22             : #ifdef DCESRV_INTERFACE_NTSVCS_BIND
      23             :         return DCESRV_INTERFACE_NTSVCS_BIND(context,iface);
      24             : #else
      25           4 :         return NT_STATUS_OK;
      26             : #endif
      27             : }
      28             : 
      29           4 : static void ntsvcs__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      30             : {
      31             : #ifdef DCESRV_INTERFACE_NTSVCS_UNBIND
      32             :         DCESRV_INTERFACE_NTSVCS_UNBIND(context, iface);
      33             : #else
      34           4 :         return;
      35             : #endif
      36             : }
      37             : 
      38          32 : NTSTATUS ntsvcs__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
      39             : {
      40             :         enum ndr_err_code ndr_err;
      41          32 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      42             : 
      43          32 :         dce_call->fault_code = 0;
      44             : 
      45          32 :         if (opnum >= ndr_table_ntsvcs.num_calls) {
      46           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
      47           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      48             :         }
      49             : 
      50          32 :         *r = talloc_named(mem_ctx, ndr_table_ntsvcs.calls[opnum].struct_size, "struct %s", ndr_table_ntsvcs.calls[opnum].name);
      51          32 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      52             : 
      53             :         /* unravel the NDR for the packet */
      54          32 :         ndr_err = ndr_table_ntsvcs.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      55          32 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
      56           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
      57           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      58             :         }
      59             : 
      60          32 :         return NT_STATUS_OK;
      61             : }
      62             : 
      63          32 : static NTSTATUS ntsvcs__op_dispatch_internal(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, enum s3compat_rpc_dispatch dispatch)
      64             : {
      65          32 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      66          32 :         struct pipes_struct *p = NULL;
      67          32 :         struct auth_session_info *pipe_session_info = NULL;
      68          32 :         NTSTATUS status = NT_STATUS_OK;
      69          32 :         bool impersonated = false;
      70             : 
      71             :         /* Retrieve pipes struct */
      72          32 :         p = dcesrv_get_pipes_struct(dce_call->conn);
      73             :         /* Update pipes struct opnum */
      74          32 :         p->opnum = opnum;
      75          32 :         p->dce_call = dce_call;
      76          32 :         p->mem_ctx = mem_ctx;
      77             :         /* Update pipes struct session info */
      78          32 :         pipe_session_info = p->session_info;
      79          32 :         p->session_info = dce_call->auth_state->session_info;
      80          32 :         p->auth.auth_type = dce_call->auth_state->auth_type;
      81          32 :         p->auth.auth_level = dce_call->auth_state->auth_level;
      82          32 :         p->auth.auth_context_id = dce_call->auth_state->auth_context_id;
      83             :         /* Reset pipes struct fault state */
      84          32 :         p->fault_state = 0;
      85             : 
      86             :         /* Impersonate */
      87          32 :         if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) {
      88          32 :                 impersonated = become_authenticated_pipe_user(p->session_info);
      89          32 :                 if (!impersonated) {
      90           0 :                         dce_call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
      91           0 :                         status = NT_STATUS_NET_WRITE_FAULT;
      92           0 :                         goto fail;
      93             :                 }
      94             :         }
      95             : 
      96          32 :         switch (opnum) {
      97           0 :         case 0: { /* PNP_Disconnect */
      98           0 :                 struct PNP_Disconnect *r2 = (struct PNP_Disconnect *)r;
      99           0 :                 if (DEBUGLEVEL >= 10) {
     100           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_Disconnect, NDR_IN, r2);
     101             :                 }
     102           0 :                 r2->out.result = _PNP_Disconnect(p, r2);
     103           0 :                 break;
     104             :         }
     105           0 :         case 1: { /* PNP_Connect */
     106           0 :                 struct PNP_Connect *r2 = (struct PNP_Connect *)r;
     107           0 :                 if (DEBUGLEVEL >= 10) {
     108           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_Connect, NDR_IN, r2);
     109             :                 }
     110           0 :                 r2->out.result = _PNP_Connect(p, r2);
     111           0 :                 break;
     112             :         }
     113           4 :         case 2: { /* PNP_GetVersion */
     114           4 :                 struct PNP_GetVersion *r2 = (struct PNP_GetVersion *)r;
     115           4 :                 if (DEBUGLEVEL >= 10) {
     116           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetVersion, NDR_IN, r2);
     117             :                 }
     118           4 :                 NDR_ZERO_STRUCT(r2->out);
     119           4 :                 r2->out.version = talloc_zero(r2, uint16_t);
     120           4 :                 if (r2->out.version == NULL) {
     121           0 :                         status = NT_STATUS_NO_MEMORY;
     122           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     123           0 :                         goto fail;
     124             :                 }
     125             : 
     126           4 :                 r2->out.result = _PNP_GetVersion(p, r2);
     127           4 :                 break;
     128             :         }
     129           0 :         case 3: { /* PNP_GetGlobalState */
     130           0 :                 struct PNP_GetGlobalState *r2 = (struct PNP_GetGlobalState *)r;
     131           0 :                 if (DEBUGLEVEL >= 10) {
     132           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetGlobalState, NDR_IN, r2);
     133             :                 }
     134           0 :                 r2->out.result = _PNP_GetGlobalState(p, r2);
     135           0 :                 break;
     136             :         }
     137           0 :         case 4: { /* PNP_InitDetection */
     138           0 :                 struct PNP_InitDetection *r2 = (struct PNP_InitDetection *)r;
     139           0 :                 if (DEBUGLEVEL >= 10) {
     140           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_InitDetection, NDR_IN, r2);
     141             :                 }
     142           0 :                 r2->out.result = _PNP_InitDetection(p, r2);
     143           0 :                 break;
     144             :         }
     145           0 :         case 5: { /* PNP_ReportLogOn */
     146           0 :                 struct PNP_ReportLogOn *r2 = (struct PNP_ReportLogOn *)r;
     147           0 :                 if (DEBUGLEVEL >= 10) {
     148           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_ReportLogOn, NDR_IN, r2);
     149             :                 }
     150           0 :                 r2->out.result = _PNP_ReportLogOn(p, r2);
     151           0 :                 break;
     152             :         }
     153           0 :         case 6: { /* PNP_ValidateDeviceInstance */
     154           0 :                 struct PNP_ValidateDeviceInstance *r2 = (struct PNP_ValidateDeviceInstance *)r;
     155           0 :                 if (DEBUGLEVEL >= 10) {
     156           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_ValidateDeviceInstance, NDR_IN, r2);
     157             :                 }
     158           0 :                 r2->out.result = _PNP_ValidateDeviceInstance(p, r2);
     159           0 :                 break;
     160             :         }
     161           0 :         case 7: { /* PNP_GetRootDeviceInstance */
     162           0 :                 struct PNP_GetRootDeviceInstance *r2 = (struct PNP_GetRootDeviceInstance *)r;
     163           0 :                 if (DEBUGLEVEL >= 10) {
     164           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetRootDeviceInstance, NDR_IN, r2);
     165             :                 }
     166           0 :                 r2->out.result = _PNP_GetRootDeviceInstance(p, r2);
     167           0 :                 break;
     168             :         }
     169           0 :         case 8: { /* PNP_GetRelatedDeviceInstance */
     170           0 :                 struct PNP_GetRelatedDeviceInstance *r2 = (struct PNP_GetRelatedDeviceInstance *)r;
     171           0 :                 if (DEBUGLEVEL >= 10) {
     172           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetRelatedDeviceInstance, NDR_IN, r2);
     173             :                 }
     174           0 :                 r2->out.result = _PNP_GetRelatedDeviceInstance(p, r2);
     175           0 :                 break;
     176             :         }
     177           0 :         case 9: { /* PNP_EnumerateSubKeys */
     178           0 :                 struct PNP_EnumerateSubKeys *r2 = (struct PNP_EnumerateSubKeys *)r;
     179           0 :                 if (DEBUGLEVEL >= 10) {
     180           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_EnumerateSubKeys, NDR_IN, r2);
     181             :                 }
     182           0 :                 r2->out.result = _PNP_EnumerateSubKeys(p, r2);
     183           0 :                 break;
     184             :         }
     185          12 :         case 10: { /* PNP_GetDeviceList */
     186          12 :                 struct PNP_GetDeviceList *r2 = (struct PNP_GetDeviceList *)r;
     187          12 :                 if (DEBUGLEVEL >= 10) {
     188           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDeviceList, NDR_IN, r2);
     189             :                 }
     190          12 :                 NDR_ZERO_STRUCT(r2->out);
     191          12 :                 r2->out.length = r2->in.length;
     192          12 :                 r2->out.buffer = talloc_zero_array(r2, uint16_t, *r2->out.length);
     193          12 :                 if (r2->out.buffer == NULL) {
     194           0 :                         status = NT_STATUS_NO_MEMORY;
     195           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     196           0 :                         goto fail;
     197             :                 }
     198             : 
     199          12 :                 r2->out.result = _PNP_GetDeviceList(p, r2);
     200          12 :                 break;
     201             :         }
     202          12 :         case 11: { /* PNP_GetDeviceListSize */
     203          12 :                 struct PNP_GetDeviceListSize *r2 = (struct PNP_GetDeviceListSize *)r;
     204          12 :                 if (DEBUGLEVEL >= 10) {
     205           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDeviceListSize, NDR_IN, r2);
     206             :                 }
     207          12 :                 NDR_ZERO_STRUCT(r2->out);
     208          12 :                 r2->out.size = talloc_zero(r2, uint32_t);
     209          12 :                 if (r2->out.size == NULL) {
     210           0 :                         status = NT_STATUS_NO_MEMORY;
     211           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     212           0 :                         goto fail;
     213             :                 }
     214             : 
     215          12 :                 r2->out.result = _PNP_GetDeviceListSize(p, r2);
     216          12 :                 break;
     217             :         }
     218           0 :         case 12: { /* PNP_GetDepth */
     219           0 :                 struct PNP_GetDepth *r2 = (struct PNP_GetDepth *)r;
     220           0 :                 if (DEBUGLEVEL >= 10) {
     221           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDepth, NDR_IN, r2);
     222             :                 }
     223           0 :                 r2->out.result = _PNP_GetDepth(p, r2);
     224           0 :                 break;
     225             :         }
     226           4 :         case 13: { /* PNP_GetDeviceRegProp */
     227           4 :                 struct PNP_GetDeviceRegProp *r2 = (struct PNP_GetDeviceRegProp *)r;
     228           4 :                 if (DEBUGLEVEL >= 10) {
     229           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDeviceRegProp, NDR_IN, r2);
     230             :                 }
     231           4 :                 NDR_ZERO_STRUCT(r2->out);
     232           4 :                 r2->out.reg_data_type = r2->in.reg_data_type;
     233           4 :                 r2->out.buffer_size = r2->in.buffer_size;
     234           4 :                 r2->out.needed = r2->in.needed;
     235           4 :                 r2->out.buffer = talloc_zero_array(r2, uint8_t, *r2->out.buffer_size);
     236           4 :                 if (r2->out.buffer == NULL) {
     237           0 :                         status = NT_STATUS_NO_MEMORY;
     238           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     239           0 :                         goto fail;
     240             :                 }
     241             : 
     242           4 :                 r2->out.result = _PNP_GetDeviceRegProp(p, r2);
     243           4 :                 break;
     244             :         }
     245           0 :         case 14: { /* PNP_SetDeviceRegProp */
     246           0 :                 struct PNP_SetDeviceRegProp *r2 = (struct PNP_SetDeviceRegProp *)r;
     247           0 :                 if (DEBUGLEVEL >= 10) {
     248           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_SetDeviceRegProp, NDR_IN, r2);
     249             :                 }
     250           0 :                 r2->out.result = _PNP_SetDeviceRegProp(p, r2);
     251           0 :                 break;
     252             :         }
     253           0 :         case 15: { /* PNP_GetClassInstance */
     254           0 :                 struct PNP_GetClassInstance *r2 = (struct PNP_GetClassInstance *)r;
     255           0 :                 if (DEBUGLEVEL >= 10) {
     256           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetClassInstance, NDR_IN, r2);
     257             :                 }
     258           0 :                 r2->out.result = _PNP_GetClassInstance(p, r2);
     259           0 :                 break;
     260             :         }
     261           0 :         case 16: { /* PNP_CreateKey */
     262           0 :                 struct PNP_CreateKey *r2 = (struct PNP_CreateKey *)r;
     263           0 :                 if (DEBUGLEVEL >= 10) {
     264           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_CreateKey, NDR_IN, r2);
     265             :                 }
     266           0 :                 r2->out.result = _PNP_CreateKey(p, r2);
     267           0 :                 break;
     268             :         }
     269           0 :         case 17: { /* PNP_DeleteRegistryKey */
     270           0 :                 struct PNP_DeleteRegistryKey *r2 = (struct PNP_DeleteRegistryKey *)r;
     271           0 :                 if (DEBUGLEVEL >= 10) {
     272           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DeleteRegistryKey, NDR_IN, r2);
     273             :                 }
     274           0 :                 r2->out.result = _PNP_DeleteRegistryKey(p, r2);
     275           0 :                 break;
     276             :         }
     277           0 :         case 18: { /* PNP_GetClassCount */
     278           0 :                 struct PNP_GetClassCount *r2 = (struct PNP_GetClassCount *)r;
     279           0 :                 if (DEBUGLEVEL >= 10) {
     280           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetClassCount, NDR_IN, r2);
     281             :                 }
     282           0 :                 r2->out.result = _PNP_GetClassCount(p, r2);
     283           0 :                 break;
     284             :         }
     285           0 :         case 19: { /* PNP_GetClassName */
     286           0 :                 struct PNP_GetClassName *r2 = (struct PNP_GetClassName *)r;
     287           0 :                 if (DEBUGLEVEL >= 10) {
     288           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetClassName, NDR_IN, r2);
     289             :                 }
     290           0 :                 r2->out.result = _PNP_GetClassName(p, r2);
     291           0 :                 break;
     292             :         }
     293           0 :         case 20: { /* PNP_DeleteClassKey */
     294           0 :                 struct PNP_DeleteClassKey *r2 = (struct PNP_DeleteClassKey *)r;
     295           0 :                 if (DEBUGLEVEL >= 10) {
     296           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DeleteClassKey, NDR_IN, r2);
     297             :                 }
     298           0 :                 r2->out.result = _PNP_DeleteClassKey(p, r2);
     299           0 :                 break;
     300             :         }
     301           0 :         case 21: { /* PNP_GetInterfaceDeviceAlias */
     302           0 :                 struct PNP_GetInterfaceDeviceAlias *r2 = (struct PNP_GetInterfaceDeviceAlias *)r;
     303           0 :                 if (DEBUGLEVEL >= 10) {
     304           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetInterfaceDeviceAlias, NDR_IN, r2);
     305             :                 }
     306           0 :                 r2->out.result = _PNP_GetInterfaceDeviceAlias(p, r2);
     307           0 :                 break;
     308             :         }
     309           0 :         case 22: { /* PNP_GetInterfaceDeviceList */
     310           0 :                 struct PNP_GetInterfaceDeviceList *r2 = (struct PNP_GetInterfaceDeviceList *)r;
     311           0 :                 if (DEBUGLEVEL >= 10) {
     312           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetInterfaceDeviceList, NDR_IN, r2);
     313             :                 }
     314           0 :                 r2->out.result = _PNP_GetInterfaceDeviceList(p, r2);
     315           0 :                 break;
     316             :         }
     317           0 :         case 23: { /* PNP_GetInterfaceDeviceListSize */
     318           0 :                 struct PNP_GetInterfaceDeviceListSize *r2 = (struct PNP_GetInterfaceDeviceListSize *)r;
     319           0 :                 if (DEBUGLEVEL >= 10) {
     320           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetInterfaceDeviceListSize, NDR_IN, r2);
     321             :                 }
     322           0 :                 r2->out.result = _PNP_GetInterfaceDeviceListSize(p, r2);
     323           0 :                 break;
     324             :         }
     325           0 :         case 24: { /* PNP_RegisterDeviceClassAssociation */
     326           0 :                 struct PNP_RegisterDeviceClassAssociation *r2 = (struct PNP_RegisterDeviceClassAssociation *)r;
     327           0 :                 if (DEBUGLEVEL >= 10) {
     328           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RegisterDeviceClassAssociation, NDR_IN, r2);
     329             :                 }
     330           0 :                 r2->out.result = _PNP_RegisterDeviceClassAssociation(p, r2);
     331           0 :                 break;
     332             :         }
     333           0 :         case 25: { /* PNP_UnregisterDeviceClassAssociation */
     334           0 :                 struct PNP_UnregisterDeviceClassAssociation *r2 = (struct PNP_UnregisterDeviceClassAssociation *)r;
     335           0 :                 if (DEBUGLEVEL >= 10) {
     336           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_UnregisterDeviceClassAssociation, NDR_IN, r2);
     337             :                 }
     338           0 :                 r2->out.result = _PNP_UnregisterDeviceClassAssociation(p, r2);
     339           0 :                 break;
     340             :         }
     341           0 :         case 26: { /* PNP_GetClassRegProp */
     342           0 :                 struct PNP_GetClassRegProp *r2 = (struct PNP_GetClassRegProp *)r;
     343           0 :                 if (DEBUGLEVEL >= 10) {
     344           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetClassRegProp, NDR_IN, r2);
     345             :                 }
     346           0 :                 r2->out.result = _PNP_GetClassRegProp(p, r2);
     347           0 :                 break;
     348             :         }
     349           0 :         case 27: { /* PNP_SetClassRegProp */
     350           0 :                 struct PNP_SetClassRegProp *r2 = (struct PNP_SetClassRegProp *)r;
     351           0 :                 if (DEBUGLEVEL >= 10) {
     352           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_SetClassRegProp, NDR_IN, r2);
     353             :                 }
     354           0 :                 r2->out.result = _PNP_SetClassRegProp(p, r2);
     355           0 :                 break;
     356             :         }
     357           0 :         case 28: { /* PNP_CreateDevInst */
     358           0 :                 struct PNP_CreateDevInst *r2 = (struct PNP_CreateDevInst *)r;
     359           0 :                 if (DEBUGLEVEL >= 10) {
     360           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_CreateDevInst, NDR_IN, r2);
     361             :                 }
     362           0 :                 r2->out.result = _PNP_CreateDevInst(p, r2);
     363           0 :                 break;
     364             :         }
     365           0 :         case 29: { /* PNP_DeviceInstanceAction */
     366           0 :                 struct PNP_DeviceInstanceAction *r2 = (struct PNP_DeviceInstanceAction *)r;
     367           0 :                 if (DEBUGLEVEL >= 10) {
     368           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DeviceInstanceAction, NDR_IN, r2);
     369             :                 }
     370           0 :                 r2->out.result = _PNP_DeviceInstanceAction(p, r2);
     371           0 :                 break;
     372             :         }
     373           0 :         case 30: { /* PNP_GetDeviceStatus */
     374           0 :                 struct PNP_GetDeviceStatus *r2 = (struct PNP_GetDeviceStatus *)r;
     375           0 :                 if (DEBUGLEVEL >= 10) {
     376           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDeviceStatus, NDR_IN, r2);
     377             :                 }
     378           0 :                 r2->out.result = _PNP_GetDeviceStatus(p, r2);
     379           0 :                 break;
     380             :         }
     381           0 :         case 31: { /* PNP_SetDeviceProblem */
     382           0 :                 struct PNP_SetDeviceProblem *r2 = (struct PNP_SetDeviceProblem *)r;
     383           0 :                 if (DEBUGLEVEL >= 10) {
     384           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_SetDeviceProblem, NDR_IN, r2);
     385             :                 }
     386           0 :                 r2->out.result = _PNP_SetDeviceProblem(p, r2);
     387           0 :                 break;
     388             :         }
     389           0 :         case 32: { /* PNP_DisableDevInst */
     390           0 :                 struct PNP_DisableDevInst *r2 = (struct PNP_DisableDevInst *)r;
     391           0 :                 if (DEBUGLEVEL >= 10) {
     392           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DisableDevInst, NDR_IN, r2);
     393             :                 }
     394           0 :                 r2->out.result = _PNP_DisableDevInst(p, r2);
     395           0 :                 break;
     396             :         }
     397           0 :         case 33: { /* PNP_UninstallDevInst */
     398           0 :                 struct PNP_UninstallDevInst *r2 = (struct PNP_UninstallDevInst *)r;
     399           0 :                 if (DEBUGLEVEL >= 10) {
     400           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_UninstallDevInst, NDR_IN, r2);
     401             :                 }
     402           0 :                 r2->out.result = _PNP_UninstallDevInst(p, r2);
     403           0 :                 break;
     404             :         }
     405           0 :         case 34: { /* PNP_AddID */
     406           0 :                 struct PNP_AddID *r2 = (struct PNP_AddID *)r;
     407           0 :                 if (DEBUGLEVEL >= 10) {
     408           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_AddID, NDR_IN, r2);
     409             :                 }
     410           0 :                 r2->out.result = _PNP_AddID(p, r2);
     411           0 :                 break;
     412             :         }
     413           0 :         case 35: { /* PNP_RegisterDriver */
     414           0 :                 struct PNP_RegisterDriver *r2 = (struct PNP_RegisterDriver *)r;
     415           0 :                 if (DEBUGLEVEL >= 10) {
     416           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RegisterDriver, NDR_IN, r2);
     417             :                 }
     418           0 :                 r2->out.result = _PNP_RegisterDriver(p, r2);
     419           0 :                 break;
     420             :         }
     421           0 :         case 36: { /* PNP_QueryRemove */
     422           0 :                 struct PNP_QueryRemove *r2 = (struct PNP_QueryRemove *)r;
     423           0 :                 if (DEBUGLEVEL >= 10) {
     424           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_QueryRemove, NDR_IN, r2);
     425             :                 }
     426           0 :                 r2->out.result = _PNP_QueryRemove(p, r2);
     427           0 :                 break;
     428             :         }
     429           0 :         case 37: { /* PNP_RequestDeviceEject */
     430           0 :                 struct PNP_RequestDeviceEject *r2 = (struct PNP_RequestDeviceEject *)r;
     431           0 :                 if (DEBUGLEVEL >= 10) {
     432           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RequestDeviceEject, NDR_IN, r2);
     433             :                 }
     434           0 :                 r2->out.result = _PNP_RequestDeviceEject(p, r2);
     435           0 :                 break;
     436             :         }
     437           0 :         case 38: { /* PNP_IsDockStationPresent */
     438           0 :                 struct PNP_IsDockStationPresent *r2 = (struct PNP_IsDockStationPresent *)r;
     439           0 :                 if (DEBUGLEVEL >= 10) {
     440           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_IsDockStationPresent, NDR_IN, r2);
     441             :                 }
     442           0 :                 r2->out.result = _PNP_IsDockStationPresent(p, r2);
     443           0 :                 break;
     444             :         }
     445           0 :         case 39: { /* PNP_RequestEjectPC */
     446           0 :                 struct PNP_RequestEjectPC *r2 = (struct PNP_RequestEjectPC *)r;
     447           0 :                 if (DEBUGLEVEL >= 10) {
     448           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RequestEjectPC, NDR_IN, r2);
     449             :                 }
     450           0 :                 r2->out.result = _PNP_RequestEjectPC(p, r2);
     451           0 :                 break;
     452             :         }
     453           0 :         case 40: { /* PNP_HwProfFlags */
     454           0 :                 struct PNP_HwProfFlags *r2 = (struct PNP_HwProfFlags *)r;
     455           0 :                 if (DEBUGLEVEL >= 10) {
     456           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_HwProfFlags, NDR_IN, r2);
     457             :                 }
     458           0 :                 NDR_ZERO_STRUCT(r2->out);
     459           0 :                 r2->out.profile_flags = r2->in.profile_flags;
     460           0 :                 r2->out.veto_type = r2->in.veto_type;
     461           0 :                 r2->out.unknown5a = talloc_zero(r2, const char *);
     462           0 :                 if (r2->out.unknown5a == NULL) {
     463           0 :                         status = NT_STATUS_NO_MEMORY;
     464           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     465           0 :                         goto fail;
     466             :                 }
     467             : 
     468           0 :                 r2->out.result = _PNP_HwProfFlags(p, r2);
     469           0 :                 break;
     470             :         }
     471           0 :         case 41: { /* PNP_GetHwProfInfo */
     472           0 :                 struct PNP_GetHwProfInfo *r2 = (struct PNP_GetHwProfInfo *)r;
     473           0 :                 if (DEBUGLEVEL >= 10) {
     474           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetHwProfInfo, NDR_IN, r2);
     475             :                 }
     476           0 :                 NDR_ZERO_STRUCT(r2->out);
     477           0 :                 r2->out.info = r2->in.info;
     478           0 :                 r2->out.result = _PNP_GetHwProfInfo(p, r2);
     479           0 :                 break;
     480             :         }
     481           0 :         case 42: { /* PNP_AddEmptyLogConf */
     482           0 :                 struct PNP_AddEmptyLogConf *r2 = (struct PNP_AddEmptyLogConf *)r;
     483           0 :                 if (DEBUGLEVEL >= 10) {
     484           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_AddEmptyLogConf, NDR_IN, r2);
     485             :                 }
     486           0 :                 r2->out.result = _PNP_AddEmptyLogConf(p, r2);
     487           0 :                 break;
     488             :         }
     489           0 :         case 43: { /* PNP_FreeLogConf */
     490           0 :                 struct PNP_FreeLogConf *r2 = (struct PNP_FreeLogConf *)r;
     491           0 :                 if (DEBUGLEVEL >= 10) {
     492           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_FreeLogConf, NDR_IN, r2);
     493             :                 }
     494           0 :                 r2->out.result = _PNP_FreeLogConf(p, r2);
     495           0 :                 break;
     496             :         }
     497           0 :         case 44: { /* PNP_GetFirstLogConf */
     498           0 :                 struct PNP_GetFirstLogConf *r2 = (struct PNP_GetFirstLogConf *)r;
     499           0 :                 if (DEBUGLEVEL >= 10) {
     500           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetFirstLogConf, NDR_IN, r2);
     501             :                 }
     502           0 :                 r2->out.result = _PNP_GetFirstLogConf(p, r2);
     503           0 :                 break;
     504             :         }
     505           0 :         case 45: { /* PNP_GetNextLogConf */
     506           0 :                 struct PNP_GetNextLogConf *r2 = (struct PNP_GetNextLogConf *)r;
     507           0 :                 if (DEBUGLEVEL >= 10) {
     508           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetNextLogConf, NDR_IN, r2);
     509             :                 }
     510           0 :                 r2->out.result = _PNP_GetNextLogConf(p, r2);
     511           0 :                 break;
     512             :         }
     513           0 :         case 46: { /* PNP_GetLogConfPriority */
     514           0 :                 struct PNP_GetLogConfPriority *r2 = (struct PNP_GetLogConfPriority *)r;
     515           0 :                 if (DEBUGLEVEL >= 10) {
     516           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetLogConfPriority, NDR_IN, r2);
     517             :                 }
     518           0 :                 r2->out.result = _PNP_GetLogConfPriority(p, r2);
     519           0 :                 break;
     520             :         }
     521           0 :         case 47: { /* PNP_AddResDes */
     522           0 :                 struct PNP_AddResDes *r2 = (struct PNP_AddResDes *)r;
     523           0 :                 if (DEBUGLEVEL >= 10) {
     524           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_AddResDes, NDR_IN, r2);
     525             :                 }
     526           0 :                 r2->out.result = _PNP_AddResDes(p, r2);
     527           0 :                 break;
     528             :         }
     529           0 :         case 48: { /* PNP_FreeResDes */
     530           0 :                 struct PNP_FreeResDes *r2 = (struct PNP_FreeResDes *)r;
     531           0 :                 if (DEBUGLEVEL >= 10) {
     532           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_FreeResDes, NDR_IN, r2);
     533             :                 }
     534           0 :                 r2->out.result = _PNP_FreeResDes(p, r2);
     535           0 :                 break;
     536             :         }
     537           0 :         case 49: { /* PNP_GetNextResDes */
     538           0 :                 struct PNP_GetNextResDes *r2 = (struct PNP_GetNextResDes *)r;
     539           0 :                 if (DEBUGLEVEL >= 10) {
     540           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetNextResDes, NDR_IN, r2);
     541             :                 }
     542           0 :                 r2->out.result = _PNP_GetNextResDes(p, r2);
     543           0 :                 break;
     544             :         }
     545           0 :         case 50: { /* PNP_GetResDesData */
     546           0 :                 struct PNP_GetResDesData *r2 = (struct PNP_GetResDesData *)r;
     547           0 :                 if (DEBUGLEVEL >= 10) {
     548           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetResDesData, NDR_IN, r2);
     549             :                 }
     550           0 :                 r2->out.result = _PNP_GetResDesData(p, r2);
     551           0 :                 break;
     552             :         }
     553           0 :         case 51: { /* PNP_GetResDesDataSize */
     554           0 :                 struct PNP_GetResDesDataSize *r2 = (struct PNP_GetResDesDataSize *)r;
     555           0 :                 if (DEBUGLEVEL >= 10) {
     556           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetResDesDataSize, NDR_IN, r2);
     557             :                 }
     558           0 :                 r2->out.result = _PNP_GetResDesDataSize(p, r2);
     559           0 :                 break;
     560             :         }
     561           0 :         case 52: { /* PNP_ModifyResDes */
     562           0 :                 struct PNP_ModifyResDes *r2 = (struct PNP_ModifyResDes *)r;
     563           0 :                 if (DEBUGLEVEL >= 10) {
     564           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_ModifyResDes, NDR_IN, r2);
     565             :                 }
     566           0 :                 r2->out.result = _PNP_ModifyResDes(p, r2);
     567           0 :                 break;
     568             :         }
     569           0 :         case 53: { /* PNP_DetectResourceLimit */
     570           0 :                 struct PNP_DetectResourceLimit *r2 = (struct PNP_DetectResourceLimit *)r;
     571           0 :                 if (DEBUGLEVEL >= 10) {
     572           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DetectResourceLimit, NDR_IN, r2);
     573             :                 }
     574           0 :                 r2->out.result = _PNP_DetectResourceLimit(p, r2);
     575           0 :                 break;
     576             :         }
     577           0 :         case 54: { /* PNP_QueryResConfList */
     578           0 :                 struct PNP_QueryResConfList *r2 = (struct PNP_QueryResConfList *)r;
     579           0 :                 if (DEBUGLEVEL >= 10) {
     580           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_QueryResConfList, NDR_IN, r2);
     581             :                 }
     582           0 :                 r2->out.result = _PNP_QueryResConfList(p, r2);
     583           0 :                 break;
     584             :         }
     585           0 :         case 55: { /* PNP_SetHwProf */
     586           0 :                 struct PNP_SetHwProf *r2 = (struct PNP_SetHwProf *)r;
     587           0 :                 if (DEBUGLEVEL >= 10) {
     588           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_SetHwProf, NDR_IN, r2);
     589             :                 }
     590           0 :                 r2->out.result = _PNP_SetHwProf(p, r2);
     591           0 :                 break;
     592             :         }
     593           0 :         case 56: { /* PNP_QueryArbitratorFreeData */
     594           0 :                 struct PNP_QueryArbitratorFreeData *r2 = (struct PNP_QueryArbitratorFreeData *)r;
     595           0 :                 if (DEBUGLEVEL >= 10) {
     596           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_QueryArbitratorFreeData, NDR_IN, r2);
     597             :                 }
     598           0 :                 r2->out.result = _PNP_QueryArbitratorFreeData(p, r2);
     599           0 :                 break;
     600             :         }
     601           0 :         case 57: { /* PNP_QueryArbitratorFreeSize */
     602           0 :                 struct PNP_QueryArbitratorFreeSize *r2 = (struct PNP_QueryArbitratorFreeSize *)r;
     603           0 :                 if (DEBUGLEVEL >= 10) {
     604           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_QueryArbitratorFreeSize, NDR_IN, r2);
     605             :                 }
     606           0 :                 r2->out.result = _PNP_QueryArbitratorFreeSize(p, r2);
     607           0 :                 break;
     608             :         }
     609           0 :         case 58: { /* PNP_RunDetection */
     610           0 :                 struct PNP_RunDetection *r2 = (struct PNP_RunDetection *)r;
     611           0 :                 if (DEBUGLEVEL >= 10) {
     612           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RunDetection, NDR_IN, r2);
     613             :                 }
     614           0 :                 r2->out.result = _PNP_RunDetection(p, r2);
     615           0 :                 break;
     616             :         }
     617           0 :         case 59: { /* PNP_RegisterNotification */
     618           0 :                 struct PNP_RegisterNotification *r2 = (struct PNP_RegisterNotification *)r;
     619           0 :                 if (DEBUGLEVEL >= 10) {
     620           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RegisterNotification, NDR_IN, r2);
     621             :                 }
     622           0 :                 r2->out.result = _PNP_RegisterNotification(p, r2);
     623           0 :                 break;
     624             :         }
     625           0 :         case 60: { /* PNP_UnregisterNotification */
     626           0 :                 struct PNP_UnregisterNotification *r2 = (struct PNP_UnregisterNotification *)r;
     627           0 :                 if (DEBUGLEVEL >= 10) {
     628           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_UnregisterNotification, NDR_IN, r2);
     629             :                 }
     630           0 :                 r2->out.result = _PNP_UnregisterNotification(p, r2);
     631           0 :                 break;
     632             :         }
     633           0 :         case 61: { /* PNP_GetCustomDevProp */
     634           0 :                 struct PNP_GetCustomDevProp *r2 = (struct PNP_GetCustomDevProp *)r;
     635           0 :                 if (DEBUGLEVEL >= 10) {
     636           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetCustomDevProp, NDR_IN, r2);
     637             :                 }
     638           0 :                 r2->out.result = _PNP_GetCustomDevProp(p, r2);
     639           0 :                 break;
     640             :         }
     641           0 :         case 62: { /* PNP_GetVersionInternal */
     642           0 :                 struct PNP_GetVersionInternal *r2 = (struct PNP_GetVersionInternal *)r;
     643           0 :                 if (DEBUGLEVEL >= 10) {
     644           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetVersionInternal, NDR_IN, r2);
     645             :                 }
     646           0 :                 r2->out.result = _PNP_GetVersionInternal(p, r2);
     647           0 :                 break;
     648             :         }
     649           0 :         case 63: { /* PNP_GetBlockedDriverInfo */
     650           0 :                 struct PNP_GetBlockedDriverInfo *r2 = (struct PNP_GetBlockedDriverInfo *)r;
     651           0 :                 if (DEBUGLEVEL >= 10) {
     652           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetBlockedDriverInfo, NDR_IN, r2);
     653             :                 }
     654           0 :                 r2->out.result = _PNP_GetBlockedDriverInfo(p, r2);
     655           0 :                 break;
     656             :         }
     657           0 :         case 64: { /* PNP_GetServerSideDeviceInstallFlags */
     658           0 :                 struct PNP_GetServerSideDeviceInstallFlags *r2 = (struct PNP_GetServerSideDeviceInstallFlags *)r;
     659           0 :                 if (DEBUGLEVEL >= 10) {
     660           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetServerSideDeviceInstallFlags, NDR_IN, r2);
     661             :                 }
     662           0 :                 r2->out.result = _PNP_GetServerSideDeviceInstallFlags(p, r2);
     663           0 :                 break;
     664             :         }
     665           0 :         default:
     666           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     667           0 :                 break;
     668             :         }
     669             : 
     670          32 : fail:
     671             :         /* Unimpersonate */
     672          32 :         if (impersonated) {
     673          32 :                 unbecome_authenticated_pipe_user();
     674             :         }
     675             : 
     676          32 :         p->dce_call = NULL;
     677          32 :         p->mem_ctx = NULL;
     678             :         /* Restore session info */
     679          32 :         p->session_info = pipe_session_info;
     680          32 :         p->auth.auth_type = 0;
     681          32 :         p->auth.auth_level = 0;
     682          32 :         p->auth.auth_context_id = 0;
     683             :         /* Check pipes struct fault state */
     684          32 :         if (p->fault_state != 0) {
     685           0 :                 dce_call->fault_code = p->fault_state;
     686             :         }
     687          32 :         if (dce_call->fault_code != 0) {
     688           0 :                 status = NT_STATUS_NET_WRITE_FAULT;
     689             :         }
     690             : 
     691          32 :         return status;
     692             : }
     693             : 
     694          32 : NTSTATUS ntsvcs__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     695             : {
     696          32 :         return ntsvcs__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL);
     697             : }
     698             : 
     699          32 : NTSTATUS ntsvcs__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     700             : {
     701          32 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     702             : 
     703          32 :         switch (opnum) {
     704           0 :         case 0: { /* PNP_Disconnect */
     705           0 :                 struct PNP_Disconnect *r2 = (struct PNP_Disconnect *)r;
     706           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     707           0 :                         DEBUG(5,("function PNP_Disconnect replied async\n"));
     708             :                 }
     709           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     710           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_Disconnect, NDR_OUT | NDR_SET_VALUES, r2);
     711             :                 }
     712           0 :                 if (dce_call->fault_code != 0) {
     713           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_Disconnect\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     714             :                 }
     715           0 :                 break;
     716             :         }
     717           0 :         case 1: { /* PNP_Connect */
     718           0 :                 struct PNP_Connect *r2 = (struct PNP_Connect *)r;
     719           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     720           0 :                         DEBUG(5,("function PNP_Connect replied async\n"));
     721             :                 }
     722           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     723           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_Connect, NDR_OUT | NDR_SET_VALUES, r2);
     724             :                 }
     725           0 :                 if (dce_call->fault_code != 0) {
     726           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_Connect\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     727             :                 }
     728           0 :                 break;
     729             :         }
     730           4 :         case 2: { /* PNP_GetVersion */
     731           4 :                 struct PNP_GetVersion *r2 = (struct PNP_GetVersion *)r;
     732           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     733           0 :                         DEBUG(5,("function PNP_GetVersion replied async\n"));
     734             :                 }
     735           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     736           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetVersion, NDR_OUT | NDR_SET_VALUES, r2);
     737             :                 }
     738           4 :                 if (dce_call->fault_code != 0) {
     739           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetVersion\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     740             :                 }
     741           4 :                 break;
     742             :         }
     743           0 :         case 3: { /* PNP_GetGlobalState */
     744           0 :                 struct PNP_GetGlobalState *r2 = (struct PNP_GetGlobalState *)r;
     745           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     746           0 :                         DEBUG(5,("function PNP_GetGlobalState replied async\n"));
     747             :                 }
     748           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     749           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetGlobalState, NDR_OUT | NDR_SET_VALUES, r2);
     750             :                 }
     751           0 :                 if (dce_call->fault_code != 0) {
     752           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetGlobalState\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     753             :                 }
     754           0 :                 break;
     755             :         }
     756           0 :         case 4: { /* PNP_InitDetection */
     757           0 :                 struct PNP_InitDetection *r2 = (struct PNP_InitDetection *)r;
     758           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     759           0 :                         DEBUG(5,("function PNP_InitDetection replied async\n"));
     760             :                 }
     761           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     762           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_InitDetection, NDR_OUT | NDR_SET_VALUES, r2);
     763             :                 }
     764           0 :                 if (dce_call->fault_code != 0) {
     765           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_InitDetection\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     766             :                 }
     767           0 :                 break;
     768             :         }
     769           0 :         case 5: { /* PNP_ReportLogOn */
     770           0 :                 struct PNP_ReportLogOn *r2 = (struct PNP_ReportLogOn *)r;
     771           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     772           0 :                         DEBUG(5,("function PNP_ReportLogOn replied async\n"));
     773             :                 }
     774           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     775           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_ReportLogOn, NDR_OUT | NDR_SET_VALUES, r2);
     776             :                 }
     777           0 :                 if (dce_call->fault_code != 0) {
     778           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_ReportLogOn\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     779             :                 }
     780           0 :                 break;
     781             :         }
     782           0 :         case 6: { /* PNP_ValidateDeviceInstance */
     783           0 :                 struct PNP_ValidateDeviceInstance *r2 = (struct PNP_ValidateDeviceInstance *)r;
     784           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     785           0 :                         DEBUG(5,("function PNP_ValidateDeviceInstance replied async\n"));
     786             :                 }
     787           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     788           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_ValidateDeviceInstance, NDR_OUT | NDR_SET_VALUES, r2);
     789             :                 }
     790           0 :                 if (dce_call->fault_code != 0) {
     791           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_ValidateDeviceInstance\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     792             :                 }
     793           0 :                 break;
     794             :         }
     795           0 :         case 7: { /* PNP_GetRootDeviceInstance */
     796           0 :                 struct PNP_GetRootDeviceInstance *r2 = (struct PNP_GetRootDeviceInstance *)r;
     797           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     798           0 :                         DEBUG(5,("function PNP_GetRootDeviceInstance replied async\n"));
     799             :                 }
     800           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     801           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetRootDeviceInstance, NDR_OUT | NDR_SET_VALUES, r2);
     802             :                 }
     803           0 :                 if (dce_call->fault_code != 0) {
     804           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetRootDeviceInstance\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     805             :                 }
     806           0 :                 break;
     807             :         }
     808           0 :         case 8: { /* PNP_GetRelatedDeviceInstance */
     809           0 :                 struct PNP_GetRelatedDeviceInstance *r2 = (struct PNP_GetRelatedDeviceInstance *)r;
     810           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     811           0 :                         DEBUG(5,("function PNP_GetRelatedDeviceInstance replied async\n"));
     812             :                 }
     813           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     814           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetRelatedDeviceInstance, NDR_OUT | NDR_SET_VALUES, r2);
     815             :                 }
     816           0 :                 if (dce_call->fault_code != 0) {
     817           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetRelatedDeviceInstance\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     818             :                 }
     819           0 :                 break;
     820             :         }
     821           0 :         case 9: { /* PNP_EnumerateSubKeys */
     822           0 :                 struct PNP_EnumerateSubKeys *r2 = (struct PNP_EnumerateSubKeys *)r;
     823           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     824           0 :                         DEBUG(5,("function PNP_EnumerateSubKeys replied async\n"));
     825             :                 }
     826           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     827           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_EnumerateSubKeys, NDR_OUT | NDR_SET_VALUES, r2);
     828             :                 }
     829           0 :                 if (dce_call->fault_code != 0) {
     830           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_EnumerateSubKeys\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     831             :                 }
     832           0 :                 break;
     833             :         }
     834          12 :         case 10: { /* PNP_GetDeviceList */
     835          12 :                 struct PNP_GetDeviceList *r2 = (struct PNP_GetDeviceList *)r;
     836          12 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     837           0 :                         DEBUG(5,("function PNP_GetDeviceList replied async\n"));
     838             :                 }
     839          12 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     840           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDeviceList, NDR_OUT | NDR_SET_VALUES, r2);
     841             :                 }
     842          12 :                 if (dce_call->fault_code != 0) {
     843           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetDeviceList\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     844             :                 }
     845          12 :                 break;
     846             :         }
     847          12 :         case 11: { /* PNP_GetDeviceListSize */
     848          12 :                 struct PNP_GetDeviceListSize *r2 = (struct PNP_GetDeviceListSize *)r;
     849          12 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     850           0 :                         DEBUG(5,("function PNP_GetDeviceListSize replied async\n"));
     851             :                 }
     852          12 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     853           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDeviceListSize, NDR_OUT | NDR_SET_VALUES, r2);
     854             :                 }
     855          12 :                 if (dce_call->fault_code != 0) {
     856           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetDeviceListSize\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     857             :                 }
     858          12 :                 break;
     859             :         }
     860           0 :         case 12: { /* PNP_GetDepth */
     861           0 :                 struct PNP_GetDepth *r2 = (struct PNP_GetDepth *)r;
     862           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     863           0 :                         DEBUG(5,("function PNP_GetDepth replied async\n"));
     864             :                 }
     865           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     866           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDepth, NDR_OUT | NDR_SET_VALUES, r2);
     867             :                 }
     868           0 :                 if (dce_call->fault_code != 0) {
     869           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetDepth\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     870             :                 }
     871           0 :                 break;
     872             :         }
     873           4 :         case 13: { /* PNP_GetDeviceRegProp */
     874           4 :                 struct PNP_GetDeviceRegProp *r2 = (struct PNP_GetDeviceRegProp *)r;
     875           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     876           0 :                         DEBUG(5,("function PNP_GetDeviceRegProp replied async\n"));
     877             :                 }
     878           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     879           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDeviceRegProp, NDR_OUT | NDR_SET_VALUES, r2);
     880             :                 }
     881           4 :                 if (dce_call->fault_code != 0) {
     882           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetDeviceRegProp\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     883             :                 }
     884           4 :                 break;
     885             :         }
     886           0 :         case 14: { /* PNP_SetDeviceRegProp */
     887           0 :                 struct PNP_SetDeviceRegProp *r2 = (struct PNP_SetDeviceRegProp *)r;
     888           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     889           0 :                         DEBUG(5,("function PNP_SetDeviceRegProp replied async\n"));
     890             :                 }
     891           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     892           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_SetDeviceRegProp, NDR_OUT | NDR_SET_VALUES, r2);
     893             :                 }
     894           0 :                 if (dce_call->fault_code != 0) {
     895           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_SetDeviceRegProp\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     896             :                 }
     897           0 :                 break;
     898             :         }
     899           0 :         case 15: { /* PNP_GetClassInstance */
     900           0 :                 struct PNP_GetClassInstance *r2 = (struct PNP_GetClassInstance *)r;
     901           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     902           0 :                         DEBUG(5,("function PNP_GetClassInstance replied async\n"));
     903             :                 }
     904           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     905           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetClassInstance, NDR_OUT | NDR_SET_VALUES, r2);
     906             :                 }
     907           0 :                 if (dce_call->fault_code != 0) {
     908           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetClassInstance\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     909             :                 }
     910           0 :                 break;
     911             :         }
     912           0 :         case 16: { /* PNP_CreateKey */
     913           0 :                 struct PNP_CreateKey *r2 = (struct PNP_CreateKey *)r;
     914           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     915           0 :                         DEBUG(5,("function PNP_CreateKey replied async\n"));
     916             :                 }
     917           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     918           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_CreateKey, NDR_OUT | NDR_SET_VALUES, r2);
     919             :                 }
     920           0 :                 if (dce_call->fault_code != 0) {
     921           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_CreateKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     922             :                 }
     923           0 :                 break;
     924             :         }
     925           0 :         case 17: { /* PNP_DeleteRegistryKey */
     926           0 :                 struct PNP_DeleteRegistryKey *r2 = (struct PNP_DeleteRegistryKey *)r;
     927           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     928           0 :                         DEBUG(5,("function PNP_DeleteRegistryKey replied async\n"));
     929             :                 }
     930           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     931           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DeleteRegistryKey, NDR_OUT | NDR_SET_VALUES, r2);
     932             :                 }
     933           0 :                 if (dce_call->fault_code != 0) {
     934           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_DeleteRegistryKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     935             :                 }
     936           0 :                 break;
     937             :         }
     938           0 :         case 18: { /* PNP_GetClassCount */
     939           0 :                 struct PNP_GetClassCount *r2 = (struct PNP_GetClassCount *)r;
     940           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     941           0 :                         DEBUG(5,("function PNP_GetClassCount replied async\n"));
     942             :                 }
     943           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     944           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetClassCount, NDR_OUT | NDR_SET_VALUES, r2);
     945             :                 }
     946           0 :                 if (dce_call->fault_code != 0) {
     947           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetClassCount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     948             :                 }
     949           0 :                 break;
     950             :         }
     951           0 :         case 19: { /* PNP_GetClassName */
     952           0 :                 struct PNP_GetClassName *r2 = (struct PNP_GetClassName *)r;
     953           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     954           0 :                         DEBUG(5,("function PNP_GetClassName replied async\n"));
     955             :                 }
     956           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     957           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetClassName, NDR_OUT | NDR_SET_VALUES, r2);
     958             :                 }
     959           0 :                 if (dce_call->fault_code != 0) {
     960           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetClassName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     961             :                 }
     962           0 :                 break;
     963             :         }
     964           0 :         case 20: { /* PNP_DeleteClassKey */
     965           0 :                 struct PNP_DeleteClassKey *r2 = (struct PNP_DeleteClassKey *)r;
     966           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     967           0 :                         DEBUG(5,("function PNP_DeleteClassKey replied async\n"));
     968             :                 }
     969           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     970           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DeleteClassKey, NDR_OUT | NDR_SET_VALUES, r2);
     971             :                 }
     972           0 :                 if (dce_call->fault_code != 0) {
     973           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_DeleteClassKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     974             :                 }
     975           0 :                 break;
     976             :         }
     977           0 :         case 21: { /* PNP_GetInterfaceDeviceAlias */
     978           0 :                 struct PNP_GetInterfaceDeviceAlias *r2 = (struct PNP_GetInterfaceDeviceAlias *)r;
     979           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     980           0 :                         DEBUG(5,("function PNP_GetInterfaceDeviceAlias replied async\n"));
     981             :                 }
     982           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     983           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetInterfaceDeviceAlias, NDR_OUT | NDR_SET_VALUES, r2);
     984             :                 }
     985           0 :                 if (dce_call->fault_code != 0) {
     986           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetInterfaceDeviceAlias\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
     987             :                 }
     988           0 :                 break;
     989             :         }
     990           0 :         case 22: { /* PNP_GetInterfaceDeviceList */
     991           0 :                 struct PNP_GetInterfaceDeviceList *r2 = (struct PNP_GetInterfaceDeviceList *)r;
     992           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     993           0 :                         DEBUG(5,("function PNP_GetInterfaceDeviceList replied async\n"));
     994             :                 }
     995           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     996           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetInterfaceDeviceList, NDR_OUT | NDR_SET_VALUES, r2);
     997             :                 }
     998           0 :                 if (dce_call->fault_code != 0) {
     999           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetInterfaceDeviceList\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1000             :                 }
    1001           0 :                 break;
    1002             :         }
    1003           0 :         case 23: { /* PNP_GetInterfaceDeviceListSize */
    1004           0 :                 struct PNP_GetInterfaceDeviceListSize *r2 = (struct PNP_GetInterfaceDeviceListSize *)r;
    1005           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1006           0 :                         DEBUG(5,("function PNP_GetInterfaceDeviceListSize replied async\n"));
    1007             :                 }
    1008           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1009           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetInterfaceDeviceListSize, NDR_OUT | NDR_SET_VALUES, r2);
    1010             :                 }
    1011           0 :                 if (dce_call->fault_code != 0) {
    1012           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetInterfaceDeviceListSize\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1013             :                 }
    1014           0 :                 break;
    1015             :         }
    1016           0 :         case 24: { /* PNP_RegisterDeviceClassAssociation */
    1017           0 :                 struct PNP_RegisterDeviceClassAssociation *r2 = (struct PNP_RegisterDeviceClassAssociation *)r;
    1018           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1019           0 :                         DEBUG(5,("function PNP_RegisterDeviceClassAssociation replied async\n"));
    1020             :                 }
    1021           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1022           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RegisterDeviceClassAssociation, NDR_OUT | NDR_SET_VALUES, r2);
    1023             :                 }
    1024           0 :                 if (dce_call->fault_code != 0) {
    1025           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_RegisterDeviceClassAssociation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1026             :                 }
    1027           0 :                 break;
    1028             :         }
    1029           0 :         case 25: { /* PNP_UnregisterDeviceClassAssociation */
    1030           0 :                 struct PNP_UnregisterDeviceClassAssociation *r2 = (struct PNP_UnregisterDeviceClassAssociation *)r;
    1031           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1032           0 :                         DEBUG(5,("function PNP_UnregisterDeviceClassAssociation replied async\n"));
    1033             :                 }
    1034           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1035           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_UnregisterDeviceClassAssociation, NDR_OUT | NDR_SET_VALUES, r2);
    1036             :                 }
    1037           0 :                 if (dce_call->fault_code != 0) {
    1038           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_UnregisterDeviceClassAssociation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1039             :                 }
    1040           0 :                 break;
    1041             :         }
    1042           0 :         case 26: { /* PNP_GetClassRegProp */
    1043           0 :                 struct PNP_GetClassRegProp *r2 = (struct PNP_GetClassRegProp *)r;
    1044           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1045           0 :                         DEBUG(5,("function PNP_GetClassRegProp replied async\n"));
    1046             :                 }
    1047           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1048           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetClassRegProp, NDR_OUT | NDR_SET_VALUES, r2);
    1049             :                 }
    1050           0 :                 if (dce_call->fault_code != 0) {
    1051           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetClassRegProp\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1052             :                 }
    1053           0 :                 break;
    1054             :         }
    1055           0 :         case 27: { /* PNP_SetClassRegProp */
    1056           0 :                 struct PNP_SetClassRegProp *r2 = (struct PNP_SetClassRegProp *)r;
    1057           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1058           0 :                         DEBUG(5,("function PNP_SetClassRegProp replied async\n"));
    1059             :                 }
    1060           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1061           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_SetClassRegProp, NDR_OUT | NDR_SET_VALUES, r2);
    1062             :                 }
    1063           0 :                 if (dce_call->fault_code != 0) {
    1064           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_SetClassRegProp\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1065             :                 }
    1066           0 :                 break;
    1067             :         }
    1068           0 :         case 28: { /* PNP_CreateDevInst */
    1069           0 :                 struct PNP_CreateDevInst *r2 = (struct PNP_CreateDevInst *)r;
    1070           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1071           0 :                         DEBUG(5,("function PNP_CreateDevInst replied async\n"));
    1072             :                 }
    1073           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1074           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_CreateDevInst, NDR_OUT | NDR_SET_VALUES, r2);
    1075             :                 }
    1076           0 :                 if (dce_call->fault_code != 0) {
    1077           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_CreateDevInst\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1078             :                 }
    1079           0 :                 break;
    1080             :         }
    1081           0 :         case 29: { /* PNP_DeviceInstanceAction */
    1082           0 :                 struct PNP_DeviceInstanceAction *r2 = (struct PNP_DeviceInstanceAction *)r;
    1083           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1084           0 :                         DEBUG(5,("function PNP_DeviceInstanceAction replied async\n"));
    1085             :                 }
    1086           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1087           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DeviceInstanceAction, NDR_OUT | NDR_SET_VALUES, r2);
    1088             :                 }
    1089           0 :                 if (dce_call->fault_code != 0) {
    1090           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_DeviceInstanceAction\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1091             :                 }
    1092           0 :                 break;
    1093             :         }
    1094           0 :         case 30: { /* PNP_GetDeviceStatus */
    1095           0 :                 struct PNP_GetDeviceStatus *r2 = (struct PNP_GetDeviceStatus *)r;
    1096           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1097           0 :                         DEBUG(5,("function PNP_GetDeviceStatus replied async\n"));
    1098             :                 }
    1099           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1100           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetDeviceStatus, NDR_OUT | NDR_SET_VALUES, r2);
    1101             :                 }
    1102           0 :                 if (dce_call->fault_code != 0) {
    1103           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetDeviceStatus\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1104             :                 }
    1105           0 :                 break;
    1106             :         }
    1107           0 :         case 31: { /* PNP_SetDeviceProblem */
    1108           0 :                 struct PNP_SetDeviceProblem *r2 = (struct PNP_SetDeviceProblem *)r;
    1109           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1110           0 :                         DEBUG(5,("function PNP_SetDeviceProblem replied async\n"));
    1111             :                 }
    1112           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1113           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_SetDeviceProblem, NDR_OUT | NDR_SET_VALUES, r2);
    1114             :                 }
    1115           0 :                 if (dce_call->fault_code != 0) {
    1116           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_SetDeviceProblem\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1117             :                 }
    1118           0 :                 break;
    1119             :         }
    1120           0 :         case 32: { /* PNP_DisableDevInst */
    1121           0 :                 struct PNP_DisableDevInst *r2 = (struct PNP_DisableDevInst *)r;
    1122           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1123           0 :                         DEBUG(5,("function PNP_DisableDevInst replied async\n"));
    1124             :                 }
    1125           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1126           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DisableDevInst, NDR_OUT | NDR_SET_VALUES, r2);
    1127             :                 }
    1128           0 :                 if (dce_call->fault_code != 0) {
    1129           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_DisableDevInst\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1130             :                 }
    1131           0 :                 break;
    1132             :         }
    1133           0 :         case 33: { /* PNP_UninstallDevInst */
    1134           0 :                 struct PNP_UninstallDevInst *r2 = (struct PNP_UninstallDevInst *)r;
    1135           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1136           0 :                         DEBUG(5,("function PNP_UninstallDevInst replied async\n"));
    1137             :                 }
    1138           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1139           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_UninstallDevInst, NDR_OUT | NDR_SET_VALUES, r2);
    1140             :                 }
    1141           0 :                 if (dce_call->fault_code != 0) {
    1142           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_UninstallDevInst\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1143             :                 }
    1144           0 :                 break;
    1145             :         }
    1146           0 :         case 34: { /* PNP_AddID */
    1147           0 :                 struct PNP_AddID *r2 = (struct PNP_AddID *)r;
    1148           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1149           0 :                         DEBUG(5,("function PNP_AddID replied async\n"));
    1150             :                 }
    1151           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1152           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_AddID, NDR_OUT | NDR_SET_VALUES, r2);
    1153             :                 }
    1154           0 :                 if (dce_call->fault_code != 0) {
    1155           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_AddID\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1156             :                 }
    1157           0 :                 break;
    1158             :         }
    1159           0 :         case 35: { /* PNP_RegisterDriver */
    1160           0 :                 struct PNP_RegisterDriver *r2 = (struct PNP_RegisterDriver *)r;
    1161           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1162           0 :                         DEBUG(5,("function PNP_RegisterDriver replied async\n"));
    1163             :                 }
    1164           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1165           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RegisterDriver, NDR_OUT | NDR_SET_VALUES, r2);
    1166             :                 }
    1167           0 :                 if (dce_call->fault_code != 0) {
    1168           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_RegisterDriver\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1169             :                 }
    1170           0 :                 break;
    1171             :         }
    1172           0 :         case 36: { /* PNP_QueryRemove */
    1173           0 :                 struct PNP_QueryRemove *r2 = (struct PNP_QueryRemove *)r;
    1174           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1175           0 :                         DEBUG(5,("function PNP_QueryRemove replied async\n"));
    1176             :                 }
    1177           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1178           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_QueryRemove, NDR_OUT | NDR_SET_VALUES, r2);
    1179             :                 }
    1180           0 :                 if (dce_call->fault_code != 0) {
    1181           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_QueryRemove\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1182             :                 }
    1183           0 :                 break;
    1184             :         }
    1185           0 :         case 37: { /* PNP_RequestDeviceEject */
    1186           0 :                 struct PNP_RequestDeviceEject *r2 = (struct PNP_RequestDeviceEject *)r;
    1187           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1188           0 :                         DEBUG(5,("function PNP_RequestDeviceEject replied async\n"));
    1189             :                 }
    1190           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1191           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RequestDeviceEject, NDR_OUT | NDR_SET_VALUES, r2);
    1192             :                 }
    1193           0 :                 if (dce_call->fault_code != 0) {
    1194           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_RequestDeviceEject\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1195             :                 }
    1196           0 :                 break;
    1197             :         }
    1198           0 :         case 38: { /* PNP_IsDockStationPresent */
    1199           0 :                 struct PNP_IsDockStationPresent *r2 = (struct PNP_IsDockStationPresent *)r;
    1200           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1201           0 :                         DEBUG(5,("function PNP_IsDockStationPresent replied async\n"));
    1202             :                 }
    1203           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1204           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_IsDockStationPresent, NDR_OUT | NDR_SET_VALUES, r2);
    1205             :                 }
    1206           0 :                 if (dce_call->fault_code != 0) {
    1207           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_IsDockStationPresent\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1208             :                 }
    1209           0 :                 break;
    1210             :         }
    1211           0 :         case 39: { /* PNP_RequestEjectPC */
    1212           0 :                 struct PNP_RequestEjectPC *r2 = (struct PNP_RequestEjectPC *)r;
    1213           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1214           0 :                         DEBUG(5,("function PNP_RequestEjectPC replied async\n"));
    1215             :                 }
    1216           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1217           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RequestEjectPC, NDR_OUT | NDR_SET_VALUES, r2);
    1218             :                 }
    1219           0 :                 if (dce_call->fault_code != 0) {
    1220           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_RequestEjectPC\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1221             :                 }
    1222           0 :                 break;
    1223             :         }
    1224           0 :         case 40: { /* PNP_HwProfFlags */
    1225           0 :                 struct PNP_HwProfFlags *r2 = (struct PNP_HwProfFlags *)r;
    1226           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1227           0 :                         DEBUG(5,("function PNP_HwProfFlags replied async\n"));
    1228             :                 }
    1229           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1230           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_HwProfFlags, NDR_OUT | NDR_SET_VALUES, r2);
    1231             :                 }
    1232           0 :                 if (dce_call->fault_code != 0) {
    1233           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_HwProfFlags\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1234             :                 }
    1235           0 :                 break;
    1236             :         }
    1237           0 :         case 41: { /* PNP_GetHwProfInfo */
    1238           0 :                 struct PNP_GetHwProfInfo *r2 = (struct PNP_GetHwProfInfo *)r;
    1239           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1240           0 :                         DEBUG(5,("function PNP_GetHwProfInfo replied async\n"));
    1241             :                 }
    1242           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1243           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetHwProfInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1244             :                 }
    1245           0 :                 if (dce_call->fault_code != 0) {
    1246           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetHwProfInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1247             :                 }
    1248           0 :                 break;
    1249             :         }
    1250           0 :         case 42: { /* PNP_AddEmptyLogConf */
    1251           0 :                 struct PNP_AddEmptyLogConf *r2 = (struct PNP_AddEmptyLogConf *)r;
    1252           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1253           0 :                         DEBUG(5,("function PNP_AddEmptyLogConf replied async\n"));
    1254             :                 }
    1255           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1256           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_AddEmptyLogConf, NDR_OUT | NDR_SET_VALUES, r2);
    1257             :                 }
    1258           0 :                 if (dce_call->fault_code != 0) {
    1259           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_AddEmptyLogConf\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1260             :                 }
    1261           0 :                 break;
    1262             :         }
    1263           0 :         case 43: { /* PNP_FreeLogConf */
    1264           0 :                 struct PNP_FreeLogConf *r2 = (struct PNP_FreeLogConf *)r;
    1265           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1266           0 :                         DEBUG(5,("function PNP_FreeLogConf replied async\n"));
    1267             :                 }
    1268           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1269           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_FreeLogConf, NDR_OUT | NDR_SET_VALUES, r2);
    1270             :                 }
    1271           0 :                 if (dce_call->fault_code != 0) {
    1272           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_FreeLogConf\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1273             :                 }
    1274           0 :                 break;
    1275             :         }
    1276           0 :         case 44: { /* PNP_GetFirstLogConf */
    1277           0 :                 struct PNP_GetFirstLogConf *r2 = (struct PNP_GetFirstLogConf *)r;
    1278           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1279           0 :                         DEBUG(5,("function PNP_GetFirstLogConf replied async\n"));
    1280             :                 }
    1281           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1282           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetFirstLogConf, NDR_OUT | NDR_SET_VALUES, r2);
    1283             :                 }
    1284           0 :                 if (dce_call->fault_code != 0) {
    1285           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetFirstLogConf\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1286             :                 }
    1287           0 :                 break;
    1288             :         }
    1289           0 :         case 45: { /* PNP_GetNextLogConf */
    1290           0 :                 struct PNP_GetNextLogConf *r2 = (struct PNP_GetNextLogConf *)r;
    1291           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1292           0 :                         DEBUG(5,("function PNP_GetNextLogConf replied async\n"));
    1293             :                 }
    1294           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1295           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetNextLogConf, NDR_OUT | NDR_SET_VALUES, r2);
    1296             :                 }
    1297           0 :                 if (dce_call->fault_code != 0) {
    1298           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetNextLogConf\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1299             :                 }
    1300           0 :                 break;
    1301             :         }
    1302           0 :         case 46: { /* PNP_GetLogConfPriority */
    1303           0 :                 struct PNP_GetLogConfPriority *r2 = (struct PNP_GetLogConfPriority *)r;
    1304           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1305           0 :                         DEBUG(5,("function PNP_GetLogConfPriority replied async\n"));
    1306             :                 }
    1307           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1308           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetLogConfPriority, NDR_OUT | NDR_SET_VALUES, r2);
    1309             :                 }
    1310           0 :                 if (dce_call->fault_code != 0) {
    1311           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetLogConfPriority\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1312             :                 }
    1313           0 :                 break;
    1314             :         }
    1315           0 :         case 47: { /* PNP_AddResDes */
    1316           0 :                 struct PNP_AddResDes *r2 = (struct PNP_AddResDes *)r;
    1317           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1318           0 :                         DEBUG(5,("function PNP_AddResDes replied async\n"));
    1319             :                 }
    1320           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1321           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_AddResDes, NDR_OUT | NDR_SET_VALUES, r2);
    1322             :                 }
    1323           0 :                 if (dce_call->fault_code != 0) {
    1324           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_AddResDes\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1325             :                 }
    1326           0 :                 break;
    1327             :         }
    1328           0 :         case 48: { /* PNP_FreeResDes */
    1329           0 :                 struct PNP_FreeResDes *r2 = (struct PNP_FreeResDes *)r;
    1330           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1331           0 :                         DEBUG(5,("function PNP_FreeResDes replied async\n"));
    1332             :                 }
    1333           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1334           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_FreeResDes, NDR_OUT | NDR_SET_VALUES, r2);
    1335             :                 }
    1336           0 :                 if (dce_call->fault_code != 0) {
    1337           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_FreeResDes\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1338             :                 }
    1339           0 :                 break;
    1340             :         }
    1341           0 :         case 49: { /* PNP_GetNextResDes */
    1342           0 :                 struct PNP_GetNextResDes *r2 = (struct PNP_GetNextResDes *)r;
    1343           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1344           0 :                         DEBUG(5,("function PNP_GetNextResDes replied async\n"));
    1345             :                 }
    1346           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1347           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetNextResDes, NDR_OUT | NDR_SET_VALUES, r2);
    1348             :                 }
    1349           0 :                 if (dce_call->fault_code != 0) {
    1350           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetNextResDes\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1351             :                 }
    1352           0 :                 break;
    1353             :         }
    1354           0 :         case 50: { /* PNP_GetResDesData */
    1355           0 :                 struct PNP_GetResDesData *r2 = (struct PNP_GetResDesData *)r;
    1356           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1357           0 :                         DEBUG(5,("function PNP_GetResDesData replied async\n"));
    1358             :                 }
    1359           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1360           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetResDesData, NDR_OUT | NDR_SET_VALUES, r2);
    1361             :                 }
    1362           0 :                 if (dce_call->fault_code != 0) {
    1363           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetResDesData\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1364             :                 }
    1365           0 :                 break;
    1366             :         }
    1367           0 :         case 51: { /* PNP_GetResDesDataSize */
    1368           0 :                 struct PNP_GetResDesDataSize *r2 = (struct PNP_GetResDesDataSize *)r;
    1369           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1370           0 :                         DEBUG(5,("function PNP_GetResDesDataSize replied async\n"));
    1371             :                 }
    1372           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1373           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetResDesDataSize, NDR_OUT | NDR_SET_VALUES, r2);
    1374             :                 }
    1375           0 :                 if (dce_call->fault_code != 0) {
    1376           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetResDesDataSize\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1377             :                 }
    1378           0 :                 break;
    1379             :         }
    1380           0 :         case 52: { /* PNP_ModifyResDes */
    1381           0 :                 struct PNP_ModifyResDes *r2 = (struct PNP_ModifyResDes *)r;
    1382           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1383           0 :                         DEBUG(5,("function PNP_ModifyResDes replied async\n"));
    1384             :                 }
    1385           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1386           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_ModifyResDes, NDR_OUT | NDR_SET_VALUES, r2);
    1387             :                 }
    1388           0 :                 if (dce_call->fault_code != 0) {
    1389           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_ModifyResDes\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1390             :                 }
    1391           0 :                 break;
    1392             :         }
    1393           0 :         case 53: { /* PNP_DetectResourceLimit */
    1394           0 :                 struct PNP_DetectResourceLimit *r2 = (struct PNP_DetectResourceLimit *)r;
    1395           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1396           0 :                         DEBUG(5,("function PNP_DetectResourceLimit replied async\n"));
    1397             :                 }
    1398           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1399           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_DetectResourceLimit, NDR_OUT | NDR_SET_VALUES, r2);
    1400             :                 }
    1401           0 :                 if (dce_call->fault_code != 0) {
    1402           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_DetectResourceLimit\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1403             :                 }
    1404           0 :                 break;
    1405             :         }
    1406           0 :         case 54: { /* PNP_QueryResConfList */
    1407           0 :                 struct PNP_QueryResConfList *r2 = (struct PNP_QueryResConfList *)r;
    1408           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1409           0 :                         DEBUG(5,("function PNP_QueryResConfList replied async\n"));
    1410             :                 }
    1411           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1412           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_QueryResConfList, NDR_OUT | NDR_SET_VALUES, r2);
    1413             :                 }
    1414           0 :                 if (dce_call->fault_code != 0) {
    1415           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_QueryResConfList\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1416             :                 }
    1417           0 :                 break;
    1418             :         }
    1419           0 :         case 55: { /* PNP_SetHwProf */
    1420           0 :                 struct PNP_SetHwProf *r2 = (struct PNP_SetHwProf *)r;
    1421           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1422           0 :                         DEBUG(5,("function PNP_SetHwProf replied async\n"));
    1423             :                 }
    1424           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1425           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_SetHwProf, NDR_OUT | NDR_SET_VALUES, r2);
    1426             :                 }
    1427           0 :                 if (dce_call->fault_code != 0) {
    1428           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_SetHwProf\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1429             :                 }
    1430           0 :                 break;
    1431             :         }
    1432           0 :         case 56: { /* PNP_QueryArbitratorFreeData */
    1433           0 :                 struct PNP_QueryArbitratorFreeData *r2 = (struct PNP_QueryArbitratorFreeData *)r;
    1434           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1435           0 :                         DEBUG(5,("function PNP_QueryArbitratorFreeData replied async\n"));
    1436             :                 }
    1437           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1438           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_QueryArbitratorFreeData, NDR_OUT | NDR_SET_VALUES, r2);
    1439             :                 }
    1440           0 :                 if (dce_call->fault_code != 0) {
    1441           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_QueryArbitratorFreeData\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1442             :                 }
    1443           0 :                 break;
    1444             :         }
    1445           0 :         case 57: { /* PNP_QueryArbitratorFreeSize */
    1446           0 :                 struct PNP_QueryArbitratorFreeSize *r2 = (struct PNP_QueryArbitratorFreeSize *)r;
    1447           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1448           0 :                         DEBUG(5,("function PNP_QueryArbitratorFreeSize replied async\n"));
    1449             :                 }
    1450           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1451           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_QueryArbitratorFreeSize, NDR_OUT | NDR_SET_VALUES, r2);
    1452             :                 }
    1453           0 :                 if (dce_call->fault_code != 0) {
    1454           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_QueryArbitratorFreeSize\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1455             :                 }
    1456           0 :                 break;
    1457             :         }
    1458           0 :         case 58: { /* PNP_RunDetection */
    1459           0 :                 struct PNP_RunDetection *r2 = (struct PNP_RunDetection *)r;
    1460           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1461           0 :                         DEBUG(5,("function PNP_RunDetection replied async\n"));
    1462             :                 }
    1463           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1464           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RunDetection, NDR_OUT | NDR_SET_VALUES, r2);
    1465             :                 }
    1466           0 :                 if (dce_call->fault_code != 0) {
    1467           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_RunDetection\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1468             :                 }
    1469           0 :                 break;
    1470             :         }
    1471           0 :         case 59: { /* PNP_RegisterNotification */
    1472           0 :                 struct PNP_RegisterNotification *r2 = (struct PNP_RegisterNotification *)r;
    1473           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1474           0 :                         DEBUG(5,("function PNP_RegisterNotification replied async\n"));
    1475             :                 }
    1476           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1477           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_RegisterNotification, NDR_OUT | NDR_SET_VALUES, r2);
    1478             :                 }
    1479           0 :                 if (dce_call->fault_code != 0) {
    1480           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_RegisterNotification\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1481             :                 }
    1482           0 :                 break;
    1483             :         }
    1484           0 :         case 60: { /* PNP_UnregisterNotification */
    1485           0 :                 struct PNP_UnregisterNotification *r2 = (struct PNP_UnregisterNotification *)r;
    1486           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1487           0 :                         DEBUG(5,("function PNP_UnregisterNotification replied async\n"));
    1488             :                 }
    1489           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1490           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_UnregisterNotification, NDR_OUT | NDR_SET_VALUES, r2);
    1491             :                 }
    1492           0 :                 if (dce_call->fault_code != 0) {
    1493           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_UnregisterNotification\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1494             :                 }
    1495           0 :                 break;
    1496             :         }
    1497           0 :         case 61: { /* PNP_GetCustomDevProp */
    1498           0 :                 struct PNP_GetCustomDevProp *r2 = (struct PNP_GetCustomDevProp *)r;
    1499           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1500           0 :                         DEBUG(5,("function PNP_GetCustomDevProp replied async\n"));
    1501             :                 }
    1502           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1503           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetCustomDevProp, NDR_OUT | NDR_SET_VALUES, r2);
    1504             :                 }
    1505           0 :                 if (dce_call->fault_code != 0) {
    1506           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetCustomDevProp\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1507             :                 }
    1508           0 :                 break;
    1509             :         }
    1510           0 :         case 62: { /* PNP_GetVersionInternal */
    1511           0 :                 struct PNP_GetVersionInternal *r2 = (struct PNP_GetVersionInternal *)r;
    1512           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1513           0 :                         DEBUG(5,("function PNP_GetVersionInternal replied async\n"));
    1514             :                 }
    1515           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1516           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetVersionInternal, NDR_OUT | NDR_SET_VALUES, r2);
    1517             :                 }
    1518           0 :                 if (dce_call->fault_code != 0) {
    1519           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetVersionInternal\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1520             :                 }
    1521           0 :                 break;
    1522             :         }
    1523           0 :         case 63: { /* PNP_GetBlockedDriverInfo */
    1524           0 :                 struct PNP_GetBlockedDriverInfo *r2 = (struct PNP_GetBlockedDriverInfo *)r;
    1525           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1526           0 :                         DEBUG(5,("function PNP_GetBlockedDriverInfo replied async\n"));
    1527             :                 }
    1528           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1529           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetBlockedDriverInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1530             :                 }
    1531           0 :                 if (dce_call->fault_code != 0) {
    1532           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetBlockedDriverInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1533             :                 }
    1534           0 :                 break;
    1535             :         }
    1536           0 :         case 64: { /* PNP_GetServerSideDeviceInstallFlags */
    1537           0 :                 struct PNP_GetServerSideDeviceInstallFlags *r2 = (struct PNP_GetServerSideDeviceInstallFlags *)r;
    1538           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1539           0 :                         DEBUG(5,("function PNP_GetServerSideDeviceInstallFlags replied async\n"));
    1540             :                 }
    1541           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1542           0 :                         NDR_PRINT_FUNCTION_DEBUG(PNP_GetServerSideDeviceInstallFlags, NDR_OUT | NDR_SET_VALUES, r2);
    1543             :                 }
    1544           0 :                 if (dce_call->fault_code != 0) {
    1545           0 :                         DBG_WARNING("dcerpc_fault %s in PNP_GetServerSideDeviceInstallFlags\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1546             :                 }
    1547           0 :                 break;
    1548             :         }
    1549           0 :         default:
    1550           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
    1551           0 :                 break;
    1552             :         }
    1553             : 
    1554          32 :         if (dce_call->fault_code != 0) {
    1555           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    1556             :         }
    1557             : 
    1558          32 :         return NT_STATUS_OK;
    1559             : }
    1560             : 
    1561          32 : NTSTATUS ntsvcs__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
    1562             : {
    1563             :         enum ndr_err_code ndr_err;
    1564          32 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
    1565             : 
    1566          32 :         ndr_err = ndr_table_ntsvcs.calls[opnum].ndr_push(push, NDR_OUT, r);
    1567          32 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
    1568           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
    1569           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    1570             :         }
    1571             : 
    1572          32 :         return NT_STATUS_OK;
    1573             : }
    1574             : 
    1575           0 : NTSTATUS ntsvcs__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    1576             : {
    1577           0 :         return ntsvcs__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL);
    1578             : }
    1579             : 
    1580             : static const struct dcesrv_interface dcesrv_ntsvcs_interface = {
    1581             :         .name      = "ntsvcs",
    1582             :         .syntax_id = {{0x8d9f4e40,0xa03d,0x11ce,{0x8f,0x69},{0x08,0x00,0x3e,0x30,0x05,0x1b}},1.0},
    1583             :         .bind      = ntsvcs__op_bind,
    1584             :         .unbind    = ntsvcs__op_unbind,
    1585             :         .ndr_pull  = ntsvcs__op_ndr_pull,
    1586             :         .dispatch  = ntsvcs__op_dispatch,
    1587             :         .reply     = ntsvcs__op_reply,
    1588             :         .ndr_push  = ntsvcs__op_ndr_push,
    1589             :         .local     = ntsvcs__op_local,
    1590             : #ifdef DCESRV_INTERFACE_NTSVCS_FLAGS
    1591             :         .flags     = DCESRV_INTERFACE_NTSVCS_FLAGS
    1592             : #else
    1593             :         .flags     = 0
    1594             : #endif
    1595             : };
    1596             : 
    1597         120 : static NTSTATUS ntsvcs__check_register_in_endpoint(const char *name, struct dcerpc_binding *binding) {
    1598         120 :         enum dcerpc_transport_t transport = dcerpc_binding_get_transport(binding);
    1599             :         NTSTATUS status;
    1600             : 
    1601             :         /* If service is disabled, do not register */
    1602         120 :         if (rpc_service_mode(name) == RPC_SERVICE_MODE_DISABLED) {
    1603           0 :                 return NT_STATUS_NOT_IMPLEMENTED;
    1604             :         }
    1605             : 
    1606             :         /* If service is embedded, register only for ncacn_np
    1607             :          * see 8466b3c85e4b835e57e41776853093f4a0edc8b8
    1608             :          */
    1609         120 :         if (rpc_service_mode(name) == RPC_SERVICE_MODE_EMBEDDED && (transport != NCACN_NP && transport != NCALRPC)) {
    1610           0 :                 DBG_INFO("Interface 'ntsvcs' not registered in endpoint '%s' as service is embedded\n", name);
    1611           0 :                 return NT_STATUS_NOT_SUPPORTED;
    1612             :         }
    1613             : 
    1614             :         /*
    1615             :          * If rpc service is external then change the default ncalrpc endpoint,
    1616             :          * otherwise if the rpc daemon running this service is configured in
    1617             :          * fork mode the forked process will race with main smbd to accept the
    1618             :          * connections in the default ncalrpc socket, and the forked process
    1619             :          * may not have the requested interface registered.
    1620             :          * For example, in the ad_member test environment:
    1621             :          *
    1622             :          *   rpc_server:lsarpc = external
    1623             :          *   rpc_server:samr = external
    1624             :          *   rpc_server:netlogon = disabled
    1625             :          *   rpc_daemon:lsasd = fork
    1626             :          *
    1627             :          * With these settings both, the main smbd and all the preforked lsasd
    1628             :          * processes would be listening in the default ncalrpc socket if it is
    1629             :          * not changed. If a client connection is accepted by one of the lsasd
    1630             :          * worker processes and the client asks for an interface not registered
    1631             :          * in these processes (winreg for example) it will get an error.
    1632             :          */
    1633         120 :         if (rpc_service_mode(name) == RPC_SERVICE_MODE_EXTERNAL && transport == NCALRPC) {
    1634           0 :                 status = dcerpc_binding_set_string_option(binding, "endpoint", "NTSVCS");
    1635           0 :                 if (!NT_STATUS_IS_OK(status)) {
    1636           0 :                         return status;
    1637             :                 }
    1638             :         }
    1639             : 
    1640         120 :         return NT_STATUS_OK;
    1641             : }
    1642             : 
    1643          60 : static NTSTATUS ntsvcs__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    1644             : {
    1645             :         uint32_t i;
    1646             :         NTSTATUS ret;
    1647             :         struct dcerpc_binding *binding;
    1648          60 :         struct dcerpc_binding *binding2 = NULL;
    1649             : 
    1650             : #ifdef DCESRV_INTERFACE_NTSVCS_NCACN_NP_SECONDARY_ENDPOINT
    1651             :         const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_NTSVCS_NCACN_NP_SECONDARY_ENDPOINT;
    1652             : #else
    1653          60 :         const char *ncacn_np_secondary_endpoint = NULL;
    1654             : #endif
    1655             : 
    1656         180 :         for (i=0;i<ndr_table_ntsvcs.endpoints->count;i++) {
    1657         120 :                 const char *name = ndr_table_ntsvcs.endpoints->names[i];
    1658             : 
    1659         120 :                 ret = dcerpc_parse_binding(dce_ctx, name, &binding);
    1660         120 :                 if (NT_STATUS_IS_ERR(ret)) {
    1661           0 :                         DBG_ERR("Failed to parse binding string '%s'\n", name);
    1662           0 :                         return ret;
    1663             :                 }
    1664             : 
    1665         120 :                 ret = ntsvcs__check_register_in_endpoint("ntsvcs", binding);
    1666         120 :                 if (NT_STATUS_IS_ERR(ret)) {
    1667           0 :                         talloc_free(binding);
    1668           0 :                         continue;
    1669             :                 }
    1670             : 
    1671         116 :                 if (ncacn_np_secondary_endpoint != NULL) {
    1672           0 :                         ret = dcerpc_parse_binding(dce_ctx, ncacn_np_secondary_endpoint, &binding2);
    1673           0 :                         if (NT_STATUS_IS_ERR(ret)) {
    1674           0 :                                 DBG_ERR("Failed to parse 2nd binding string '%s'\n", ncacn_np_secondary_endpoint);
    1675           0 :                                 TALLOC_FREE(binding);
    1676           0 :                                 return ret;
    1677             :                         }
    1678             :                 }
    1679             : 
    1680         120 :                 ret = dcesrv_interface_register_b(dce_ctx, binding, binding2, &dcesrv_ntsvcs_interface, NULL);
    1681         120 :                 TALLOC_FREE(binding);
    1682         116 :                 TALLOC_FREE(binding2);
    1683         120 :                 if (!NT_STATUS_IS_OK(ret)) {
    1684           0 :                         DBG_ERR("Failed to register endpoint '%s'\n",name);
    1685           0 :                         return ret;
    1686             :                 }
    1687             :         }
    1688             : 
    1689          60 :         return NT_STATUS_OK;
    1690             : }
    1691             : 
    1692          19 : static NTSTATUS ntsvcs__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    1693             : {
    1694          19 :         return NT_STATUS_OK;
    1695             : }
    1696             : 
    1697           0 : static bool ntsvcs__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
    1698             : {
    1699           0 :         if (dcesrv_ntsvcs_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_ntsvcs_interface.syntax_id.uuid, uuid)) {
    1700           0 :                 memcpy(iface,&dcesrv_ntsvcs_interface, sizeof(*iface));
    1701           0 :                 return true;
    1702             :         }
    1703             : 
    1704           0 :         return false;
    1705             : }
    1706             : 
    1707           0 : static bool ntsvcs__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
    1708             : {
    1709           0 :         if (strcmp(dcesrv_ntsvcs_interface.name, name)==0) {
    1710           0 :                 memcpy(iface, &dcesrv_ntsvcs_interface, sizeof(*iface));
    1711           0 :                 return true;
    1712             :         }
    1713             : 
    1714           0 :         return false;
    1715             : }
    1716             : 
    1717             : static const struct dcesrv_endpoint_server ntsvcs_ep_server = {
    1718             :         /* fill in our name */
    1719             :         .name = "ntsvcs",
    1720             : 
    1721             :         /* Initialization flag */
    1722             :         .initialized = false,
    1723             : 
    1724             :         /* fill in all the operations */
    1725             : #ifdef DCESRV_INTERFACE_NTSVCS_INIT_SERVER
    1726             :         .init_server = DCESRV_INTERFACE_NTSVCS_INIT_SERVER,
    1727             : #else
    1728             :         .init_server = ntsvcs__op_init_server,
    1729             : #endif
    1730             : #ifdef DCESRV_INTERFACE_NTSVCS_SHUTDOWN_SERVER
    1731             :         .shutdown_server = DCESRV_INTERFACE_NTSVCS_SHUTDOWN_SERVER,
    1732             : #else
    1733             :         .shutdown_server = ntsvcs__op_shutdown_server,
    1734             : #endif
    1735             :         .interface_by_uuid = ntsvcs__op_interface_by_uuid,
    1736             :         .interface_by_name = ntsvcs__op_interface_by_name
    1737             : };
    1738             : 
    1739          60 : const struct dcesrv_endpoint_server *ntsvcs_get_ep_server(void)
    1740             : {
    1741          60 :         return &ntsvcs_ep_server;
    1742             : }

Generated by: LCOV version 1.13