LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_winreg_s.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 245 684 35.8 %
Date: 2021-09-23 10:06:22 Functions: 8 11 72.7 %

          Line data    Source code
       1             : /* server functions auto-generated by pidl */
       2             : #include "bin/default/librpc/gen_ndr/ndr_winreg.h"
       3             : #include <util/debug.h>
       4             : 
       5             : NTSTATUS dcerpc_server_winreg_init(TALLOC_CTX *);
       6             : 
       7             : /* winreg - dcerpc server boilerplate generated by pidl */
       8             : 
       9             : 
      10          23 : static NTSTATUS winreg__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      11             : {
      12             : #ifdef DCESRV_INTERFACE_WINREG_BIND
      13             :         return DCESRV_INTERFACE_WINREG_BIND(context,iface);
      14             : #else
      15          23 :         return NT_STATUS_OK;
      16             : #endif
      17             : }
      18             : 
      19          23 : static void winreg__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      20             : {
      21             : #ifdef DCESRV_INTERFACE_WINREG_UNBIND
      22             :         DCESRV_INTERFACE_WINREG_UNBIND(context, iface);
      23             : #else
      24          23 :         return;
      25             : #endif
      26             : }
      27             : 
      28        6548 : static NTSTATUS winreg__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
      29             : {
      30             :         enum ndr_err_code ndr_err;
      31        6548 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      32             : 
      33        6548 :         dce_call->fault_code = 0;
      34             : 
      35        6548 :         if (opnum >= ndr_table_winreg.num_calls) {
      36           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
      37           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      38             :         }
      39             : 
      40       13096 :         *r = talloc_named(mem_ctx,
      41        6548 :                           ndr_table_winreg.calls[opnum].struct_size,
      42             :                           "struct %s",
      43        6548 :                           ndr_table_winreg.calls[opnum].name);
      44        6548 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      45             : 
      46             :         /* unravel the NDR for the packet */
      47        6548 :         ndr_err = ndr_table_winreg.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      48        6548 :         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        6548 :         return NT_STATUS_OK;
      54             : }
      55             : 
      56        6548 : static NTSTATUS winreg__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
      57             : {
      58        6548 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      59             : 
      60        6548 :         switch (opnum) {
      61          20 :         case 0: {
      62          20 :                 struct winreg_OpenHKCR *r2 = (struct winreg_OpenHKCR *)r;
      63          20 :                 if (DEBUGLEVEL >= 10) {
      64           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCR, NDR_IN, r2);
      65             :                 }
      66          20 :                 r2->out.result = dcesrv_winreg_OpenHKCR(dce_call, mem_ctx, r2);
      67          20 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      68           0 :                         DEBUG(5,("function winreg_OpenHKCR will reply async\n"));
      69             :                 }
      70          20 :                 break;
      71             :         }
      72          20 :         case 1: {
      73          20 :                 struct winreg_OpenHKCU *r2 = (struct winreg_OpenHKCU *)r;
      74          20 :                 if (DEBUGLEVEL >= 10) {
      75           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCU, NDR_IN, r2);
      76             :                 }
      77          20 :                 r2->out.result = dcesrv_winreg_OpenHKCU(dce_call, mem_ctx, r2);
      78          20 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      79           0 :                         DEBUG(5,("function winreg_OpenHKCU will reply async\n"));
      80             :                 }
      81          20 :                 break;
      82             :         }
      83          23 :         case 2: {
      84          23 :                 struct winreg_OpenHKLM *r2 = (struct winreg_OpenHKLM *)r;
      85          23 :                 if (DEBUGLEVEL >= 10) {
      86           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKLM, NDR_IN, r2);
      87             :                 }
      88          23 :                 r2->out.result = dcesrv_winreg_OpenHKLM(dce_call, mem_ctx, r2);
      89          23 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      90           0 :                         DEBUG(5,("function winreg_OpenHKLM will reply async\n"));
      91             :                 }
      92          23 :                 break;
      93             :         }
      94           0 :         case 3: {
      95           0 :                 struct winreg_OpenHKPD *r2 = (struct winreg_OpenHKPD *)r;
      96           0 :                 if (DEBUGLEVEL >= 10) {
      97           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKPD, NDR_IN, r2);
      98             :                 }
      99           0 :                 r2->out.result = dcesrv_winreg_OpenHKPD(dce_call, mem_ctx, r2);
     100           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     101           0 :                         DEBUG(5,("function winreg_OpenHKPD will reply async\n"));
     102             :                 }
     103           0 :                 break;
     104             :         }
     105          20 :         case 4: {
     106          20 :                 struct winreg_OpenHKU *r2 = (struct winreg_OpenHKU *)r;
     107          20 :                 if (DEBUGLEVEL >= 10) {
     108           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKU, NDR_IN, r2);
     109             :                 }
     110          20 :                 r2->out.result = dcesrv_winreg_OpenHKU(dce_call, mem_ctx, r2);
     111          20 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     112           0 :                         DEBUG(5,("function winreg_OpenHKU will reply async\n"));
     113             :                 }
     114          20 :                 break;
     115             :         }
     116         163 :         case 5: {
     117         163 :                 struct winreg_CloseKey *r2 = (struct winreg_CloseKey *)r;
     118         163 :                 if (DEBUGLEVEL >= 10) {
     119           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_CloseKey, NDR_IN, r2);
     120             :                 }
     121         163 :                 r2->out.result = dcesrv_winreg_CloseKey(dce_call, mem_ctx, r2);
     122         163 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     123           0 :                         DEBUG(5,("function winreg_CloseKey will reply async\n"));
     124             :                 }
     125         163 :                 break;
     126             :         }
     127         420 :         case 6: {
     128         420 :                 struct winreg_CreateKey *r2 = (struct winreg_CreateKey *)r;
     129         420 :                 if (DEBUGLEVEL >= 10) {
     130           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_CreateKey, NDR_IN, r2);
     131             :                 }
     132         420 :                 r2->out.result = dcesrv_winreg_CreateKey(dce_call, mem_ctx, r2);
     133         420 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     134           0 :                         DEBUG(5,("function winreg_CreateKey will reply async\n"));
     135             :                 }
     136         420 :                 break;
     137             :         }
     138         640 :         case 7: {
     139         640 :                 struct winreg_DeleteKey *r2 = (struct winreg_DeleteKey *)r;
     140         640 :                 if (DEBUGLEVEL >= 10) {
     141           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteKey, NDR_IN, r2);
     142             :                 }
     143         640 :                 r2->out.result = dcesrv_winreg_DeleteKey(dce_call, mem_ctx, r2);
     144         640 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     145           0 :                         DEBUG(5,("function winreg_DeleteKey will reply async\n"));
     146             :                 }
     147         640 :                 break;
     148             :         }
     149         360 :         case 8: {
     150         360 :                 struct winreg_DeleteValue *r2 = (struct winreg_DeleteValue *)r;
     151         360 :                 if (DEBUGLEVEL >= 10) {
     152           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteValue, NDR_IN, r2);
     153             :                 }
     154         360 :                 r2->out.result = dcesrv_winreg_DeleteValue(dce_call, mem_ctx, r2);
     155         360 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     156           0 :                         DEBUG(5,("function winreg_DeleteValue will reply async\n"));
     157             :                 }
     158         360 :                 break;
     159             :         }
     160          60 :         case 9: {
     161          60 :                 struct winreg_EnumKey *r2 = (struct winreg_EnumKey *)r;
     162          60 :                 if (DEBUGLEVEL >= 10) {
     163           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_EnumKey, NDR_IN, r2);
     164             :                 }
     165          60 :                 r2->out.result = dcesrv_winreg_EnumKey(dce_call, mem_ctx, r2);
     166          60 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     167           0 :                         DEBUG(5,("function winreg_EnumKey will reply async\n"));
     168             :                 }
     169          60 :                 break;
     170             :         }
     171         120 :         case 10: {
     172         120 :                 struct winreg_EnumValue *r2 = (struct winreg_EnumValue *)r;
     173         120 :                 if (DEBUGLEVEL >= 10) {
     174           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_EnumValue, NDR_IN, r2);
     175             :                 }
     176         120 :                 r2->out.result = dcesrv_winreg_EnumValue(dce_call, mem_ctx, r2);
     177         120 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     178           0 :                         DEBUG(5,("function winreg_EnumValue will reply async\n"));
     179             :                 }
     180         120 :                 break;
     181             :         }
     182         160 :         case 11: {
     183         160 :                 struct winreg_FlushKey *r2 = (struct winreg_FlushKey *)r;
     184         160 :                 if (DEBUGLEVEL >= 10) {
     185           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_FlushKey, NDR_IN, r2);
     186             :                 }
     187         160 :                 r2->out.result = dcesrv_winreg_FlushKey(dce_call, mem_ctx, r2);
     188         160 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     189           0 :                         DEBUG(5,("function winreg_FlushKey will reply async\n"));
     190             :                 }
     191         160 :                 break;
     192             :         }
     193           0 :         case 12: {
     194           0 :                 struct winreg_GetKeySecurity *r2 = (struct winreg_GetKeySecurity *)r;
     195           0 :                 if (DEBUGLEVEL >= 10) {
     196           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_GetKeySecurity, NDR_IN, r2);
     197             :                 }
     198           0 :                 r2->out.result = dcesrv_winreg_GetKeySecurity(dce_call, mem_ctx, r2);
     199           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     200           0 :                         DEBUG(5,("function winreg_GetKeySecurity will reply async\n"));
     201             :                 }
     202           0 :                 break;
     203             :         }
     204           0 :         case 13: {
     205           0 :                 struct winreg_LoadKey *r2 = (struct winreg_LoadKey *)r;
     206           0 :                 if (DEBUGLEVEL >= 10) {
     207           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_LoadKey, NDR_IN, r2);
     208             :                 }
     209           0 :                 r2->out.result = dcesrv_winreg_LoadKey(dce_call, mem_ctx, r2);
     210           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     211           0 :                         DEBUG(5,("function winreg_LoadKey will reply async\n"));
     212             :                 }
     213           0 :                 break;
     214             :         }
     215          60 :         case 14: {
     216          60 :                 struct winreg_NotifyChangeKeyValue *r2 = (struct winreg_NotifyChangeKeyValue *)r;
     217          60 :                 if (DEBUGLEVEL >= 10) {
     218           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_NotifyChangeKeyValue, NDR_IN, r2);
     219             :                 }
     220          60 :                 r2->out.result = dcesrv_winreg_NotifyChangeKeyValue(dce_call, mem_ctx, r2);
     221          60 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     222           0 :                         DEBUG(5,("function winreg_NotifyChangeKeyValue will reply async\n"));
     223             :                 }
     224          60 :                 break;
     225             :         }
     226         180 :         case 15: {
     227         180 :                 struct winreg_OpenKey *r2 = (struct winreg_OpenKey *)r;
     228         180 :                 if (DEBUGLEVEL >= 10) {
     229           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenKey, NDR_IN, r2);
     230             :                 }
     231         180 :                 r2->out.result = dcesrv_winreg_OpenKey(dce_call, mem_ctx, r2);
     232         180 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     233           0 :                         DEBUG(5,("function winreg_OpenKey will reply async\n"));
     234             :                 }
     235         180 :                 break;
     236             :         }
     237          61 :         case 16: {
     238          61 :                 struct winreg_QueryInfoKey *r2 = (struct winreg_QueryInfoKey *)r;
     239          61 :                 if (DEBUGLEVEL >= 10) {
     240           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryInfoKey, NDR_IN, r2);
     241             :                 }
     242          61 :                 r2->out.result = dcesrv_winreg_QueryInfoKey(dce_call, mem_ctx, r2);
     243          61 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     244           0 :                         DEBUG(5,("function winreg_QueryInfoKey will reply async\n"));
     245             :                 }
     246          61 :                 break;
     247             :         }
     248        3800 :         case 17: {
     249        3800 :                 struct winreg_QueryValue *r2 = (struct winreg_QueryValue *)r;
     250        3800 :                 if (DEBUGLEVEL >= 10) {
     251           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryValue, NDR_IN, r2);
     252             :                 }
     253        3800 :                 r2->out.result = dcesrv_winreg_QueryValue(dce_call, mem_ctx, r2);
     254        3800 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     255           0 :                         DEBUG(5,("function winreg_QueryValue will reply async\n"));
     256             :                 }
     257        3800 :                 break;
     258             :         }
     259           0 :         case 18: {
     260           0 :                 struct winreg_ReplaceKey *r2 = (struct winreg_ReplaceKey *)r;
     261           0 :                 if (DEBUGLEVEL >= 10) {
     262           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_ReplaceKey, NDR_IN, r2);
     263             :                 }
     264           0 :                 r2->out.result = dcesrv_winreg_ReplaceKey(dce_call, mem_ctx, r2);
     265           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     266           0 :                         DEBUG(5,("function winreg_ReplaceKey will reply async\n"));
     267             :                 }
     268           0 :                 break;
     269             :         }
     270           0 :         case 19: {
     271           0 :                 struct winreg_RestoreKey *r2 = (struct winreg_RestoreKey *)r;
     272           0 :                 if (DEBUGLEVEL >= 10) {
     273           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_RestoreKey, NDR_IN, r2);
     274             :                 }
     275           0 :                 r2->out.result = dcesrv_winreg_RestoreKey(dce_call, mem_ctx, r2);
     276           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     277           0 :                         DEBUG(5,("function winreg_RestoreKey will reply async\n"));
     278             :                 }
     279           0 :                 break;
     280             :         }
     281           0 :         case 20: {
     282           0 :                 struct winreg_SaveKey *r2 = (struct winreg_SaveKey *)r;
     283           0 :                 if (DEBUGLEVEL >= 10) {
     284           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SaveKey, NDR_IN, r2);
     285             :                 }
     286           0 :                 r2->out.result = dcesrv_winreg_SaveKey(dce_call, mem_ctx, r2);
     287           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     288           0 :                         DEBUG(5,("function winreg_SaveKey will reply async\n"));
     289             :                 }
     290           0 :                 break;
     291             :         }
     292           0 :         case 21: {
     293           0 :                 struct winreg_SetKeySecurity *r2 = (struct winreg_SetKeySecurity *)r;
     294           0 :                 if (DEBUGLEVEL >= 10) {
     295           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SetKeySecurity, NDR_IN, r2);
     296             :                 }
     297           0 :                 r2->out.result = dcesrv_winreg_SetKeySecurity(dce_call, mem_ctx, r2);
     298           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     299           0 :                         DEBUG(5,("function winreg_SetKeySecurity will reply async\n"));
     300             :                 }
     301           0 :                 break;
     302             :         }
     303         360 :         case 22: {
     304         360 :                 struct winreg_SetValue *r2 = (struct winreg_SetValue *)r;
     305         360 :                 if (DEBUGLEVEL >= 10) {
     306           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SetValue, NDR_IN, r2);
     307             :                 }
     308         360 :                 r2->out.result = dcesrv_winreg_SetValue(dce_call, mem_ctx, r2);
     309         360 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     310           0 :                         DEBUG(5,("function winreg_SetValue will reply async\n"));
     311             :                 }
     312         360 :                 break;
     313             :         }
     314           0 :         case 23: {
     315           0 :                 struct winreg_UnLoadKey *r2 = (struct winreg_UnLoadKey *)r;
     316           0 :                 if (DEBUGLEVEL >= 10) {
     317           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_UnLoadKey, NDR_IN, r2);
     318             :                 }
     319           0 :                 r2->out.result = dcesrv_winreg_UnLoadKey(dce_call, mem_ctx, r2);
     320           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     321           0 :                         DEBUG(5,("function winreg_UnLoadKey will reply async\n"));
     322             :                 }
     323           0 :                 break;
     324             :         }
     325           0 :         case 24: {
     326           0 :                 struct winreg_InitiateSystemShutdown *r2 = (struct winreg_InitiateSystemShutdown *)r;
     327           0 :                 if (DEBUGLEVEL >= 10) {
     328           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_InitiateSystemShutdown, NDR_IN, r2);
     329             :                 }
     330           0 :                 r2->out.result = dcesrv_winreg_InitiateSystemShutdown(dce_call, mem_ctx, r2);
     331           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     332           0 :                         DEBUG(5,("function winreg_InitiateSystemShutdown will reply async\n"));
     333             :                 }
     334           0 :                 break;
     335             :         }
     336           0 :         case 25: {
     337           0 :                 struct winreg_AbortSystemShutdown *r2 = (struct winreg_AbortSystemShutdown *)r;
     338           0 :                 if (DEBUGLEVEL >= 10) {
     339           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_AbortSystemShutdown, NDR_IN, r2);
     340             :                 }
     341           0 :                 r2->out.result = dcesrv_winreg_AbortSystemShutdown(dce_call, mem_ctx, r2);
     342           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     343           0 :                         DEBUG(5,("function winreg_AbortSystemShutdown will reply async\n"));
     344             :                 }
     345           0 :                 break;
     346             :         }
     347          81 :         case 26: {
     348          81 :                 struct winreg_GetVersion *r2 = (struct winreg_GetVersion *)r;
     349          81 :                 if (DEBUGLEVEL >= 10) {
     350           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_GetVersion, NDR_IN, r2);
     351             :                 }
     352          81 :                 r2->out.result = dcesrv_winreg_GetVersion(dce_call, mem_ctx, r2);
     353          81 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     354           0 :                         DEBUG(5,("function winreg_GetVersion will reply async\n"));
     355             :                 }
     356          81 :                 break;
     357             :         }
     358           0 :         case 27: {
     359           0 :                 struct winreg_OpenHKCC *r2 = (struct winreg_OpenHKCC *)r;
     360           0 :                 if (DEBUGLEVEL >= 10) {
     361           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCC, NDR_IN, r2);
     362             :                 }
     363           0 :                 r2->out.result = dcesrv_winreg_OpenHKCC(dce_call, mem_ctx, r2);
     364           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     365           0 :                         DEBUG(5,("function winreg_OpenHKCC will reply async\n"));
     366             :                 }
     367           0 :                 break;
     368             :         }
     369           0 :         case 28: {
     370           0 :                 struct winreg_OpenHKDD *r2 = (struct winreg_OpenHKDD *)r;
     371           0 :                 if (DEBUGLEVEL >= 10) {
     372           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKDD, NDR_IN, r2);
     373             :                 }
     374           0 :                 r2->out.result = dcesrv_winreg_OpenHKDD(dce_call, mem_ctx, r2);
     375           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     376           0 :                         DEBUG(5,("function winreg_OpenHKDD will reply async\n"));
     377             :                 }
     378           0 :                 break;
     379             :         }
     380           0 :         case 29: {
     381           0 :                 struct winreg_QueryMultipleValues *r2 = (struct winreg_QueryMultipleValues *)r;
     382           0 :                 if (DEBUGLEVEL >= 10) {
     383           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryMultipleValues, NDR_IN, r2);
     384             :                 }
     385           0 :                 r2->out.result = dcesrv_winreg_QueryMultipleValues(dce_call, mem_ctx, r2);
     386           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     387           0 :                         DEBUG(5,("function winreg_QueryMultipleValues will reply async\n"));
     388             :                 }
     389           0 :                 break;
     390             :         }
     391           0 :         case 30: {
     392           0 :                 struct winreg_InitiateSystemShutdownEx *r2 = (struct winreg_InitiateSystemShutdownEx *)r;
     393           0 :                 if (DEBUGLEVEL >= 10) {
     394           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_InitiateSystemShutdownEx, NDR_IN, r2);
     395             :                 }
     396           0 :                 r2->out.result = dcesrv_winreg_InitiateSystemShutdownEx(dce_call, mem_ctx, r2);
     397           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     398           0 :                         DEBUG(5,("function winreg_InitiateSystemShutdownEx will reply async\n"));
     399             :                 }
     400           0 :                 break;
     401             :         }
     402           0 :         case 31: {
     403           0 :                 struct winreg_SaveKeyEx *r2 = (struct winreg_SaveKeyEx *)r;
     404           0 :                 if (DEBUGLEVEL >= 10) {
     405           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SaveKeyEx, NDR_IN, r2);
     406             :                 }
     407           0 :                 r2->out.result = dcesrv_winreg_SaveKeyEx(dce_call, mem_ctx, r2);
     408           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     409           0 :                         DEBUG(5,("function winreg_SaveKeyEx will reply async\n"));
     410             :                 }
     411           0 :                 break;
     412             :         }
     413           0 :         case 32: {
     414           0 :                 struct winreg_OpenHKPT *r2 = (struct winreg_OpenHKPT *)r;
     415           0 :                 if (DEBUGLEVEL >= 10) {
     416           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKPT, NDR_IN, r2);
     417             :                 }
     418           0 :                 r2->out.result = dcesrv_winreg_OpenHKPT(dce_call, mem_ctx, r2);
     419           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     420           0 :                         DEBUG(5,("function winreg_OpenHKPT will reply async\n"));
     421             :                 }
     422           0 :                 break;
     423             :         }
     424           0 :         case 33: {
     425           0 :                 struct winreg_OpenHKPN *r2 = (struct winreg_OpenHKPN *)r;
     426           0 :                 if (DEBUGLEVEL >= 10) {
     427           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKPN, NDR_IN, r2);
     428             :                 }
     429           0 :                 r2->out.result = dcesrv_winreg_OpenHKPN(dce_call, mem_ctx, r2);
     430           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     431           0 :                         DEBUG(5,("function winreg_OpenHKPN will reply async\n"));
     432             :                 }
     433           0 :                 break;
     434             :         }
     435           0 :         case 34: {
     436           0 :                 struct winreg_QueryMultipleValues2 *r2 = (struct winreg_QueryMultipleValues2 *)r;
     437           0 :                 if (DEBUGLEVEL >= 10) {
     438           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryMultipleValues2, NDR_IN, r2);
     439             :                 }
     440           0 :                 r2->out.result = dcesrv_winreg_QueryMultipleValues2(dce_call, mem_ctx, r2);
     441           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     442           0 :                         DEBUG(5,("function winreg_QueryMultipleValues2 will reply async\n"));
     443             :                 }
     444           0 :                 break;
     445             :         }
     446           0 :         case 35: {
     447           0 :                 struct winreg_DeleteKeyEx *r2 = (struct winreg_DeleteKeyEx *)r;
     448           0 :                 if (DEBUGLEVEL >= 10) {
     449           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteKeyEx, NDR_IN, r2);
     450             :                 }
     451           0 :                 r2->out.result = dcesrv_winreg_DeleteKeyEx(dce_call, mem_ctx, r2);
     452           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     453           0 :                         DEBUG(5,("function winreg_DeleteKeyEx will reply async\n"));
     454             :                 }
     455           0 :                 break;
     456             :         }
     457             : 
     458           0 :         default:
     459           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     460           0 :                 break;
     461             :         }
     462             : 
     463        6548 :         if (dce_call->fault_code != 0) {
     464           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     465             :         }
     466             : 
     467        6548 :         return NT_STATUS_OK;
     468             : }
     469             : 
     470        6548 : static NTSTATUS winreg__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     471             : {
     472        6548 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     473             : 
     474        6548 :         switch (opnum) {
     475          20 :         case 0: {
     476          20 :                 struct winreg_OpenHKCR *r2 = (struct winreg_OpenHKCR *)r;
     477          20 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     478           0 :                         DEBUG(5,("function winreg_OpenHKCR replied async\n"));
     479             :                 }
     480          20 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     481           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCR, NDR_OUT | NDR_SET_VALUES, r2);
     482             :                 }
     483          20 :                 if (dce_call->fault_code != 0) {
     484           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenHKCR\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     485             :                 }
     486          20 :                 break;
     487             :         }
     488          20 :         case 1: {
     489          20 :                 struct winreg_OpenHKCU *r2 = (struct winreg_OpenHKCU *)r;
     490          20 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     491           0 :                         DEBUG(5,("function winreg_OpenHKCU replied async\n"));
     492             :                 }
     493          20 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     494           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCU, NDR_OUT | NDR_SET_VALUES, r2);
     495             :                 }
     496          20 :                 if (dce_call->fault_code != 0) {
     497           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenHKCU\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     498             :                 }
     499          20 :                 break;
     500             :         }
     501          23 :         case 2: {
     502          23 :                 struct winreg_OpenHKLM *r2 = (struct winreg_OpenHKLM *)r;
     503          23 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     504           0 :                         DEBUG(5,("function winreg_OpenHKLM replied async\n"));
     505             :                 }
     506          23 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     507           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKLM, NDR_OUT | NDR_SET_VALUES, r2);
     508             :                 }
     509          23 :                 if (dce_call->fault_code != 0) {
     510           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenHKLM\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     511             :                 }
     512          23 :                 break;
     513             :         }
     514           0 :         case 3: {
     515           0 :                 struct winreg_OpenHKPD *r2 = (struct winreg_OpenHKPD *)r;
     516           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     517           0 :                         DEBUG(5,("function winreg_OpenHKPD replied async\n"));
     518             :                 }
     519           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     520           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKPD, NDR_OUT | NDR_SET_VALUES, r2);
     521             :                 }
     522           0 :                 if (dce_call->fault_code != 0) {
     523           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenHKPD\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     524             :                 }
     525           0 :                 break;
     526             :         }
     527          20 :         case 4: {
     528          20 :                 struct winreg_OpenHKU *r2 = (struct winreg_OpenHKU *)r;
     529          20 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     530           0 :                         DEBUG(5,("function winreg_OpenHKU replied async\n"));
     531             :                 }
     532          20 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     533           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKU, NDR_OUT | NDR_SET_VALUES, r2);
     534             :                 }
     535          20 :                 if (dce_call->fault_code != 0) {
     536           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenHKU\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     537             :                 }
     538          20 :                 break;
     539             :         }
     540         163 :         case 5: {
     541         163 :                 struct winreg_CloseKey *r2 = (struct winreg_CloseKey *)r;
     542         163 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     543           0 :                         DEBUG(5,("function winreg_CloseKey replied async\n"));
     544             :                 }
     545         163 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     546           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_CloseKey, NDR_OUT | NDR_SET_VALUES, r2);
     547             :                 }
     548         163 :                 if (dce_call->fault_code != 0) {
     549           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_CloseKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     550             :                 }
     551         163 :                 break;
     552             :         }
     553         420 :         case 6: {
     554         420 :                 struct winreg_CreateKey *r2 = (struct winreg_CreateKey *)r;
     555         420 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     556           0 :                         DEBUG(5,("function winreg_CreateKey replied async\n"));
     557             :                 }
     558         420 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     559           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_CreateKey, NDR_OUT | NDR_SET_VALUES, r2);
     560             :                 }
     561         420 :                 if (dce_call->fault_code != 0) {
     562           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_CreateKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     563             :                 }
     564         420 :                 break;
     565             :         }
     566         640 :         case 7: {
     567         640 :                 struct winreg_DeleteKey *r2 = (struct winreg_DeleteKey *)r;
     568         640 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     569           0 :                         DEBUG(5,("function winreg_DeleteKey replied async\n"));
     570             :                 }
     571         640 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     572           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteKey, NDR_OUT | NDR_SET_VALUES, r2);
     573             :                 }
     574         640 :                 if (dce_call->fault_code != 0) {
     575           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_DeleteKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     576             :                 }
     577         640 :                 break;
     578             :         }
     579         360 :         case 8: {
     580         360 :                 struct winreg_DeleteValue *r2 = (struct winreg_DeleteValue *)r;
     581         360 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     582           0 :                         DEBUG(5,("function winreg_DeleteValue replied async\n"));
     583             :                 }
     584         360 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     585           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteValue, NDR_OUT | NDR_SET_VALUES, r2);
     586             :                 }
     587         360 :                 if (dce_call->fault_code != 0) {
     588           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_DeleteValue\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     589             :                 }
     590         360 :                 break;
     591             :         }
     592          60 :         case 9: {
     593          60 :                 struct winreg_EnumKey *r2 = (struct winreg_EnumKey *)r;
     594          60 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     595           0 :                         DEBUG(5,("function winreg_EnumKey replied async\n"));
     596             :                 }
     597          60 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     598           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_EnumKey, NDR_OUT | NDR_SET_VALUES, r2);
     599             :                 }
     600          60 :                 if (dce_call->fault_code != 0) {
     601           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_EnumKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     602             :                 }
     603          60 :                 break;
     604             :         }
     605         120 :         case 10: {
     606         120 :                 struct winreg_EnumValue *r2 = (struct winreg_EnumValue *)r;
     607         120 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     608           0 :                         DEBUG(5,("function winreg_EnumValue replied async\n"));
     609             :                 }
     610         120 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     611           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_EnumValue, NDR_OUT | NDR_SET_VALUES, r2);
     612             :                 }
     613         120 :                 if (dce_call->fault_code != 0) {
     614           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_EnumValue\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     615             :                 }
     616         120 :                 break;
     617             :         }
     618         160 :         case 11: {
     619         160 :                 struct winreg_FlushKey *r2 = (struct winreg_FlushKey *)r;
     620         160 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     621           0 :                         DEBUG(5,("function winreg_FlushKey replied async\n"));
     622             :                 }
     623         160 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     624           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_FlushKey, NDR_OUT | NDR_SET_VALUES, r2);
     625             :                 }
     626         160 :                 if (dce_call->fault_code != 0) {
     627           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_FlushKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     628             :                 }
     629         160 :                 break;
     630             :         }
     631           0 :         case 12: {
     632           0 :                 struct winreg_GetKeySecurity *r2 = (struct winreg_GetKeySecurity *)r;
     633           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     634           0 :                         DEBUG(5,("function winreg_GetKeySecurity replied async\n"));
     635             :                 }
     636           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     637           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_GetKeySecurity, NDR_OUT | NDR_SET_VALUES, r2);
     638             :                 }
     639           0 :                 if (dce_call->fault_code != 0) {
     640           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_GetKeySecurity\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     641             :                 }
     642           0 :                 break;
     643             :         }
     644           0 :         case 13: {
     645           0 :                 struct winreg_LoadKey *r2 = (struct winreg_LoadKey *)r;
     646           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     647           0 :                         DEBUG(5,("function winreg_LoadKey replied async\n"));
     648             :                 }
     649           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     650           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_LoadKey, NDR_OUT | NDR_SET_VALUES, r2);
     651             :                 }
     652           0 :                 if (dce_call->fault_code != 0) {
     653           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_LoadKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     654             :                 }
     655           0 :                 break;
     656             :         }
     657          60 :         case 14: {
     658          60 :                 struct winreg_NotifyChangeKeyValue *r2 = (struct winreg_NotifyChangeKeyValue *)r;
     659          60 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     660           0 :                         DEBUG(5,("function winreg_NotifyChangeKeyValue replied async\n"));
     661             :                 }
     662          60 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     663           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_NotifyChangeKeyValue, NDR_OUT | NDR_SET_VALUES, r2);
     664             :                 }
     665          60 :                 if (dce_call->fault_code != 0) {
     666           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_NotifyChangeKeyValue\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     667             :                 }
     668          60 :                 break;
     669             :         }
     670         180 :         case 15: {
     671         180 :                 struct winreg_OpenKey *r2 = (struct winreg_OpenKey *)r;
     672         180 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     673           0 :                         DEBUG(5,("function winreg_OpenKey replied async\n"));
     674             :                 }
     675         180 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     676           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenKey, NDR_OUT | NDR_SET_VALUES, r2);
     677             :                 }
     678         180 :                 if (dce_call->fault_code != 0) {
     679           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     680             :                 }
     681         180 :                 break;
     682             :         }
     683          61 :         case 16: {
     684          61 :                 struct winreg_QueryInfoKey *r2 = (struct winreg_QueryInfoKey *)r;
     685          61 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     686           0 :                         DEBUG(5,("function winreg_QueryInfoKey replied async\n"));
     687             :                 }
     688          61 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     689           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryInfoKey, NDR_OUT | NDR_SET_VALUES, r2);
     690             :                 }
     691          61 :                 if (dce_call->fault_code != 0) {
     692           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_QueryInfoKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     693             :                 }
     694          61 :                 break;
     695             :         }
     696        3800 :         case 17: {
     697        3800 :                 struct winreg_QueryValue *r2 = (struct winreg_QueryValue *)r;
     698        3800 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     699           0 :                         DEBUG(5,("function winreg_QueryValue replied async\n"));
     700             :                 }
     701        3800 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     702           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryValue, NDR_OUT | NDR_SET_VALUES, r2);
     703             :                 }
     704        3800 :                 if (dce_call->fault_code != 0) {
     705           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_QueryValue\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     706             :                 }
     707        3800 :                 break;
     708             :         }
     709           0 :         case 18: {
     710           0 :                 struct winreg_ReplaceKey *r2 = (struct winreg_ReplaceKey *)r;
     711           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     712           0 :                         DEBUG(5,("function winreg_ReplaceKey replied async\n"));
     713             :                 }
     714           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     715           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_ReplaceKey, NDR_OUT | NDR_SET_VALUES, r2);
     716             :                 }
     717           0 :                 if (dce_call->fault_code != 0) {
     718           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_ReplaceKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     719             :                 }
     720           0 :                 break;
     721             :         }
     722           0 :         case 19: {
     723           0 :                 struct winreg_RestoreKey *r2 = (struct winreg_RestoreKey *)r;
     724           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     725           0 :                         DEBUG(5,("function winreg_RestoreKey replied async\n"));
     726             :                 }
     727           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     728           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_RestoreKey, NDR_OUT | NDR_SET_VALUES, r2);
     729             :                 }
     730           0 :                 if (dce_call->fault_code != 0) {
     731           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_RestoreKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     732             :                 }
     733           0 :                 break;
     734             :         }
     735           0 :         case 20: {
     736           0 :                 struct winreg_SaveKey *r2 = (struct winreg_SaveKey *)r;
     737           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     738           0 :                         DEBUG(5,("function winreg_SaveKey replied async\n"));
     739             :                 }
     740           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     741           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SaveKey, NDR_OUT | NDR_SET_VALUES, r2);
     742             :                 }
     743           0 :                 if (dce_call->fault_code != 0) {
     744           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_SaveKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     745             :                 }
     746           0 :                 break;
     747             :         }
     748           0 :         case 21: {
     749           0 :                 struct winreg_SetKeySecurity *r2 = (struct winreg_SetKeySecurity *)r;
     750           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     751           0 :                         DEBUG(5,("function winreg_SetKeySecurity replied async\n"));
     752             :                 }
     753           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     754           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SetKeySecurity, NDR_OUT | NDR_SET_VALUES, r2);
     755             :                 }
     756           0 :                 if (dce_call->fault_code != 0) {
     757           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_SetKeySecurity\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     758             :                 }
     759           0 :                 break;
     760             :         }
     761         360 :         case 22: {
     762         360 :                 struct winreg_SetValue *r2 = (struct winreg_SetValue *)r;
     763         360 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     764           0 :                         DEBUG(5,("function winreg_SetValue replied async\n"));
     765             :                 }
     766         360 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     767           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SetValue, NDR_OUT | NDR_SET_VALUES, r2);
     768             :                 }
     769         360 :                 if (dce_call->fault_code != 0) {
     770           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_SetValue\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     771             :                 }
     772         360 :                 break;
     773             :         }
     774           0 :         case 23: {
     775           0 :                 struct winreg_UnLoadKey *r2 = (struct winreg_UnLoadKey *)r;
     776           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     777           0 :                         DEBUG(5,("function winreg_UnLoadKey replied async\n"));
     778             :                 }
     779           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     780           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_UnLoadKey, NDR_OUT | NDR_SET_VALUES, r2);
     781             :                 }
     782           0 :                 if (dce_call->fault_code != 0) {
     783           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_UnLoadKey\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     784             :                 }
     785           0 :                 break;
     786             :         }
     787           0 :         case 24: {
     788           0 :                 struct winreg_InitiateSystemShutdown *r2 = (struct winreg_InitiateSystemShutdown *)r;
     789           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     790           0 :                         DEBUG(5,("function winreg_InitiateSystemShutdown replied async\n"));
     791             :                 }
     792           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     793           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_InitiateSystemShutdown, NDR_OUT | NDR_SET_VALUES, r2);
     794             :                 }
     795           0 :                 if (dce_call->fault_code != 0) {
     796           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_InitiateSystemShutdown\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     797             :                 }
     798           0 :                 break;
     799             :         }
     800           0 :         case 25: {
     801           0 :                 struct winreg_AbortSystemShutdown *r2 = (struct winreg_AbortSystemShutdown *)r;
     802           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     803           0 :                         DEBUG(5,("function winreg_AbortSystemShutdown replied async\n"));
     804             :                 }
     805           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     806           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_AbortSystemShutdown, NDR_OUT | NDR_SET_VALUES, r2);
     807             :                 }
     808           0 :                 if (dce_call->fault_code != 0) {
     809           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_AbortSystemShutdown\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     810             :                 }
     811           0 :                 break;
     812             :         }
     813          81 :         case 26: {
     814          81 :                 struct winreg_GetVersion *r2 = (struct winreg_GetVersion *)r;
     815          81 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     816           0 :                         DEBUG(5,("function winreg_GetVersion replied async\n"));
     817             :                 }
     818          81 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     819           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_GetVersion, NDR_OUT | NDR_SET_VALUES, r2);
     820             :                 }
     821          81 :                 if (dce_call->fault_code != 0) {
     822           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_GetVersion\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     823             :                 }
     824          81 :                 break;
     825             :         }
     826           0 :         case 27: {
     827           0 :                 struct winreg_OpenHKCC *r2 = (struct winreg_OpenHKCC *)r;
     828           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     829           0 :                         DEBUG(5,("function winreg_OpenHKCC replied async\n"));
     830             :                 }
     831           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     832           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCC, NDR_OUT | NDR_SET_VALUES, r2);
     833             :                 }
     834           0 :                 if (dce_call->fault_code != 0) {
     835           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenHKCC\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     836             :                 }
     837           0 :                 break;
     838             :         }
     839           0 :         case 28: {
     840           0 :                 struct winreg_OpenHKDD *r2 = (struct winreg_OpenHKDD *)r;
     841           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     842           0 :                         DEBUG(5,("function winreg_OpenHKDD replied async\n"));
     843             :                 }
     844           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     845           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKDD, NDR_OUT | NDR_SET_VALUES, r2);
     846             :                 }
     847           0 :                 if (dce_call->fault_code != 0) {
     848           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenHKDD\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     849             :                 }
     850           0 :                 break;
     851             :         }
     852           0 :         case 29: {
     853           0 :                 struct winreg_QueryMultipleValues *r2 = (struct winreg_QueryMultipleValues *)r;
     854           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     855           0 :                         DEBUG(5,("function winreg_QueryMultipleValues replied async\n"));
     856             :                 }
     857           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     858           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryMultipleValues, NDR_OUT | NDR_SET_VALUES, r2);
     859             :                 }
     860           0 :                 if (dce_call->fault_code != 0) {
     861           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_QueryMultipleValues\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     862             :                 }
     863           0 :                 break;
     864             :         }
     865           0 :         case 30: {
     866           0 :                 struct winreg_InitiateSystemShutdownEx *r2 = (struct winreg_InitiateSystemShutdownEx *)r;
     867           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     868           0 :                         DEBUG(5,("function winreg_InitiateSystemShutdownEx replied async\n"));
     869             :                 }
     870           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     871           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_InitiateSystemShutdownEx, NDR_OUT | NDR_SET_VALUES, r2);
     872             :                 }
     873           0 :                 if (dce_call->fault_code != 0) {
     874           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_InitiateSystemShutdownEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     875             :                 }
     876           0 :                 break;
     877             :         }
     878           0 :         case 31: {
     879           0 :                 struct winreg_SaveKeyEx *r2 = (struct winreg_SaveKeyEx *)r;
     880           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     881           0 :                         DEBUG(5,("function winreg_SaveKeyEx replied async\n"));
     882             :                 }
     883           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     884           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SaveKeyEx, NDR_OUT | NDR_SET_VALUES, r2);
     885             :                 }
     886           0 :                 if (dce_call->fault_code != 0) {
     887           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_SaveKeyEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     888             :                 }
     889           0 :                 break;
     890             :         }
     891           0 :         case 32: {
     892           0 :                 struct winreg_OpenHKPT *r2 = (struct winreg_OpenHKPT *)r;
     893           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     894           0 :                         DEBUG(5,("function winreg_OpenHKPT replied async\n"));
     895             :                 }
     896           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     897           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKPT, NDR_OUT | NDR_SET_VALUES, r2);
     898             :                 }
     899           0 :                 if (dce_call->fault_code != 0) {
     900           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenHKPT\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     901             :                 }
     902           0 :                 break;
     903             :         }
     904           0 :         case 33: {
     905           0 :                 struct winreg_OpenHKPN *r2 = (struct winreg_OpenHKPN *)r;
     906           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     907           0 :                         DEBUG(5,("function winreg_OpenHKPN replied async\n"));
     908             :                 }
     909           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     910           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKPN, NDR_OUT | NDR_SET_VALUES, r2);
     911             :                 }
     912           0 :                 if (dce_call->fault_code != 0) {
     913           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_OpenHKPN\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     914             :                 }
     915           0 :                 break;
     916             :         }
     917           0 :         case 34: {
     918           0 :                 struct winreg_QueryMultipleValues2 *r2 = (struct winreg_QueryMultipleValues2 *)r;
     919           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     920           0 :                         DEBUG(5,("function winreg_QueryMultipleValues2 replied async\n"));
     921             :                 }
     922           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     923           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryMultipleValues2, NDR_OUT | NDR_SET_VALUES, r2);
     924             :                 }
     925           0 :                 if (dce_call->fault_code != 0) {
     926           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_QueryMultipleValues2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     927             :                 }
     928           0 :                 break;
     929             :         }
     930           0 :         case 35: {
     931           0 :                 struct winreg_DeleteKeyEx *r2 = (struct winreg_DeleteKeyEx *)r;
     932           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     933           0 :                         DEBUG(5,("function winreg_DeleteKeyEx replied async\n"));
     934             :                 }
     935           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     936           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteKeyEx, NDR_OUT | NDR_SET_VALUES, r2);
     937             :                 }
     938           0 :                 if (dce_call->fault_code != 0) {
     939           0 :                         DEBUG(2,("dcerpc_fault %s in winreg_DeleteKeyEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code)));
     940             :                 }
     941           0 :                 break;
     942             :         }
     943             : 
     944           0 :         default:
     945           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
     946           0 :                 break;
     947             :         }
     948             : 
     949        6548 :         if (dce_call->fault_code != 0) {
     950           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     951             :         }
     952             : 
     953        6548 :         return NT_STATUS_OK;
     954             : }
     955             : 
     956        6548 : static NTSTATUS winreg__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
     957             : {
     958             :         enum ndr_err_code ndr_err;
     959        6548 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     960             : 
     961        6548 :         ndr_err = ndr_table_winreg.calls[opnum].ndr_push(push, NDR_OUT, r);
     962        6548 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
     963           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
     964           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     965             :         }
     966             : 
     967        6548 :         return NT_STATUS_OK;
     968             : }
     969             : 
     970             : static const struct dcesrv_interface dcesrv_winreg_interface = {
     971             :         .name               = "winreg",
     972             :         .syntax_id          = {{0x338cd001,0x2244,0x31f1,{0xaa,0xaa},{0x90,0x00,0x38,0x00,0x10,0x03}},1.0},
     973             :         .bind               = winreg__op_bind,
     974             :         .unbind             = winreg__op_unbind,
     975             :         .ndr_pull           = winreg__op_ndr_pull,
     976             :         .dispatch           = winreg__op_dispatch,
     977             :         .reply              = winreg__op_reply,
     978             :         .ndr_push           = winreg__op_ndr_push,
     979             :         .local              = NULL,
     980             : #ifdef DCESRV_INTERFACE_WINREG_FLAGS
     981             :         .flags              = DCESRV_INTERFACE_WINREG_FLAGS
     982             : #else
     983             :         .flags              = 0
     984             : #endif
     985             : };
     986             : 
     987             : 
     988          34 : static NTSTATUS winreg__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
     989             : {
     990             :         int i;
     991             : #ifdef DCESRV_INTERFACE_WINREG_NCACN_NP_SECONDARY_ENDPOINT
     992             :         const char *ncacn_np_secondary_endpoint =
     993             :                 DCESRV_INTERFACE_WINREG_NCACN_NP_SECONDARY_ENDPOINT;
     994             : #else
     995          34 :         const char *ncacn_np_secondary_endpoint = NULL;
     996             : #endif
     997             : 
     998         136 :         for (i=0;i<ndr_table_winreg.endpoints->count;i++) {
     999             :                 NTSTATUS ret;
    1000         102 :                 const char *name = ndr_table_winreg.endpoints->names[i];
    1001             : 
    1002         102 :                 ret = dcesrv_interface_register(dce_ctx,
    1003             :                                                 name,
    1004             :                                                 ncacn_np_secondary_endpoint,
    1005             :                                                 &dcesrv_winreg_interface,
    1006             :                                                 NULL);
    1007         102 :                 if (!NT_STATUS_IS_OK(ret)) {
    1008           0 :                         DEBUG(1,("winreg_op_init_server: failed to register endpoint '%s'\n",name));
    1009           0 :                         return ret;
    1010             :                 }
    1011             :         }
    1012             : 
    1013          34 :         return NT_STATUS_OK;
    1014             : }
    1015             : 
    1016           0 : static NTSTATUS winreg__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    1017             : {
    1018           0 :         return NT_STATUS_OK;
    1019             : }
    1020             : 
    1021           0 : static bool winreg__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
    1022             : {
    1023           0 :         if (dcesrv_winreg_interface.syntax_id.if_version == if_version &&
    1024           0 :                 GUID_equal(&dcesrv_winreg_interface.syntax_id.uuid, uuid)) {
    1025           0 :                 memcpy(iface,&dcesrv_winreg_interface, sizeof(*iface));
    1026           0 :                 return true;
    1027             :         }
    1028             : 
    1029           0 :         return false;
    1030             : }
    1031             : 
    1032           0 : static bool winreg__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
    1033             : {
    1034           0 :         if (strcmp(dcesrv_winreg_interface.name, name)==0) {
    1035           0 :                 memcpy(iface, &dcesrv_winreg_interface, sizeof(*iface));
    1036           0 :                 return true;
    1037             :         }
    1038             : 
    1039           0 :         return false;
    1040             : }
    1041             : 
    1042          64 : NTSTATUS dcerpc_server_winreg_init(TALLOC_CTX *ctx)
    1043             : {
    1044             :         NTSTATUS ret;
    1045             :         static const struct dcesrv_endpoint_server ep_server = {
    1046             :             /* fill in our name */
    1047             :             .name = "winreg",
    1048             : 
    1049             :             /* Initialization flag */
    1050             :             .initialized = false,
    1051             : 
    1052             :             /* fill in all the operations */
    1053             : #ifdef DCESRV_INTERFACE_WINREG_INIT_SERVER
    1054             :             .init_server = DCESRV_INTERFACE_WINREG_INIT_SERVER,
    1055             : #else
    1056             :             .init_server = winreg__op_init_server,
    1057             : #endif
    1058             : #ifdef DCESRV_INTERFACE_WINREG_SHUTDOWN_SERVER
    1059             :             .shutdown_server = DCESRV_INTERFACE_WINREG_SHUTDOWN_SERVER,
    1060             : #else
    1061             :             .shutdown_server = winreg__op_shutdown_server,
    1062             : #endif
    1063             :             .interface_by_uuid = winreg__op_interface_by_uuid,
    1064             :             .interface_by_name = winreg__op_interface_by_name
    1065             :         };
    1066             :         /* register ourselves with the DCERPC subsystem. */
    1067          64 :         ret = dcerpc_register_ep_server(&ep_server);
    1068             : 
    1069          64 :         if (!NT_STATUS_IS_OK(ret)) {
    1070           0 :                 DEBUG(0,("Failed to register 'winreg' endpoint server!\n"));
    1071           0 :                 return ret;
    1072             :         }
    1073             : 
    1074          64 :         return ret;
    1075             : }
    1076             : 

Generated by: LCOV version 1.13