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

          Line data    Source code
       1             : /* s3 compat server functions auto-generated by pidl */
       2             : #include "bin/default/librpc/gen_ndr/ndr_samr.h"
       3             : #include "bin/default/librpc/gen_ndr/ndr_samr_scompat.h"
       4             : #include <librpc/rpc/dcesrv_core.h>
       5             : #include <rpc_server/rpc_config.h>
       6             : #include <rpc_server/rpc_server.h>
       7             : #include <util/debug.h>
       8             : 
       9             : enum s3compat_rpc_dispatch {
      10             :         S3COMPAT_RPC_DISPATCH_EXTERNAL = 0x00000001,
      11             :         S3COMPAT_RPC_DISPATCH_INTERNAL = 0x00000002,
      12             : };
      13             : 
      14             : /* samr - dcerpc server boilerplate generated by pidl */
      15         581 : static NTSTATUS samr__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      16             : {
      17             : #ifdef DCESRV_INTERFACE_SAMR_BIND
      18             :         return DCESRV_INTERFACE_SAMR_BIND(context,iface);
      19             : #else
      20         581 :         return NT_STATUS_OK;
      21             : #endif
      22             : }
      23             : 
      24         580 : static void samr__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      25             : {
      26             : #ifdef DCESRV_INTERFACE_SAMR_UNBIND
      27             :         DCESRV_INTERFACE_SAMR_UNBIND(context, iface);
      28             : #else
      29         580 :         return;
      30             : #endif
      31             : }
      32             : 
      33       29809 : NTSTATUS samr__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
      34             : {
      35           0 :         enum ndr_err_code ndr_err;
      36       29809 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      37             : 
      38       29809 :         dce_call->fault_code = 0;
      39             : 
      40       29809 :         if (opnum >= ndr_table_samr.num_calls) {
      41           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
      42           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      43             :         }
      44             : 
      45       29809 :         *r = talloc_named(mem_ctx, ndr_table_samr.calls[opnum].struct_size, "struct %s", ndr_table_samr.calls[opnum].name);
      46       29809 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      47             : 
      48             :         /* unravel the NDR for the packet */
      49       29809 :         ndr_err = ndr_table_samr.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      50       29809 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
      51           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
      52           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      53             :         }
      54             : 
      55       29809 :         return NT_STATUS_OK;
      56             : }
      57             : 
      58       29809 : static NTSTATUS samr__op_dispatch_internal(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, enum s3compat_rpc_dispatch dispatch)
      59             : {
      60       29809 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      61       29809 :         struct pipes_struct *p = NULL;
      62       29809 :         NTSTATUS status = NT_STATUS_OK;
      63       29809 :         bool impersonated = false;
      64             : 
      65             :         /* Retrieve pipes struct */
      66       29809 :         p = dcesrv_get_pipes_struct(dce_call->conn);
      67       29809 :         p->dce_call = dce_call;
      68       29809 :         p->mem_ctx = mem_ctx;
      69             :         /* Reset pipes struct fault state */
      70       29809 :         p->fault_state = 0;
      71             : 
      72             :         /* Impersonate */
      73       29809 :         if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) {
      74       29809 :                 impersonated = become_authenticated_pipe_user(dce_call->auth_state->session_info);
      75       29809 :                 if (!impersonated) {
      76           0 :                         dce_call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
      77           0 :                         status = NT_STATUS_NET_WRITE_FAULT;
      78           0 :                         goto fail;
      79             :                 }
      80             :         }
      81             : 
      82       29809 :         switch (opnum) {
      83         252 :         case 0: { /* samr_Connect */
      84         252 :                 struct samr_Connect *r2 = (struct samr_Connect *)r;
      85         252 :                 if (DEBUGLEVEL >= 10) {
      86           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect, NDR_IN, r2);
      87             :                 }
      88         252 :                 NDR_ZERO_STRUCT(r2->out);
      89         252 :                 r2->out.connect_handle = talloc_zero(r2, struct policy_handle);
      90         252 :                 if (r2->out.connect_handle == NULL) {
      91           0 :                         status = NT_STATUS_NO_MEMORY;
      92           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
      93           0 :                         goto fail;
      94             :                 }
      95             : 
      96         252 :                 r2->out.result = _samr_Connect(p, r2);
      97         252 :                 break;
      98             :         }
      99        6212 :         case 1: { /* samr_Close */
     100        6212 :                 struct samr_Close *r2 = (struct samr_Close *)r;
     101        6212 :                 if (DEBUGLEVEL >= 10) {
     102           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Close, NDR_IN, r2);
     103             :                 }
     104        6212 :                 NDR_ZERO_STRUCT(r2->out);
     105        6212 :                 r2->out.handle = r2->in.handle;
     106        6212 :                 r2->out.result = _samr_Close(p, r2);
     107        6212 :                 break;
     108             :         }
     109           4 :         case 2: { /* samr_SetSecurity */
     110           4 :                 struct samr_SetSecurity *r2 = (struct samr_SetSecurity *)r;
     111           4 :                 if (DEBUGLEVEL >= 10) {
     112           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetSecurity, NDR_IN, r2);
     113             :                 }
     114           4 :                 r2->out.result = _samr_SetSecurity(p, r2);
     115           4 :                 break;
     116             :         }
     117           8 :         case 3: { /* samr_QuerySecurity */
     118           8 :                 struct samr_QuerySecurity *r2 = (struct samr_QuerySecurity *)r;
     119           8 :                 if (DEBUGLEVEL >= 10) {
     120           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QuerySecurity, NDR_IN, r2);
     121             :                 }
     122           8 :                 NDR_ZERO_STRUCT(r2->out);
     123           8 :                 r2->out.sdbuf = talloc_zero(r2, struct sec_desc_buf *);
     124           8 :                 if (r2->out.sdbuf == NULL) {
     125           0 :                         status = NT_STATUS_NO_MEMORY;
     126           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     127           0 :                         goto fail;
     128             :                 }
     129             : 
     130           8 :                 r2->out.result = _samr_QuerySecurity(p, r2);
     131           8 :                 break;
     132             :         }
     133           0 :         case 4: { /* samr_Shutdown */
     134           0 :                 struct samr_Shutdown *r2 = (struct samr_Shutdown *)r;
     135           0 :                 if (DEBUGLEVEL >= 10) {
     136           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Shutdown, NDR_IN, r2);
     137             :                 }
     138           0 :                 r2->out.result = _samr_Shutdown(p, r2);
     139           0 :                 break;
     140             :         }
     141         396 :         case 5: { /* samr_LookupDomain */
     142         396 :                 struct samr_LookupDomain *r2 = (struct samr_LookupDomain *)r;
     143         396 :                 if (DEBUGLEVEL >= 10) {
     144           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_LookupDomain, NDR_IN, r2);
     145             :                 }
     146         396 :                 NDR_ZERO_STRUCT(r2->out);
     147         396 :                 r2->out.sid = talloc_zero(r2, struct dom_sid2 *);
     148         396 :                 if (r2->out.sid == NULL) {
     149           0 :                         status = NT_STATUS_NO_MEMORY;
     150           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     151           0 :                         goto fail;
     152             :                 }
     153             : 
     154         396 :                 r2->out.result = _samr_LookupDomain(p, r2);
     155         396 :                 break;
     156             :         }
     157          68 :         case 6: { /* samr_EnumDomains */
     158          68 :                 struct samr_EnumDomains *r2 = (struct samr_EnumDomains *)r;
     159          68 :                 if (DEBUGLEVEL >= 10) {
     160           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_EnumDomains, NDR_IN, r2);
     161             :                 }
     162          68 :                 NDR_ZERO_STRUCT(r2->out);
     163          68 :                 r2->out.resume_handle = r2->in.resume_handle;
     164          68 :                 r2->out.sam = talloc_zero(r2, struct samr_SamArray *);
     165          68 :                 if (r2->out.sam == NULL) {
     166           0 :                         status = NT_STATUS_NO_MEMORY;
     167           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     168           0 :                         goto fail;
     169             :                 }
     170             : 
     171          68 :                 r2->out.num_entries = talloc_zero(r2, uint32_t);
     172          68 :                 if (r2->out.num_entries == NULL) {
     173           0 :                         status = NT_STATUS_NO_MEMORY;
     174           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     175           0 :                         goto fail;
     176             :                 }
     177             : 
     178          68 :                 r2->out.result = _samr_EnumDomains(p, r2);
     179          68 :                 break;
     180             :         }
     181         589 :         case 7: { /* samr_OpenDomain */
     182         589 :                 struct samr_OpenDomain *r2 = (struct samr_OpenDomain *)r;
     183         589 :                 if (DEBUGLEVEL >= 10) {
     184           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OpenDomain, NDR_IN, r2);
     185             :                 }
     186         589 :                 NDR_ZERO_STRUCT(r2->out);
     187         589 :                 r2->out.domain_handle = talloc_zero(r2, struct policy_handle);
     188         589 :                 if (r2->out.domain_handle == NULL) {
     189           0 :                         status = NT_STATUS_NO_MEMORY;
     190           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     191           0 :                         goto fail;
     192             :                 }
     193             : 
     194         589 :                 r2->out.result = _samr_OpenDomain(p, r2);
     195         589 :                 break;
     196             :         }
     197         128 :         case 8: { /* samr_QueryDomainInfo */
     198         128 :                 struct samr_QueryDomainInfo *r2 = (struct samr_QueryDomainInfo *)r;
     199         128 :                 if (DEBUGLEVEL >= 10) {
     200           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDomainInfo, NDR_IN, r2);
     201             :                 }
     202         128 :                 NDR_ZERO_STRUCT(r2->out);
     203         128 :                 r2->out.info = talloc_zero(r2, union samr_DomainInfo *);
     204         128 :                 if (r2->out.info == NULL) {
     205           0 :                         status = NT_STATUS_NO_MEMORY;
     206           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     207           0 :                         goto fail;
     208             :                 }
     209             : 
     210         128 :                 r2->out.result = _samr_QueryDomainInfo(p, r2);
     211         128 :                 break;
     212             :         }
     213          92 :         case 9: { /* samr_SetDomainInfo */
     214          92 :                 struct samr_SetDomainInfo *r2 = (struct samr_SetDomainInfo *)r;
     215          92 :                 if (DEBUGLEVEL >= 10) {
     216           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetDomainInfo, NDR_IN, r2);
     217             :                 }
     218          92 :                 r2->out.result = _samr_SetDomainInfo(p, r2);
     219          92 :                 break;
     220             :         }
     221         604 :         case 10: { /* samr_CreateDomainGroup */
     222         604 :                 struct samr_CreateDomainGroup *r2 = (struct samr_CreateDomainGroup *)r;
     223         604 :                 if (DEBUGLEVEL >= 10) {
     224           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_CreateDomainGroup, NDR_IN, r2);
     225             :                 }
     226         604 :                 NDR_ZERO_STRUCT(r2->out);
     227         604 :                 r2->out.group_handle = talloc_zero(r2, struct policy_handle);
     228         604 :                 if (r2->out.group_handle == NULL) {
     229           0 :                         status = NT_STATUS_NO_MEMORY;
     230           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     231           0 :                         goto fail;
     232             :                 }
     233             : 
     234         604 :                 r2->out.rid = talloc_zero(r2, uint32_t);
     235         604 :                 if (r2->out.rid == NULL) {
     236           0 :                         status = NT_STATUS_NO_MEMORY;
     237           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     238           0 :                         goto fail;
     239             :                 }
     240             : 
     241         604 :                 r2->out.result = _samr_CreateDomainGroup(p, r2);
     242         604 :                 break;
     243             :         }
     244          24 :         case 11: { /* samr_EnumDomainGroups */
     245          24 :                 struct samr_EnumDomainGroups *r2 = (struct samr_EnumDomainGroups *)r;
     246          24 :                 if (DEBUGLEVEL >= 10) {
     247           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_EnumDomainGroups, NDR_IN, r2);
     248             :                 }
     249          24 :                 NDR_ZERO_STRUCT(r2->out);
     250          24 :                 r2->out.resume_handle = r2->in.resume_handle;
     251          24 :                 r2->out.sam = talloc_zero(r2, struct samr_SamArray *);
     252          24 :                 if (r2->out.sam == NULL) {
     253           0 :                         status = NT_STATUS_NO_MEMORY;
     254           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     255           0 :                         goto fail;
     256             :                 }
     257             : 
     258          24 :                 r2->out.num_entries = talloc_zero(r2, uint32_t);
     259          24 :                 if (r2->out.num_entries == NULL) {
     260           0 :                         status = NT_STATUS_NO_MEMORY;
     261           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     262           0 :                         goto fail;
     263             :                 }
     264             : 
     265          24 :                 r2->out.result = _samr_EnumDomainGroups(p, r2);
     266          24 :                 break;
     267             :         }
     268         630 :         case 12: { /* samr_CreateUser */
     269         630 :                 struct samr_CreateUser *r2 = (struct samr_CreateUser *)r;
     270         630 :                 if (DEBUGLEVEL >= 10) {
     271           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_CreateUser, NDR_IN, r2);
     272             :                 }
     273         630 :                 NDR_ZERO_STRUCT(r2->out);
     274         630 :                 r2->out.user_handle = talloc_zero(r2, struct policy_handle);
     275         630 :                 if (r2->out.user_handle == NULL) {
     276           0 :                         status = NT_STATUS_NO_MEMORY;
     277           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     278           0 :                         goto fail;
     279             :                 }
     280             : 
     281         630 :                 r2->out.rid = talloc_zero(r2, uint32_t);
     282         630 :                 if (r2->out.rid == NULL) {
     283           0 :                         status = NT_STATUS_NO_MEMORY;
     284           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     285           0 :                         goto fail;
     286             :                 }
     287             : 
     288         630 :                 r2->out.result = _samr_CreateUser(p, r2);
     289         630 :                 break;
     290             :         }
     291          60 :         case 13: { /* samr_EnumDomainUsers */
     292          60 :                 struct samr_EnumDomainUsers *r2 = (struct samr_EnumDomainUsers *)r;
     293          60 :                 if (DEBUGLEVEL >= 10) {
     294           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_EnumDomainUsers, NDR_IN, r2);
     295             :                 }
     296          60 :                 NDR_ZERO_STRUCT(r2->out);
     297          60 :                 r2->out.resume_handle = r2->in.resume_handle;
     298          60 :                 r2->out.sam = talloc_zero(r2, struct samr_SamArray *);
     299          60 :                 if (r2->out.sam == NULL) {
     300           0 :                         status = NT_STATUS_NO_MEMORY;
     301           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     302           0 :                         goto fail;
     303             :                 }
     304             : 
     305          60 :                 r2->out.num_entries = talloc_zero(r2, uint32_t);
     306          60 :                 if (r2->out.num_entries == NULL) {
     307           0 :                         status = NT_STATUS_NO_MEMORY;
     308           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     309           0 :                         goto fail;
     310             :                 }
     311             : 
     312          60 :                 r2->out.result = _samr_EnumDomainUsers(p, r2);
     313          60 :                 break;
     314             :         }
     315         604 :         case 14: { /* samr_CreateDomAlias */
     316         604 :                 struct samr_CreateDomAlias *r2 = (struct samr_CreateDomAlias *)r;
     317         604 :                 if (DEBUGLEVEL >= 10) {
     318           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_CreateDomAlias, NDR_IN, r2);
     319             :                 }
     320         604 :                 NDR_ZERO_STRUCT(r2->out);
     321         604 :                 r2->out.alias_handle = talloc_zero(r2, struct policy_handle);
     322         604 :                 if (r2->out.alias_handle == NULL) {
     323           0 :                         status = NT_STATUS_NO_MEMORY;
     324           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     325           0 :                         goto fail;
     326             :                 }
     327             : 
     328         604 :                 r2->out.rid = talloc_zero(r2, uint32_t);
     329         604 :                 if (r2->out.rid == NULL) {
     330           0 :                         status = NT_STATUS_NO_MEMORY;
     331           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     332           0 :                         goto fail;
     333             :                 }
     334             : 
     335         604 :                 r2->out.result = _samr_CreateDomAlias(p, r2);
     336         604 :                 break;
     337             :         }
     338          52 :         case 15: { /* samr_EnumDomainAliases */
     339          52 :                 struct samr_EnumDomainAliases *r2 = (struct samr_EnumDomainAliases *)r;
     340          52 :                 if (DEBUGLEVEL >= 10) {
     341           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_EnumDomainAliases, NDR_IN, r2);
     342             :                 }
     343          52 :                 NDR_ZERO_STRUCT(r2->out);
     344          52 :                 r2->out.resume_handle = r2->in.resume_handle;
     345          52 :                 r2->out.sam = talloc_zero(r2, struct samr_SamArray *);
     346          52 :                 if (r2->out.sam == NULL) {
     347           0 :                         status = NT_STATUS_NO_MEMORY;
     348           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     349           0 :                         goto fail;
     350             :                 }
     351             : 
     352          52 :                 r2->out.num_entries = talloc_zero(r2, uint32_t);
     353          52 :                 if (r2->out.num_entries == NULL) {
     354           0 :                         status = NT_STATUS_NO_MEMORY;
     355           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     356           0 :                         goto fail;
     357             :                 }
     358             : 
     359          52 :                 r2->out.result = _samr_EnumDomainAliases(p, r2);
     360          52 :                 break;
     361             :         }
     362        3884 :         case 16: { /* samr_GetAliasMembership */
     363        3884 :                 struct samr_GetAliasMembership *r2 = (struct samr_GetAliasMembership *)r;
     364        3884 :                 if (DEBUGLEVEL >= 10) {
     365           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetAliasMembership, NDR_IN, r2);
     366             :                 }
     367        3884 :                 NDR_ZERO_STRUCT(r2->out);
     368        3884 :                 r2->out.rids = talloc_zero(r2, struct samr_Ids);
     369        3884 :                 if (r2->out.rids == NULL) {
     370           0 :                         status = NT_STATUS_NO_MEMORY;
     371           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     372           0 :                         goto fail;
     373             :                 }
     374             : 
     375        3884 :                 r2->out.result = _samr_GetAliasMembership(p, r2);
     376        3884 :                 break;
     377             :         }
     378        1235 :         case 17: { /* samr_LookupNames */
     379        1235 :                 struct samr_LookupNames *r2 = (struct samr_LookupNames *)r;
     380        1235 :                 if (DEBUGLEVEL >= 10) {
     381           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_LookupNames, NDR_IN, r2);
     382             :                 }
     383        1235 :                 NDR_ZERO_STRUCT(r2->out);
     384        1235 :                 r2->out.rids = talloc_zero(r2, struct samr_Ids);
     385        1235 :                 if (r2->out.rids == NULL) {
     386           0 :                         status = NT_STATUS_NO_MEMORY;
     387           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     388           0 :                         goto fail;
     389             :                 }
     390             : 
     391        1235 :                 r2->out.types = talloc_zero(r2, struct samr_Ids);
     392        1235 :                 if (r2->out.types == NULL) {
     393           0 :                         status = NT_STATUS_NO_MEMORY;
     394           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     395           0 :                         goto fail;
     396             :                 }
     397             : 
     398        1235 :                 r2->out.result = _samr_LookupNames(p, r2);
     399        1235 :                 break;
     400             :         }
     401        1268 :         case 18: { /* samr_LookupRids */
     402        1268 :                 struct samr_LookupRids *r2 = (struct samr_LookupRids *)r;
     403        1268 :                 if (DEBUGLEVEL >= 10) {
     404           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_LookupRids, NDR_IN, r2);
     405             :                 }
     406        1268 :                 NDR_ZERO_STRUCT(r2->out);
     407        1268 :                 r2->out.names = talloc_zero(r2, struct lsa_Strings);
     408        1268 :                 if (r2->out.names == NULL) {
     409           0 :                         status = NT_STATUS_NO_MEMORY;
     410           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     411           0 :                         goto fail;
     412             :                 }
     413             : 
     414        1268 :                 r2->out.types = talloc_zero(r2, struct samr_Ids);
     415        1268 :                 if (r2->out.types == NULL) {
     416           0 :                         status = NT_STATUS_NO_MEMORY;
     417           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     418           0 :                         goto fail;
     419             :                 }
     420             : 
     421        1268 :                 r2->out.result = _samr_LookupRids(p, r2);
     422        1268 :                 break;
     423             :         }
     424         316 :         case 19: { /* samr_OpenGroup */
     425         316 :                 struct samr_OpenGroup *r2 = (struct samr_OpenGroup *)r;
     426         316 :                 if (DEBUGLEVEL >= 10) {
     427           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OpenGroup, NDR_IN, r2);
     428             :                 }
     429         316 :                 NDR_ZERO_STRUCT(r2->out);
     430         316 :                 r2->out.group_handle = talloc_zero(r2, struct policy_handle);
     431         316 :                 if (r2->out.group_handle == NULL) {
     432           0 :                         status = NT_STATUS_NO_MEMORY;
     433           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     434           0 :                         goto fail;
     435             :                 }
     436             : 
     437         316 :                 r2->out.result = _samr_OpenGroup(p, r2);
     438         316 :                 break;
     439             :         }
     440          38 :         case 20: { /* samr_QueryGroupInfo */
     441          38 :                 struct samr_QueryGroupInfo *r2 = (struct samr_QueryGroupInfo *)r;
     442          38 :                 if (DEBUGLEVEL >= 10) {
     443           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryGroupInfo, NDR_IN, r2);
     444             :                 }
     445          38 :                 NDR_ZERO_STRUCT(r2->out);
     446          38 :                 r2->out.info = talloc_zero(r2, union samr_GroupInfo *);
     447          38 :                 if (r2->out.info == NULL) {
     448           0 :                         status = NT_STATUS_NO_MEMORY;
     449           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     450           0 :                         goto fail;
     451             :                 }
     452             : 
     453          38 :                 r2->out.result = _samr_QueryGroupInfo(p, r2);
     454          38 :                 break;
     455             :         }
     456           8 :         case 21: { /* samr_SetGroupInfo */
     457           8 :                 struct samr_SetGroupInfo *r2 = (struct samr_SetGroupInfo *)r;
     458           8 :                 if (DEBUGLEVEL >= 10) {
     459           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetGroupInfo, NDR_IN, r2);
     460             :                 }
     461           8 :                 r2->out.result = _samr_SetGroupInfo(p, r2);
     462           8 :                 break;
     463             :         }
     464           6 :         case 22: { /* samr_AddGroupMember */
     465           6 :                 struct samr_AddGroupMember *r2 = (struct samr_AddGroupMember *)r;
     466           6 :                 if (DEBUGLEVEL >= 10) {
     467           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_AddGroupMember, NDR_IN, r2);
     468             :                 }
     469           6 :                 r2->out.result = _samr_AddGroupMember(p, r2);
     470           6 :                 break;
     471             :         }
     472           2 :         case 23: { /* samr_DeleteDomainGroup */
     473           2 :                 struct samr_DeleteDomainGroup *r2 = (struct samr_DeleteDomainGroup *)r;
     474           2 :                 if (DEBUGLEVEL >= 10) {
     475           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteDomainGroup, NDR_IN, r2);
     476             :                 }
     477           2 :                 NDR_ZERO_STRUCT(r2->out);
     478           2 :                 r2->out.group_handle = r2->in.group_handle;
     479           2 :                 r2->out.result = _samr_DeleteDomainGroup(p, r2);
     480           2 :                 break;
     481             :         }
     482           4 :         case 24: { /* samr_DeleteGroupMember */
     483           4 :                 struct samr_DeleteGroupMember *r2 = (struct samr_DeleteGroupMember *)r;
     484           4 :                 if (DEBUGLEVEL >= 10) {
     485           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteGroupMember, NDR_IN, r2);
     486             :                 }
     487           4 :                 r2->out.result = _samr_DeleteGroupMember(p, r2);
     488           4 :                 break;
     489             :         }
     490         316 :         case 25: { /* samr_QueryGroupMember */
     491         316 :                 struct samr_QueryGroupMember *r2 = (struct samr_QueryGroupMember *)r;
     492         316 :                 if (DEBUGLEVEL >= 10) {
     493           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryGroupMember, NDR_IN, r2);
     494             :                 }
     495         316 :                 NDR_ZERO_STRUCT(r2->out);
     496         316 :                 r2->out.rids = talloc_zero(r2, struct samr_RidAttrArray *);
     497         316 :                 if (r2->out.rids == NULL) {
     498           0 :                         status = NT_STATUS_NO_MEMORY;
     499           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     500           0 :                         goto fail;
     501             :                 }
     502             : 
     503         316 :                 r2->out.result = _samr_QueryGroupMember(p, r2);
     504         316 :                 break;
     505             :         }
     506           0 :         case 26: { /* samr_SetMemberAttributesOfGroup */
     507           0 :                 struct samr_SetMemberAttributesOfGroup *r2 = (struct samr_SetMemberAttributesOfGroup *)r;
     508           0 :                 if (DEBUGLEVEL >= 10) {
     509           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetMemberAttributesOfGroup, NDR_IN, r2);
     510             :                 }
     511           0 :                 r2->out.result = _samr_SetMemberAttributesOfGroup(p, r2);
     512           0 :                 break;
     513             :         }
     514        1234 :         case 27: { /* samr_OpenAlias */
     515        1234 :                 struct samr_OpenAlias *r2 = (struct samr_OpenAlias *)r;
     516        1234 :                 if (DEBUGLEVEL >= 10) {
     517           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OpenAlias, NDR_IN, r2);
     518             :                 }
     519        1234 :                 NDR_ZERO_STRUCT(r2->out);
     520        1234 :                 r2->out.alias_handle = talloc_zero(r2, struct policy_handle);
     521        1234 :                 if (r2->out.alias_handle == NULL) {
     522           0 :                         status = NT_STATUS_NO_MEMORY;
     523           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     524           0 :                         goto fail;
     525             :                 }
     526             : 
     527        1234 :                 r2->out.result = _samr_OpenAlias(p, r2);
     528        1234 :                 break;
     529             :         }
     530          34 :         case 28: { /* samr_QueryAliasInfo */
     531          34 :                 struct samr_QueryAliasInfo *r2 = (struct samr_QueryAliasInfo *)r;
     532          34 :                 if (DEBUGLEVEL >= 10) {
     533           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryAliasInfo, NDR_IN, r2);
     534             :                 }
     535          34 :                 NDR_ZERO_STRUCT(r2->out);
     536          34 :                 r2->out.info = talloc_zero(r2, union samr_AliasInfo *);
     537          34 :                 if (r2->out.info == NULL) {
     538           0 :                         status = NT_STATUS_NO_MEMORY;
     539           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     540           0 :                         goto fail;
     541             :                 }
     542             : 
     543          34 :                 r2->out.result = _samr_QueryAliasInfo(p, r2);
     544          34 :                 break;
     545             :         }
     546           4 :         case 29: { /* samr_SetAliasInfo */
     547           4 :                 struct samr_SetAliasInfo *r2 = (struct samr_SetAliasInfo *)r;
     548           4 :                 if (DEBUGLEVEL >= 10) {
     549           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetAliasInfo, NDR_IN, r2);
     550             :                 }
     551           4 :                 r2->out.result = _samr_SetAliasInfo(p, r2);
     552           4 :                 break;
     553             :         }
     554           2 :         case 30: { /* samr_DeleteDomAlias */
     555           2 :                 struct samr_DeleteDomAlias *r2 = (struct samr_DeleteDomAlias *)r;
     556           2 :                 if (DEBUGLEVEL >= 10) {
     557           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteDomAlias, NDR_IN, r2);
     558             :                 }
     559           2 :                 NDR_ZERO_STRUCT(r2->out);
     560           2 :                 r2->out.alias_handle = r2->in.alias_handle;
     561           2 :                 r2->out.result = _samr_DeleteDomAlias(p, r2);
     562           2 :                 break;
     563             :         }
     564           2 :         case 31: { /* samr_AddAliasMember */
     565           2 :                 struct samr_AddAliasMember *r2 = (struct samr_AddAliasMember *)r;
     566           2 :                 if (DEBUGLEVEL >= 10) {
     567           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_AddAliasMember, NDR_IN, r2);
     568             :                 }
     569           2 :                 r2->out.result = _samr_AddAliasMember(p, r2);
     570           2 :                 break;
     571             :         }
     572           2 :         case 32: { /* samr_DeleteAliasMember */
     573           2 :                 struct samr_DeleteAliasMember *r2 = (struct samr_DeleteAliasMember *)r;
     574           2 :                 if (DEBUGLEVEL >= 10) {
     575           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteAliasMember, NDR_IN, r2);
     576             :                 }
     577           2 :                 r2->out.result = _samr_DeleteAliasMember(p, r2);
     578           2 :                 break;
     579             :         }
     580        1234 :         case 33: { /* samr_GetMembersInAlias */
     581        1234 :                 struct samr_GetMembersInAlias *r2 = (struct samr_GetMembersInAlias *)r;
     582        1234 :                 if (DEBUGLEVEL >= 10) {
     583           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetMembersInAlias, NDR_IN, r2);
     584             :                 }
     585        1234 :                 NDR_ZERO_STRUCT(r2->out);
     586        1234 :                 r2->out.sids = talloc_zero(r2, struct lsa_SidArray);
     587        1234 :                 if (r2->out.sids == NULL) {
     588           0 :                         status = NT_STATUS_NO_MEMORY;
     589           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     590           0 :                         goto fail;
     591             :                 }
     592             : 
     593        1234 :                 r2->out.result = _samr_GetMembersInAlias(p, r2);
     594        1234 :                 break;
     595             :         }
     596        2855 :         case 34: { /* samr_OpenUser */
     597        2855 :                 struct samr_OpenUser *r2 = (struct samr_OpenUser *)r;
     598        2855 :                 if (DEBUGLEVEL >= 10) {
     599           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OpenUser, NDR_IN, r2);
     600             :                 }
     601        2855 :                 NDR_ZERO_STRUCT(r2->out);
     602        2855 :                 r2->out.user_handle = talloc_zero(r2, struct policy_handle);
     603        2855 :                 if (r2->out.user_handle == NULL) {
     604           0 :                         status = NT_STATUS_NO_MEMORY;
     605           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     606           0 :                         goto fail;
     607             :                 }
     608             : 
     609        2855 :                 r2->out.result = _samr_OpenUser(p, r2);
     610        2855 :                 break;
     611             :         }
     612          84 :         case 35: { /* samr_DeleteUser */
     613          84 :                 struct samr_DeleteUser *r2 = (struct samr_DeleteUser *)r;
     614          84 :                 if (DEBUGLEVEL >= 10) {
     615           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteUser, NDR_IN, r2);
     616             :                 }
     617          84 :                 NDR_ZERO_STRUCT(r2->out);
     618          84 :                 r2->out.user_handle = r2->in.user_handle;
     619          84 :                 r2->out.result = _samr_DeleteUser(p, r2);
     620          84 :                 break;
     621             :         }
     622        1822 :         case 36: { /* samr_QueryUserInfo */
     623        1822 :                 struct samr_QueryUserInfo *r2 = (struct samr_QueryUserInfo *)r;
     624        1822 :                 if (DEBUGLEVEL >= 10) {
     625           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryUserInfo, NDR_IN, r2);
     626             :                 }
     627        1822 :                 NDR_ZERO_STRUCT(r2->out);
     628        1822 :                 r2->out.info = talloc_zero(r2, union samr_UserInfo *);
     629        1822 :                 if (r2->out.info == NULL) {
     630           0 :                         status = NT_STATUS_NO_MEMORY;
     631           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     632           0 :                         goto fail;
     633             :                 }
     634             : 
     635        1822 :                 r2->out.result = _samr_QueryUserInfo(p, r2);
     636        1822 :                 break;
     637             :         }
     638         558 :         case 37: { /* samr_SetUserInfo */
     639         558 :                 struct samr_SetUserInfo *r2 = (struct samr_SetUserInfo *)r;
     640         558 :                 if (DEBUGLEVEL >= 10) {
     641           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetUserInfo, NDR_IN, r2);
     642             :                 }
     643         558 :                 r2->out.result = _samr_SetUserInfo(p, r2);
     644         558 :                 break;
     645             :         }
     646           4 :         case 38: { /* samr_ChangePasswordUser */
     647           4 :                 struct samr_ChangePasswordUser *r2 = (struct samr_ChangePasswordUser *)r;
     648           4 :                 if (DEBUGLEVEL >= 10) {
     649           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ChangePasswordUser, NDR_IN, r2);
     650             :                 }
     651           4 :                 r2->out.result = _samr_ChangePasswordUser(p, r2);
     652           4 :                 break;
     653             :         }
     654        2550 :         case 39: { /* samr_GetGroupsForUser */
     655        2550 :                 struct samr_GetGroupsForUser *r2 = (struct samr_GetGroupsForUser *)r;
     656        2550 :                 if (DEBUGLEVEL >= 10) {
     657           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetGroupsForUser, NDR_IN, r2);
     658             :                 }
     659        2550 :                 NDR_ZERO_STRUCT(r2->out);
     660        2550 :                 r2->out.rids = talloc_zero(r2, struct samr_RidWithAttributeArray *);
     661        2550 :                 if (r2->out.rids == NULL) {
     662           0 :                         status = NT_STATUS_NO_MEMORY;
     663           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     664           0 :                         goto fail;
     665             :                 }
     666             : 
     667        2550 :                 r2->out.result = _samr_GetGroupsForUser(p, r2);
     668        2550 :                 break;
     669             :         }
     670          84 :         case 40: { /* samr_QueryDisplayInfo */
     671          84 :                 struct samr_QueryDisplayInfo *r2 = (struct samr_QueryDisplayInfo *)r;
     672          84 :                 if (DEBUGLEVEL >= 10) {
     673           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDisplayInfo, NDR_IN, r2);
     674             :                 }
     675          84 :                 NDR_ZERO_STRUCT(r2->out);
     676          84 :                 r2->out.total_size = talloc_zero(r2, uint32_t);
     677          84 :                 if (r2->out.total_size == NULL) {
     678           0 :                         status = NT_STATUS_NO_MEMORY;
     679           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     680           0 :                         goto fail;
     681             :                 }
     682             : 
     683          84 :                 r2->out.returned_size = talloc_zero(r2, uint32_t);
     684          84 :                 if (r2->out.returned_size == NULL) {
     685           0 :                         status = NT_STATUS_NO_MEMORY;
     686           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     687           0 :                         goto fail;
     688             :                 }
     689             : 
     690          84 :                 r2->out.info = talloc_zero(r2, union samr_DispInfo);
     691          84 :                 if (r2->out.info == NULL) {
     692           0 :                         status = NT_STATUS_NO_MEMORY;
     693           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     694           0 :                         goto fail;
     695             :                 }
     696             : 
     697          84 :                 r2->out.result = _samr_QueryDisplayInfo(p, r2);
     698          84 :                 break;
     699             :         }
     700          40 :         case 41: { /* samr_GetDisplayEnumerationIndex */
     701          40 :                 struct samr_GetDisplayEnumerationIndex *r2 = (struct samr_GetDisplayEnumerationIndex *)r;
     702          40 :                 if (DEBUGLEVEL >= 10) {
     703           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetDisplayEnumerationIndex, NDR_IN, r2);
     704             :                 }
     705          40 :                 NDR_ZERO_STRUCT(r2->out);
     706          40 :                 r2->out.idx = talloc_zero(r2, uint32_t);
     707          40 :                 if (r2->out.idx == NULL) {
     708           0 :                         status = NT_STATUS_NO_MEMORY;
     709           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     710           0 :                         goto fail;
     711             :                 }
     712             : 
     713          40 :                 r2->out.result = _samr_GetDisplayEnumerationIndex(p, r2);
     714          40 :                 break;
     715             :         }
     716           4 :         case 42: { /* samr_TestPrivateFunctionsDomain */
     717           4 :                 struct samr_TestPrivateFunctionsDomain *r2 = (struct samr_TestPrivateFunctionsDomain *)r;
     718           4 :                 if (DEBUGLEVEL >= 10) {
     719           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_TestPrivateFunctionsDomain, NDR_IN, r2);
     720             :                 }
     721           4 :                 r2->out.result = _samr_TestPrivateFunctionsDomain(p, r2);
     722           4 :                 break;
     723             :         }
     724           2 :         case 43: { /* samr_TestPrivateFunctionsUser */
     725           2 :                 struct samr_TestPrivateFunctionsUser *r2 = (struct samr_TestPrivateFunctionsUser *)r;
     726           2 :                 if (DEBUGLEVEL >= 10) {
     727           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_TestPrivateFunctionsUser, NDR_IN, r2);
     728             :                 }
     729           2 :                 r2->out.result = _samr_TestPrivateFunctionsUser(p, r2);
     730           2 :                 break;
     731             :         }
     732         348 :         case 44: { /* samr_GetUserPwInfo */
     733         348 :                 struct samr_GetUserPwInfo *r2 = (struct samr_GetUserPwInfo *)r;
     734         348 :                 if (DEBUGLEVEL >= 10) {
     735           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetUserPwInfo, NDR_IN, r2);
     736             :                 }
     737         348 :                 NDR_ZERO_STRUCT(r2->out);
     738         348 :                 r2->out.info = talloc_zero(r2, struct samr_PwInfo);
     739         348 :                 if (r2->out.info == NULL) {
     740           0 :                         status = NT_STATUS_NO_MEMORY;
     741           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     742           0 :                         goto fail;
     743             :                 }
     744             : 
     745         348 :                 r2->out.result = _samr_GetUserPwInfo(p, r2);
     746         348 :                 break;
     747             :         }
     748           6 :         case 45: { /* samr_RemoveMemberFromForeignDomain */
     749           6 :                 struct samr_RemoveMemberFromForeignDomain *r2 = (struct samr_RemoveMemberFromForeignDomain *)r;
     750           6 :                 if (DEBUGLEVEL >= 10) {
     751           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_RemoveMemberFromForeignDomain, NDR_IN, r2);
     752             :                 }
     753           6 :                 r2->out.result = _samr_RemoveMemberFromForeignDomain(p, r2);
     754           6 :                 break;
     755             :         }
     756          68 :         case 46: { /* samr_QueryDomainInfo2 */
     757          68 :                 struct samr_QueryDomainInfo2 *r2 = (struct samr_QueryDomainInfo2 *)r;
     758          68 :                 if (DEBUGLEVEL >= 10) {
     759           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDomainInfo2, NDR_IN, r2);
     760             :                 }
     761          68 :                 NDR_ZERO_STRUCT(r2->out);
     762          68 :                 r2->out.info = talloc_zero(r2, union samr_DomainInfo *);
     763          68 :                 if (r2->out.info == NULL) {
     764           0 :                         status = NT_STATUS_NO_MEMORY;
     765           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     766           0 :                         goto fail;
     767             :                 }
     768             : 
     769          68 :                 r2->out.result = _samr_QueryDomainInfo2(p, r2);
     770          68 :                 break;
     771             :         }
     772         382 :         case 47: { /* samr_QueryUserInfo2 */
     773         382 :                 struct samr_QueryUserInfo2 *r2 = (struct samr_QueryUserInfo2 *)r;
     774         382 :                 if (DEBUGLEVEL >= 10) {
     775           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryUserInfo2, NDR_IN, r2);
     776             :                 }
     777         382 :                 NDR_ZERO_STRUCT(r2->out);
     778         382 :                 r2->out.info = talloc_zero(r2, union samr_UserInfo *);
     779         382 :                 if (r2->out.info == NULL) {
     780           0 :                         status = NT_STATUS_NO_MEMORY;
     781           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     782           0 :                         goto fail;
     783             :                 }
     784             : 
     785         382 :                 r2->out.result = _samr_QueryUserInfo2(p, r2);
     786         382 :                 break;
     787             :         }
     788          20 :         case 48: { /* samr_QueryDisplayInfo2 */
     789          20 :                 struct samr_QueryDisplayInfo2 *r2 = (struct samr_QueryDisplayInfo2 *)r;
     790          20 :                 if (DEBUGLEVEL >= 10) {
     791           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDisplayInfo2, NDR_IN, r2);
     792             :                 }
     793          20 :                 NDR_ZERO_STRUCT(r2->out);
     794          20 :                 r2->out.total_size = talloc_zero(r2, uint32_t);
     795          20 :                 if (r2->out.total_size == NULL) {
     796           0 :                         status = NT_STATUS_NO_MEMORY;
     797           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     798           0 :                         goto fail;
     799             :                 }
     800             : 
     801          20 :                 r2->out.returned_size = talloc_zero(r2, uint32_t);
     802          20 :                 if (r2->out.returned_size == NULL) {
     803           0 :                         status = NT_STATUS_NO_MEMORY;
     804           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     805           0 :                         goto fail;
     806             :                 }
     807             : 
     808          20 :                 r2->out.info = talloc_zero(r2, union samr_DispInfo);
     809          20 :                 if (r2->out.info == NULL) {
     810           0 :                         status = NT_STATUS_NO_MEMORY;
     811           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     812           0 :                         goto fail;
     813             :                 }
     814             : 
     815          20 :                 r2->out.result = _samr_QueryDisplayInfo2(p, r2);
     816          20 :                 break;
     817             :         }
     818          40 :         case 49: { /* samr_GetDisplayEnumerationIndex2 */
     819          40 :                 struct samr_GetDisplayEnumerationIndex2 *r2 = (struct samr_GetDisplayEnumerationIndex2 *)r;
     820          40 :                 if (DEBUGLEVEL >= 10) {
     821           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetDisplayEnumerationIndex2, NDR_IN, r2);
     822             :                 }
     823          40 :                 NDR_ZERO_STRUCT(r2->out);
     824          40 :                 r2->out.idx = talloc_zero(r2, uint32_t);
     825          40 :                 if (r2->out.idx == NULL) {
     826           0 :                         status = NT_STATUS_NO_MEMORY;
     827           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     828           0 :                         goto fail;
     829             :                 }
     830             : 
     831          40 :                 r2->out.result = _samr_GetDisplayEnumerationIndex2(p, r2);
     832          40 :                 break;
     833             :         }
     834          87 :         case 50: { /* samr_CreateUser2 */
     835          87 :                 struct samr_CreateUser2 *r2 = (struct samr_CreateUser2 *)r;
     836          87 :                 if (DEBUGLEVEL >= 10) {
     837           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_CreateUser2, NDR_IN, r2);
     838             :                 }
     839          87 :                 NDR_ZERO_STRUCT(r2->out);
     840          87 :                 r2->out.user_handle = talloc_zero(r2, struct policy_handle);
     841          87 :                 if (r2->out.user_handle == NULL) {
     842           0 :                         status = NT_STATUS_NO_MEMORY;
     843           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     844           0 :                         goto fail;
     845             :                 }
     846             : 
     847          87 :                 r2->out.access_granted = talloc_zero(r2, uint32_t);
     848          87 :                 if (r2->out.access_granted == NULL) {
     849           0 :                         status = NT_STATUS_NO_MEMORY;
     850           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     851           0 :                         goto fail;
     852             :                 }
     853             : 
     854          87 :                 r2->out.rid = talloc_zero(r2, uint32_t);
     855          87 :                 if (r2->out.rid == NULL) {
     856           0 :                         status = NT_STATUS_NO_MEMORY;
     857           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     858           0 :                         goto fail;
     859             :                 }
     860             : 
     861          87 :                 r2->out.result = _samr_CreateUser2(p, r2);
     862          87 :                 break;
     863             :         }
     864          20 :         case 51: { /* samr_QueryDisplayInfo3 */
     865          20 :                 struct samr_QueryDisplayInfo3 *r2 = (struct samr_QueryDisplayInfo3 *)r;
     866          20 :                 if (DEBUGLEVEL >= 10) {
     867           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDisplayInfo3, NDR_IN, r2);
     868             :                 }
     869          20 :                 NDR_ZERO_STRUCT(r2->out);
     870          20 :                 r2->out.total_size = talloc_zero(r2, uint32_t);
     871          20 :                 if (r2->out.total_size == NULL) {
     872           0 :                         status = NT_STATUS_NO_MEMORY;
     873           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     874           0 :                         goto fail;
     875             :                 }
     876             : 
     877          20 :                 r2->out.returned_size = talloc_zero(r2, uint32_t);
     878          20 :                 if (r2->out.returned_size == NULL) {
     879           0 :                         status = NT_STATUS_NO_MEMORY;
     880           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     881           0 :                         goto fail;
     882             :                 }
     883             : 
     884          20 :                 r2->out.info = talloc_zero(r2, union samr_DispInfo);
     885          20 :                 if (r2->out.info == NULL) {
     886           0 :                         status = NT_STATUS_NO_MEMORY;
     887           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     888           0 :                         goto fail;
     889             :                 }
     890             : 
     891          20 :                 r2->out.result = _samr_QueryDisplayInfo3(p, r2);
     892          20 :                 break;
     893             :         }
     894           0 :         case 52: { /* samr_AddMultipleMembersToAlias */
     895           0 :                 struct samr_AddMultipleMembersToAlias *r2 = (struct samr_AddMultipleMembersToAlias *)r;
     896           0 :                 if (DEBUGLEVEL >= 10) {
     897           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_AddMultipleMembersToAlias, NDR_IN, r2);
     898             :                 }
     899           0 :                 r2->out.result = _samr_AddMultipleMembersToAlias(p, r2);
     900           0 :                 break;
     901             :         }
     902           0 :         case 53: { /* samr_RemoveMultipleMembersFromAlias */
     903           0 :                 struct samr_RemoveMultipleMembersFromAlias *r2 = (struct samr_RemoveMultipleMembersFromAlias *)r;
     904           0 :                 if (DEBUGLEVEL >= 10) {
     905           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_RemoveMultipleMembersFromAlias, NDR_IN, r2);
     906             :                 }
     907           0 :                 r2->out.result = _samr_RemoveMultipleMembersFromAlias(p, r2);
     908           0 :                 break;
     909             :         }
     910          30 :         case 54: { /* samr_OemChangePasswordUser2 */
     911          30 :                 struct samr_OemChangePasswordUser2 *r2 = (struct samr_OemChangePasswordUser2 *)r;
     912          30 :                 if (DEBUGLEVEL >= 10) {
     913           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OemChangePasswordUser2, NDR_IN, r2);
     914             :                 }
     915          30 :                 r2->out.result = _samr_OemChangePasswordUser2(p, r2);
     916          30 :                 break;
     917             :         }
     918          14 :         case 55: { /* samr_ChangePasswordUser2 */
     919          14 :                 struct samr_ChangePasswordUser2 *r2 = (struct samr_ChangePasswordUser2 *)r;
     920          14 :                 if (DEBUGLEVEL >= 10) {
     921           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ChangePasswordUser2, NDR_IN, r2);
     922             :                 }
     923          14 :                 r2->out.result = _samr_ChangePasswordUser2(p, r2);
     924          14 :                 break;
     925             :         }
     926         412 :         case 56: { /* samr_GetDomPwInfo */
     927         412 :                 struct samr_GetDomPwInfo *r2 = (struct samr_GetDomPwInfo *)r;
     928         412 :                 if (DEBUGLEVEL >= 10) {
     929           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetDomPwInfo, NDR_IN, r2);
     930             :                 }
     931         412 :                 NDR_ZERO_STRUCT(r2->out);
     932         412 :                 r2->out.info = talloc_zero(r2, struct samr_PwInfo);
     933         412 :                 if (r2->out.info == NULL) {
     934           0 :                         status = NT_STATUS_NO_MEMORY;
     935           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     936           0 :                         goto fail;
     937             :                 }
     938             : 
     939         412 :                 r2->out.result = _samr_GetDomPwInfo(p, r2);
     940         412 :                 break;
     941             :         }
     942         395 :         case 57: { /* samr_Connect2 */
     943         395 :                 struct samr_Connect2 *r2 = (struct samr_Connect2 *)r;
     944         395 :                 if (DEBUGLEVEL >= 10) {
     945           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect2, NDR_IN, r2);
     946             :                 }
     947         395 :                 NDR_ZERO_STRUCT(r2->out);
     948         395 :                 r2->out.connect_handle = talloc_zero(r2, struct policy_handle);
     949         395 :                 if (r2->out.connect_handle == NULL) {
     950           0 :                         status = NT_STATUS_NO_MEMORY;
     951           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     952           0 :                         goto fail;
     953             :                 }
     954             : 
     955         395 :                 r2->out.result = _samr_Connect2(p, r2);
     956         395 :                 break;
     957             :         }
     958         238 :         case 58: { /* samr_SetUserInfo2 */
     959         238 :                 struct samr_SetUserInfo2 *r2 = (struct samr_SetUserInfo2 *)r;
     960         238 :                 if (DEBUGLEVEL >= 10) {
     961           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetUserInfo2, NDR_IN, r2);
     962             :                 }
     963         238 :                 r2->out.result = _samr_SetUserInfo2(p, r2);
     964         238 :                 break;
     965             :         }
     966           0 :         case 59: { /* samr_SetBootKeyInformation */
     967           0 :                 struct samr_SetBootKeyInformation *r2 = (struct samr_SetBootKeyInformation *)r;
     968           0 :                 if (DEBUGLEVEL >= 10) {
     969           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetBootKeyInformation, NDR_IN, r2);
     970             :                 }
     971           0 :                 r2->out.result = _samr_SetBootKeyInformation(p, r2);
     972           0 :                 break;
     973             :         }
     974           4 :         case 60: { /* samr_GetBootKeyInformation */
     975           4 :                 struct samr_GetBootKeyInformation *r2 = (struct samr_GetBootKeyInformation *)r;
     976           4 :                 if (DEBUGLEVEL >= 10) {
     977           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetBootKeyInformation, NDR_IN, r2);
     978             :                 }
     979           4 :                 NDR_ZERO_STRUCT(r2->out);
     980           4 :                 r2->out.unknown = talloc_zero(r2, uint32_t);
     981           4 :                 if (r2->out.unknown == NULL) {
     982           0 :                         status = NT_STATUS_NO_MEMORY;
     983           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     984           0 :                         goto fail;
     985             :                 }
     986             : 
     987           4 :                 r2->out.result = _samr_GetBootKeyInformation(p, r2);
     988           4 :                 break;
     989             :         }
     990          60 :         case 61: { /* samr_Connect3 */
     991          60 :                 struct samr_Connect3 *r2 = (struct samr_Connect3 *)r;
     992          60 :                 if (DEBUGLEVEL >= 10) {
     993           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect3, NDR_IN, r2);
     994             :                 }
     995          60 :                 NDR_ZERO_STRUCT(r2->out);
     996          60 :                 r2->out.connect_handle = talloc_zero(r2, struct policy_handle);
     997          60 :                 if (r2->out.connect_handle == NULL) {
     998           0 :                         status = NT_STATUS_NO_MEMORY;
     999           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1000           0 :                         goto fail;
    1001             :                 }
    1002             : 
    1003          60 :                 r2->out.result = _samr_Connect3(p, r2);
    1004          60 :                 break;
    1005             :         }
    1006          60 :         case 62: { /* samr_Connect4 */
    1007          60 :                 struct samr_Connect4 *r2 = (struct samr_Connect4 *)r;
    1008          60 :                 if (DEBUGLEVEL >= 10) {
    1009           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect4, NDR_IN, r2);
    1010             :                 }
    1011          60 :                 NDR_ZERO_STRUCT(r2->out);
    1012          60 :                 r2->out.connect_handle = talloc_zero(r2, struct policy_handle);
    1013          60 :                 if (r2->out.connect_handle == NULL) {
    1014           0 :                         status = NT_STATUS_NO_MEMORY;
    1015           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1016           0 :                         goto fail;
    1017             :                 }
    1018             : 
    1019          60 :                 r2->out.result = _samr_Connect4(p, r2);
    1020          60 :                 break;
    1021             :         }
    1022         208 :         case 63: { /* samr_ChangePasswordUser3 */
    1023         208 :                 struct samr_ChangePasswordUser3 *r2 = (struct samr_ChangePasswordUser3 *)r;
    1024         208 :                 if (DEBUGLEVEL >= 10) {
    1025           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ChangePasswordUser3, NDR_IN, r2);
    1026             :                 }
    1027         208 :                 NDR_ZERO_STRUCT(r2->out);
    1028         208 :                 r2->out.dominfo = talloc_zero(r2, struct samr_DomInfo1 *);
    1029         208 :                 if (r2->out.dominfo == NULL) {
    1030           0 :                         status = NT_STATUS_NO_MEMORY;
    1031           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1032           0 :                         goto fail;
    1033             :                 }
    1034             : 
    1035         208 :                 r2->out.reject = talloc_zero(r2, struct userPwdChangeFailureInformation *);
    1036         208 :                 if (r2->out.reject == NULL) {
    1037           0 :                         status = NT_STATUS_NO_MEMORY;
    1038           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1039           0 :                         goto fail;
    1040             :                 }
    1041             : 
    1042         208 :                 r2->out.result = _samr_ChangePasswordUser3(p, r2);
    1043         208 :                 break;
    1044             :         }
    1045          70 :         case 64: { /* samr_Connect5 */
    1046          70 :                 struct samr_Connect5 *r2 = (struct samr_Connect5 *)r;
    1047          70 :                 if (DEBUGLEVEL >= 10) {
    1048           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect5, NDR_IN, r2);
    1049             :                 }
    1050          70 :                 NDR_ZERO_STRUCT(r2->out);
    1051          70 :                 r2->out.level_out = talloc_zero(r2, uint32_t);
    1052          70 :                 if (r2->out.level_out == NULL) {
    1053           0 :                         status = NT_STATUS_NO_MEMORY;
    1054           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1055           0 :                         goto fail;
    1056             :                 }
    1057             : 
    1058          70 :                 r2->out.info_out = talloc_zero(r2, union samr_ConnectInfo);
    1059          70 :                 if (r2->out.info_out == NULL) {
    1060           0 :                         status = NT_STATUS_NO_MEMORY;
    1061           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1062           0 :                         goto fail;
    1063             :                 }
    1064             : 
    1065          70 :                 r2->out.connect_handle = talloc_zero(r2, struct policy_handle);
    1066          70 :                 if (r2->out.connect_handle == NULL) {
    1067           0 :                         status = NT_STATUS_NO_MEMORY;
    1068           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1069           0 :                         goto fail;
    1070             :                 }
    1071             : 
    1072          70 :                 r2->out.result = _samr_Connect5(p, r2);
    1073          70 :                 break;
    1074             :         }
    1075          16 :         case 65: { /* samr_RidToSid */
    1076          16 :                 struct samr_RidToSid *r2 = (struct samr_RidToSid *)r;
    1077          16 :                 if (DEBUGLEVEL >= 10) {
    1078           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_RidToSid, NDR_IN, r2);
    1079             :                 }
    1080          16 :                 NDR_ZERO_STRUCT(r2->out);
    1081          16 :                 r2->out.sid = talloc_zero(r2, struct dom_sid2 *);
    1082          16 :                 if (r2->out.sid == NULL) {
    1083           0 :                         status = NT_STATUS_NO_MEMORY;
    1084           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1085           0 :                         goto fail;
    1086             :                 }
    1087             : 
    1088          16 :                 r2->out.result = _samr_RidToSid(p, r2);
    1089          16 :                 break;
    1090             :         }
    1091           0 :         case 66: { /* samr_SetDsrmPassword */
    1092           0 :                 struct samr_SetDsrmPassword *r2 = (struct samr_SetDsrmPassword *)r;
    1093           0 :                 if (DEBUGLEVEL >= 10) {
    1094           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetDsrmPassword, NDR_IN, r2);
    1095             :                 }
    1096           0 :                 r2->out.result = _samr_SetDsrmPassword(p, r2);
    1097           0 :                 break;
    1098             :         }
    1099           6 :         case 67: { /* samr_ValidatePassword */
    1100           6 :                 struct samr_ValidatePassword *r2 = (struct samr_ValidatePassword *)r;
    1101           6 :                 if (DEBUGLEVEL >= 10) {
    1102           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ValidatePassword, NDR_IN, r2);
    1103             :                 }
    1104           6 :                 NDR_ZERO_STRUCT(r2->out);
    1105           6 :                 r2->out.rep = talloc_zero(r2, union samr_ValidatePasswordRep *);
    1106           6 :                 if (r2->out.rep == NULL) {
    1107           0 :                         status = NT_STATUS_NO_MEMORY;
    1108           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1109           0 :                         goto fail;
    1110             :                 }
    1111             : 
    1112           6 :                 r2->out.result = _samr_ValidatePassword(p, r2);
    1113           6 :                 break;
    1114             :         }
    1115           0 :         case 68: { /* samr_Opnum68NotUsedOnWire */
    1116           0 :                 struct samr_Opnum68NotUsedOnWire *r2 = (struct samr_Opnum68NotUsedOnWire *)r;
    1117           0 :                 if (DEBUGLEVEL >= 10) {
    1118           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum68NotUsedOnWire, NDR_IN, r2);
    1119             :                 }
    1120           0 :                 _samr_Opnum68NotUsedOnWire(p, r2);
    1121           0 :                 break;
    1122             :         }
    1123           0 :         case 69: { /* samr_Opnum69NotUsedOnWire */
    1124           0 :                 struct samr_Opnum69NotUsedOnWire *r2 = (struct samr_Opnum69NotUsedOnWire *)r;
    1125           0 :                 if (DEBUGLEVEL >= 10) {
    1126           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum69NotUsedOnWire, NDR_IN, r2);
    1127             :                 }
    1128           0 :                 _samr_Opnum69NotUsedOnWire(p, r2);
    1129           0 :                 break;
    1130             :         }
    1131           0 :         case 70: { /* samr_Opnum70NotUsedOnWire */
    1132           0 :                 struct samr_Opnum70NotUsedOnWire *r2 = (struct samr_Opnum70NotUsedOnWire *)r;
    1133           0 :                 if (DEBUGLEVEL >= 10) {
    1134           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum70NotUsedOnWire, NDR_IN, r2);
    1135             :                 }
    1136           0 :                 _samr_Opnum70NotUsedOnWire(p, r2);
    1137           0 :                 break;
    1138             :         }
    1139           0 :         case 71: { /* samr_Opnum71NotUsedOnWire */
    1140           0 :                 struct samr_Opnum71NotUsedOnWire *r2 = (struct samr_Opnum71NotUsedOnWire *)r;
    1141           0 :                 if (DEBUGLEVEL >= 10) {
    1142           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum71NotUsedOnWire, NDR_IN, r2);
    1143             :                 }
    1144           0 :                 _samr_Opnum71NotUsedOnWire(p, r2);
    1145           0 :                 break;
    1146             :         }
    1147           0 :         case 72: { /* samr_Opnum72NotUsedOnWire */
    1148           0 :                 struct samr_Opnum72NotUsedOnWire *r2 = (struct samr_Opnum72NotUsedOnWire *)r;
    1149           0 :                 if (DEBUGLEVEL >= 10) {
    1150           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum72NotUsedOnWire, NDR_IN, r2);
    1151             :                 }
    1152           0 :                 _samr_Opnum72NotUsedOnWire(p, r2);
    1153           0 :                 break;
    1154             :         }
    1155          10 :         case 73: { /* samr_ChangePasswordUser4 */
    1156          10 :                 struct samr_ChangePasswordUser4 *r2 = (struct samr_ChangePasswordUser4 *)r;
    1157          10 :                 if (DEBUGLEVEL >= 10) {
    1158           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ChangePasswordUser4, NDR_IN, r2);
    1159             :                 }
    1160          10 :                 r2->out.result = _samr_ChangePasswordUser4(p, r2);
    1161          10 :                 break;
    1162             :         }
    1163           0 :         default:
    1164           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
    1165           0 :                 break;
    1166             :         }
    1167             : 
    1168       29809 : fail:
    1169             :         /* Unimpersonate */
    1170       29809 :         if (impersonated) {
    1171       29809 :                 unbecome_authenticated_pipe_user();
    1172             :         }
    1173             : 
    1174       29809 :         p->dce_call = NULL;
    1175       29809 :         p->mem_ctx = NULL;
    1176             :         /* Check pipes struct fault state */
    1177       29809 :         if (p->fault_state != 0) {
    1178          18 :                 dce_call->fault_code = p->fault_state;
    1179             :         }
    1180       29809 :         if (dce_call->fault_code != 0) {
    1181          18 :                 status = NT_STATUS_NET_WRITE_FAULT;
    1182             :         }
    1183             : 
    1184       29809 :         return status;
    1185             : }
    1186             : 
    1187       29809 : NTSTATUS samr__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    1188             : {
    1189       29809 :         return samr__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL);
    1190             : }
    1191             : 
    1192       29791 : NTSTATUS samr__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    1193             : {
    1194       29791 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
    1195             : 
    1196       29791 :         switch (opnum) {
    1197         252 :         case 0: { /* samr_Connect */
    1198         252 :                 struct samr_Connect *r2 = (struct samr_Connect *)r;
    1199         252 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1200           0 :                         DEBUG(5,("function samr_Connect replied async\n"));
    1201             :                 }
    1202         252 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1203           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect, NDR_OUT | NDR_SET_VALUES, r2);
    1204             :                 }
    1205         252 :                 if (dce_call->fault_code != 0) {
    1206           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Connect\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1207             :                 }
    1208         252 :                 break;
    1209             :         }
    1210        6212 :         case 1: { /* samr_Close */
    1211        6212 :                 struct samr_Close *r2 = (struct samr_Close *)r;
    1212        6212 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1213           0 :                         DEBUG(5,("function samr_Close replied async\n"));
    1214             :                 }
    1215        6212 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1216           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Close, NDR_OUT | NDR_SET_VALUES, r2);
    1217             :                 }
    1218        6212 :                 if (dce_call->fault_code != 0) {
    1219           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Close\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1220             :                 }
    1221        6212 :                 break;
    1222             :         }
    1223           4 :         case 2: { /* samr_SetSecurity */
    1224           4 :                 struct samr_SetSecurity *r2 = (struct samr_SetSecurity *)r;
    1225           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1226           0 :                         DEBUG(5,("function samr_SetSecurity replied async\n"));
    1227             :                 }
    1228           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1229           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetSecurity, NDR_OUT | NDR_SET_VALUES, r2);
    1230             :                 }
    1231           4 :                 if (dce_call->fault_code != 0) {
    1232           0 :                         DBG_WARNING("dcerpc_fault %s in samr_SetSecurity\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1233             :                 }
    1234           4 :                 break;
    1235             :         }
    1236           8 :         case 3: { /* samr_QuerySecurity */
    1237           8 :                 struct samr_QuerySecurity *r2 = (struct samr_QuerySecurity *)r;
    1238           8 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1239           0 :                         DEBUG(5,("function samr_QuerySecurity replied async\n"));
    1240             :                 }
    1241           8 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1242           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QuerySecurity, NDR_OUT | NDR_SET_VALUES, r2);
    1243             :                 }
    1244           8 :                 if (dce_call->fault_code != 0) {
    1245           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QuerySecurity\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1246             :                 }
    1247           8 :                 break;
    1248             :         }
    1249           0 :         case 4: { /* samr_Shutdown */
    1250           0 :                 struct samr_Shutdown *r2 = (struct samr_Shutdown *)r;
    1251           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1252           0 :                         DEBUG(5,("function samr_Shutdown replied async\n"));
    1253             :                 }
    1254           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1255           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Shutdown, NDR_OUT | NDR_SET_VALUES, r2);
    1256             :                 }
    1257           0 :                 if (dce_call->fault_code != 0) {
    1258           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Shutdown\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1259             :                 }
    1260           0 :                 break;
    1261             :         }
    1262         396 :         case 5: { /* samr_LookupDomain */
    1263         396 :                 struct samr_LookupDomain *r2 = (struct samr_LookupDomain *)r;
    1264         396 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1265           0 :                         DEBUG(5,("function samr_LookupDomain replied async\n"));
    1266             :                 }
    1267         396 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1268           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_LookupDomain, NDR_OUT | NDR_SET_VALUES, r2);
    1269             :                 }
    1270         396 :                 if (dce_call->fault_code != 0) {
    1271           0 :                         DBG_WARNING("dcerpc_fault %s in samr_LookupDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1272             :                 }
    1273         396 :                 break;
    1274             :         }
    1275          68 :         case 6: { /* samr_EnumDomains */
    1276          68 :                 struct samr_EnumDomains *r2 = (struct samr_EnumDomains *)r;
    1277          68 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1278           0 :                         DEBUG(5,("function samr_EnumDomains replied async\n"));
    1279             :                 }
    1280          68 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1281           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_EnumDomains, NDR_OUT | NDR_SET_VALUES, r2);
    1282             :                 }
    1283          68 :                 if (dce_call->fault_code != 0) {
    1284           0 :                         DBG_WARNING("dcerpc_fault %s in samr_EnumDomains\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1285             :                 }
    1286          68 :                 break;
    1287             :         }
    1288         585 :         case 7: { /* samr_OpenDomain */
    1289         585 :                 struct samr_OpenDomain *r2 = (struct samr_OpenDomain *)r;
    1290         585 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1291           0 :                         DEBUG(5,("function samr_OpenDomain replied async\n"));
    1292             :                 }
    1293         585 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1294           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OpenDomain, NDR_OUT | NDR_SET_VALUES, r2);
    1295             :                 }
    1296         585 :                 if (dce_call->fault_code != 0) {
    1297           0 :                         DBG_WARNING("dcerpc_fault %s in samr_OpenDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1298             :                 }
    1299         585 :                 break;
    1300             :         }
    1301         128 :         case 8: { /* samr_QueryDomainInfo */
    1302         128 :                 struct samr_QueryDomainInfo *r2 = (struct samr_QueryDomainInfo *)r;
    1303         128 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1304           0 :                         DEBUG(5,("function samr_QueryDomainInfo replied async\n"));
    1305             :                 }
    1306         128 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1307           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDomainInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1308             :                 }
    1309         128 :                 if (dce_call->fault_code != 0) {
    1310           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryDomainInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1311             :                 }
    1312         128 :                 break;
    1313             :         }
    1314          92 :         case 9: { /* samr_SetDomainInfo */
    1315          92 :                 struct samr_SetDomainInfo *r2 = (struct samr_SetDomainInfo *)r;
    1316          92 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1317           0 :                         DEBUG(5,("function samr_SetDomainInfo replied async\n"));
    1318             :                 }
    1319          92 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1320           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetDomainInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1321             :                 }
    1322          92 :                 if (dce_call->fault_code != 0) {
    1323           0 :                         DBG_WARNING("dcerpc_fault %s in samr_SetDomainInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1324             :                 }
    1325          92 :                 break;
    1326             :         }
    1327         604 :         case 10: { /* samr_CreateDomainGroup */
    1328         604 :                 struct samr_CreateDomainGroup *r2 = (struct samr_CreateDomainGroup *)r;
    1329         604 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1330           0 :                         DEBUG(5,("function samr_CreateDomainGroup replied async\n"));
    1331             :                 }
    1332         604 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1333           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_CreateDomainGroup, NDR_OUT | NDR_SET_VALUES, r2);
    1334             :                 }
    1335         604 :                 if (dce_call->fault_code != 0) {
    1336           0 :                         DBG_WARNING("dcerpc_fault %s in samr_CreateDomainGroup\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1337             :                 }
    1338         604 :                 break;
    1339             :         }
    1340          24 :         case 11: { /* samr_EnumDomainGroups */
    1341          24 :                 struct samr_EnumDomainGroups *r2 = (struct samr_EnumDomainGroups *)r;
    1342          24 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1343           0 :                         DEBUG(5,("function samr_EnumDomainGroups replied async\n"));
    1344             :                 }
    1345          24 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1346           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_EnumDomainGroups, NDR_OUT | NDR_SET_VALUES, r2);
    1347             :                 }
    1348          24 :                 if (dce_call->fault_code != 0) {
    1349           0 :                         DBG_WARNING("dcerpc_fault %s in samr_EnumDomainGroups\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1350             :                 }
    1351          24 :                 break;
    1352             :         }
    1353         630 :         case 12: { /* samr_CreateUser */
    1354         630 :                 struct samr_CreateUser *r2 = (struct samr_CreateUser *)r;
    1355         630 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1356           0 :                         DEBUG(5,("function samr_CreateUser replied async\n"));
    1357             :                 }
    1358         630 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1359           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_CreateUser, NDR_OUT | NDR_SET_VALUES, r2);
    1360             :                 }
    1361         630 :                 if (dce_call->fault_code != 0) {
    1362           0 :                         DBG_WARNING("dcerpc_fault %s in samr_CreateUser\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1363             :                 }
    1364         630 :                 break;
    1365             :         }
    1366          60 :         case 13: { /* samr_EnumDomainUsers */
    1367          60 :                 struct samr_EnumDomainUsers *r2 = (struct samr_EnumDomainUsers *)r;
    1368          60 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1369           0 :                         DEBUG(5,("function samr_EnumDomainUsers replied async\n"));
    1370             :                 }
    1371          60 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1372           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_EnumDomainUsers, NDR_OUT | NDR_SET_VALUES, r2);
    1373             :                 }
    1374          60 :                 if (dce_call->fault_code != 0) {
    1375           0 :                         DBG_WARNING("dcerpc_fault %s in samr_EnumDomainUsers\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1376             :                 }
    1377          60 :                 break;
    1378             :         }
    1379         604 :         case 14: { /* samr_CreateDomAlias */
    1380         604 :                 struct samr_CreateDomAlias *r2 = (struct samr_CreateDomAlias *)r;
    1381         604 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1382           0 :                         DEBUG(5,("function samr_CreateDomAlias replied async\n"));
    1383             :                 }
    1384         604 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1385           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_CreateDomAlias, NDR_OUT | NDR_SET_VALUES, r2);
    1386             :                 }
    1387         604 :                 if (dce_call->fault_code != 0) {
    1388           0 :                         DBG_WARNING("dcerpc_fault %s in samr_CreateDomAlias\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1389             :                 }
    1390         604 :                 break;
    1391             :         }
    1392          52 :         case 15: { /* samr_EnumDomainAliases */
    1393          52 :                 struct samr_EnumDomainAliases *r2 = (struct samr_EnumDomainAliases *)r;
    1394          52 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1395           0 :                         DEBUG(5,("function samr_EnumDomainAliases replied async\n"));
    1396             :                 }
    1397          52 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1398           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_EnumDomainAliases, NDR_OUT | NDR_SET_VALUES, r2);
    1399             :                 }
    1400          52 :                 if (dce_call->fault_code != 0) {
    1401           0 :                         DBG_WARNING("dcerpc_fault %s in samr_EnumDomainAliases\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1402             :                 }
    1403          52 :                 break;
    1404             :         }
    1405        3884 :         case 16: { /* samr_GetAliasMembership */
    1406        3884 :                 struct samr_GetAliasMembership *r2 = (struct samr_GetAliasMembership *)r;
    1407        3884 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1408           0 :                         DEBUG(5,("function samr_GetAliasMembership replied async\n"));
    1409             :                 }
    1410        3884 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1411           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetAliasMembership, NDR_OUT | NDR_SET_VALUES, r2);
    1412             :                 }
    1413        3884 :                 if (dce_call->fault_code != 0) {
    1414           0 :                         DBG_WARNING("dcerpc_fault %s in samr_GetAliasMembership\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1415             :                 }
    1416        3884 :                 break;
    1417             :         }
    1418        1235 :         case 17: { /* samr_LookupNames */
    1419        1235 :                 struct samr_LookupNames *r2 = (struct samr_LookupNames *)r;
    1420        1235 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1421           0 :                         DEBUG(5,("function samr_LookupNames replied async\n"));
    1422             :                 }
    1423        1235 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1424           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_LookupNames, NDR_OUT | NDR_SET_VALUES, r2);
    1425             :                 }
    1426        1235 :                 if (dce_call->fault_code != 0) {
    1427           0 :                         DBG_WARNING("dcerpc_fault %s in samr_LookupNames\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1428             :                 }
    1429        1235 :                 break;
    1430             :         }
    1431        1268 :         case 18: { /* samr_LookupRids */
    1432        1268 :                 struct samr_LookupRids *r2 = (struct samr_LookupRids *)r;
    1433        1268 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1434           0 :                         DEBUG(5,("function samr_LookupRids replied async\n"));
    1435             :                 }
    1436        1268 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1437           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_LookupRids, NDR_OUT | NDR_SET_VALUES, r2);
    1438             :                 }
    1439        1268 :                 if (dce_call->fault_code != 0) {
    1440           0 :                         DBG_WARNING("dcerpc_fault %s in samr_LookupRids\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1441             :                 }
    1442        1268 :                 break;
    1443             :         }
    1444         314 :         case 19: { /* samr_OpenGroup */
    1445         314 :                 struct samr_OpenGroup *r2 = (struct samr_OpenGroup *)r;
    1446         314 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1447           0 :                         DEBUG(5,("function samr_OpenGroup replied async\n"));
    1448             :                 }
    1449         314 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1450           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OpenGroup, NDR_OUT | NDR_SET_VALUES, r2);
    1451             :                 }
    1452         314 :                 if (dce_call->fault_code != 0) {
    1453           0 :                         DBG_WARNING("dcerpc_fault %s in samr_OpenGroup\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1454             :                 }
    1455         314 :                 break;
    1456             :         }
    1457          38 :         case 20: { /* samr_QueryGroupInfo */
    1458          38 :                 struct samr_QueryGroupInfo *r2 = (struct samr_QueryGroupInfo *)r;
    1459          38 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1460           0 :                         DEBUG(5,("function samr_QueryGroupInfo replied async\n"));
    1461             :                 }
    1462          38 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1463           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryGroupInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1464             :                 }
    1465          38 :                 if (dce_call->fault_code != 0) {
    1466           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryGroupInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1467             :                 }
    1468          38 :                 break;
    1469             :         }
    1470           8 :         case 21: { /* samr_SetGroupInfo */
    1471           8 :                 struct samr_SetGroupInfo *r2 = (struct samr_SetGroupInfo *)r;
    1472           8 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1473           0 :                         DEBUG(5,("function samr_SetGroupInfo replied async\n"));
    1474             :                 }
    1475           8 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1476           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetGroupInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1477             :                 }
    1478           8 :                 if (dce_call->fault_code != 0) {
    1479           0 :                         DBG_WARNING("dcerpc_fault %s in samr_SetGroupInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1480             :                 }
    1481           8 :                 break;
    1482             :         }
    1483           6 :         case 22: { /* samr_AddGroupMember */
    1484           6 :                 struct samr_AddGroupMember *r2 = (struct samr_AddGroupMember *)r;
    1485           6 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1486           0 :                         DEBUG(5,("function samr_AddGroupMember replied async\n"));
    1487             :                 }
    1488           6 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1489           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_AddGroupMember, NDR_OUT | NDR_SET_VALUES, r2);
    1490             :                 }
    1491           6 :                 if (dce_call->fault_code != 0) {
    1492           0 :                         DBG_WARNING("dcerpc_fault %s in samr_AddGroupMember\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1493             :                 }
    1494           6 :                 break;
    1495             :         }
    1496           2 :         case 23: { /* samr_DeleteDomainGroup */
    1497           2 :                 struct samr_DeleteDomainGroup *r2 = (struct samr_DeleteDomainGroup *)r;
    1498           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1499           0 :                         DEBUG(5,("function samr_DeleteDomainGroup replied async\n"));
    1500             :                 }
    1501           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1502           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteDomainGroup, NDR_OUT | NDR_SET_VALUES, r2);
    1503             :                 }
    1504           2 :                 if (dce_call->fault_code != 0) {
    1505           0 :                         DBG_WARNING("dcerpc_fault %s in samr_DeleteDomainGroup\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1506             :                 }
    1507           2 :                 break;
    1508             :         }
    1509           4 :         case 24: { /* samr_DeleteGroupMember */
    1510           4 :                 struct samr_DeleteGroupMember *r2 = (struct samr_DeleteGroupMember *)r;
    1511           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1512           0 :                         DEBUG(5,("function samr_DeleteGroupMember replied async\n"));
    1513             :                 }
    1514           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1515           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteGroupMember, NDR_OUT | NDR_SET_VALUES, r2);
    1516             :                 }
    1517           4 :                 if (dce_call->fault_code != 0) {
    1518           0 :                         DBG_WARNING("dcerpc_fault %s in samr_DeleteGroupMember\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1519             :                 }
    1520           4 :                 break;
    1521             :         }
    1522         316 :         case 25: { /* samr_QueryGroupMember */
    1523         316 :                 struct samr_QueryGroupMember *r2 = (struct samr_QueryGroupMember *)r;
    1524         316 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1525           0 :                         DEBUG(5,("function samr_QueryGroupMember replied async\n"));
    1526             :                 }
    1527         316 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1528           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryGroupMember, NDR_OUT | NDR_SET_VALUES, r2);
    1529             :                 }
    1530         316 :                 if (dce_call->fault_code != 0) {
    1531           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryGroupMember\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1532             :                 }
    1533         316 :                 break;
    1534             :         }
    1535           0 :         case 26: { /* samr_SetMemberAttributesOfGroup */
    1536           0 :                 struct samr_SetMemberAttributesOfGroup *r2 = (struct samr_SetMemberAttributesOfGroup *)r;
    1537           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1538           0 :                         DEBUG(5,("function samr_SetMemberAttributesOfGroup replied async\n"));
    1539             :                 }
    1540           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1541           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetMemberAttributesOfGroup, NDR_OUT | NDR_SET_VALUES, r2);
    1542             :                 }
    1543           0 :                 if (dce_call->fault_code != 0) {
    1544           0 :                         DBG_WARNING("dcerpc_fault %s in samr_SetMemberAttributesOfGroup\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1545             :                 }
    1546           0 :                 break;
    1547             :         }
    1548        1234 :         case 27: { /* samr_OpenAlias */
    1549        1234 :                 struct samr_OpenAlias *r2 = (struct samr_OpenAlias *)r;
    1550        1234 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1551           0 :                         DEBUG(5,("function samr_OpenAlias replied async\n"));
    1552             :                 }
    1553        1234 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1554           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OpenAlias, NDR_OUT | NDR_SET_VALUES, r2);
    1555             :                 }
    1556        1234 :                 if (dce_call->fault_code != 0) {
    1557           0 :                         DBG_WARNING("dcerpc_fault %s in samr_OpenAlias\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1558             :                 }
    1559        1234 :                 break;
    1560             :         }
    1561          34 :         case 28: { /* samr_QueryAliasInfo */
    1562          34 :                 struct samr_QueryAliasInfo *r2 = (struct samr_QueryAliasInfo *)r;
    1563          34 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1564           0 :                         DEBUG(5,("function samr_QueryAliasInfo replied async\n"));
    1565             :                 }
    1566          34 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1567           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryAliasInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1568             :                 }
    1569          34 :                 if (dce_call->fault_code != 0) {
    1570           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryAliasInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1571             :                 }
    1572          34 :                 break;
    1573             :         }
    1574           4 :         case 29: { /* samr_SetAliasInfo */
    1575           4 :                 struct samr_SetAliasInfo *r2 = (struct samr_SetAliasInfo *)r;
    1576           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1577           0 :                         DEBUG(5,("function samr_SetAliasInfo replied async\n"));
    1578             :                 }
    1579           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1580           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetAliasInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1581             :                 }
    1582           4 :                 if (dce_call->fault_code != 0) {
    1583           0 :                         DBG_WARNING("dcerpc_fault %s in samr_SetAliasInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1584             :                 }
    1585           4 :                 break;
    1586             :         }
    1587           2 :         case 30: { /* samr_DeleteDomAlias */
    1588           2 :                 struct samr_DeleteDomAlias *r2 = (struct samr_DeleteDomAlias *)r;
    1589           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1590           0 :                         DEBUG(5,("function samr_DeleteDomAlias replied async\n"));
    1591             :                 }
    1592           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1593           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteDomAlias, NDR_OUT | NDR_SET_VALUES, r2);
    1594             :                 }
    1595           2 :                 if (dce_call->fault_code != 0) {
    1596           0 :                         DBG_WARNING("dcerpc_fault %s in samr_DeleteDomAlias\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1597             :                 }
    1598           2 :                 break;
    1599             :         }
    1600           2 :         case 31: { /* samr_AddAliasMember */
    1601           2 :                 struct samr_AddAliasMember *r2 = (struct samr_AddAliasMember *)r;
    1602           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1603           0 :                         DEBUG(5,("function samr_AddAliasMember replied async\n"));
    1604             :                 }
    1605           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1606           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_AddAliasMember, NDR_OUT | NDR_SET_VALUES, r2);
    1607             :                 }
    1608           2 :                 if (dce_call->fault_code != 0) {
    1609           0 :                         DBG_WARNING("dcerpc_fault %s in samr_AddAliasMember\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1610             :                 }
    1611           2 :                 break;
    1612             :         }
    1613           2 :         case 32: { /* samr_DeleteAliasMember */
    1614           2 :                 struct samr_DeleteAliasMember *r2 = (struct samr_DeleteAliasMember *)r;
    1615           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1616           0 :                         DEBUG(5,("function samr_DeleteAliasMember replied async\n"));
    1617             :                 }
    1618           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1619           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteAliasMember, NDR_OUT | NDR_SET_VALUES, r2);
    1620             :                 }
    1621           2 :                 if (dce_call->fault_code != 0) {
    1622           0 :                         DBG_WARNING("dcerpc_fault %s in samr_DeleteAliasMember\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1623             :                 }
    1624           2 :                 break;
    1625             :         }
    1626        1234 :         case 33: { /* samr_GetMembersInAlias */
    1627        1234 :                 struct samr_GetMembersInAlias *r2 = (struct samr_GetMembersInAlias *)r;
    1628        1234 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1629           0 :                         DEBUG(5,("function samr_GetMembersInAlias replied async\n"));
    1630             :                 }
    1631        1234 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1632           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetMembersInAlias, NDR_OUT | NDR_SET_VALUES, r2);
    1633             :                 }
    1634        1234 :                 if (dce_call->fault_code != 0) {
    1635           0 :                         DBG_WARNING("dcerpc_fault %s in samr_GetMembersInAlias\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1636             :                 }
    1637        1234 :                 break;
    1638             :         }
    1639        2853 :         case 34: { /* samr_OpenUser */
    1640        2853 :                 struct samr_OpenUser *r2 = (struct samr_OpenUser *)r;
    1641        2853 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1642           0 :                         DEBUG(5,("function samr_OpenUser replied async\n"));
    1643             :                 }
    1644        2853 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1645           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OpenUser, NDR_OUT | NDR_SET_VALUES, r2);
    1646             :                 }
    1647        2853 :                 if (dce_call->fault_code != 0) {
    1648           0 :                         DBG_WARNING("dcerpc_fault %s in samr_OpenUser\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1649             :                 }
    1650        2853 :                 break;
    1651             :         }
    1652          84 :         case 35: { /* samr_DeleteUser */
    1653          84 :                 struct samr_DeleteUser *r2 = (struct samr_DeleteUser *)r;
    1654          84 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1655           0 :                         DEBUG(5,("function samr_DeleteUser replied async\n"));
    1656             :                 }
    1657          84 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1658           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_DeleteUser, NDR_OUT | NDR_SET_VALUES, r2);
    1659             :                 }
    1660          84 :                 if (dce_call->fault_code != 0) {
    1661           0 :                         DBG_WARNING("dcerpc_fault %s in samr_DeleteUser\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1662             :                 }
    1663          84 :                 break;
    1664             :         }
    1665        1822 :         case 36: { /* samr_QueryUserInfo */
    1666        1822 :                 struct samr_QueryUserInfo *r2 = (struct samr_QueryUserInfo *)r;
    1667        1822 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1668           0 :                         DEBUG(5,("function samr_QueryUserInfo replied async\n"));
    1669             :                 }
    1670        1822 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1671           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryUserInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1672             :                 }
    1673        1822 :                 if (dce_call->fault_code != 0) {
    1674           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryUserInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1675             :                 }
    1676        1822 :                 break;
    1677             :         }
    1678         558 :         case 37: { /* samr_SetUserInfo */
    1679         558 :                 struct samr_SetUserInfo *r2 = (struct samr_SetUserInfo *)r;
    1680         558 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1681           0 :                         DEBUG(5,("function samr_SetUserInfo replied async\n"));
    1682             :                 }
    1683         558 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1684           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetUserInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1685             :                 }
    1686         558 :                 if (dce_call->fault_code != 0) {
    1687           0 :                         DBG_WARNING("dcerpc_fault %s in samr_SetUserInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1688             :                 }
    1689         558 :                 break;
    1690             :         }
    1691           4 :         case 38: { /* samr_ChangePasswordUser */
    1692           4 :                 struct samr_ChangePasswordUser *r2 = (struct samr_ChangePasswordUser *)r;
    1693           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1694           0 :                         DEBUG(5,("function samr_ChangePasswordUser replied async\n"));
    1695             :                 }
    1696           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1697           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ChangePasswordUser, NDR_OUT | NDR_SET_VALUES, r2);
    1698             :                 }
    1699           4 :                 if (dce_call->fault_code != 0) {
    1700           0 :                         DBG_WARNING("dcerpc_fault %s in samr_ChangePasswordUser\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1701             :                 }
    1702           4 :                 break;
    1703             :         }
    1704        2550 :         case 39: { /* samr_GetGroupsForUser */
    1705        2550 :                 struct samr_GetGroupsForUser *r2 = (struct samr_GetGroupsForUser *)r;
    1706        2550 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1707           0 :                         DEBUG(5,("function samr_GetGroupsForUser replied async\n"));
    1708             :                 }
    1709        2550 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1710           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetGroupsForUser, NDR_OUT | NDR_SET_VALUES, r2);
    1711             :                 }
    1712        2550 :                 if (dce_call->fault_code != 0) {
    1713           0 :                         DBG_WARNING("dcerpc_fault %s in samr_GetGroupsForUser\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1714             :                 }
    1715        2550 :                 break;
    1716             :         }
    1717          84 :         case 40: { /* samr_QueryDisplayInfo */
    1718          84 :                 struct samr_QueryDisplayInfo *r2 = (struct samr_QueryDisplayInfo *)r;
    1719          84 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1720           0 :                         DEBUG(5,("function samr_QueryDisplayInfo replied async\n"));
    1721             :                 }
    1722          84 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1723           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDisplayInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1724             :                 }
    1725          84 :                 if (dce_call->fault_code != 0) {
    1726           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryDisplayInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1727             :                 }
    1728          84 :                 break;
    1729             :         }
    1730          40 :         case 41: { /* samr_GetDisplayEnumerationIndex */
    1731          40 :                 struct samr_GetDisplayEnumerationIndex *r2 = (struct samr_GetDisplayEnumerationIndex *)r;
    1732          40 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1733           0 :                         DEBUG(5,("function samr_GetDisplayEnumerationIndex replied async\n"));
    1734             :                 }
    1735          40 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1736           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetDisplayEnumerationIndex, NDR_OUT | NDR_SET_VALUES, r2);
    1737             :                 }
    1738          40 :                 if (dce_call->fault_code != 0) {
    1739           0 :                         DBG_WARNING("dcerpc_fault %s in samr_GetDisplayEnumerationIndex\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1740             :                 }
    1741          40 :                 break;
    1742             :         }
    1743           0 :         case 42: { /* samr_TestPrivateFunctionsDomain */
    1744           0 :                 struct samr_TestPrivateFunctionsDomain *r2 = (struct samr_TestPrivateFunctionsDomain *)r;
    1745           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1746           0 :                         DEBUG(5,("function samr_TestPrivateFunctionsDomain replied async\n"));
    1747             :                 }
    1748           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1749           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_TestPrivateFunctionsDomain, NDR_OUT | NDR_SET_VALUES, r2);
    1750             :                 }
    1751           0 :                 if (dce_call->fault_code != 0) {
    1752           0 :                         DBG_WARNING("dcerpc_fault %s in samr_TestPrivateFunctionsDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1753             :                 }
    1754           0 :                 break;
    1755             :         }
    1756           0 :         case 43: { /* samr_TestPrivateFunctionsUser */
    1757           0 :                 struct samr_TestPrivateFunctionsUser *r2 = (struct samr_TestPrivateFunctionsUser *)r;
    1758           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1759           0 :                         DEBUG(5,("function samr_TestPrivateFunctionsUser replied async\n"));
    1760             :                 }
    1761           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1762           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_TestPrivateFunctionsUser, NDR_OUT | NDR_SET_VALUES, r2);
    1763             :                 }
    1764           0 :                 if (dce_call->fault_code != 0) {
    1765           0 :                         DBG_WARNING("dcerpc_fault %s in samr_TestPrivateFunctionsUser\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1766             :                 }
    1767           0 :                 break;
    1768             :         }
    1769         348 :         case 44: { /* samr_GetUserPwInfo */
    1770         348 :                 struct samr_GetUserPwInfo *r2 = (struct samr_GetUserPwInfo *)r;
    1771         348 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1772           0 :                         DEBUG(5,("function samr_GetUserPwInfo replied async\n"));
    1773             :                 }
    1774         348 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1775           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetUserPwInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1776             :                 }
    1777         348 :                 if (dce_call->fault_code != 0) {
    1778           0 :                         DBG_WARNING("dcerpc_fault %s in samr_GetUserPwInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1779             :                 }
    1780         348 :                 break;
    1781             :         }
    1782           6 :         case 45: { /* samr_RemoveMemberFromForeignDomain */
    1783           6 :                 struct samr_RemoveMemberFromForeignDomain *r2 = (struct samr_RemoveMemberFromForeignDomain *)r;
    1784           6 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1785           0 :                         DEBUG(5,("function samr_RemoveMemberFromForeignDomain replied async\n"));
    1786             :                 }
    1787           6 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1788           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_RemoveMemberFromForeignDomain, NDR_OUT | NDR_SET_VALUES, r2);
    1789             :                 }
    1790           6 :                 if (dce_call->fault_code != 0) {
    1791           0 :                         DBG_WARNING("dcerpc_fault %s in samr_RemoveMemberFromForeignDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1792             :                 }
    1793           6 :                 break;
    1794             :         }
    1795          68 :         case 46: { /* samr_QueryDomainInfo2 */
    1796          68 :                 struct samr_QueryDomainInfo2 *r2 = (struct samr_QueryDomainInfo2 *)r;
    1797          68 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1798           0 :                         DEBUG(5,("function samr_QueryDomainInfo2 replied async\n"));
    1799             :                 }
    1800          68 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1801           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDomainInfo2, NDR_OUT | NDR_SET_VALUES, r2);
    1802             :                 }
    1803          68 :                 if (dce_call->fault_code != 0) {
    1804           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryDomainInfo2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1805             :                 }
    1806          68 :                 break;
    1807             :         }
    1808         382 :         case 47: { /* samr_QueryUserInfo2 */
    1809         382 :                 struct samr_QueryUserInfo2 *r2 = (struct samr_QueryUserInfo2 *)r;
    1810         382 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1811           0 :                         DEBUG(5,("function samr_QueryUserInfo2 replied async\n"));
    1812             :                 }
    1813         382 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1814           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryUserInfo2, NDR_OUT | NDR_SET_VALUES, r2);
    1815             :                 }
    1816         382 :                 if (dce_call->fault_code != 0) {
    1817           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryUserInfo2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1818             :                 }
    1819         382 :                 break;
    1820             :         }
    1821          20 :         case 48: { /* samr_QueryDisplayInfo2 */
    1822          20 :                 struct samr_QueryDisplayInfo2 *r2 = (struct samr_QueryDisplayInfo2 *)r;
    1823          20 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1824           0 :                         DEBUG(5,("function samr_QueryDisplayInfo2 replied async\n"));
    1825             :                 }
    1826          20 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1827           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDisplayInfo2, NDR_OUT | NDR_SET_VALUES, r2);
    1828             :                 }
    1829          20 :                 if (dce_call->fault_code != 0) {
    1830           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryDisplayInfo2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1831             :                 }
    1832          20 :                 break;
    1833             :         }
    1834          40 :         case 49: { /* samr_GetDisplayEnumerationIndex2 */
    1835          40 :                 struct samr_GetDisplayEnumerationIndex2 *r2 = (struct samr_GetDisplayEnumerationIndex2 *)r;
    1836          40 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1837           0 :                         DEBUG(5,("function samr_GetDisplayEnumerationIndex2 replied async\n"));
    1838             :                 }
    1839          40 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1840           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetDisplayEnumerationIndex2, NDR_OUT | NDR_SET_VALUES, r2);
    1841             :                 }
    1842          40 :                 if (dce_call->fault_code != 0) {
    1843           0 :                         DBG_WARNING("dcerpc_fault %s in samr_GetDisplayEnumerationIndex2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1844             :                 }
    1845          40 :                 break;
    1846             :         }
    1847          87 :         case 50: { /* samr_CreateUser2 */
    1848          87 :                 struct samr_CreateUser2 *r2 = (struct samr_CreateUser2 *)r;
    1849          87 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1850           0 :                         DEBUG(5,("function samr_CreateUser2 replied async\n"));
    1851             :                 }
    1852          87 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1853           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_CreateUser2, NDR_OUT | NDR_SET_VALUES, r2);
    1854             :                 }
    1855          87 :                 if (dce_call->fault_code != 0) {
    1856           0 :                         DBG_WARNING("dcerpc_fault %s in samr_CreateUser2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1857             :                 }
    1858          87 :                 break;
    1859             :         }
    1860          20 :         case 51: { /* samr_QueryDisplayInfo3 */
    1861          20 :                 struct samr_QueryDisplayInfo3 *r2 = (struct samr_QueryDisplayInfo3 *)r;
    1862          20 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1863           0 :                         DEBUG(5,("function samr_QueryDisplayInfo3 replied async\n"));
    1864             :                 }
    1865          20 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1866           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_QueryDisplayInfo3, NDR_OUT | NDR_SET_VALUES, r2);
    1867             :                 }
    1868          20 :                 if (dce_call->fault_code != 0) {
    1869           0 :                         DBG_WARNING("dcerpc_fault %s in samr_QueryDisplayInfo3\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1870             :                 }
    1871          20 :                 break;
    1872             :         }
    1873           0 :         case 52: { /* samr_AddMultipleMembersToAlias */
    1874           0 :                 struct samr_AddMultipleMembersToAlias *r2 = (struct samr_AddMultipleMembersToAlias *)r;
    1875           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1876           0 :                         DEBUG(5,("function samr_AddMultipleMembersToAlias replied async\n"));
    1877             :                 }
    1878           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1879           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_AddMultipleMembersToAlias, NDR_OUT | NDR_SET_VALUES, r2);
    1880             :                 }
    1881           0 :                 if (dce_call->fault_code != 0) {
    1882           0 :                         DBG_WARNING("dcerpc_fault %s in samr_AddMultipleMembersToAlias\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1883             :                 }
    1884           0 :                 break;
    1885             :         }
    1886           0 :         case 53: { /* samr_RemoveMultipleMembersFromAlias */
    1887           0 :                 struct samr_RemoveMultipleMembersFromAlias *r2 = (struct samr_RemoveMultipleMembersFromAlias *)r;
    1888           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1889           0 :                         DEBUG(5,("function samr_RemoveMultipleMembersFromAlias replied async\n"));
    1890             :                 }
    1891           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1892           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_RemoveMultipleMembersFromAlias, NDR_OUT | NDR_SET_VALUES, r2);
    1893             :                 }
    1894           0 :                 if (dce_call->fault_code != 0) {
    1895           0 :                         DBG_WARNING("dcerpc_fault %s in samr_RemoveMultipleMembersFromAlias\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1896             :                 }
    1897           0 :                 break;
    1898             :         }
    1899          30 :         case 54: { /* samr_OemChangePasswordUser2 */
    1900          30 :                 struct samr_OemChangePasswordUser2 *r2 = (struct samr_OemChangePasswordUser2 *)r;
    1901          30 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1902           0 :                         DEBUG(5,("function samr_OemChangePasswordUser2 replied async\n"));
    1903             :                 }
    1904          30 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1905           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_OemChangePasswordUser2, NDR_OUT | NDR_SET_VALUES, r2);
    1906             :                 }
    1907          30 :                 if (dce_call->fault_code != 0) {
    1908           0 :                         DBG_WARNING("dcerpc_fault %s in samr_OemChangePasswordUser2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1909             :                 }
    1910          30 :                 break;
    1911             :         }
    1912          14 :         case 55: { /* samr_ChangePasswordUser2 */
    1913          14 :                 struct samr_ChangePasswordUser2 *r2 = (struct samr_ChangePasswordUser2 *)r;
    1914          14 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1915           0 :                         DEBUG(5,("function samr_ChangePasswordUser2 replied async\n"));
    1916             :                 }
    1917          14 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1918           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ChangePasswordUser2, NDR_OUT | NDR_SET_VALUES, r2);
    1919             :                 }
    1920          14 :                 if (dce_call->fault_code != 0) {
    1921           0 :                         DBG_WARNING("dcerpc_fault %s in samr_ChangePasswordUser2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1922             :                 }
    1923          14 :                 break;
    1924             :         }
    1925         412 :         case 56: { /* samr_GetDomPwInfo */
    1926         412 :                 struct samr_GetDomPwInfo *r2 = (struct samr_GetDomPwInfo *)r;
    1927         412 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1928           0 :                         DEBUG(5,("function samr_GetDomPwInfo replied async\n"));
    1929             :                 }
    1930         412 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1931           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetDomPwInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1932             :                 }
    1933         412 :                 if (dce_call->fault_code != 0) {
    1934           0 :                         DBG_WARNING("dcerpc_fault %s in samr_GetDomPwInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1935             :                 }
    1936         412 :                 break;
    1937             :         }
    1938         395 :         case 57: { /* samr_Connect2 */
    1939         395 :                 struct samr_Connect2 *r2 = (struct samr_Connect2 *)r;
    1940         395 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1941           0 :                         DEBUG(5,("function samr_Connect2 replied async\n"));
    1942             :                 }
    1943         395 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1944           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect2, NDR_OUT | NDR_SET_VALUES, r2);
    1945             :                 }
    1946         395 :                 if (dce_call->fault_code != 0) {
    1947           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Connect2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1948             :                 }
    1949         395 :                 break;
    1950             :         }
    1951         238 :         case 58: { /* samr_SetUserInfo2 */
    1952         238 :                 struct samr_SetUserInfo2 *r2 = (struct samr_SetUserInfo2 *)r;
    1953         238 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1954           0 :                         DEBUG(5,("function samr_SetUserInfo2 replied async\n"));
    1955             :                 }
    1956         238 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1957           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetUserInfo2, NDR_OUT | NDR_SET_VALUES, r2);
    1958             :                 }
    1959         238 :                 if (dce_call->fault_code != 0) {
    1960           0 :                         DBG_WARNING("dcerpc_fault %s in samr_SetUserInfo2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1961             :                 }
    1962         238 :                 break;
    1963             :         }
    1964           0 :         case 59: { /* samr_SetBootKeyInformation */
    1965           0 :                 struct samr_SetBootKeyInformation *r2 = (struct samr_SetBootKeyInformation *)r;
    1966           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1967           0 :                         DEBUG(5,("function samr_SetBootKeyInformation replied async\n"));
    1968             :                 }
    1969           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1970           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetBootKeyInformation, NDR_OUT | NDR_SET_VALUES, r2);
    1971             :                 }
    1972           0 :                 if (dce_call->fault_code != 0) {
    1973           0 :                         DBG_WARNING("dcerpc_fault %s in samr_SetBootKeyInformation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1974             :                 }
    1975           0 :                 break;
    1976             :         }
    1977           0 :         case 60: { /* samr_GetBootKeyInformation */
    1978           0 :                 struct samr_GetBootKeyInformation *r2 = (struct samr_GetBootKeyInformation *)r;
    1979           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1980           0 :                         DEBUG(5,("function samr_GetBootKeyInformation replied async\n"));
    1981             :                 }
    1982           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1983           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_GetBootKeyInformation, NDR_OUT | NDR_SET_VALUES, r2);
    1984             :                 }
    1985           0 :                 if (dce_call->fault_code != 0) {
    1986           0 :                         DBG_WARNING("dcerpc_fault %s in samr_GetBootKeyInformation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1987             :                 }
    1988           0 :                 break;
    1989             :         }
    1990          60 :         case 61: { /* samr_Connect3 */
    1991          60 :                 struct samr_Connect3 *r2 = (struct samr_Connect3 *)r;
    1992          60 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1993           0 :                         DEBUG(5,("function samr_Connect3 replied async\n"));
    1994             :                 }
    1995          60 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1996           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect3, NDR_OUT | NDR_SET_VALUES, r2);
    1997             :                 }
    1998          60 :                 if (dce_call->fault_code != 0) {
    1999           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Connect3\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2000             :                 }
    2001          60 :                 break;
    2002             :         }
    2003          60 :         case 62: { /* samr_Connect4 */
    2004          60 :                 struct samr_Connect4 *r2 = (struct samr_Connect4 *)r;
    2005          60 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2006           0 :                         DEBUG(5,("function samr_Connect4 replied async\n"));
    2007             :                 }
    2008          60 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2009           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect4, NDR_OUT | NDR_SET_VALUES, r2);
    2010             :                 }
    2011          60 :                 if (dce_call->fault_code != 0) {
    2012           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Connect4\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2013             :                 }
    2014          60 :                 break;
    2015             :         }
    2016         208 :         case 63: { /* samr_ChangePasswordUser3 */
    2017         208 :                 struct samr_ChangePasswordUser3 *r2 = (struct samr_ChangePasswordUser3 *)r;
    2018         208 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2019           0 :                         DEBUG(5,("function samr_ChangePasswordUser3 replied async\n"));
    2020             :                 }
    2021         208 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2022           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ChangePasswordUser3, NDR_OUT | NDR_SET_VALUES, r2);
    2023             :                 }
    2024         208 :                 if (dce_call->fault_code != 0) {
    2025           0 :                         DBG_WARNING("dcerpc_fault %s in samr_ChangePasswordUser3\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2026             :                 }
    2027         208 :                 break;
    2028             :         }
    2029          70 :         case 64: { /* samr_Connect5 */
    2030          70 :                 struct samr_Connect5 *r2 = (struct samr_Connect5 *)r;
    2031          70 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2032           0 :                         DEBUG(5,("function samr_Connect5 replied async\n"));
    2033             :                 }
    2034          70 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2035           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Connect5, NDR_OUT | NDR_SET_VALUES, r2);
    2036             :                 }
    2037          70 :                 if (dce_call->fault_code != 0) {
    2038           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Connect5\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2039             :                 }
    2040          70 :                 break;
    2041             :         }
    2042          16 :         case 65: { /* samr_RidToSid */
    2043          16 :                 struct samr_RidToSid *r2 = (struct samr_RidToSid *)r;
    2044          16 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2045           0 :                         DEBUG(5,("function samr_RidToSid replied async\n"));
    2046             :                 }
    2047          16 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2048           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_RidToSid, NDR_OUT | NDR_SET_VALUES, r2);
    2049             :                 }
    2050          16 :                 if (dce_call->fault_code != 0) {
    2051           0 :                         DBG_WARNING("dcerpc_fault %s in samr_RidToSid\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2052             :                 }
    2053          16 :                 break;
    2054             :         }
    2055           0 :         case 66: { /* samr_SetDsrmPassword */
    2056           0 :                 struct samr_SetDsrmPassword *r2 = (struct samr_SetDsrmPassword *)r;
    2057           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2058           0 :                         DEBUG(5,("function samr_SetDsrmPassword replied async\n"));
    2059             :                 }
    2060           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2061           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_SetDsrmPassword, NDR_OUT | NDR_SET_VALUES, r2);
    2062             :                 }
    2063           0 :                 if (dce_call->fault_code != 0) {
    2064           0 :                         DBG_WARNING("dcerpc_fault %s in samr_SetDsrmPassword\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2065             :                 }
    2066           0 :                 break;
    2067             :         }
    2068           6 :         case 67: { /* samr_ValidatePassword */
    2069           6 :                 struct samr_ValidatePassword *r2 = (struct samr_ValidatePassword *)r;
    2070           6 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2071           0 :                         DEBUG(5,("function samr_ValidatePassword replied async\n"));
    2072             :                 }
    2073           6 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2074           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ValidatePassword, NDR_OUT | NDR_SET_VALUES, r2);
    2075             :                 }
    2076           6 :                 if (dce_call->fault_code != 0) {
    2077           0 :                         DBG_WARNING("dcerpc_fault %s in samr_ValidatePassword\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2078             :                 }
    2079           6 :                 break;
    2080             :         }
    2081           0 :         case 68: { /* samr_Opnum68NotUsedOnWire */
    2082           0 :                 struct samr_Opnum68NotUsedOnWire *r2 = (struct samr_Opnum68NotUsedOnWire *)r;
    2083           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2084           0 :                         DEBUG(5,("function samr_Opnum68NotUsedOnWire replied async\n"));
    2085             :                 }
    2086           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2087           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum68NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    2088             :                 }
    2089           0 :                 if (dce_call->fault_code != 0) {
    2090           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Opnum68NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2091             :                 }
    2092           0 :                 break;
    2093             :         }
    2094           0 :         case 69: { /* samr_Opnum69NotUsedOnWire */
    2095           0 :                 struct samr_Opnum69NotUsedOnWire *r2 = (struct samr_Opnum69NotUsedOnWire *)r;
    2096           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2097           0 :                         DEBUG(5,("function samr_Opnum69NotUsedOnWire replied async\n"));
    2098             :                 }
    2099           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2100           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum69NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    2101             :                 }
    2102           0 :                 if (dce_call->fault_code != 0) {
    2103           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Opnum69NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2104             :                 }
    2105           0 :                 break;
    2106             :         }
    2107           0 :         case 70: { /* samr_Opnum70NotUsedOnWire */
    2108           0 :                 struct samr_Opnum70NotUsedOnWire *r2 = (struct samr_Opnum70NotUsedOnWire *)r;
    2109           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2110           0 :                         DEBUG(5,("function samr_Opnum70NotUsedOnWire replied async\n"));
    2111             :                 }
    2112           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2113           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum70NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    2114             :                 }
    2115           0 :                 if (dce_call->fault_code != 0) {
    2116           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Opnum70NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2117             :                 }
    2118           0 :                 break;
    2119             :         }
    2120           0 :         case 71: { /* samr_Opnum71NotUsedOnWire */
    2121           0 :                 struct samr_Opnum71NotUsedOnWire *r2 = (struct samr_Opnum71NotUsedOnWire *)r;
    2122           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2123           0 :                         DEBUG(5,("function samr_Opnum71NotUsedOnWire replied async\n"));
    2124             :                 }
    2125           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2126           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum71NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    2127             :                 }
    2128           0 :                 if (dce_call->fault_code != 0) {
    2129           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Opnum71NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2130             :                 }
    2131           0 :                 break;
    2132             :         }
    2133           0 :         case 72: { /* samr_Opnum72NotUsedOnWire */
    2134           0 :                 struct samr_Opnum72NotUsedOnWire *r2 = (struct samr_Opnum72NotUsedOnWire *)r;
    2135           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2136           0 :                         DEBUG(5,("function samr_Opnum72NotUsedOnWire replied async\n"));
    2137             :                 }
    2138           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2139           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_Opnum72NotUsedOnWire, NDR_OUT | NDR_SET_VALUES, r2);
    2140             :                 }
    2141           0 :                 if (dce_call->fault_code != 0) {
    2142           0 :                         DBG_WARNING("dcerpc_fault %s in samr_Opnum72NotUsedOnWire\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2143             :                 }
    2144           0 :                 break;
    2145             :         }
    2146          10 :         case 73: { /* samr_ChangePasswordUser4 */
    2147          10 :                 struct samr_ChangePasswordUser4 *r2 = (struct samr_ChangePasswordUser4 *)r;
    2148          10 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2149           0 :                         DEBUG(5,("function samr_ChangePasswordUser4 replied async\n"));
    2150             :                 }
    2151          10 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2152           0 :                         NDR_PRINT_FUNCTION_DEBUG(samr_ChangePasswordUser4, NDR_OUT | NDR_SET_VALUES, r2);
    2153             :                 }
    2154          10 :                 if (dce_call->fault_code != 0) {
    2155           0 :                         DBG_WARNING("dcerpc_fault %s in samr_ChangePasswordUser4\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2156             :                 }
    2157          10 :                 break;
    2158             :         }
    2159           0 :         default:
    2160           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
    2161           0 :                 break;
    2162             :         }
    2163             : 
    2164       29791 :         if (dce_call->fault_code != 0) {
    2165           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    2166             :         }
    2167             : 
    2168       29791 :         return NT_STATUS_OK;
    2169             : }
    2170             : 
    2171       29791 : NTSTATUS samr__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
    2172             : {
    2173           0 :         enum ndr_err_code ndr_err;
    2174       29791 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
    2175             : 
    2176       29791 :         ndr_err = ndr_table_samr.calls[opnum].ndr_push(push, NDR_OUT, r);
    2177       29791 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
    2178           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
    2179           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    2180             :         }
    2181             : 
    2182       29791 :         return NT_STATUS_OK;
    2183             : }
    2184             : 
    2185           0 : NTSTATUS samr__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    2186             : {
    2187           0 :         return samr__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL);
    2188             : }
    2189             : 
    2190             : static const struct dcesrv_interface dcesrv_samr_interface = {
    2191             :         .name      = "samr",
    2192             :         .syntax_id = {{0x12345778,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xac}},1.0},
    2193             :         .bind      = samr__op_bind,
    2194             :         .unbind    = samr__op_unbind,
    2195             :         .ndr_pull  = samr__op_ndr_pull,
    2196             :         .dispatch  = samr__op_dispatch,
    2197             :         .reply     = samr__op_reply,
    2198             :         .ndr_push  = samr__op_ndr_push,
    2199             :         .local     = samr__op_local,
    2200             : #ifdef DCESRV_INTERFACE_SAMR_FLAGS
    2201             :         .flags     = DCESRV_INTERFACE_SAMR_FLAGS
    2202             : #else
    2203             :         .flags     = 0
    2204             : #endif
    2205             : };
    2206             : 
    2207         215 : static NTSTATUS samr__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    2208             : {
    2209           0 :         uint32_t i;
    2210           0 :         NTSTATUS ret;
    2211             : 
    2212             : #ifdef DCESRV_INTERFACE_SAMR_NCACN_NP_SECONDARY_ENDPOINT
    2213             :         const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_SAMR_NCACN_NP_SECONDARY_ENDPOINT;
    2214             : #else
    2215         215 :         const char *ncacn_np_secondary_endpoint = NULL;
    2216             : #endif
    2217             : 
    2218         860 :         for (i=0;i<ndr_table_samr.endpoints->count;i++) {
    2219         645 :                 const char *name = ndr_table_samr.endpoints->names[i];
    2220             : 
    2221         645 :                 ret = dcesrv_interface_register(dce_ctx, name, ncacn_np_secondary_endpoint, &dcesrv_samr_interface, NULL);
    2222         645 :                 if (!NT_STATUS_IS_OK(ret)) {
    2223           0 :                         DBG_ERR("Failed to register endpoint '%s'\n",name);
    2224           0 :                         return ret;
    2225             :                 }
    2226             :         }
    2227             : 
    2228         215 :         return NT_STATUS_OK;
    2229             : }
    2230             : 
    2231         215 : static NTSTATUS samr__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    2232             : {
    2233         215 :         return NT_STATUS_OK;
    2234             : }
    2235             : 
    2236           0 : static bool samr__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
    2237             : {
    2238           0 :         if (dcesrv_samr_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_samr_interface.syntax_id.uuid, uuid)) {
    2239           0 :                 memcpy(iface,&dcesrv_samr_interface, sizeof(*iface));
    2240           0 :                 return true;
    2241             :         }
    2242             : 
    2243           0 :         return false;
    2244             : }
    2245             : 
    2246           0 : static bool samr__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
    2247             : {
    2248           0 :         if (strcmp(dcesrv_samr_interface.name, name)==0) {
    2249           0 :                 memcpy(iface, &dcesrv_samr_interface, sizeof(*iface));
    2250           0 :                 return true;
    2251             :         }
    2252             : 
    2253           0 :         return false;
    2254             : }
    2255             : 
    2256             : static const struct dcesrv_endpoint_server samr_ep_server = {
    2257             :         /* fill in our name */
    2258             :         .name = "samr",
    2259             : 
    2260             :         /* Initialization flag */
    2261             :         .initialized = false,
    2262             : 
    2263             :         /* fill in all the operations */
    2264             : #ifdef DCESRV_INTERFACE_SAMR_INIT_SERVER
    2265             :         .init_server = DCESRV_INTERFACE_SAMR_INIT_SERVER,
    2266             : #else
    2267             :         .init_server = samr__op_init_server,
    2268             : #endif
    2269             : #ifdef DCESRV_INTERFACE_SAMR_SHUTDOWN_SERVER
    2270             :         .shutdown_server = DCESRV_INTERFACE_SAMR_SHUTDOWN_SERVER,
    2271             : #else
    2272             :         .shutdown_server = samr__op_shutdown_server,
    2273             : #endif
    2274             :         .interface_by_uuid = samr__op_interface_by_uuid,
    2275             :         .interface_by_name = samr__op_interface_by_name
    2276             : };
    2277             : 
    2278         215 : const struct dcesrv_endpoint_server *samr_get_ep_server(void)
    2279             : {
    2280         215 :         return &samr_ep_server;
    2281             : }

Generated by: LCOV version 1.14