LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_wkssvc_s.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 196 605 32.4 %
Date: 2024-04-21 15:09:00 Functions: 8 11 72.7 %

          Line data    Source code
       1             : /* server functions auto-generated by pidl */
       2             : #include "bin/default/librpc/gen_ndr/ndr_wkssvc.h"
       3             : #include <util/debug.h>
       4             : 
       5             : NTSTATUS dcerpc_server_wkssvc_init(TALLOC_CTX *);
       6             : 
       7             : /* wkssvc - dcerpc server boilerplate generated by pidl */
       8             : 
       9             : 
      10           5 : static NTSTATUS wkssvc__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      11             : {
      12             : #ifdef DCESRV_INTERFACE_WKSSVC_BIND
      13             :         return DCESRV_INTERFACE_WKSSVC_BIND(context,iface);
      14             : #else
      15           5 :         return NT_STATUS_OK;
      16             : #endif
      17             : }
      18             : 
      19           5 : static void wkssvc__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      20             : {
      21             : #ifdef DCESRV_INTERFACE_WKSSVC_UNBIND
      22             :         DCESRV_INTERFACE_WKSSVC_UNBIND(context, iface);
      23             : #else
      24           5 :         return;
      25             : #endif
      26             : }
      27             : 
      28          80 : static NTSTATUS wkssvc__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
      29             : {
      30           0 :         enum ndr_err_code ndr_err;
      31          80 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      32             : 
      33          80 :         dce_call->fault_code = 0;
      34             : 
      35          80 :         if (opnum >= ndr_table_wkssvc.num_calls) {
      36           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
      37           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      38             :         }
      39             : 
      40         160 :         *r = talloc_named(mem_ctx,
      41          80 :                           ndr_table_wkssvc.calls[opnum].struct_size,
      42             :                           "struct %s",
      43          80 :                           ndr_table_wkssvc.calls[opnum].name);
      44          80 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      45             : 
      46             :         /* unravel the NDR for the packet */
      47          80 :         ndr_err = ndr_table_wkssvc.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      48          80 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
      49           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
      50           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      51             :         }
      52             : 
      53          80 :         return NT_STATUS_OK;
      54             : }
      55             : 
      56          80 : static NTSTATUS wkssvc__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
      57             : {
      58          80 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      59             : 
      60          80 :         switch (opnum) {
      61          11 :         case 0: {
      62          11 :                 struct wkssvc_NetWkstaGetInfo *r2 = (struct wkssvc_NetWkstaGetInfo *)r;
      63          11 :                 if (DEBUGLEVEL >= 10) {
      64           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaGetInfo, NDR_IN, r2);
      65             :                 }
      66          11 :                 r2->out.result = dcesrv_wkssvc_NetWkstaGetInfo(dce_call, mem_ctx, r2);
      67          11 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      68           0 :                         DEBUG(5,("function wkssvc_NetWkstaGetInfo will reply async\n"));
      69             :                 }
      70          11 :                 break;
      71             :         }
      72           0 :         case 1: {
      73           0 :                 struct wkssvc_NetWkstaSetInfo *r2 = (struct wkssvc_NetWkstaSetInfo *)r;
      74           0 :                 if (DEBUGLEVEL >= 10) {
      75           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaSetInfo, NDR_IN, r2);
      76             :                 }
      77           0 :                 r2->out.result = dcesrv_wkssvc_NetWkstaSetInfo(dce_call, mem_ctx, r2);
      78           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      79           0 :                         DEBUG(5,("function wkssvc_NetWkstaSetInfo will reply async\n"));
      80             :                 }
      81           0 :                 break;
      82             :         }
      83           3 :         case 2: {
      84           3 :                 struct wkssvc_NetWkstaEnumUsers *r2 = (struct wkssvc_NetWkstaEnumUsers *)r;
      85           3 :                 if (DEBUGLEVEL >= 10) {
      86           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaEnumUsers, NDR_IN, r2);
      87             :                 }
      88           3 :                 r2->out.result = dcesrv_wkssvc_NetWkstaEnumUsers(dce_call, mem_ctx, r2);
      89           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      90           0 :                         DEBUG(5,("function wkssvc_NetWkstaEnumUsers will reply async\n"));
      91             :                 }
      92           3 :                 break;
      93             :         }
      94           3 :         case 3: {
      95           3 :                 struct wkssvc_NetrWkstaUserGetInfo *r2 = (struct wkssvc_NetrWkstaUserGetInfo *)r;
      96           3 :                 if (DEBUGLEVEL >= 10) {
      97           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaUserGetInfo, NDR_IN, r2);
      98             :                 }
      99           3 :                 r2->out.result = dcesrv_wkssvc_NetrWkstaUserGetInfo(dce_call, mem_ctx, r2);
     100           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     101           0 :                         DEBUG(5,("function wkssvc_NetrWkstaUserGetInfo will reply async\n"));
     102             :                 }
     103           3 :                 break;
     104             :         }
     105           0 :         case 4: {
     106           0 :                 struct wkssvc_NetrWkstaUserSetInfo *r2 = (struct wkssvc_NetrWkstaUserSetInfo *)r;
     107           0 :                 if (DEBUGLEVEL >= 10) {
     108           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaUserSetInfo, NDR_IN, r2);
     109             :                 }
     110           0 :                 r2->out.result = dcesrv_wkssvc_NetrWkstaUserSetInfo(dce_call, mem_ctx, r2);
     111           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     112           0 :                         DEBUG(5,("function wkssvc_NetrWkstaUserSetInfo will reply async\n"));
     113             :                 }
     114           0 :                 break;
     115             :         }
     116           3 :         case 5: {
     117           3 :                 struct wkssvc_NetWkstaTransportEnum *r2 = (struct wkssvc_NetWkstaTransportEnum *)r;
     118           3 :                 if (DEBUGLEVEL >= 10) {
     119           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaTransportEnum, NDR_IN, r2);
     120             :                 }
     121           3 :                 r2->out.result = dcesrv_wkssvc_NetWkstaTransportEnum(dce_call, mem_ctx, r2);
     122           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     123           0 :                         DEBUG(5,("function wkssvc_NetWkstaTransportEnum will reply async\n"));
     124             :                 }
     125           3 :                 break;
     126             :         }
     127           3 :         case 6: {
     128           3 :                 struct wkssvc_NetrWkstaTransportAdd *r2 = (struct wkssvc_NetrWkstaTransportAdd *)r;
     129           3 :                 if (DEBUGLEVEL >= 10) {
     130           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaTransportAdd, NDR_IN, r2);
     131             :                 }
     132           3 :                 r2->out.result = dcesrv_wkssvc_NetrWkstaTransportAdd(dce_call, mem_ctx, r2);
     133           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     134           0 :                         DEBUG(5,("function wkssvc_NetrWkstaTransportAdd will reply async\n"));
     135             :                 }
     136           3 :                 break;
     137             :         }
     138           3 :         case 7: {
     139           3 :                 struct wkssvc_NetrWkstaTransportDel *r2 = (struct wkssvc_NetrWkstaTransportDel *)r;
     140           3 :                 if (DEBUGLEVEL >= 10) {
     141           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaTransportDel, NDR_IN, r2);
     142             :                 }
     143           3 :                 r2->out.result = dcesrv_wkssvc_NetrWkstaTransportDel(dce_call, mem_ctx, r2);
     144           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     145           0 :                         DEBUG(5,("function wkssvc_NetrWkstaTransportDel will reply async\n"));
     146             :                 }
     147           3 :                 break;
     148             :         }
     149           3 :         case 8: {
     150           3 :                 struct wkssvc_NetrUseAdd *r2 = (struct wkssvc_NetrUseAdd *)r;
     151           3 :                 if (DEBUGLEVEL >= 10) {
     152           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseAdd, NDR_IN, r2);
     153             :                 }
     154           3 :                 r2->out.result = dcesrv_wkssvc_NetrUseAdd(dce_call, mem_ctx, r2);
     155           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     156           0 :                         DEBUG(5,("function wkssvc_NetrUseAdd will reply async\n"));
     157             :                 }
     158           3 :                 break;
     159             :         }
     160           0 :         case 9: {
     161           0 :                 struct wkssvc_NetrUseGetInfo *r2 = (struct wkssvc_NetrUseGetInfo *)r;
     162           0 :                 if (DEBUGLEVEL >= 10) {
     163           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseGetInfo, NDR_IN, r2);
     164             :                 }
     165           0 :                 r2->out.result = dcesrv_wkssvc_NetrUseGetInfo(dce_call, mem_ctx, r2);
     166           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     167           0 :                         DEBUG(5,("function wkssvc_NetrUseGetInfo will reply async\n"));
     168             :                 }
     169           0 :                 break;
     170             :         }
     171           3 :         case 10: {
     172           3 :                 struct wkssvc_NetrUseDel *r2 = (struct wkssvc_NetrUseDel *)r;
     173           3 :                 if (DEBUGLEVEL >= 10) {
     174           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseDel, NDR_IN, r2);
     175             :                 }
     176           3 :                 r2->out.result = dcesrv_wkssvc_NetrUseDel(dce_call, mem_ctx, r2);
     177           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     178           0 :                         DEBUG(5,("function wkssvc_NetrUseDel will reply async\n"));
     179             :                 }
     180           3 :                 break;
     181             :         }
     182           6 :         case 11: {
     183           6 :                 struct wkssvc_NetrUseEnum *r2 = (struct wkssvc_NetrUseEnum *)r;
     184           6 :                 if (DEBUGLEVEL >= 10) {
     185           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseEnum, NDR_IN, r2);
     186             :                 }
     187           6 :                 r2->out.result = dcesrv_wkssvc_NetrUseEnum(dce_call, mem_ctx, r2);
     188           6 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     189           0 :                         DEBUG(5,("function wkssvc_NetrUseEnum will reply async\n"));
     190             :                 }
     191           6 :                 break;
     192             :         }
     193           3 :         case 12: {
     194           3 :                 struct wkssvc_NetrMessageBufferSend *r2 = (struct wkssvc_NetrMessageBufferSend *)r;
     195           3 :                 if (DEBUGLEVEL >= 10) {
     196           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrMessageBufferSend, NDR_IN, r2);
     197             :                 }
     198           3 :                 r2->out.result = dcesrv_wkssvc_NetrMessageBufferSend(dce_call, mem_ctx, r2);
     199           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     200           0 :                         DEBUG(5,("function wkssvc_NetrMessageBufferSend will reply async\n"));
     201             :                 }
     202           3 :                 break;
     203             :         }
     204           3 :         case 13: {
     205           3 :                 struct wkssvc_NetrWorkstationStatisticsGet *r2 = (struct wkssvc_NetrWorkstationStatisticsGet *)r;
     206           3 :                 if (DEBUGLEVEL >= 10) {
     207           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWorkstationStatisticsGet, NDR_IN, r2);
     208             :                 }
     209           3 :                 r2->out.result = dcesrv_wkssvc_NetrWorkstationStatisticsGet(dce_call, mem_ctx, r2);
     210           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     211           0 :                         DEBUG(5,("function wkssvc_NetrWorkstationStatisticsGet will reply async\n"));
     212             :                 }
     213           3 :                 break;
     214             :         }
     215           3 :         case 14: {
     216           3 :                 struct wkssvc_NetrLogonDomainNameAdd *r2 = (struct wkssvc_NetrLogonDomainNameAdd *)r;
     217           3 :                 if (DEBUGLEVEL >= 10) {
     218           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrLogonDomainNameAdd, NDR_IN, r2);
     219             :                 }
     220           3 :                 r2->out.result = dcesrv_wkssvc_NetrLogonDomainNameAdd(dce_call, mem_ctx, r2);
     221           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     222           0 :                         DEBUG(5,("function wkssvc_NetrLogonDomainNameAdd will reply async\n"));
     223             :                 }
     224           3 :                 break;
     225             :         }
     226           3 :         case 15: {
     227           3 :                 struct wkssvc_NetrLogonDomainNameDel *r2 = (struct wkssvc_NetrLogonDomainNameDel *)r;
     228           3 :                 if (DEBUGLEVEL >= 10) {
     229           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrLogonDomainNameDel, NDR_IN, r2);
     230             :                 }
     231           3 :                 r2->out.result = dcesrv_wkssvc_NetrLogonDomainNameDel(dce_call, mem_ctx, r2);
     232           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     233           0 :                         DEBUG(5,("function wkssvc_NetrLogonDomainNameDel will reply async\n"));
     234             :                 }
     235           3 :                 break;
     236             :         }
     237           3 :         case 16: {
     238           3 :                 struct wkssvc_NetrJoinDomain *r2 = (struct wkssvc_NetrJoinDomain *)r;
     239           3 :                 if (DEBUGLEVEL >= 10) {
     240           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrJoinDomain, NDR_IN, r2);
     241             :                 }
     242           3 :                 r2->out.result = dcesrv_wkssvc_NetrJoinDomain(dce_call, mem_ctx, r2);
     243           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     244           0 :                         DEBUG(5,("function wkssvc_NetrJoinDomain will reply async\n"));
     245             :                 }
     246           3 :                 break;
     247             :         }
     248           3 :         case 17: {
     249           3 :                 struct wkssvc_NetrUnjoinDomain *r2 = (struct wkssvc_NetrUnjoinDomain *)r;
     250           3 :                 if (DEBUGLEVEL >= 10) {
     251           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUnjoinDomain, NDR_IN, r2);
     252             :                 }
     253           3 :                 r2->out.result = dcesrv_wkssvc_NetrUnjoinDomain(dce_call, mem_ctx, r2);
     254           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     255           0 :                         DEBUG(5,("function wkssvc_NetrUnjoinDomain will reply async\n"));
     256             :                 }
     257           3 :                 break;
     258             :         }
     259           0 :         case 18: {
     260           0 :                 struct wkssvc_NetrRenameMachineInDomain *r2 = (struct wkssvc_NetrRenameMachineInDomain *)r;
     261           0 :                 if (DEBUGLEVEL >= 10) {
     262           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrRenameMachineInDomain, NDR_IN, r2);
     263             :                 }
     264           0 :                 r2->out.result = dcesrv_wkssvc_NetrRenameMachineInDomain(dce_call, mem_ctx, r2);
     265           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     266           0 :                         DEBUG(5,("function wkssvc_NetrRenameMachineInDomain will reply async\n"));
     267             :                 }
     268           0 :                 break;
     269             :         }
     270           3 :         case 19: {
     271           3 :                 struct wkssvc_NetrValidateName *r2 = (struct wkssvc_NetrValidateName *)r;
     272           3 :                 if (DEBUGLEVEL >= 10) {
     273           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrValidateName, NDR_IN, r2);
     274             :                 }
     275           3 :                 r2->out.result = dcesrv_wkssvc_NetrValidateName(dce_call, mem_ctx, r2);
     276           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     277           0 :                         DEBUG(5,("function wkssvc_NetrValidateName will reply async\n"));
     278             :                 }
     279           3 :                 break;
     280             :         }
     281           3 :         case 20: {
     282           3 :                 struct wkssvc_NetrGetJoinInformation *r2 = (struct wkssvc_NetrGetJoinInformation *)r;
     283           3 :                 if (DEBUGLEVEL >= 10) {
     284           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrGetJoinInformation, NDR_IN, r2);
     285             :                 }
     286           3 :                 r2->out.result = dcesrv_wkssvc_NetrGetJoinInformation(dce_call, mem_ctx, r2);
     287           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     288           0 :                         DEBUG(5,("function wkssvc_NetrGetJoinInformation will reply async\n"));
     289             :                 }
     290           3 :                 break;
     291             :         }
     292           3 :         case 21: {
     293           3 :                 struct wkssvc_NetrGetJoinableOus *r2 = (struct wkssvc_NetrGetJoinableOus *)r;
     294           3 :                 if (DEBUGLEVEL >= 10) {
     295           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrGetJoinableOus, NDR_IN, r2);
     296             :                 }
     297           3 :                 r2->out.result = dcesrv_wkssvc_NetrGetJoinableOus(dce_call, mem_ctx, r2);
     298           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     299           0 :                         DEBUG(5,("function wkssvc_NetrGetJoinableOus will reply async\n"));
     300             :                 }
     301           3 :                 break;
     302             :         }
     303           0 :         case 22: {
     304           0 :                 struct wkssvc_NetrJoinDomain2 *r2 = (struct wkssvc_NetrJoinDomain2 *)r;
     305           0 :                 if (DEBUGLEVEL >= 10) {
     306           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrJoinDomain2, NDR_IN, r2);
     307             :                 }
     308           0 :                 r2->out.result = dcesrv_wkssvc_NetrJoinDomain2(dce_call, mem_ctx, r2);
     309           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     310           0 :                         DEBUG(5,("function wkssvc_NetrJoinDomain2 will reply async\n"));
     311             :                 }
     312           0 :                 break;
     313             :         }
     314           0 :         case 23: {
     315           0 :                 struct wkssvc_NetrUnjoinDomain2 *r2 = (struct wkssvc_NetrUnjoinDomain2 *)r;
     316           0 :                 if (DEBUGLEVEL >= 10) {
     317           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUnjoinDomain2, NDR_IN, r2);
     318             :                 }
     319           0 :                 r2->out.result = dcesrv_wkssvc_NetrUnjoinDomain2(dce_call, mem_ctx, r2);
     320           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     321           0 :                         DEBUG(5,("function wkssvc_NetrUnjoinDomain2 will reply async\n"));
     322             :                 }
     323           0 :                 break;
     324             :         }
     325           0 :         case 24: {
     326           0 :                 struct wkssvc_NetrRenameMachineInDomain2 *r2 = (struct wkssvc_NetrRenameMachineInDomain2 *)r;
     327           0 :                 if (DEBUGLEVEL >= 10) {
     328           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrRenameMachineInDomain2, NDR_IN, r2);
     329             :                 }
     330           0 :                 r2->out.result = dcesrv_wkssvc_NetrRenameMachineInDomain2(dce_call, mem_ctx, r2);
     331           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     332           0 :                         DEBUG(5,("function wkssvc_NetrRenameMachineInDomain2 will reply async\n"));
     333             :                 }
     334           0 :                 break;
     335             :         }
     336           3 :         case 25: {
     337           3 :                 struct wkssvc_NetrValidateName2 *r2 = (struct wkssvc_NetrValidateName2 *)r;
     338           3 :                 if (DEBUGLEVEL >= 10) {
     339           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrValidateName2, NDR_IN, r2);
     340             :                 }
     341           3 :                 r2->out.result = dcesrv_wkssvc_NetrValidateName2(dce_call, mem_ctx, r2);
     342           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     343           0 :                         DEBUG(5,("function wkssvc_NetrValidateName2 will reply async\n"));
     344             :                 }
     345           3 :                 break;
     346             :         }
     347           3 :         case 26: {
     348           3 :                 struct wkssvc_NetrGetJoinableOus2 *r2 = (struct wkssvc_NetrGetJoinableOus2 *)r;
     349           3 :                 if (DEBUGLEVEL >= 10) {
     350           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrGetJoinableOus2, NDR_IN, r2);
     351             :                 }
     352           3 :                 r2->out.result = dcesrv_wkssvc_NetrGetJoinableOus2(dce_call, mem_ctx, r2);
     353           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     354           0 :                         DEBUG(5,("function wkssvc_NetrGetJoinableOus2 will reply async\n"));
     355             :                 }
     356           3 :                 break;
     357             :         }
     358           3 :         case 27: {
     359           3 :                 struct wkssvc_NetrAddAlternateComputerName *r2 = (struct wkssvc_NetrAddAlternateComputerName *)r;
     360           3 :                 if (DEBUGLEVEL >= 10) {
     361           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrAddAlternateComputerName, NDR_IN, r2);
     362             :                 }
     363           3 :                 r2->out.result = dcesrv_wkssvc_NetrAddAlternateComputerName(dce_call, mem_ctx, r2);
     364           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     365           0 :                         DEBUG(5,("function wkssvc_NetrAddAlternateComputerName will reply async\n"));
     366             :                 }
     367           3 :                 break;
     368             :         }
     369           3 :         case 28: {
     370           3 :                 struct wkssvc_NetrRemoveAlternateComputerName *r2 = (struct wkssvc_NetrRemoveAlternateComputerName *)r;
     371           3 :                 if (DEBUGLEVEL >= 10) {
     372           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrRemoveAlternateComputerName, NDR_IN, r2);
     373             :                 }
     374           3 :                 r2->out.result = dcesrv_wkssvc_NetrRemoveAlternateComputerName(dce_call, mem_ctx, r2);
     375           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     376           0 :                         DEBUG(5,("function wkssvc_NetrRemoveAlternateComputerName will reply async\n"));
     377             :                 }
     378           3 :                 break;
     379             :         }
     380           0 :         case 29: {
     381           0 :                 struct wkssvc_NetrSetPrimaryComputername *r2 = (struct wkssvc_NetrSetPrimaryComputername *)r;
     382           0 :                 if (DEBUGLEVEL >= 10) {
     383           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrSetPrimaryComputername, NDR_IN, r2);
     384             :                 }
     385           0 :                 r2->out.result = dcesrv_wkssvc_NetrSetPrimaryComputername(dce_call, mem_ctx, r2);
     386           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     387           0 :                         DEBUG(5,("function wkssvc_NetrSetPrimaryComputername will reply async\n"));
     388             :                 }
     389           0 :                 break;
     390             :         }
     391           3 :         case 30: {
     392           3 :                 struct wkssvc_NetrEnumerateComputerNames *r2 = (struct wkssvc_NetrEnumerateComputerNames *)r;
     393           3 :                 if (DEBUGLEVEL >= 10) {
     394           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrEnumerateComputerNames, NDR_IN, r2);
     395             :                 }
     396           3 :                 r2->out.result = dcesrv_wkssvc_NetrEnumerateComputerNames(dce_call, mem_ctx, r2);
     397           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     398           0 :                         DEBUG(5,("function wkssvc_NetrEnumerateComputerNames will reply async\n"));
     399             :                 }
     400           3 :                 break;
     401             :         }
     402             : 
     403           0 :         default:
     404           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     405           0 :                 break;
     406             :         }
     407             : 
     408          80 :         if (dce_call->fault_code != 0) {
     409          66 :                 return NT_STATUS_NET_WRITE_FAULT;
     410             :         }
     411             : 
     412          14 :         return NT_STATUS_OK;
     413             : }
     414             : 
     415          14 : static NTSTATUS wkssvc__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     416             : {
     417          14 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     418             : 
     419          14 :         switch (opnum) {
     420          11 :         case 0: {
     421          11 :                 struct wkssvc_NetWkstaGetInfo *r2 = (struct wkssvc_NetWkstaGetInfo *)r;
     422          11 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     423           0 :                         DEBUG(5,("function wkssvc_NetWkstaGetInfo replied async\n"));
     424             :                 }
     425          11 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     426           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaGetInfo, NDR_OUT | NDR_SET_VALUES, r2);
     427             :                 }
     428          11 :                 if (dce_call->fault_code != 0) {
     429           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetWkstaGetInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     430             :                 }
     431          11 :                 break;
     432             :         }
     433           0 :         case 1: {
     434           0 :                 struct wkssvc_NetWkstaSetInfo *r2 = (struct wkssvc_NetWkstaSetInfo *)r;
     435           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     436           0 :                         DEBUG(5,("function wkssvc_NetWkstaSetInfo replied async\n"));
     437             :                 }
     438           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     439           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaSetInfo, NDR_OUT | NDR_SET_VALUES, r2);
     440             :                 }
     441           0 :                 if (dce_call->fault_code != 0) {
     442           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetWkstaSetInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     443             :                 }
     444           0 :                 break;
     445             :         }
     446           0 :         case 2: {
     447           0 :                 struct wkssvc_NetWkstaEnumUsers *r2 = (struct wkssvc_NetWkstaEnumUsers *)r;
     448           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     449           0 :                         DEBUG(5,("function wkssvc_NetWkstaEnumUsers replied async\n"));
     450             :                 }
     451           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     452           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaEnumUsers, NDR_OUT | NDR_SET_VALUES, r2);
     453             :                 }
     454           0 :                 if (dce_call->fault_code != 0) {
     455           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetWkstaEnumUsers\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     456             :                 }
     457           0 :                 break;
     458             :         }
     459           0 :         case 3: {
     460           0 :                 struct wkssvc_NetrWkstaUserGetInfo *r2 = (struct wkssvc_NetrWkstaUserGetInfo *)r;
     461           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     462           0 :                         DEBUG(5,("function wkssvc_NetrWkstaUserGetInfo replied async\n"));
     463             :                 }
     464           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     465           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaUserGetInfo, NDR_OUT | NDR_SET_VALUES, r2);
     466             :                 }
     467           0 :                 if (dce_call->fault_code != 0) {
     468           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrWkstaUserGetInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     469             :                 }
     470           0 :                 break;
     471             :         }
     472           0 :         case 4: {
     473           0 :                 struct wkssvc_NetrWkstaUserSetInfo *r2 = (struct wkssvc_NetrWkstaUserSetInfo *)r;
     474           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     475           0 :                         DEBUG(5,("function wkssvc_NetrWkstaUserSetInfo replied async\n"));
     476             :                 }
     477           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     478           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaUserSetInfo, NDR_OUT | NDR_SET_VALUES, r2);
     479             :                 }
     480           0 :                 if (dce_call->fault_code != 0) {
     481           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrWkstaUserSetInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     482             :                 }
     483           0 :                 break;
     484             :         }
     485           3 :         case 5: {
     486           3 :                 struct wkssvc_NetWkstaTransportEnum *r2 = (struct wkssvc_NetWkstaTransportEnum *)r;
     487           3 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     488           0 :                         DEBUG(5,("function wkssvc_NetWkstaTransportEnum replied async\n"));
     489             :                 }
     490           3 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     491           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetWkstaTransportEnum, NDR_OUT | NDR_SET_VALUES, r2);
     492             :                 }
     493           3 :                 if (dce_call->fault_code != 0) {
     494           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetWkstaTransportEnum\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     495             :                 }
     496           3 :                 break;
     497             :         }
     498           0 :         case 6: {
     499           0 :                 struct wkssvc_NetrWkstaTransportAdd *r2 = (struct wkssvc_NetrWkstaTransportAdd *)r;
     500           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     501           0 :                         DEBUG(5,("function wkssvc_NetrWkstaTransportAdd replied async\n"));
     502             :                 }
     503           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     504           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaTransportAdd, NDR_OUT | NDR_SET_VALUES, r2);
     505             :                 }
     506           0 :                 if (dce_call->fault_code != 0) {
     507           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrWkstaTransportAdd\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     508             :                 }
     509           0 :                 break;
     510             :         }
     511           0 :         case 7: {
     512           0 :                 struct wkssvc_NetrWkstaTransportDel *r2 = (struct wkssvc_NetrWkstaTransportDel *)r;
     513           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     514           0 :                         DEBUG(5,("function wkssvc_NetrWkstaTransportDel replied async\n"));
     515             :                 }
     516           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     517           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWkstaTransportDel, NDR_OUT | NDR_SET_VALUES, r2);
     518             :                 }
     519           0 :                 if (dce_call->fault_code != 0) {
     520           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrWkstaTransportDel\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     521             :                 }
     522           0 :                 break;
     523             :         }
     524           0 :         case 8: {
     525           0 :                 struct wkssvc_NetrUseAdd *r2 = (struct wkssvc_NetrUseAdd *)r;
     526           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     527           0 :                         DEBUG(5,("function wkssvc_NetrUseAdd replied async\n"));
     528             :                 }
     529           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     530           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseAdd, NDR_OUT | NDR_SET_VALUES, r2);
     531             :                 }
     532           0 :                 if (dce_call->fault_code != 0) {
     533           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrUseAdd\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     534             :                 }
     535           0 :                 break;
     536             :         }
     537           0 :         case 9: {
     538           0 :                 struct wkssvc_NetrUseGetInfo *r2 = (struct wkssvc_NetrUseGetInfo *)r;
     539           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     540           0 :                         DEBUG(5,("function wkssvc_NetrUseGetInfo replied async\n"));
     541             :                 }
     542           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     543           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseGetInfo, NDR_OUT | NDR_SET_VALUES, r2);
     544             :                 }
     545           0 :                 if (dce_call->fault_code != 0) {
     546           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrUseGetInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     547             :                 }
     548           0 :                 break;
     549             :         }
     550           0 :         case 10: {
     551           0 :                 struct wkssvc_NetrUseDel *r2 = (struct wkssvc_NetrUseDel *)r;
     552           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     553           0 :                         DEBUG(5,("function wkssvc_NetrUseDel replied async\n"));
     554             :                 }
     555           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     556           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseDel, NDR_OUT | NDR_SET_VALUES, r2);
     557             :                 }
     558           0 :                 if (dce_call->fault_code != 0) {
     559           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrUseDel\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     560             :                 }
     561           0 :                 break;
     562             :         }
     563           0 :         case 11: {
     564           0 :                 struct wkssvc_NetrUseEnum *r2 = (struct wkssvc_NetrUseEnum *)r;
     565           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     566           0 :                         DEBUG(5,("function wkssvc_NetrUseEnum replied async\n"));
     567             :                 }
     568           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     569           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUseEnum, NDR_OUT | NDR_SET_VALUES, r2);
     570             :                 }
     571           0 :                 if (dce_call->fault_code != 0) {
     572           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrUseEnum\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     573             :                 }
     574           0 :                 break;
     575             :         }
     576           0 :         case 12: {
     577           0 :                 struct wkssvc_NetrMessageBufferSend *r2 = (struct wkssvc_NetrMessageBufferSend *)r;
     578           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     579           0 :                         DEBUG(5,("function wkssvc_NetrMessageBufferSend replied async\n"));
     580             :                 }
     581           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     582           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrMessageBufferSend, NDR_OUT | NDR_SET_VALUES, r2);
     583             :                 }
     584           0 :                 if (dce_call->fault_code != 0) {
     585           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrMessageBufferSend\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     586             :                 }
     587           0 :                 break;
     588             :         }
     589           0 :         case 13: {
     590           0 :                 struct wkssvc_NetrWorkstationStatisticsGet *r2 = (struct wkssvc_NetrWorkstationStatisticsGet *)r;
     591           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     592           0 :                         DEBUG(5,("function wkssvc_NetrWorkstationStatisticsGet replied async\n"));
     593             :                 }
     594           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     595           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrWorkstationStatisticsGet, NDR_OUT | NDR_SET_VALUES, r2);
     596             :                 }
     597           0 :                 if (dce_call->fault_code != 0) {
     598           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrWorkstationStatisticsGet\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     599             :                 }
     600           0 :                 break;
     601             :         }
     602           0 :         case 14: {
     603           0 :                 struct wkssvc_NetrLogonDomainNameAdd *r2 = (struct wkssvc_NetrLogonDomainNameAdd *)r;
     604           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     605           0 :                         DEBUG(5,("function wkssvc_NetrLogonDomainNameAdd replied async\n"));
     606             :                 }
     607           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     608           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrLogonDomainNameAdd, NDR_OUT | NDR_SET_VALUES, r2);
     609             :                 }
     610           0 :                 if (dce_call->fault_code != 0) {
     611           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrLogonDomainNameAdd\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     612             :                 }
     613           0 :                 break;
     614             :         }
     615           0 :         case 15: {
     616           0 :                 struct wkssvc_NetrLogonDomainNameDel *r2 = (struct wkssvc_NetrLogonDomainNameDel *)r;
     617           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     618           0 :                         DEBUG(5,("function wkssvc_NetrLogonDomainNameDel replied async\n"));
     619             :                 }
     620           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     621           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrLogonDomainNameDel, NDR_OUT | NDR_SET_VALUES, r2);
     622             :                 }
     623           0 :                 if (dce_call->fault_code != 0) {
     624           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrLogonDomainNameDel\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     625             :                 }
     626           0 :                 break;
     627             :         }
     628           0 :         case 16: {
     629           0 :                 struct wkssvc_NetrJoinDomain *r2 = (struct wkssvc_NetrJoinDomain *)r;
     630           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     631           0 :                         DEBUG(5,("function wkssvc_NetrJoinDomain replied async\n"));
     632             :                 }
     633           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     634           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrJoinDomain, NDR_OUT | NDR_SET_VALUES, r2);
     635             :                 }
     636           0 :                 if (dce_call->fault_code != 0) {
     637           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrJoinDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     638             :                 }
     639           0 :                 break;
     640             :         }
     641           0 :         case 17: {
     642           0 :                 struct wkssvc_NetrUnjoinDomain *r2 = (struct wkssvc_NetrUnjoinDomain *)r;
     643           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     644           0 :                         DEBUG(5,("function wkssvc_NetrUnjoinDomain replied async\n"));
     645             :                 }
     646           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     647           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUnjoinDomain, NDR_OUT | NDR_SET_VALUES, r2);
     648             :                 }
     649           0 :                 if (dce_call->fault_code != 0) {
     650           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrUnjoinDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     651             :                 }
     652           0 :                 break;
     653             :         }
     654           0 :         case 18: {
     655           0 :                 struct wkssvc_NetrRenameMachineInDomain *r2 = (struct wkssvc_NetrRenameMachineInDomain *)r;
     656           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     657           0 :                         DEBUG(5,("function wkssvc_NetrRenameMachineInDomain replied async\n"));
     658             :                 }
     659           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     660           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrRenameMachineInDomain, NDR_OUT | NDR_SET_VALUES, r2);
     661             :                 }
     662           0 :                 if (dce_call->fault_code != 0) {
     663           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrRenameMachineInDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     664             :                 }
     665           0 :                 break;
     666             :         }
     667           0 :         case 19: {
     668           0 :                 struct wkssvc_NetrValidateName *r2 = (struct wkssvc_NetrValidateName *)r;
     669           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     670           0 :                         DEBUG(5,("function wkssvc_NetrValidateName replied async\n"));
     671             :                 }
     672           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     673           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrValidateName, NDR_OUT | NDR_SET_VALUES, r2);
     674             :                 }
     675           0 :                 if (dce_call->fault_code != 0) {
     676           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrValidateName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     677             :                 }
     678           0 :                 break;
     679             :         }
     680           0 :         case 20: {
     681           0 :                 struct wkssvc_NetrGetJoinInformation *r2 = (struct wkssvc_NetrGetJoinInformation *)r;
     682           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     683           0 :                         DEBUG(5,("function wkssvc_NetrGetJoinInformation replied async\n"));
     684             :                 }
     685           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     686           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrGetJoinInformation, NDR_OUT | NDR_SET_VALUES, r2);
     687             :                 }
     688           0 :                 if (dce_call->fault_code != 0) {
     689           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrGetJoinInformation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     690             :                 }
     691           0 :                 break;
     692             :         }
     693           0 :         case 21: {
     694           0 :                 struct wkssvc_NetrGetJoinableOus *r2 = (struct wkssvc_NetrGetJoinableOus *)r;
     695           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     696           0 :                         DEBUG(5,("function wkssvc_NetrGetJoinableOus replied async\n"));
     697             :                 }
     698           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     699           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrGetJoinableOus, NDR_OUT | NDR_SET_VALUES, r2);
     700             :                 }
     701           0 :                 if (dce_call->fault_code != 0) {
     702           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrGetJoinableOus\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     703             :                 }
     704           0 :                 break;
     705             :         }
     706           0 :         case 22: {
     707           0 :                 struct wkssvc_NetrJoinDomain2 *r2 = (struct wkssvc_NetrJoinDomain2 *)r;
     708           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     709           0 :                         DEBUG(5,("function wkssvc_NetrJoinDomain2 replied async\n"));
     710             :                 }
     711           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     712           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrJoinDomain2, NDR_OUT | NDR_SET_VALUES, r2);
     713             :                 }
     714           0 :                 if (dce_call->fault_code != 0) {
     715           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrJoinDomain2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     716             :                 }
     717           0 :                 break;
     718             :         }
     719           0 :         case 23: {
     720           0 :                 struct wkssvc_NetrUnjoinDomain2 *r2 = (struct wkssvc_NetrUnjoinDomain2 *)r;
     721           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     722           0 :                         DEBUG(5,("function wkssvc_NetrUnjoinDomain2 replied async\n"));
     723             :                 }
     724           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     725           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrUnjoinDomain2, NDR_OUT | NDR_SET_VALUES, r2);
     726             :                 }
     727           0 :                 if (dce_call->fault_code != 0) {
     728           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrUnjoinDomain2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     729             :                 }
     730           0 :                 break;
     731             :         }
     732           0 :         case 24: {
     733           0 :                 struct wkssvc_NetrRenameMachineInDomain2 *r2 = (struct wkssvc_NetrRenameMachineInDomain2 *)r;
     734           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     735           0 :                         DEBUG(5,("function wkssvc_NetrRenameMachineInDomain2 replied async\n"));
     736             :                 }
     737           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     738           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrRenameMachineInDomain2, NDR_OUT | NDR_SET_VALUES, r2);
     739             :                 }
     740           0 :                 if (dce_call->fault_code != 0) {
     741           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrRenameMachineInDomain2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     742             :                 }
     743           0 :                 break;
     744             :         }
     745           0 :         case 25: {
     746           0 :                 struct wkssvc_NetrValidateName2 *r2 = (struct wkssvc_NetrValidateName2 *)r;
     747           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     748           0 :                         DEBUG(5,("function wkssvc_NetrValidateName2 replied async\n"));
     749             :                 }
     750           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     751           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrValidateName2, NDR_OUT | NDR_SET_VALUES, r2);
     752             :                 }
     753           0 :                 if (dce_call->fault_code != 0) {
     754           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrValidateName2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     755             :                 }
     756           0 :                 break;
     757             :         }
     758           0 :         case 26: {
     759           0 :                 struct wkssvc_NetrGetJoinableOus2 *r2 = (struct wkssvc_NetrGetJoinableOus2 *)r;
     760           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     761           0 :                         DEBUG(5,("function wkssvc_NetrGetJoinableOus2 replied async\n"));
     762             :                 }
     763           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     764           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrGetJoinableOus2, NDR_OUT | NDR_SET_VALUES, r2);
     765             :                 }
     766           0 :                 if (dce_call->fault_code != 0) {
     767           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrGetJoinableOus2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     768             :                 }
     769           0 :                 break;
     770             :         }
     771           0 :         case 27: {
     772           0 :                 struct wkssvc_NetrAddAlternateComputerName *r2 = (struct wkssvc_NetrAddAlternateComputerName *)r;
     773           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     774           0 :                         DEBUG(5,("function wkssvc_NetrAddAlternateComputerName replied async\n"));
     775             :                 }
     776           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     777           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrAddAlternateComputerName, NDR_OUT | NDR_SET_VALUES, r2);
     778             :                 }
     779           0 :                 if (dce_call->fault_code != 0) {
     780           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrAddAlternateComputerName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     781             :                 }
     782           0 :                 break;
     783             :         }
     784           0 :         case 28: {
     785           0 :                 struct wkssvc_NetrRemoveAlternateComputerName *r2 = (struct wkssvc_NetrRemoveAlternateComputerName *)r;
     786           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     787           0 :                         DEBUG(5,("function wkssvc_NetrRemoveAlternateComputerName replied async\n"));
     788             :                 }
     789           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     790           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrRemoveAlternateComputerName, NDR_OUT | NDR_SET_VALUES, r2);
     791             :                 }
     792           0 :                 if (dce_call->fault_code != 0) {
     793           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrRemoveAlternateComputerName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     794             :                 }
     795           0 :                 break;
     796             :         }
     797           0 :         case 29: {
     798           0 :                 struct wkssvc_NetrSetPrimaryComputername *r2 = (struct wkssvc_NetrSetPrimaryComputername *)r;
     799           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     800           0 :                         DEBUG(5,("function wkssvc_NetrSetPrimaryComputername replied async\n"));
     801             :                 }
     802           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     803           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrSetPrimaryComputername, NDR_OUT | NDR_SET_VALUES, r2);
     804             :                 }
     805           0 :                 if (dce_call->fault_code != 0) {
     806           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrSetPrimaryComputername\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     807             :                 }
     808           0 :                 break;
     809             :         }
     810           0 :         case 30: {
     811           0 :                 struct wkssvc_NetrEnumerateComputerNames *r2 = (struct wkssvc_NetrEnumerateComputerNames *)r;
     812           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     813           0 :                         DEBUG(5,("function wkssvc_NetrEnumerateComputerNames replied async\n"));
     814             :                 }
     815           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     816           0 :                         NDR_PRINT_FUNCTION_DEBUG(wkssvc_NetrEnumerateComputerNames, NDR_OUT | NDR_SET_VALUES, r2);
     817             :                 }
     818           0 :                 if (dce_call->fault_code != 0) {
     819           0 :                         DEBUG(2,("dcerpc_fault %s in wkssvc_NetrEnumerateComputerNames\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     820             :                 }
     821           0 :                 break;
     822             :         }
     823             : 
     824           0 :         default:
     825           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     826           0 :                 break;
     827             :         }
     828             : 
     829          14 :         if (dce_call->fault_code != 0) {
     830           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     831             :         }
     832             : 
     833          14 :         return NT_STATUS_OK;
     834             : }
     835             : 
     836          14 : static NTSTATUS wkssvc__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
     837             : {
     838           0 :         enum ndr_err_code ndr_err;
     839          14 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     840             : 
     841          14 :         ndr_err = ndr_table_wkssvc.calls[opnum].ndr_push(push, NDR_OUT, r);
     842          14 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
     843           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
     844           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     845             :         }
     846             : 
     847          14 :         return NT_STATUS_OK;
     848             : }
     849             : 
     850             : static const struct dcesrv_interface dcesrv_wkssvc_interface = {
     851             :         .name               = "wkssvc",
     852             :         .syntax_id          = {{0x6bffd098,0xa112,0x3610,{0x98,0x33},{0x46,0xc3,0xf8,0x7e,0x34,0x5a}},1.0},
     853             :         .bind               = wkssvc__op_bind,
     854             :         .unbind             = wkssvc__op_unbind,
     855             :         .ndr_pull           = wkssvc__op_ndr_pull,
     856             :         .dispatch           = wkssvc__op_dispatch,
     857             :         .reply              = wkssvc__op_reply,
     858             :         .ndr_push           = wkssvc__op_ndr_push,
     859             :         .local              = NULL,
     860             : #ifdef DCESRV_INTERFACE_WKSSVC_FLAGS
     861             :         .flags              = DCESRV_INTERFACE_WKSSVC_FLAGS
     862             : #else
     863             :         .flags              = 0
     864             : #endif
     865             : };
     866             : 
     867             : 
     868          64 : static NTSTATUS wkssvc__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
     869             : {
     870           2 :         int i;
     871             : #ifdef DCESRV_INTERFACE_WKSSVC_NCACN_NP_SECONDARY_ENDPOINT
     872             :         const char *ncacn_np_secondary_endpoint =
     873             :                 DCESRV_INTERFACE_WKSSVC_NCACN_NP_SECONDARY_ENDPOINT;
     874             : #else
     875          64 :         const char *ncacn_np_secondary_endpoint = NULL;
     876             : #endif
     877             : 
     878         256 :         for (i=0;i<ndr_table_wkssvc.endpoints->count;i++) {
     879           6 :                 NTSTATUS ret;
     880         192 :                 const char *name = ndr_table_wkssvc.endpoints->names[i];
     881             : 
     882         192 :                 ret = dcesrv_interface_register(dce_ctx,
     883             :                                                 name,
     884             :                                                 ncacn_np_secondary_endpoint,
     885             :                                                 &dcesrv_wkssvc_interface,
     886             :                                                 NULL);
     887         192 :                 if (!NT_STATUS_IS_OK(ret)) {
     888           0 :                         DEBUG(1,("wkssvc_op_init_server: failed to register endpoint '%s'\n",name));
     889           0 :                         return ret;
     890             :                 }
     891             :         }
     892             : 
     893          64 :         return NT_STATUS_OK;
     894             : }
     895             : 
     896           0 : static NTSTATUS wkssvc__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
     897             : {
     898           0 :         return NT_STATUS_OK;
     899             : }
     900             : 
     901           0 : static bool wkssvc__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
     902             : {
     903           0 :         if (dcesrv_wkssvc_interface.syntax_id.if_version == if_version &&
     904           0 :                 GUID_equal(&dcesrv_wkssvc_interface.syntax_id.uuid, uuid)) {
     905           0 :                 memcpy(iface,&dcesrv_wkssvc_interface, sizeof(*iface));
     906           0 :                 return true;
     907             :         }
     908             : 
     909           0 :         return false;
     910             : }
     911             : 
     912           0 : static bool wkssvc__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
     913             : {
     914           0 :         if (strcmp(dcesrv_wkssvc_interface.name, name)==0) {
     915           0 :                 memcpy(iface, &dcesrv_wkssvc_interface, sizeof(*iface));
     916           0 :                 return true;
     917             :         }
     918             : 
     919           0 :         return false;
     920             : }
     921             : 
     922          66 : NTSTATUS dcerpc_server_wkssvc_init(TALLOC_CTX *ctx)
     923             : {
     924           2 :         NTSTATUS ret;
     925           2 :         static const struct dcesrv_endpoint_server ep_server = {
     926             :             /* fill in our name */
     927             :             .name = "wkssvc",
     928             : 
     929             :             /* Initialization flag */
     930             :             .initialized = false,
     931             : 
     932             :             /* fill in all the operations */
     933             : #ifdef DCESRV_INTERFACE_WKSSVC_INIT_SERVER
     934             :             .init_server = DCESRV_INTERFACE_WKSSVC_INIT_SERVER,
     935             : #else
     936             :             .init_server = wkssvc__op_init_server,
     937             : #endif
     938             : #ifdef DCESRV_INTERFACE_WKSSVC_SHUTDOWN_SERVER
     939             :             .shutdown_server = DCESRV_INTERFACE_WKSSVC_SHUTDOWN_SERVER,
     940             : #else
     941             :             .shutdown_server = wkssvc__op_shutdown_server,
     942             : #endif
     943             :             .interface_by_uuid = wkssvc__op_interface_by_uuid,
     944             :             .interface_by_name = wkssvc__op_interface_by_name
     945             :         };
     946             :         /* register ourselves with the DCERPC subsystem. */
     947          66 :         ret = dcerpc_register_ep_server(&ep_server);
     948             : 
     949          66 :         if (!NT_STATUS_IS_OK(ret)) {
     950           0 :                 DEBUG(0,("Failed to register 'wkssvc' endpoint server!\n"));
     951           0 :                 return ret;
     952             :         }
     953             : 
     954          66 :         return ret;
     955             : }
     956             : 

Generated by: LCOV version 1.14