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 master 2f515e9b Lines: 247 690 35.8 %
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_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          83 : 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          83 :         return NT_STATUS_OK;
      16             : #endif
      17             : }
      18             : 
      19          83 : 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          83 :         return;
      25             : #endif
      26             : }
      27             : 
      28       30488 : static NTSTATUS winreg__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       30488 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      32             : 
      33       30488 :         dce_call->fault_code = 0;
      34             : 
      35       30488 :         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       60976 :         *r = talloc_named(mem_ctx,
      41       30488 :                           ndr_table_winreg.calls[opnum].struct_size,
      42             :                           "struct %s",
      43       30488 :                           ndr_table_winreg.calls[opnum].name);
      44       30488 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      45             : 
      46             :         /* unravel the NDR for the packet */
      47       30488 :         ndr_err = ndr_table_winreg.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      48       30488 :         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       30488 :         return NT_STATUS_OK;
      54             : }
      55             : 
      56       30488 : static NTSTATUS winreg__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
      57             : {
      58       30488 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      59             : 
      60       30488 :         switch (opnum) {
      61          80 :         case 0: {
      62          80 :                 struct winreg_OpenHKCR *r2 = (struct winreg_OpenHKCR *)r;
      63          80 :                 if (DEBUGLEVEL >= 10) {
      64           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCR, NDR_IN, r2);
      65             :                 }
      66          80 :                 r2->out.result = dcesrv_winreg_OpenHKCR(dce_call, mem_ctx, r2);
      67          80 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      68           0 :                         DEBUG(5,("function winreg_OpenHKCR will reply async\n"));
      69             :                 }
      70          80 :                 break;
      71             :         }
      72          80 :         case 1: {
      73          80 :                 struct winreg_OpenHKCU *r2 = (struct winreg_OpenHKCU *)r;
      74          80 :                 if (DEBUGLEVEL >= 10) {
      75           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCU, NDR_IN, r2);
      76             :                 }
      77          80 :                 r2->out.result = dcesrv_winreg_OpenHKCU(dce_call, mem_ctx, r2);
      78          80 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      79           0 :                         DEBUG(5,("function winreg_OpenHKCU will reply async\n"));
      80             :                 }
      81          80 :                 break;
      82             :         }
      83          83 :         case 2: {
      84          83 :                 struct winreg_OpenHKLM *r2 = (struct winreg_OpenHKLM *)r;
      85          83 :                 if (DEBUGLEVEL >= 10) {
      86           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKLM, NDR_IN, r2);
      87             :                 }
      88          83 :                 r2->out.result = dcesrv_winreg_OpenHKLM(dce_call, mem_ctx, r2);
      89          83 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
      90           0 :                         DEBUG(5,("function winreg_OpenHKLM will reply async\n"));
      91             :                 }
      92          83 :                 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          80 :         case 4: {
     106          80 :                 struct winreg_OpenHKU *r2 = (struct winreg_OpenHKU *)r;
     107          80 :                 if (DEBUGLEVEL >= 10) {
     108           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKU, NDR_IN, r2);
     109             :                 }
     110          80 :                 r2->out.result = dcesrv_winreg_OpenHKU(dce_call, mem_ctx, r2);
     111          80 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     112           0 :                         DEBUG(5,("function winreg_OpenHKU will reply async\n"));
     113             :                 }
     114          80 :                 break;
     115             :         }
     116         643 :         case 5: {
     117         643 :                 struct winreg_CloseKey *r2 = (struct winreg_CloseKey *)r;
     118         643 :                 if (DEBUGLEVEL >= 10) {
     119           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_CloseKey, NDR_IN, r2);
     120             :                 }
     121         643 :                 r2->out.result = dcesrv_winreg_CloseKey(dce_call, mem_ctx, r2);
     122         643 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     123           0 :                         DEBUG(5,("function winreg_CloseKey will reply async\n"));
     124             :                 }
     125         643 :                 break;
     126             :         }
     127        1680 :         case 6: {
     128        1680 :                 struct winreg_CreateKey *r2 = (struct winreg_CreateKey *)r;
     129        1680 :                 if (DEBUGLEVEL >= 10) {
     130           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_CreateKey, NDR_IN, r2);
     131             :                 }
     132        1680 :                 r2->out.result = dcesrv_winreg_CreateKey(dce_call, mem_ctx, r2);
     133        1680 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     134           0 :                         DEBUG(5,("function winreg_CreateKey will reply async\n"));
     135             :                 }
     136        1680 :                 break;
     137             :         }
     138        2560 :         case 7: {
     139        2560 :                 struct winreg_DeleteKey *r2 = (struct winreg_DeleteKey *)r;
     140        2560 :                 if (DEBUGLEVEL >= 10) {
     141           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteKey, NDR_IN, r2);
     142             :                 }
     143        2560 :                 r2->out.result = dcesrv_winreg_DeleteKey(dce_call, mem_ctx, r2);
     144        2560 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     145           0 :                         DEBUG(5,("function winreg_DeleteKey will reply async\n"));
     146             :                 }
     147        2560 :                 break;
     148             :         }
     149        2400 :         case 8: {
     150        2400 :                 struct winreg_DeleteValue *r2 = (struct winreg_DeleteValue *)r;
     151        2400 :                 if (DEBUGLEVEL >= 10) {
     152           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteValue, NDR_IN, r2);
     153             :                 }
     154        2400 :                 r2->out.result = dcesrv_winreg_DeleteValue(dce_call, mem_ctx, r2);
     155        2400 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     156           0 :                         DEBUG(5,("function winreg_DeleteValue will reply async\n"));
     157             :                 }
     158        2400 :                 break;
     159             :         }
     160         240 :         case 9: {
     161         240 :                 struct winreg_EnumKey *r2 = (struct winreg_EnumKey *)r;
     162         240 :                 if (DEBUGLEVEL >= 10) {
     163           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_EnumKey, NDR_IN, r2);
     164             :                 }
     165         240 :                 r2->out.result = dcesrv_winreg_EnumKey(dce_call, mem_ctx, r2);
     166         240 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     167           0 :                         DEBUG(5,("function winreg_EnumKey will reply async\n"));
     168             :                 }
     169         240 :                 break;
     170             :         }
     171        2880 :         case 10: {
     172        2880 :                 struct winreg_EnumValue *r2 = (struct winreg_EnumValue *)r;
     173        2880 :                 if (DEBUGLEVEL >= 10) {
     174           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_EnumValue, NDR_IN, r2);
     175             :                 }
     176        2880 :                 r2->out.result = dcesrv_winreg_EnumValue(dce_call, mem_ctx, r2);
     177        2880 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     178           0 :                         DEBUG(5,("function winreg_EnumValue will reply async\n"));
     179             :                 }
     180        2880 :                 break;
     181             :         }
     182         640 :         case 11: {
     183         640 :                 struct winreg_FlushKey *r2 = (struct winreg_FlushKey *)r;
     184         640 :                 if (DEBUGLEVEL >= 10) {
     185           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_FlushKey, NDR_IN, r2);
     186             :                 }
     187         640 :                 r2->out.result = dcesrv_winreg_FlushKey(dce_call, mem_ctx, r2);
     188         640 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     189           0 :                         DEBUG(5,("function winreg_FlushKey will reply async\n"));
     190             :                 }
     191         640 :                 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         240 :         case 14: {
     216         240 :                 struct winreg_NotifyChangeKeyValue *r2 = (struct winreg_NotifyChangeKeyValue *)r;
     217         240 :                 if (DEBUGLEVEL >= 10) {
     218           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_NotifyChangeKeyValue, NDR_IN, r2);
     219             :                 }
     220         240 :                 r2->out.result = dcesrv_winreg_NotifyChangeKeyValue(dce_call, mem_ctx, r2);
     221         240 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     222           0 :                         DEBUG(5,("function winreg_NotifyChangeKeyValue will reply async\n"));
     223             :                 }
     224         240 :                 break;
     225             :         }
     226         720 :         case 15: {
     227         720 :                 struct winreg_OpenKey *r2 = (struct winreg_OpenKey *)r;
     228         720 :                 if (DEBUGLEVEL >= 10) {
     229           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenKey, NDR_IN, r2);
     230             :                 }
     231         720 :                 r2->out.result = dcesrv_winreg_OpenKey(dce_call, mem_ctx, r2);
     232         720 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     233           0 :                         DEBUG(5,("function winreg_OpenKey will reply async\n"));
     234             :                 }
     235         720 :                 break;
     236             :         }
     237         241 :         case 16: {
     238         241 :                 struct winreg_QueryInfoKey *r2 = (struct winreg_QueryInfoKey *)r;
     239         241 :                 if (DEBUGLEVEL >= 10) {
     240           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryInfoKey, NDR_IN, r2);
     241             :                 }
     242         241 :                 r2->out.result = dcesrv_winreg_QueryInfoKey(dce_call, mem_ctx, r2);
     243         241 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     244           0 :                         DEBUG(5,("function winreg_QueryInfoKey will reply async\n"));
     245             :                 }
     246         241 :                 break;
     247             :         }
     248       15200 :         case 17: {
     249       15200 :                 struct winreg_QueryValue *r2 = (struct winreg_QueryValue *)r;
     250       15200 :                 if (DEBUGLEVEL >= 10) {
     251           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryValue, NDR_IN, r2);
     252             :                 }
     253       15200 :                 r2->out.result = dcesrv_winreg_QueryValue(dce_call, mem_ctx, r2);
     254       15200 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     255           0 :                         DEBUG(5,("function winreg_QueryValue will reply async\n"));
     256             :                 }
     257       15200 :                 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        2400 :         case 22: {
     304        2400 :                 struct winreg_SetValue *r2 = (struct winreg_SetValue *)r;
     305        2400 :                 if (DEBUGLEVEL >= 10) {
     306           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SetValue, NDR_IN, r2);
     307             :                 }
     308        2400 :                 r2->out.result = dcesrv_winreg_SetValue(dce_call, mem_ctx, r2);
     309        2400 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     310           0 :                         DEBUG(5,("function winreg_SetValue will reply async\n"));
     311             :                 }
     312        2400 :                 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         321 :         case 26: {
     348         321 :                 struct winreg_GetVersion *r2 = (struct winreg_GetVersion *)r;
     349         321 :                 if (DEBUGLEVEL >= 10) {
     350           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_GetVersion, NDR_IN, r2);
     351             :                 }
     352         321 :                 r2->out.result = dcesrv_winreg_GetVersion(dce_call, mem_ctx, r2);
     353         321 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     354           0 :                         DEBUG(5,("function winreg_GetVersion will reply async\n"));
     355             :                 }
     356         321 :                 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       30488 :         if (dce_call->fault_code != 0) {
     464           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     465             :         }
     466             : 
     467       30488 :         return NT_STATUS_OK;
     468             : }
     469             : 
     470       30488 : static NTSTATUS winreg__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
     471             : {
     472       30488 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     473             : 
     474       30488 :         switch (opnum) {
     475          80 :         case 0: {
     476          80 :                 struct winreg_OpenHKCR *r2 = (struct winreg_OpenHKCR *)r;
     477          80 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     478           0 :                         DEBUG(5,("function winreg_OpenHKCR replied async\n"));
     479             :                 }
     480          80 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     481           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCR, NDR_OUT | NDR_SET_VALUES, r2);
     482             :                 }
     483          80 :                 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          80 :                 break;
     487             :         }
     488          80 :         case 1: {
     489          80 :                 struct winreg_OpenHKCU *r2 = (struct winreg_OpenHKCU *)r;
     490          80 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     491           0 :                         DEBUG(5,("function winreg_OpenHKCU replied async\n"));
     492             :                 }
     493          80 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     494           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKCU, NDR_OUT | NDR_SET_VALUES, r2);
     495             :                 }
     496          80 :                 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          80 :                 break;
     500             :         }
     501          83 :         case 2: {
     502          83 :                 struct winreg_OpenHKLM *r2 = (struct winreg_OpenHKLM *)r;
     503          83 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     504           0 :                         DEBUG(5,("function winreg_OpenHKLM replied async\n"));
     505             :                 }
     506          83 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     507           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKLM, NDR_OUT | NDR_SET_VALUES, r2);
     508             :                 }
     509          83 :                 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          83 :                 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          80 :         case 4: {
     528          80 :                 struct winreg_OpenHKU *r2 = (struct winreg_OpenHKU *)r;
     529          80 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     530           0 :                         DEBUG(5,("function winreg_OpenHKU replied async\n"));
     531             :                 }
     532          80 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     533           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenHKU, NDR_OUT | NDR_SET_VALUES, r2);
     534             :                 }
     535          80 :                 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          80 :                 break;
     539             :         }
     540         643 :         case 5: {
     541         643 :                 struct winreg_CloseKey *r2 = (struct winreg_CloseKey *)r;
     542         643 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     543           0 :                         DEBUG(5,("function winreg_CloseKey replied async\n"));
     544             :                 }
     545         643 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     546           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_CloseKey, NDR_OUT | NDR_SET_VALUES, r2);
     547             :                 }
     548         643 :                 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         643 :                 break;
     552             :         }
     553        1680 :         case 6: {
     554        1680 :                 struct winreg_CreateKey *r2 = (struct winreg_CreateKey *)r;
     555        1680 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     556           0 :                         DEBUG(5,("function winreg_CreateKey replied async\n"));
     557             :                 }
     558        1680 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     559           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_CreateKey, NDR_OUT | NDR_SET_VALUES, r2);
     560             :                 }
     561        1680 :                 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        1680 :                 break;
     565             :         }
     566        2560 :         case 7: {
     567        2560 :                 struct winreg_DeleteKey *r2 = (struct winreg_DeleteKey *)r;
     568        2560 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     569           0 :                         DEBUG(5,("function winreg_DeleteKey replied async\n"));
     570             :                 }
     571        2560 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     572           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteKey, NDR_OUT | NDR_SET_VALUES, r2);
     573             :                 }
     574        2560 :                 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        2560 :                 break;
     578             :         }
     579        2400 :         case 8: {
     580        2400 :                 struct winreg_DeleteValue *r2 = (struct winreg_DeleteValue *)r;
     581        2400 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     582           0 :                         DEBUG(5,("function winreg_DeleteValue replied async\n"));
     583             :                 }
     584        2400 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     585           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_DeleteValue, NDR_OUT | NDR_SET_VALUES, r2);
     586             :                 }
     587        2400 :                 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        2400 :                 break;
     591             :         }
     592         240 :         case 9: {
     593         240 :                 struct winreg_EnumKey *r2 = (struct winreg_EnumKey *)r;
     594         240 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     595           0 :                         DEBUG(5,("function winreg_EnumKey replied async\n"));
     596             :                 }
     597         240 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     598           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_EnumKey, NDR_OUT | NDR_SET_VALUES, r2);
     599             :                 }
     600         240 :                 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         240 :                 break;
     604             :         }
     605        2880 :         case 10: {
     606        2880 :                 struct winreg_EnumValue *r2 = (struct winreg_EnumValue *)r;
     607        2880 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     608           0 :                         DEBUG(5,("function winreg_EnumValue replied async\n"));
     609             :                 }
     610        2880 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     611           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_EnumValue, NDR_OUT | NDR_SET_VALUES, r2);
     612             :                 }
     613        2880 :                 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        2880 :                 break;
     617             :         }
     618         640 :         case 11: {
     619         640 :                 struct winreg_FlushKey *r2 = (struct winreg_FlushKey *)r;
     620         640 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     621           0 :                         DEBUG(5,("function winreg_FlushKey replied async\n"));
     622             :                 }
     623         640 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     624           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_FlushKey, NDR_OUT | NDR_SET_VALUES, r2);
     625             :                 }
     626         640 :                 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         640 :                 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         240 :         case 14: {
     658         240 :                 struct winreg_NotifyChangeKeyValue *r2 = (struct winreg_NotifyChangeKeyValue *)r;
     659         240 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     660           0 :                         DEBUG(5,("function winreg_NotifyChangeKeyValue replied async\n"));
     661             :                 }
     662         240 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     663           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_NotifyChangeKeyValue, NDR_OUT | NDR_SET_VALUES, r2);
     664             :                 }
     665         240 :                 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         240 :                 break;
     669             :         }
     670         720 :         case 15: {
     671         720 :                 struct winreg_OpenKey *r2 = (struct winreg_OpenKey *)r;
     672         720 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     673           0 :                         DEBUG(5,("function winreg_OpenKey replied async\n"));
     674             :                 }
     675         720 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     676           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_OpenKey, NDR_OUT | NDR_SET_VALUES, r2);
     677             :                 }
     678         720 :                 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         720 :                 break;
     682             :         }
     683         241 :         case 16: {
     684         241 :                 struct winreg_QueryInfoKey *r2 = (struct winreg_QueryInfoKey *)r;
     685         241 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     686           0 :                         DEBUG(5,("function winreg_QueryInfoKey replied async\n"));
     687             :                 }
     688         241 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     689           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryInfoKey, NDR_OUT | NDR_SET_VALUES, r2);
     690             :                 }
     691         241 :                 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         241 :                 break;
     695             :         }
     696       15200 :         case 17: {
     697       15200 :                 struct winreg_QueryValue *r2 = (struct winreg_QueryValue *)r;
     698       15200 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     699           0 :                         DEBUG(5,("function winreg_QueryValue replied async\n"));
     700             :                 }
     701       15200 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     702           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_QueryValue, NDR_OUT | NDR_SET_VALUES, r2);
     703             :                 }
     704       15200 :                 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       15200 :                 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        2400 :         case 22: {
     762        2400 :                 struct winreg_SetValue *r2 = (struct winreg_SetValue *)r;
     763        2400 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     764           0 :                         DEBUG(5,("function winreg_SetValue replied async\n"));
     765             :                 }
     766        2400 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     767           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_SetValue, NDR_OUT | NDR_SET_VALUES, r2);
     768             :                 }
     769        2400 :                 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        2400 :                 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         321 :         case 26: {
     814         321 :                 struct winreg_GetVersion *r2 = (struct winreg_GetVersion *)r;
     815         321 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
     816           0 :                         DEBUG(5,("function winreg_GetVersion replied async\n"));
     817             :                 }
     818         321 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
     819           0 :                         NDR_PRINT_FUNCTION_DEBUG(winreg_GetVersion, NDR_OUT | NDR_SET_VALUES, r2);
     820             :                 }
     821         321 :                 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         321 :                 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       30488 :         if (dce_call->fault_code != 0) {
     950           0 :                 return NT_STATUS_NET_WRITE_FAULT;
     951             :         }
     952             : 
     953       30488 :         return NT_STATUS_OK;
     954             : }
     955             : 
     956       30488 : 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           0 :         enum ndr_err_code ndr_err;
     959       30488 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
     960             : 
     961       30488 :         ndr_err = ndr_table_winreg.calls[opnum].ndr_push(push, NDR_OUT, r);
     962       30488 :         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       30488 :         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          36 : static NTSTATUS winreg__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
     989             : {
     990           0 :         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          36 :         const char *ncacn_np_secondary_endpoint = NULL;
     996             : #endif
     997             : 
     998         144 :         for (i=0;i<ndr_table_winreg.endpoints->count;i++) {
     999           0 :                 NTSTATUS ret;
    1000         108 :                 const char *name = ndr_table_winreg.endpoints->names[i];
    1001             : 
    1002         108 :                 ret = dcesrv_interface_register(dce_ctx,
    1003             :                                                 name,
    1004             :                                                 ncacn_np_secondary_endpoint,
    1005             :                                                 &dcesrv_winreg_interface,
    1006             :                                                 NULL);
    1007         108 :                 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          36 :         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          66 : NTSTATUS dcerpc_server_winreg_init(TALLOC_CTX *ctx)
    1043             : {
    1044           2 :         NTSTATUS ret;
    1045           2 :         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          66 :         ret = dcerpc_register_ep_server(&ep_server);
    1068             : 
    1069          66 :         if (!NT_STATUS_IS_OK(ret)) {
    1070           0 :                 DEBUG(0,("Failed to register 'winreg' endpoint server!\n"));
    1071           0 :                 return ret;
    1072             :         }
    1073             : 
    1074          66 :         return ret;
    1075             : }
    1076             : 

Generated by: LCOV version 1.14