LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_lsa_scompat.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 563 1629 34.6 %
Date: 2021-09-23 10:06:22 Functions: 11 15 73.3 %

          Line data    Source code
       1             : /* s3 compat server functions auto-generated by pidl */
       2             : #include "bin/default/librpc/gen_ndr/ndr_lsa.h"
       3             : #include "bin/default/librpc/gen_ndr/ndr_lsa_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             : /* lsarpc - dcerpc server boilerplate generated by pidl */
      15        7994 : static NTSTATUS lsarpc__op_bind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      16             : {
      17        7994 :         struct pipes_struct *p = NULL;
      18             : 
      19             :         /* Retrieve pipes struct */
      20        7994 :         p = dcesrv_get_pipes_struct(context->conn);
      21        7994 :         p->pipe_bound = true;
      22             : #ifdef DCESRV_INTERFACE_LSARPC_BIND
      23        7994 :         return DCESRV_INTERFACE_LSARPC_BIND(context,iface);
      24             : #else
      25             :         return NT_STATUS_OK;
      26             : #endif
      27             : }
      28             : 
      29        7980 : static void lsarpc__op_unbind(struct dcesrv_connection_context *context, const struct dcesrv_interface *iface)
      30             : {
      31             : #ifdef DCESRV_INTERFACE_LSARPC_UNBIND
      32             :         DCESRV_INTERFACE_LSARPC_UNBIND(context, iface);
      33             : #else
      34        7980 :         return;
      35             : #endif
      36             : }
      37             : 
      38       17401 : NTSTATUS lsarpc__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
      39             : {
      40             :         enum ndr_err_code ndr_err;
      41       17401 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      42             : 
      43       17401 :         dce_call->fault_code = 0;
      44             : 
      45       17401 :         if (opnum >= ndr_table_lsarpc.num_calls) {
      46           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
      47           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      48             :         }
      49             : 
      50       17401 :         *r = talloc_named(mem_ctx, ndr_table_lsarpc.calls[opnum].struct_size, "struct %s", ndr_table_lsarpc.calls[opnum].name);
      51       17401 :         NT_STATUS_HAVE_NO_MEMORY(*r);
      52             : 
      53             :         /* unravel the NDR for the packet */
      54       17401 :         ndr_err = ndr_table_lsarpc.calls[opnum].ndr_pull(pull, NDR_IN, *r);
      55       17401 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
      56           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
      57           0 :                 return NT_STATUS_NET_WRITE_FAULT;
      58             :         }
      59             : 
      60       17401 :         return NT_STATUS_OK;
      61             : }
      62             : 
      63       17401 : static NTSTATUS lsarpc__op_dispatch_internal(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r, enum s3compat_rpc_dispatch dispatch)
      64             : {
      65       17401 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
      66       17401 :         struct pipes_struct *p = NULL;
      67       17401 :         struct auth_session_info *pipe_session_info = NULL;
      68       17401 :         NTSTATUS status = NT_STATUS_OK;
      69       17401 :         bool impersonated = false;
      70             : 
      71             :         /* Retrieve pipes struct */
      72       17401 :         p = dcesrv_get_pipes_struct(dce_call->conn);
      73             :         /* Update pipes struct opnum */
      74       17401 :         p->opnum = opnum;
      75       17401 :         p->dce_call = dce_call;
      76       17401 :         p->mem_ctx = mem_ctx;
      77             :         /* Update pipes struct session info */
      78       17401 :         pipe_session_info = p->session_info;
      79       17401 :         p->session_info = dce_call->auth_state->session_info;
      80       17401 :         p->auth.auth_type = dce_call->auth_state->auth_type;
      81       17401 :         p->auth.auth_level = dce_call->auth_state->auth_level;
      82       17401 :         p->auth.auth_context_id = dce_call->auth_state->auth_context_id;
      83             :         /* Reset pipes struct fault state */
      84       17401 :         p->fault_state = 0;
      85             : 
      86             :         /* Impersonate */
      87       17401 :         if (dispatch == S3COMPAT_RPC_DISPATCH_EXTERNAL) {
      88       17401 :                 impersonated = become_authenticated_pipe_user(p->session_info);
      89       17401 :                 if (!impersonated) {
      90           0 :                         dce_call->fault_code = DCERPC_FAULT_ACCESS_DENIED;
      91           0 :                         status = NT_STATUS_NET_WRITE_FAULT;
      92           0 :                         goto fail;
      93             :                 }
      94             :         }
      95             : 
      96       17401 :         switch (opnum) {
      97         747 :         case 0: { /* lsa_Close */
      98         747 :                 struct lsa_Close *r2 = (struct lsa_Close *)r;
      99         747 :                 if (DEBUGLEVEL >= 10) {
     100           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_Close, NDR_IN, r2);
     101             :                 }
     102         747 :                 NDR_ZERO_STRUCT(r2->out);
     103         747 :                 r2->out.handle = r2->in.handle;
     104         747 :                 r2->out.result = _lsa_Close(p, r2);
     105         747 :                 break;
     106             :         }
     107           2 :         case 1: { /* lsa_Delete */
     108           2 :                 struct lsa_Delete *r2 = (struct lsa_Delete *)r;
     109           2 :                 if (DEBUGLEVEL >= 10) {
     110           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_Delete, NDR_IN, r2);
     111             :                 }
     112           2 :                 r2->out.result = _lsa_Delete(p, r2);
     113           2 :                 break;
     114             :         }
     115           2 :         case 2: { /* lsa_EnumPrivs */
     116           2 :                 struct lsa_EnumPrivs *r2 = (struct lsa_EnumPrivs *)r;
     117           2 :                 if (DEBUGLEVEL >= 10) {
     118           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumPrivs, NDR_IN, r2);
     119             :                 }
     120           2 :                 NDR_ZERO_STRUCT(r2->out);
     121           2 :                 r2->out.resume_handle = r2->in.resume_handle;
     122           2 :                 r2->out.privs = talloc_zero(r2, struct lsa_PrivArray);
     123           2 :                 if (r2->out.privs == NULL) {
     124           0 :                         status = NT_STATUS_NO_MEMORY;
     125           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     126           0 :                         goto fail;
     127             :                 }
     128             : 
     129           2 :                 r2->out.result = _lsa_EnumPrivs(p, r2);
     130           2 :                 break;
     131             :         }
     132          12 :         case 3: { /* lsa_QuerySecurity */
     133          12 :                 struct lsa_QuerySecurity *r2 = (struct lsa_QuerySecurity *)r;
     134          12 :                 if (DEBUGLEVEL >= 10) {
     135           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QuerySecurity, NDR_IN, r2);
     136             :                 }
     137          12 :                 NDR_ZERO_STRUCT(r2->out);
     138          12 :                 r2->out.sdbuf = talloc_zero(r2, struct sec_desc_buf *);
     139          12 :                 if (r2->out.sdbuf == NULL) {
     140           0 :                         status = NT_STATUS_NO_MEMORY;
     141           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     142           0 :                         goto fail;
     143             :                 }
     144             : 
     145          12 :                 r2->out.result = _lsa_QuerySecurity(p, r2);
     146          12 :                 break;
     147             :         }
     148           0 :         case 4: { /* lsa_SetSecObj */
     149           0 :                 struct lsa_SetSecObj *r2 = (struct lsa_SetSecObj *)r;
     150           0 :                 if (DEBUGLEVEL >= 10) {
     151           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetSecObj, NDR_IN, r2);
     152             :                 }
     153           0 :                 r2->out.result = _lsa_SetSecObj(p, r2);
     154           0 :                 break;
     155             :         }
     156           0 :         case 5: { /* lsa_ChangePassword */
     157           0 :                 struct lsa_ChangePassword *r2 = (struct lsa_ChangePassword *)r;
     158           0 :                 if (DEBUGLEVEL >= 10) {
     159           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_ChangePassword, NDR_IN, r2);
     160             :                 }
     161           0 :                 r2->out.result = _lsa_ChangePassword(p, r2);
     162           0 :                 break;
     163             :         }
     164        7746 :         case 6: { /* lsa_OpenPolicy */
     165        7746 :                 struct lsa_OpenPolicy *r2 = (struct lsa_OpenPolicy *)r;
     166        7746 :                 if (DEBUGLEVEL >= 10) {
     167           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenPolicy, NDR_IN, r2);
     168             :                 }
     169        7746 :                 NDR_ZERO_STRUCT(r2->out);
     170        7746 :                 r2->out.handle = talloc_zero(r2, struct policy_handle);
     171        7746 :                 if (r2->out.handle == NULL) {
     172           0 :                         status = NT_STATUS_NO_MEMORY;
     173           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     174           0 :                         goto fail;
     175             :                 }
     176             : 
     177        7746 :                 r2->out.result = _lsa_OpenPolicy(p, r2);
     178        7746 :                 break;
     179             :         }
     180         658 :         case 7: { /* lsa_QueryInfoPolicy */
     181         658 :                 struct lsa_QueryInfoPolicy *r2 = (struct lsa_QueryInfoPolicy *)r;
     182         658 :                 if (DEBUGLEVEL >= 10) {
     183           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryInfoPolicy, NDR_IN, r2);
     184             :                 }
     185         658 :                 NDR_ZERO_STRUCT(r2->out);
     186         658 :                 r2->out.info = talloc_zero(r2, union lsa_PolicyInformation *);
     187         658 :                 if (r2->out.info == NULL) {
     188           0 :                         status = NT_STATUS_NO_MEMORY;
     189           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     190           0 :                         goto fail;
     191             :                 }
     192             : 
     193         658 :                 r2->out.result = _lsa_QueryInfoPolicy(p, r2);
     194         658 :                 break;
     195             :         }
     196           0 :         case 8: { /* lsa_SetInfoPolicy */
     197           0 :                 struct lsa_SetInfoPolicy *r2 = (struct lsa_SetInfoPolicy *)r;
     198           0 :                 if (DEBUGLEVEL >= 10) {
     199           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetInfoPolicy, NDR_IN, r2);
     200             :                 }
     201           0 :                 r2->out.result = _lsa_SetInfoPolicy(p, r2);
     202           0 :                 break;
     203             :         }
     204           0 :         case 9: { /* lsa_ClearAuditLog */
     205           0 :                 struct lsa_ClearAuditLog *r2 = (struct lsa_ClearAuditLog *)r;
     206           0 :                 if (DEBUGLEVEL >= 10) {
     207           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_ClearAuditLog, NDR_IN, r2);
     208             :                 }
     209           0 :                 r2->out.result = _lsa_ClearAuditLog(p, r2);
     210           0 :                 break;
     211             :         }
     212           2 :         case 10: { /* lsa_CreateAccount */
     213           2 :                 struct lsa_CreateAccount *r2 = (struct lsa_CreateAccount *)r;
     214           2 :                 if (DEBUGLEVEL >= 10) {
     215           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateAccount, NDR_IN, r2);
     216             :                 }
     217           2 :                 NDR_ZERO_STRUCT(r2->out);
     218           2 :                 r2->out.acct_handle = talloc_zero(r2, struct policy_handle);
     219           2 :                 if (r2->out.acct_handle == NULL) {
     220           0 :                         status = NT_STATUS_NO_MEMORY;
     221           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     222           0 :                         goto fail;
     223             :                 }
     224             : 
     225           2 :                 r2->out.result = _lsa_CreateAccount(p, r2);
     226           2 :                 break;
     227             :         }
     228           7 :         case 11: { /* lsa_EnumAccounts */
     229           7 :                 struct lsa_EnumAccounts *r2 = (struct lsa_EnumAccounts *)r;
     230           7 :                 if (DEBUGLEVEL >= 10) {
     231           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumAccounts, NDR_IN, r2);
     232             :                 }
     233           7 :                 NDR_ZERO_STRUCT(r2->out);
     234           7 :                 r2->out.resume_handle = r2->in.resume_handle;
     235           7 :                 r2->out.sids = talloc_zero(r2, struct lsa_SidArray);
     236           7 :                 if (r2->out.sids == NULL) {
     237           0 :                         status = NT_STATUS_NO_MEMORY;
     238           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     239           0 :                         goto fail;
     240             :                 }
     241             : 
     242           7 :                 r2->out.result = _lsa_EnumAccounts(p, r2);
     243           7 :                 break;
     244             :         }
     245           0 :         case 12: { /* lsa_CreateTrustedDomain */
     246           0 :                 struct lsa_CreateTrustedDomain *r2 = (struct lsa_CreateTrustedDomain *)r;
     247           0 :                 if (DEBUGLEVEL >= 10) {
     248           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateTrustedDomain, NDR_IN, r2);
     249             :                 }
     250           0 :                 NDR_ZERO_STRUCT(r2->out);
     251           0 :                 r2->out.trustdom_handle = talloc_zero(r2, struct policy_handle);
     252           0 :                 if (r2->out.trustdom_handle == NULL) {
     253           0 :                         status = NT_STATUS_NO_MEMORY;
     254           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     255           0 :                         goto fail;
     256             :                 }
     257             : 
     258           0 :                 r2->out.result = _lsa_CreateTrustedDomain(p, r2);
     259           0 :                 break;
     260             :         }
     261           0 :         case 13: { /* lsa_EnumTrustDom */
     262           0 :                 struct lsa_EnumTrustDom *r2 = (struct lsa_EnumTrustDom *)r;
     263           0 :                 if (DEBUGLEVEL >= 10) {
     264           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumTrustDom, NDR_IN, r2);
     265             :                 }
     266           0 :                 NDR_ZERO_STRUCT(r2->out);
     267           0 :                 r2->out.resume_handle = r2->in.resume_handle;
     268           0 :                 r2->out.domains = talloc_zero(r2, struct lsa_DomainList);
     269           0 :                 if (r2->out.domains == NULL) {
     270           0 :                         status = NT_STATUS_NO_MEMORY;
     271           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     272           0 :                         goto fail;
     273             :                 }
     274             : 
     275           0 :                 r2->out.result = _lsa_EnumTrustDom(p, r2);
     276           0 :                 break;
     277             :         }
     278        1413 :         case 14: { /* lsa_LookupNames */
     279        1413 :                 struct lsa_LookupNames *r2 = (struct lsa_LookupNames *)r;
     280        1413 :                 if (DEBUGLEVEL >= 10) {
     281           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupNames, NDR_IN, r2);
     282             :                 }
     283        1413 :                 NDR_ZERO_STRUCT(r2->out);
     284        1413 :                 r2->out.sids = r2->in.sids;
     285        1413 :                 r2->out.count = r2->in.count;
     286        1413 :                 r2->out.domains = talloc_zero(r2, struct lsa_RefDomainList *);
     287        1413 :                 if (r2->out.domains == NULL) {
     288           0 :                         status = NT_STATUS_NO_MEMORY;
     289           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     290           0 :                         goto fail;
     291             :                 }
     292             : 
     293        1413 :                 r2->out.result = _lsa_LookupNames(p, r2);
     294        1413 :                 break;
     295             :         }
     296        6003 :         case 15: { /* lsa_LookupSids */
     297        6003 :                 struct lsa_LookupSids *r2 = (struct lsa_LookupSids *)r;
     298        6003 :                 if (DEBUGLEVEL >= 10) {
     299           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupSids, NDR_IN, r2);
     300             :                 }
     301        6003 :                 NDR_ZERO_STRUCT(r2->out);
     302        6003 :                 r2->out.names = r2->in.names;
     303        6003 :                 r2->out.count = r2->in.count;
     304        6003 :                 r2->out.domains = talloc_zero(r2, struct lsa_RefDomainList *);
     305        6003 :                 if (r2->out.domains == NULL) {
     306           0 :                         status = NT_STATUS_NO_MEMORY;
     307           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     308           0 :                         goto fail;
     309             :                 }
     310             : 
     311        6003 :                 r2->out.result = _lsa_LookupSids(p, r2);
     312        6003 :                 break;
     313             :         }
     314          48 :         case 16: { /* lsa_CreateSecret */
     315          48 :                 struct lsa_CreateSecret *r2 = (struct lsa_CreateSecret *)r;
     316          48 :                 if (DEBUGLEVEL >= 10) {
     317           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateSecret, NDR_IN, r2);
     318             :                 }
     319          48 :                 NDR_ZERO_STRUCT(r2->out);
     320          48 :                 r2->out.sec_handle = talloc_zero(r2, struct policy_handle);
     321          48 :                 if (r2->out.sec_handle == NULL) {
     322           0 :                         status = NT_STATUS_NO_MEMORY;
     323           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     324           0 :                         goto fail;
     325             :                 }
     326             : 
     327          48 :                 r2->out.result = _lsa_CreateSecret(p, r2);
     328          48 :                 break;
     329             :         }
     330          14 :         case 17: { /* lsa_OpenAccount */
     331          14 :                 struct lsa_OpenAccount *r2 = (struct lsa_OpenAccount *)r;
     332          14 :                 if (DEBUGLEVEL >= 10) {
     333           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenAccount, NDR_IN, r2);
     334             :                 }
     335          14 :                 NDR_ZERO_STRUCT(r2->out);
     336          14 :                 r2->out.acct_handle = talloc_zero(r2, struct policy_handle);
     337          14 :                 if (r2->out.acct_handle == NULL) {
     338           0 :                         status = NT_STATUS_NO_MEMORY;
     339           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     340           0 :                         goto fail;
     341             :                 }
     342             : 
     343          14 :                 r2->out.result = _lsa_OpenAccount(p, r2);
     344          14 :                 break;
     345             :         }
     346          12 :         case 18: { /* lsa_EnumPrivsAccount */
     347          12 :                 struct lsa_EnumPrivsAccount *r2 = (struct lsa_EnumPrivsAccount *)r;
     348          12 :                 if (DEBUGLEVEL >= 10) {
     349           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumPrivsAccount, NDR_IN, r2);
     350             :                 }
     351          12 :                 NDR_ZERO_STRUCT(r2->out);
     352          12 :                 r2->out.privs = talloc_zero(r2, struct lsa_PrivilegeSet *);
     353          12 :                 if (r2->out.privs == NULL) {
     354           0 :                         status = NT_STATUS_NO_MEMORY;
     355           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     356           0 :                         goto fail;
     357             :                 }
     358             : 
     359          12 :                 r2->out.result = _lsa_EnumPrivsAccount(p, r2);
     360          12 :                 break;
     361             :         }
     362           2 :         case 19: { /* lsa_AddPrivilegesToAccount */
     363           2 :                 struct lsa_AddPrivilegesToAccount *r2 = (struct lsa_AddPrivilegesToAccount *)r;
     364           2 :                 if (DEBUGLEVEL >= 10) {
     365           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_AddPrivilegesToAccount, NDR_IN, r2);
     366             :                 }
     367           2 :                 r2->out.result = _lsa_AddPrivilegesToAccount(p, r2);
     368           2 :                 break;
     369             :         }
     370           2 :         case 20: { /* lsa_RemovePrivilegesFromAccount */
     371           2 :                 struct lsa_RemovePrivilegesFromAccount *r2 = (struct lsa_RemovePrivilegesFromAccount *)r;
     372           2 :                 if (DEBUGLEVEL >= 10) {
     373           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_RemovePrivilegesFromAccount, NDR_IN, r2);
     374             :                 }
     375           2 :                 r2->out.result = _lsa_RemovePrivilegesFromAccount(p, r2);
     376           2 :                 break;
     377             :         }
     378           0 :         case 21: { /* lsa_GetQuotasForAccount */
     379           0 :                 struct lsa_GetQuotasForAccount *r2 = (struct lsa_GetQuotasForAccount *)r;
     380           0 :                 if (DEBUGLEVEL >= 10) {
     381           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_GetQuotasForAccount, NDR_IN, r2);
     382             :                 }
     383           0 :                 r2->out.result = _lsa_GetQuotasForAccount(p, r2);
     384           0 :                 break;
     385             :         }
     386           0 :         case 22: { /* lsa_SetQuotasForAccount */
     387           0 :                 struct lsa_SetQuotasForAccount *r2 = (struct lsa_SetQuotasForAccount *)r;
     388           0 :                 if (DEBUGLEVEL >= 10) {
     389           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetQuotasForAccount, NDR_IN, r2);
     390             :                 }
     391           0 :                 r2->out.result = _lsa_SetQuotasForAccount(p, r2);
     392           0 :                 break;
     393             :         }
     394          14 :         case 23: { /* lsa_GetSystemAccessAccount */
     395          14 :                 struct lsa_GetSystemAccessAccount *r2 = (struct lsa_GetSystemAccessAccount *)r;
     396          14 :                 if (DEBUGLEVEL >= 10) {
     397           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_GetSystemAccessAccount, NDR_IN, r2);
     398             :                 }
     399          14 :                 NDR_ZERO_STRUCT(r2->out);
     400          14 :                 r2->out.access_mask = talloc_zero(r2, uint32_t);
     401          14 :                 if (r2->out.access_mask == NULL) {
     402           0 :                         status = NT_STATUS_NO_MEMORY;
     403           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     404           0 :                         goto fail;
     405             :                 }
     406             : 
     407          14 :                 r2->out.result = _lsa_GetSystemAccessAccount(p, r2);
     408          14 :                 break;
     409             :         }
     410           0 :         case 24: { /* lsa_SetSystemAccessAccount */
     411           0 :                 struct lsa_SetSystemAccessAccount *r2 = (struct lsa_SetSystemAccessAccount *)r;
     412           0 :                 if (DEBUGLEVEL >= 10) {
     413           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetSystemAccessAccount, NDR_IN, r2);
     414             :                 }
     415           0 :                 r2->out.result = _lsa_SetSystemAccessAccount(p, r2);
     416           0 :                 break;
     417             :         }
     418           0 :         case 25: { /* lsa_OpenTrustedDomain */
     419           0 :                 struct lsa_OpenTrustedDomain *r2 = (struct lsa_OpenTrustedDomain *)r;
     420           0 :                 if (DEBUGLEVEL >= 10) {
     421           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenTrustedDomain, NDR_IN, r2);
     422             :                 }
     423           0 :                 NDR_ZERO_STRUCT(r2->out);
     424           0 :                 r2->out.trustdom_handle = talloc_zero(r2, struct policy_handle);
     425           0 :                 if (r2->out.trustdom_handle == NULL) {
     426           0 :                         status = NT_STATUS_NO_MEMORY;
     427           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     428           0 :                         goto fail;
     429             :                 }
     430             : 
     431           0 :                 r2->out.result = _lsa_OpenTrustedDomain(p, r2);
     432           0 :                 break;
     433             :         }
     434           0 :         case 26: { /* lsa_QueryTrustedDomainInfo */
     435           0 :                 struct lsa_QueryTrustedDomainInfo *r2 = (struct lsa_QueryTrustedDomainInfo *)r;
     436           0 :                 if (DEBUGLEVEL >= 10) {
     437           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryTrustedDomainInfo, NDR_IN, r2);
     438             :                 }
     439           0 :                 NDR_ZERO_STRUCT(r2->out);
     440           0 :                 r2->out.info = talloc_zero(r2, union lsa_TrustedDomainInfo *);
     441           0 :                 if (r2->out.info == NULL) {
     442           0 :                         status = NT_STATUS_NO_MEMORY;
     443           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     444           0 :                         goto fail;
     445             :                 }
     446             : 
     447           0 :                 r2->out.result = _lsa_QueryTrustedDomainInfo(p, r2);
     448           0 :                 break;
     449             :         }
     450           0 :         case 27: { /* lsa_SetInformationTrustedDomain */
     451           0 :                 struct lsa_SetInformationTrustedDomain *r2 = (struct lsa_SetInformationTrustedDomain *)r;
     452           0 :                 if (DEBUGLEVEL >= 10) {
     453           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetInformationTrustedDomain, NDR_IN, r2);
     454             :                 }
     455           0 :                 r2->out.result = _lsa_SetInformationTrustedDomain(p, r2);
     456           0 :                 break;
     457             :         }
     458           0 :         case 28: { /* lsa_OpenSecret */
     459           0 :                 struct lsa_OpenSecret *r2 = (struct lsa_OpenSecret *)r;
     460           0 :                 if (DEBUGLEVEL >= 10) {
     461           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenSecret, NDR_IN, r2);
     462             :                 }
     463           0 :                 NDR_ZERO_STRUCT(r2->out);
     464           0 :                 r2->out.sec_handle = talloc_zero(r2, struct policy_handle);
     465           0 :                 if (r2->out.sec_handle == NULL) {
     466           0 :                         status = NT_STATUS_NO_MEMORY;
     467           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     468           0 :                         goto fail;
     469             :                 }
     470             : 
     471           0 :                 r2->out.result = _lsa_OpenSecret(p, r2);
     472           0 :                 break;
     473             :         }
     474          64 :         case 29: { /* lsa_SetSecret */
     475          64 :                 struct lsa_SetSecret *r2 = (struct lsa_SetSecret *)r;
     476          64 :                 if (DEBUGLEVEL >= 10) {
     477           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetSecret, NDR_IN, r2);
     478             :                 }
     479          64 :                 r2->out.result = _lsa_SetSecret(p, r2);
     480          64 :                 break;
     481             :         }
     482          32 :         case 30: { /* lsa_QuerySecret */
     483          32 :                 struct lsa_QuerySecret *r2 = (struct lsa_QuerySecret *)r;
     484          32 :                 if (DEBUGLEVEL >= 10) {
     485           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QuerySecret, NDR_IN, r2);
     486             :                 }
     487          32 :                 NDR_ZERO_STRUCT(r2->out);
     488          32 :                 r2->out.new_val = r2->in.new_val;
     489          32 :                 r2->out.new_mtime = r2->in.new_mtime;
     490          32 :                 r2->out.old_val = r2->in.old_val;
     491          32 :                 r2->out.old_mtime = r2->in.old_mtime;
     492          32 :                 r2->out.result = _lsa_QuerySecret(p, r2);
     493          32 :                 break;
     494             :         }
     495          19 :         case 31: { /* lsa_LookupPrivValue */
     496          19 :                 struct lsa_LookupPrivValue *r2 = (struct lsa_LookupPrivValue *)r;
     497          19 :                 if (DEBUGLEVEL >= 10) {
     498           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupPrivValue, NDR_IN, r2);
     499             :                 }
     500          19 :                 NDR_ZERO_STRUCT(r2->out);
     501          19 :                 r2->out.luid = talloc_zero(r2, struct lsa_LUID);
     502          19 :                 if (r2->out.luid == NULL) {
     503           0 :                         status = NT_STATUS_NO_MEMORY;
     504           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     505           0 :                         goto fail;
     506             :                 }
     507             : 
     508          19 :                 r2->out.result = _lsa_LookupPrivValue(p, r2);
     509          19 :                 break;
     510             :         }
     511          50 :         case 32: { /* lsa_LookupPrivName */
     512          50 :                 struct lsa_LookupPrivName *r2 = (struct lsa_LookupPrivName *)r;
     513          50 :                 if (DEBUGLEVEL >= 10) {
     514           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupPrivName, NDR_IN, r2);
     515             :                 }
     516          50 :                 NDR_ZERO_STRUCT(r2->out);
     517          50 :                 r2->out.name = talloc_zero(r2, struct lsa_StringLarge *);
     518          50 :                 if (r2->out.name == NULL) {
     519           0 :                         status = NT_STATUS_NO_MEMORY;
     520           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     521           0 :                         goto fail;
     522             :                 }
     523             : 
     524          50 :                 r2->out.result = _lsa_LookupPrivName(p, r2);
     525          50 :                 break;
     526             :         }
     527          18 :         case 33: { /* lsa_LookupPrivDisplayName */
     528          18 :                 struct lsa_LookupPrivDisplayName *r2 = (struct lsa_LookupPrivDisplayName *)r;
     529          18 :                 if (DEBUGLEVEL >= 10) {
     530           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupPrivDisplayName, NDR_IN, r2);
     531             :                 }
     532          18 :                 NDR_ZERO_STRUCT(r2->out);
     533          18 :                 r2->out.disp_name = talloc_zero(r2, struct lsa_StringLarge *);
     534          18 :                 if (r2->out.disp_name == NULL) {
     535           0 :                         status = NT_STATUS_NO_MEMORY;
     536           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     537           0 :                         goto fail;
     538             :                 }
     539             : 
     540          18 :                 r2->out.returned_language_id = talloc_zero(r2, uint16_t);
     541          18 :                 if (r2->out.returned_language_id == NULL) {
     542           0 :                         status = NT_STATUS_NO_MEMORY;
     543           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     544           0 :                         goto fail;
     545             :                 }
     546             : 
     547          18 :                 r2->out.result = _lsa_LookupPrivDisplayName(p, r2);
     548          18 :                 break;
     549             :         }
     550          51 :         case 34: { /* lsa_DeleteObject */
     551          51 :                 struct lsa_DeleteObject *r2 = (struct lsa_DeleteObject *)r;
     552          51 :                 if (DEBUGLEVEL >= 10) {
     553           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_DeleteObject, NDR_IN, r2);
     554             :                 }
     555          51 :                 NDR_ZERO_STRUCT(r2->out);
     556          51 :                 r2->out.handle = r2->in.handle;
     557          51 :                 r2->out.result = _lsa_DeleteObject(p, r2);
     558          51 :                 break;
     559             :         }
     560          18 :         case 35: { /* lsa_EnumAccountsWithUserRight */
     561          18 :                 struct lsa_EnumAccountsWithUserRight *r2 = (struct lsa_EnumAccountsWithUserRight *)r;
     562          18 :                 if (DEBUGLEVEL >= 10) {
     563           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumAccountsWithUserRight, NDR_IN, r2);
     564             :                 }
     565          18 :                 NDR_ZERO_STRUCT(r2->out);
     566          18 :                 r2->out.sids = talloc_zero(r2, struct lsa_SidArray);
     567          18 :                 if (r2->out.sids == NULL) {
     568           0 :                         status = NT_STATUS_NO_MEMORY;
     569           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     570           0 :                         goto fail;
     571             :                 }
     572             : 
     573          18 :                 r2->out.result = _lsa_EnumAccountsWithUserRight(p, r2);
     574          18 :                 break;
     575             :         }
     576          80 :         case 36: { /* lsa_EnumAccountRights */
     577          80 :                 struct lsa_EnumAccountRights *r2 = (struct lsa_EnumAccountRights *)r;
     578          80 :                 if (DEBUGLEVEL >= 10) {
     579           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumAccountRights, NDR_IN, r2);
     580             :                 }
     581          80 :                 NDR_ZERO_STRUCT(r2->out);
     582          80 :                 r2->out.rights = talloc_zero(r2, struct lsa_RightSet);
     583          80 :                 if (r2->out.rights == NULL) {
     584           0 :                         status = NT_STATUS_NO_MEMORY;
     585           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     586           0 :                         goto fail;
     587             :                 }
     588             : 
     589          80 :                 r2->out.result = _lsa_EnumAccountRights(p, r2);
     590          80 :                 break;
     591             :         }
     592          21 :         case 37: { /* lsa_AddAccountRights */
     593          21 :                 struct lsa_AddAccountRights *r2 = (struct lsa_AddAccountRights *)r;
     594          21 :                 if (DEBUGLEVEL >= 10) {
     595           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_AddAccountRights, NDR_IN, r2);
     596             :                 }
     597          21 :                 r2->out.result = _lsa_AddAccountRights(p, r2);
     598          21 :                 break;
     599             :         }
     600          18 :         case 38: { /* lsa_RemoveAccountRights */
     601          18 :                 struct lsa_RemoveAccountRights *r2 = (struct lsa_RemoveAccountRights *)r;
     602          18 :                 if (DEBUGLEVEL >= 10) {
     603           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_RemoveAccountRights, NDR_IN, r2);
     604             :                 }
     605          18 :                 r2->out.result = _lsa_RemoveAccountRights(p, r2);
     606          18 :                 break;
     607             :         }
     608           0 :         case 39: { /* lsa_QueryTrustedDomainInfoBySid */
     609           0 :                 struct lsa_QueryTrustedDomainInfoBySid *r2 = (struct lsa_QueryTrustedDomainInfoBySid *)r;
     610           0 :                 if (DEBUGLEVEL >= 10) {
     611           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryTrustedDomainInfoBySid, NDR_IN, r2);
     612             :                 }
     613           0 :                 NDR_ZERO_STRUCT(r2->out);
     614           0 :                 r2->out.info = talloc_zero(r2, union lsa_TrustedDomainInfo *);
     615           0 :                 if (r2->out.info == NULL) {
     616           0 :                         status = NT_STATUS_NO_MEMORY;
     617           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     618           0 :                         goto fail;
     619             :                 }
     620             : 
     621           0 :                 r2->out.result = _lsa_QueryTrustedDomainInfoBySid(p, r2);
     622           0 :                 break;
     623             :         }
     624           0 :         case 40: { /* lsa_SetTrustedDomainInfo */
     625           0 :                 struct lsa_SetTrustedDomainInfo *r2 = (struct lsa_SetTrustedDomainInfo *)r;
     626           0 :                 if (DEBUGLEVEL >= 10) {
     627           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetTrustedDomainInfo, NDR_IN, r2);
     628             :                 }
     629           0 :                 r2->out.result = _lsa_SetTrustedDomainInfo(p, r2);
     630           0 :                 break;
     631             :         }
     632           0 :         case 41: { /* lsa_DeleteTrustedDomain */
     633           0 :                 struct lsa_DeleteTrustedDomain *r2 = (struct lsa_DeleteTrustedDomain *)r;
     634           0 :                 if (DEBUGLEVEL >= 10) {
     635           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_DeleteTrustedDomain, NDR_IN, r2);
     636             :                 }
     637           0 :                 r2->out.result = _lsa_DeleteTrustedDomain(p, r2);
     638           0 :                 break;
     639             :         }
     640           0 :         case 42: { /* lsa_StorePrivateData */
     641           0 :                 struct lsa_StorePrivateData *r2 = (struct lsa_StorePrivateData *)r;
     642           0 :                 if (DEBUGLEVEL >= 10) {
     643           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_StorePrivateData, NDR_IN, r2);
     644             :                 }
     645           0 :                 r2->out.result = _lsa_StorePrivateData(p, r2);
     646           0 :                 break;
     647             :         }
     648           0 :         case 43: { /* lsa_RetrievePrivateData */
     649           0 :                 struct lsa_RetrievePrivateData *r2 = (struct lsa_RetrievePrivateData *)r;
     650           0 :                 if (DEBUGLEVEL >= 10) {
     651           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_RetrievePrivateData, NDR_IN, r2);
     652             :                 }
     653           0 :                 NDR_ZERO_STRUCT(r2->out);
     654           0 :                 r2->out.val = r2->in.val;
     655           0 :                 r2->out.result = _lsa_RetrievePrivateData(p, r2);
     656           0 :                 break;
     657             :         }
     658         202 :         case 44: { /* lsa_OpenPolicy2 */
     659         202 :                 struct lsa_OpenPolicy2 *r2 = (struct lsa_OpenPolicy2 *)r;
     660         202 :                 if (DEBUGLEVEL >= 10) {
     661           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenPolicy2, NDR_IN, r2);
     662             :                 }
     663         202 :                 NDR_ZERO_STRUCT(r2->out);
     664         202 :                 r2->out.handle = talloc_zero(r2, struct policy_handle);
     665         202 :                 if (r2->out.handle == NULL) {
     666           0 :                         status = NT_STATUS_NO_MEMORY;
     667           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     668           0 :                         goto fail;
     669             :                 }
     670             : 
     671         202 :                 r2->out.result = _lsa_OpenPolicy2(p, r2);
     672         202 :                 break;
     673             :         }
     674          86 :         case 45: { /* lsa_GetUserName */
     675          86 :                 struct lsa_GetUserName *r2 = (struct lsa_GetUserName *)r;
     676          86 :                 if (DEBUGLEVEL >= 10) {
     677           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_GetUserName, NDR_IN, r2);
     678             :                 }
     679          86 :                 NDR_ZERO_STRUCT(r2->out);
     680          86 :                 r2->out.account_name = r2->in.account_name;
     681          86 :                 r2->out.authority_name = r2->in.authority_name;
     682          86 :                 r2->out.result = _lsa_GetUserName(p, r2);
     683          86 :                 break;
     684             :         }
     685          42 :         case 46: { /* lsa_QueryInfoPolicy2 */
     686          42 :                 struct lsa_QueryInfoPolicy2 *r2 = (struct lsa_QueryInfoPolicy2 *)r;
     687          42 :                 if (DEBUGLEVEL >= 10) {
     688           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryInfoPolicy2, NDR_IN, r2);
     689             :                 }
     690          42 :                 NDR_ZERO_STRUCT(r2->out);
     691          42 :                 r2->out.info = talloc_zero(r2, union lsa_PolicyInformation *);
     692          42 :                 if (r2->out.info == NULL) {
     693           0 :                         status = NT_STATUS_NO_MEMORY;
     694           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     695           0 :                         goto fail;
     696             :                 }
     697             : 
     698          42 :                 r2->out.result = _lsa_QueryInfoPolicy2(p, r2);
     699          42 :                 break;
     700             :         }
     701           0 :         case 47: { /* lsa_SetInfoPolicy2 */
     702           0 :                 struct lsa_SetInfoPolicy2 *r2 = (struct lsa_SetInfoPolicy2 *)r;
     703           0 :                 if (DEBUGLEVEL >= 10) {
     704           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetInfoPolicy2, NDR_IN, r2);
     705             :                 }
     706           0 :                 r2->out.result = _lsa_SetInfoPolicy2(p, r2);
     707           0 :                 break;
     708             :         }
     709           0 :         case 48: { /* lsa_QueryTrustedDomainInfoByName */
     710           0 :                 struct lsa_QueryTrustedDomainInfoByName *r2 = (struct lsa_QueryTrustedDomainInfoByName *)r;
     711           0 :                 if (DEBUGLEVEL >= 10) {
     712           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryTrustedDomainInfoByName, NDR_IN, r2);
     713             :                 }
     714           0 :                 NDR_ZERO_STRUCT(r2->out);
     715           0 :                 r2->out.info = talloc_zero(r2, union lsa_TrustedDomainInfo *);
     716           0 :                 if (r2->out.info == NULL) {
     717           0 :                         status = NT_STATUS_NO_MEMORY;
     718           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     719           0 :                         goto fail;
     720             :                 }
     721             : 
     722           0 :                 r2->out.result = _lsa_QueryTrustedDomainInfoByName(p, r2);
     723           0 :                 break;
     724             :         }
     725           0 :         case 49: { /* lsa_SetTrustedDomainInfoByName */
     726           0 :                 struct lsa_SetTrustedDomainInfoByName *r2 = (struct lsa_SetTrustedDomainInfoByName *)r;
     727           0 :                 if (DEBUGLEVEL >= 10) {
     728           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetTrustedDomainInfoByName, NDR_IN, r2);
     729             :                 }
     730           0 :                 r2->out.result = _lsa_SetTrustedDomainInfoByName(p, r2);
     731           0 :                 break;
     732             :         }
     733           0 :         case 50: { /* lsa_EnumTrustedDomainsEx */
     734           0 :                 struct lsa_EnumTrustedDomainsEx *r2 = (struct lsa_EnumTrustedDomainsEx *)r;
     735           0 :                 if (DEBUGLEVEL >= 10) {
     736           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumTrustedDomainsEx, NDR_IN, r2);
     737             :                 }
     738           0 :                 NDR_ZERO_STRUCT(r2->out);
     739           0 :                 r2->out.resume_handle = r2->in.resume_handle;
     740           0 :                 r2->out.domains = talloc_zero(r2, struct lsa_DomainListEx);
     741           0 :                 if (r2->out.domains == NULL) {
     742           0 :                         status = NT_STATUS_NO_MEMORY;
     743           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     744           0 :                         goto fail;
     745             :                 }
     746             : 
     747           0 :                 r2->out.result = _lsa_EnumTrustedDomainsEx(p, r2);
     748           0 :                 break;
     749             :         }
     750           0 :         case 51: { /* lsa_CreateTrustedDomainEx */
     751           0 :                 struct lsa_CreateTrustedDomainEx *r2 = (struct lsa_CreateTrustedDomainEx *)r;
     752           0 :                 if (DEBUGLEVEL >= 10) {
     753           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateTrustedDomainEx, NDR_IN, r2);
     754             :                 }
     755           0 :                 NDR_ZERO_STRUCT(r2->out);
     756           0 :                 r2->out.trustdom_handle = talloc_zero(r2, struct policy_handle);
     757           0 :                 if (r2->out.trustdom_handle == NULL) {
     758           0 :                         status = NT_STATUS_NO_MEMORY;
     759           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     760           0 :                         goto fail;
     761             :                 }
     762             : 
     763           0 :                 r2->out.result = _lsa_CreateTrustedDomainEx(p, r2);
     764           0 :                 break;
     765             :         }
     766           0 :         case 52: { /* lsa_CloseTrustedDomainEx */
     767           0 :                 struct lsa_CloseTrustedDomainEx *r2 = (struct lsa_CloseTrustedDomainEx *)r;
     768           0 :                 if (DEBUGLEVEL >= 10) {
     769           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CloseTrustedDomainEx, NDR_IN, r2);
     770             :                 }
     771           0 :                 NDR_ZERO_STRUCT(r2->out);
     772           0 :                 r2->out.handle = r2->in.handle;
     773           0 :                 r2->out.result = _lsa_CloseTrustedDomainEx(p, r2);
     774           0 :                 break;
     775             :         }
     776           0 :         case 53: { /* lsa_QueryDomainInformationPolicy */
     777           0 :                 struct lsa_QueryDomainInformationPolicy *r2 = (struct lsa_QueryDomainInformationPolicy *)r;
     778           0 :                 if (DEBUGLEVEL >= 10) {
     779           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryDomainInformationPolicy, NDR_IN, r2);
     780             :                 }
     781           0 :                 NDR_ZERO_STRUCT(r2->out);
     782           0 :                 r2->out.info = talloc_zero(r2, union lsa_DomainInformationPolicy *);
     783           0 :                 if (r2->out.info == NULL) {
     784           0 :                         status = NT_STATUS_NO_MEMORY;
     785           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     786           0 :                         goto fail;
     787             :                 }
     788             : 
     789           0 :                 r2->out.result = _lsa_QueryDomainInformationPolicy(p, r2);
     790           0 :                 break;
     791             :         }
     792           0 :         case 54: { /* lsa_SetDomainInformationPolicy */
     793           0 :                 struct lsa_SetDomainInformationPolicy *r2 = (struct lsa_SetDomainInformationPolicy *)r;
     794           0 :                 if (DEBUGLEVEL >= 10) {
     795           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetDomainInformationPolicy, NDR_IN, r2);
     796             :                 }
     797           0 :                 r2->out.result = _lsa_SetDomainInformationPolicy(p, r2);
     798           0 :                 break;
     799             :         }
     800           0 :         case 55: { /* lsa_OpenTrustedDomainByName */
     801           0 :                 struct lsa_OpenTrustedDomainByName *r2 = (struct lsa_OpenTrustedDomainByName *)r;
     802           0 :                 if (DEBUGLEVEL >= 10) {
     803           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenTrustedDomainByName, NDR_IN, r2);
     804             :                 }
     805           0 :                 NDR_ZERO_STRUCT(r2->out);
     806           0 :                 r2->out.trustdom_handle = talloc_zero(r2, struct policy_handle);
     807           0 :                 if (r2->out.trustdom_handle == NULL) {
     808           0 :                         status = NT_STATUS_NO_MEMORY;
     809           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     810           0 :                         goto fail;
     811             :                 }
     812             : 
     813           0 :                 r2->out.result = _lsa_OpenTrustedDomainByName(p, r2);
     814           0 :                 break;
     815             :         }
     816           0 :         case 56: { /* lsa_TestCall */
     817           0 :                 struct lsa_TestCall *r2 = (struct lsa_TestCall *)r;
     818           0 :                 if (DEBUGLEVEL >= 10) {
     819           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_TestCall, NDR_IN, r2);
     820             :                 }
     821           0 :                 r2->out.result = _lsa_TestCall(p, r2);
     822           0 :                 break;
     823             :         }
     824           2 :         case 57: { /* lsa_LookupSids2 */
     825           2 :                 struct lsa_LookupSids2 *r2 = (struct lsa_LookupSids2 *)r;
     826           2 :                 if (DEBUGLEVEL >= 10) {
     827           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupSids2, NDR_IN, r2);
     828             :                 }
     829           2 :                 NDR_ZERO_STRUCT(r2->out);
     830           2 :                 r2->out.names = r2->in.names;
     831           2 :                 r2->out.count = r2->in.count;
     832           2 :                 r2->out.domains = talloc_zero(r2, struct lsa_RefDomainList *);
     833           2 :                 if (r2->out.domains == NULL) {
     834           0 :                         status = NT_STATUS_NO_MEMORY;
     835           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     836           0 :                         goto fail;
     837             :                 }
     838             : 
     839           2 :                 r2->out.result = _lsa_LookupSids2(p, r2);
     840           2 :                 break;
     841             :         }
     842           4 :         case 58: { /* lsa_LookupNames2 */
     843           4 :                 struct lsa_LookupNames2 *r2 = (struct lsa_LookupNames2 *)r;
     844           4 :                 if (DEBUGLEVEL >= 10) {
     845           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupNames2, NDR_IN, r2);
     846             :                 }
     847           4 :                 NDR_ZERO_STRUCT(r2->out);
     848           4 :                 r2->out.sids = r2->in.sids;
     849           4 :                 r2->out.count = r2->in.count;
     850           4 :                 r2->out.domains = talloc_zero(r2, struct lsa_RefDomainList *);
     851           4 :                 if (r2->out.domains == NULL) {
     852           0 :                         status = NT_STATUS_NO_MEMORY;
     853           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     854           0 :                         goto fail;
     855             :                 }
     856             : 
     857           4 :                 r2->out.result = _lsa_LookupNames2(p, r2);
     858           4 :                 break;
     859             :         }
     860           0 :         case 59: { /* lsa_CreateTrustedDomainEx2 */
     861           0 :                 struct lsa_CreateTrustedDomainEx2 *r2 = (struct lsa_CreateTrustedDomainEx2 *)r;
     862           0 :                 if (DEBUGLEVEL >= 10) {
     863           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateTrustedDomainEx2, NDR_IN, r2);
     864             :                 }
     865           0 :                 NDR_ZERO_STRUCT(r2->out);
     866           0 :                 r2->out.trustdom_handle = talloc_zero(r2, struct policy_handle);
     867           0 :                 if (r2->out.trustdom_handle == NULL) {
     868           0 :                         status = NT_STATUS_NO_MEMORY;
     869           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     870           0 :                         goto fail;
     871             :                 }
     872             : 
     873           0 :                 r2->out.result = _lsa_CreateTrustedDomainEx2(p, r2);
     874           0 :                 break;
     875             :         }
     876           0 :         case 60: { /* lsa_CREDRWRITE */
     877           0 :                 struct lsa_CREDRWRITE *r2 = (struct lsa_CREDRWRITE *)r;
     878           0 :                 if (DEBUGLEVEL >= 10) {
     879           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRWRITE, NDR_IN, r2);
     880             :                 }
     881           0 :                 r2->out.result = _lsa_CREDRWRITE(p, r2);
     882           0 :                 break;
     883             :         }
     884           0 :         case 61: { /* lsa_CREDRREAD */
     885           0 :                 struct lsa_CREDRREAD *r2 = (struct lsa_CREDRREAD *)r;
     886           0 :                 if (DEBUGLEVEL >= 10) {
     887           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRREAD, NDR_IN, r2);
     888             :                 }
     889           0 :                 r2->out.result = _lsa_CREDRREAD(p, r2);
     890           0 :                 break;
     891             :         }
     892           0 :         case 62: { /* lsa_CREDRENUMERATE */
     893           0 :                 struct lsa_CREDRENUMERATE *r2 = (struct lsa_CREDRENUMERATE *)r;
     894           0 :                 if (DEBUGLEVEL >= 10) {
     895           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRENUMERATE, NDR_IN, r2);
     896             :                 }
     897           0 :                 r2->out.result = _lsa_CREDRENUMERATE(p, r2);
     898           0 :                 break;
     899             :         }
     900           0 :         case 63: { /* lsa_CREDRWRITEDOMAINCREDENTIALS */
     901           0 :                 struct lsa_CREDRWRITEDOMAINCREDENTIALS *r2 = (struct lsa_CREDRWRITEDOMAINCREDENTIALS *)r;
     902           0 :                 if (DEBUGLEVEL >= 10) {
     903           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, NDR_IN, r2);
     904             :                 }
     905           0 :                 r2->out.result = _lsa_CREDRWRITEDOMAINCREDENTIALS(p, r2);
     906           0 :                 break;
     907             :         }
     908           0 :         case 64: { /* lsa_CREDRREADDOMAINCREDENTIALS */
     909           0 :                 struct lsa_CREDRREADDOMAINCREDENTIALS *r2 = (struct lsa_CREDRREADDOMAINCREDENTIALS *)r;
     910           0 :                 if (DEBUGLEVEL >= 10) {
     911           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, NDR_IN, r2);
     912             :                 }
     913           0 :                 r2->out.result = _lsa_CREDRREADDOMAINCREDENTIALS(p, r2);
     914           0 :                 break;
     915             :         }
     916           0 :         case 65: { /* lsa_CREDRDELETE */
     917           0 :                 struct lsa_CREDRDELETE *r2 = (struct lsa_CREDRDELETE *)r;
     918           0 :                 if (DEBUGLEVEL >= 10) {
     919           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRDELETE, NDR_IN, r2);
     920             :                 }
     921           0 :                 r2->out.result = _lsa_CREDRDELETE(p, r2);
     922           0 :                 break;
     923             :         }
     924           0 :         case 66: { /* lsa_CREDRGETTARGETINFO */
     925           0 :                 struct lsa_CREDRGETTARGETINFO *r2 = (struct lsa_CREDRGETTARGETINFO *)r;
     926           0 :                 if (DEBUGLEVEL >= 10) {
     927           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRGETTARGETINFO, NDR_IN, r2);
     928             :                 }
     929           0 :                 r2->out.result = _lsa_CREDRGETTARGETINFO(p, r2);
     930           0 :                 break;
     931             :         }
     932           0 :         case 67: { /* lsa_CREDRPROFILELOADED */
     933           0 :                 struct lsa_CREDRPROFILELOADED *r2 = (struct lsa_CREDRPROFILELOADED *)r;
     934           0 :                 if (DEBUGLEVEL >= 10) {
     935           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRPROFILELOADED, NDR_IN, r2);
     936             :                 }
     937           0 :                 r2->out.result = _lsa_CREDRPROFILELOADED(p, r2);
     938           0 :                 break;
     939             :         }
     940           4 :         case 68: { /* lsa_LookupNames3 */
     941           4 :                 struct lsa_LookupNames3 *r2 = (struct lsa_LookupNames3 *)r;
     942           4 :                 if (DEBUGLEVEL >= 10) {
     943           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupNames3, NDR_IN, r2);
     944             :                 }
     945           4 :                 NDR_ZERO_STRUCT(r2->out);
     946           4 :                 r2->out.sids = r2->in.sids;
     947           4 :                 r2->out.count = r2->in.count;
     948           4 :                 r2->out.domains = talloc_zero(r2, struct lsa_RefDomainList *);
     949           4 :                 if (r2->out.domains == NULL) {
     950           0 :                         status = NT_STATUS_NO_MEMORY;
     951           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
     952           0 :                         goto fail;
     953             :                 }
     954             : 
     955           4 :                 r2->out.result = _lsa_LookupNames3(p, r2);
     956           4 :                 break;
     957             :         }
     958           0 :         case 69: { /* lsa_CREDRGETSESSIONTYPES */
     959           0 :                 struct lsa_CREDRGETSESSIONTYPES *r2 = (struct lsa_CREDRGETSESSIONTYPES *)r;
     960           0 :                 if (DEBUGLEVEL >= 10) {
     961           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRGETSESSIONTYPES, NDR_IN, r2);
     962             :                 }
     963           0 :                 r2->out.result = _lsa_CREDRGETSESSIONTYPES(p, r2);
     964           0 :                 break;
     965             :         }
     966           0 :         case 70: { /* lsa_LSARREGISTERAUDITEVENT */
     967           0 :                 struct lsa_LSARREGISTERAUDITEVENT *r2 = (struct lsa_LSARREGISTERAUDITEVENT *)r;
     968           0 :                 if (DEBUGLEVEL >= 10) {
     969           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARREGISTERAUDITEVENT, NDR_IN, r2);
     970             :                 }
     971           0 :                 r2->out.result = _lsa_LSARREGISTERAUDITEVENT(p, r2);
     972           0 :                 break;
     973             :         }
     974           0 :         case 71: { /* lsa_LSARGENAUDITEVENT */
     975           0 :                 struct lsa_LSARGENAUDITEVENT *r2 = (struct lsa_LSARGENAUDITEVENT *)r;
     976           0 :                 if (DEBUGLEVEL >= 10) {
     977           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARGENAUDITEVENT, NDR_IN, r2);
     978             :                 }
     979           0 :                 r2->out.result = _lsa_LSARGENAUDITEVENT(p, r2);
     980           0 :                 break;
     981             :         }
     982           0 :         case 72: { /* lsa_LSARUNREGISTERAUDITEVENT */
     983           0 :                 struct lsa_LSARUNREGISTERAUDITEVENT *r2 = (struct lsa_LSARUNREGISTERAUDITEVENT *)r;
     984           0 :                 if (DEBUGLEVEL >= 10) {
     985           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, NDR_IN, r2);
     986             :                 }
     987           0 :                 r2->out.result = _lsa_LSARUNREGISTERAUDITEVENT(p, r2);
     988           0 :                 break;
     989             :         }
     990           0 :         case 73: { /* lsa_lsaRQueryForestTrustInformation */
     991           0 :                 struct lsa_lsaRQueryForestTrustInformation *r2 = (struct lsa_lsaRQueryForestTrustInformation *)r;
     992           0 :                 if (DEBUGLEVEL >= 10) {
     993           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_lsaRQueryForestTrustInformation, NDR_IN, r2);
     994             :                 }
     995           0 :                 NDR_ZERO_STRUCT(r2->out);
     996           0 :                 r2->out.forest_trust_info = talloc_zero(r2, struct lsa_ForestTrustInformation *);
     997           0 :                 if (r2->out.forest_trust_info == NULL) {
     998           0 :                         status = NT_STATUS_NO_MEMORY;
     999           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1000           0 :                         goto fail;
    1001             :                 }
    1002             : 
    1003           0 :                 r2->out.result = _lsa_lsaRQueryForestTrustInformation(p, r2);
    1004           0 :                 break;
    1005             :         }
    1006           0 :         case 74: { /* lsa_lsaRSetForestTrustInformation */
    1007           0 :                 struct lsa_lsaRSetForestTrustInformation *r2 = (struct lsa_lsaRSetForestTrustInformation *)r;
    1008           0 :                 if (DEBUGLEVEL >= 10) {
    1009           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_lsaRSetForestTrustInformation, NDR_IN, r2);
    1010             :                 }
    1011           0 :                 NDR_ZERO_STRUCT(r2->out);
    1012           0 :                 r2->out.collision_info = talloc_zero(r2, struct lsa_ForestTrustCollisionInfo *);
    1013           0 :                 if (r2->out.collision_info == NULL) {
    1014           0 :                         status = NT_STATUS_NO_MEMORY;
    1015           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1016           0 :                         goto fail;
    1017             :                 }
    1018             : 
    1019           0 :                 r2->out.result = _lsa_lsaRSetForestTrustInformation(p, r2);
    1020           0 :                 break;
    1021             :         }
    1022           0 :         case 75: { /* lsa_CREDRRENAME */
    1023           0 :                 struct lsa_CREDRRENAME *r2 = (struct lsa_CREDRRENAME *)r;
    1024           0 :                 if (DEBUGLEVEL >= 10) {
    1025           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRRENAME, NDR_IN, r2);
    1026             :                 }
    1027           0 :                 r2->out.result = _lsa_CREDRRENAME(p, r2);
    1028           0 :                 break;
    1029             :         }
    1030           2 :         case 76: { /* lsa_LookupSids3 */
    1031           2 :                 struct lsa_LookupSids3 *r2 = (struct lsa_LookupSids3 *)r;
    1032           2 :                 if (DEBUGLEVEL >= 10) {
    1033           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupSids3, NDR_IN, r2);
    1034             :                 }
    1035           2 :                 NDR_ZERO_STRUCT(r2->out);
    1036           2 :                 r2->out.names = r2->in.names;
    1037           2 :                 r2->out.count = r2->in.count;
    1038           2 :                 r2->out.domains = talloc_zero(r2, struct lsa_RefDomainList *);
    1039           2 :                 if (r2->out.domains == NULL) {
    1040           0 :                         status = NT_STATUS_NO_MEMORY;
    1041           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1042           0 :                         goto fail;
    1043             :                 }
    1044             : 
    1045           2 :                 r2->out.result = _lsa_LookupSids3(p, r2);
    1046           2 :                 break;
    1047             :         }
    1048           4 :         case 77: { /* lsa_LookupNames4 */
    1049           4 :                 struct lsa_LookupNames4 *r2 = (struct lsa_LookupNames4 *)r;
    1050           4 :                 if (DEBUGLEVEL >= 10) {
    1051           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupNames4, NDR_IN, r2);
    1052             :                 }
    1053           4 :                 NDR_ZERO_STRUCT(r2->out);
    1054           4 :                 r2->out.sids = r2->in.sids;
    1055           4 :                 r2->out.count = r2->in.count;
    1056           4 :                 r2->out.domains = talloc_zero(r2, struct lsa_RefDomainList *);
    1057           4 :                 if (r2->out.domains == NULL) {
    1058           0 :                         status = NT_STATUS_NO_MEMORY;
    1059           0 :                         p->fault_state = DCERPC_FAULT_CANT_PERFORM;
    1060           0 :                         goto fail;
    1061             :                 }
    1062             : 
    1063           4 :                 r2->out.result = _lsa_LookupNames4(p, r2);
    1064           4 :                 break;
    1065             :         }
    1066           0 :         case 78: { /* lsa_LSAROPENPOLICYSCE */
    1067           0 :                 struct lsa_LSAROPENPOLICYSCE *r2 = (struct lsa_LSAROPENPOLICYSCE *)r;
    1068           0 :                 if (DEBUGLEVEL >= 10) {
    1069           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSAROPENPOLICYSCE, NDR_IN, r2);
    1070             :                 }
    1071           0 :                 r2->out.result = _lsa_LSAROPENPOLICYSCE(p, r2);
    1072           0 :                 break;
    1073             :         }
    1074           0 :         case 79: { /* lsa_LSARADTREGISTERSECURITYEVENTSOURCE */
    1075           0 :                 struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r2 = (struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *)r;
    1076           0 :                 if (DEBUGLEVEL >= 10) {
    1077           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, NDR_IN, r2);
    1078             :                 }
    1079           0 :                 r2->out.result = _lsa_LSARADTREGISTERSECURITYEVENTSOURCE(p, r2);
    1080           0 :                 break;
    1081             :         }
    1082           0 :         case 80: { /* lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE */
    1083           0 :                 struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r2 = (struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *)r;
    1084           0 :                 if (DEBUGLEVEL >= 10) {
    1085           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, NDR_IN, r2);
    1086             :                 }
    1087           0 :                 r2->out.result = _lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(p, r2);
    1088           0 :                 break;
    1089             :         }
    1090           0 :         case 81: { /* lsa_LSARADTREPORTSECURITYEVENT */
    1091           0 :                 struct lsa_LSARADTREPORTSECURITYEVENT *r2 = (struct lsa_LSARADTREPORTSECURITYEVENT *)r;
    1092           0 :                 if (DEBUGLEVEL >= 10) {
    1093           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, NDR_IN, r2);
    1094             :                 }
    1095           0 :                 r2->out.result = _lsa_LSARADTREPORTSECURITYEVENT(p, r2);
    1096           0 :                 break;
    1097             :         }
    1098           0 :         default:
    1099           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
    1100           0 :                 break;
    1101             :         }
    1102             : 
    1103       17401 : fail:
    1104             :         /* Unimpersonate */
    1105       17401 :         if (impersonated) {
    1106       17401 :                 unbecome_authenticated_pipe_user();
    1107             :         }
    1108             : 
    1109       17401 :         p->dce_call = NULL;
    1110       17401 :         p->mem_ctx = NULL;
    1111             :         /* Restore session info */
    1112       17401 :         p->session_info = pipe_session_info;
    1113       17401 :         p->auth.auth_type = 0;
    1114       17401 :         p->auth.auth_level = 0;
    1115       17401 :         p->auth.auth_context_id = 0;
    1116             :         /* Check pipes struct fault state */
    1117       17401 :         if (p->fault_state != 0) {
    1118          48 :                 dce_call->fault_code = p->fault_state;
    1119             :         }
    1120       17401 :         if (dce_call->fault_code != 0) {
    1121          48 :                 status = NT_STATUS_NET_WRITE_FAULT;
    1122             :         }
    1123             : 
    1124       17401 :         return status;
    1125             : }
    1126             : 
    1127       17401 : NTSTATUS lsarpc__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    1128             : {
    1129       17401 :         return lsarpc__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_EXTERNAL);
    1130             : }
    1131             : 
    1132       17353 : NTSTATUS lsarpc__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    1133             : {
    1134       17353 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
    1135             : 
    1136       17353 :         switch (opnum) {
    1137         741 :         case 0: { /* lsa_Close */
    1138         741 :                 struct lsa_Close *r2 = (struct lsa_Close *)r;
    1139         741 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1140           0 :                         DEBUG(5,("function lsa_Close replied async\n"));
    1141             :                 }
    1142         741 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1143           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_Close, NDR_OUT | NDR_SET_VALUES, r2);
    1144             :                 }
    1145         741 :                 if (dce_call->fault_code != 0) {
    1146           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_Close\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1147             :                 }
    1148         741 :                 break;
    1149             :         }
    1150           2 :         case 1: { /* lsa_Delete */
    1151           2 :                 struct lsa_Delete *r2 = (struct lsa_Delete *)r;
    1152           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1153           0 :                         DEBUG(5,("function lsa_Delete replied async\n"));
    1154             :                 }
    1155           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1156           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_Delete, NDR_OUT | NDR_SET_VALUES, r2);
    1157             :                 }
    1158           2 :                 if (dce_call->fault_code != 0) {
    1159           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_Delete\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1160             :                 }
    1161           2 :                 break;
    1162             :         }
    1163           2 :         case 2: { /* lsa_EnumPrivs */
    1164           2 :                 struct lsa_EnumPrivs *r2 = (struct lsa_EnumPrivs *)r;
    1165           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1166           0 :                         DEBUG(5,("function lsa_EnumPrivs replied async\n"));
    1167             :                 }
    1168           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1169           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumPrivs, NDR_OUT | NDR_SET_VALUES, r2);
    1170             :                 }
    1171           2 :                 if (dce_call->fault_code != 0) {
    1172           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_EnumPrivs\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1173             :                 }
    1174           2 :                 break;
    1175             :         }
    1176          12 :         case 3: { /* lsa_QuerySecurity */
    1177          12 :                 struct lsa_QuerySecurity *r2 = (struct lsa_QuerySecurity *)r;
    1178          12 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1179           0 :                         DEBUG(5,("function lsa_QuerySecurity replied async\n"));
    1180             :                 }
    1181          12 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1182           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QuerySecurity, NDR_OUT | NDR_SET_VALUES, r2);
    1183             :                 }
    1184          12 :                 if (dce_call->fault_code != 0) {
    1185           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_QuerySecurity\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1186             :                 }
    1187          12 :                 break;
    1188             :         }
    1189           0 :         case 4: { /* lsa_SetSecObj */
    1190           0 :                 struct lsa_SetSecObj *r2 = (struct lsa_SetSecObj *)r;
    1191           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1192           0 :                         DEBUG(5,("function lsa_SetSecObj replied async\n"));
    1193             :                 }
    1194           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1195           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetSecObj, NDR_OUT | NDR_SET_VALUES, r2);
    1196             :                 }
    1197           0 :                 if (dce_call->fault_code != 0) {
    1198           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetSecObj\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1199             :                 }
    1200           0 :                 break;
    1201             :         }
    1202           0 :         case 5: { /* lsa_ChangePassword */
    1203           0 :                 struct lsa_ChangePassword *r2 = (struct lsa_ChangePassword *)r;
    1204           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1205           0 :                         DEBUG(5,("function lsa_ChangePassword replied async\n"));
    1206             :                 }
    1207           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1208           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_ChangePassword, NDR_OUT | NDR_SET_VALUES, r2);
    1209             :                 }
    1210           0 :                 if (dce_call->fault_code != 0) {
    1211           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_ChangePassword\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1212             :                 }
    1213           0 :                 break;
    1214             :         }
    1215        7746 :         case 6: { /* lsa_OpenPolicy */
    1216        7746 :                 struct lsa_OpenPolicy *r2 = (struct lsa_OpenPolicy *)r;
    1217        7746 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1218           0 :                         DEBUG(5,("function lsa_OpenPolicy replied async\n"));
    1219             :                 }
    1220        7746 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1221           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenPolicy, NDR_OUT | NDR_SET_VALUES, r2);
    1222             :                 }
    1223        7746 :                 if (dce_call->fault_code != 0) {
    1224           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_OpenPolicy\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1225             :                 }
    1226        7746 :                 break;
    1227             :         }
    1228         658 :         case 7: { /* lsa_QueryInfoPolicy */
    1229         658 :                 struct lsa_QueryInfoPolicy *r2 = (struct lsa_QueryInfoPolicy *)r;
    1230         658 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1231           0 :                         DEBUG(5,("function lsa_QueryInfoPolicy replied async\n"));
    1232             :                 }
    1233         658 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1234           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryInfoPolicy, NDR_OUT | NDR_SET_VALUES, r2);
    1235             :                 }
    1236         658 :                 if (dce_call->fault_code != 0) {
    1237           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_QueryInfoPolicy\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1238             :                 }
    1239         658 :                 break;
    1240             :         }
    1241           0 :         case 8: { /* lsa_SetInfoPolicy */
    1242           0 :                 struct lsa_SetInfoPolicy *r2 = (struct lsa_SetInfoPolicy *)r;
    1243           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1244           0 :                         DEBUG(5,("function lsa_SetInfoPolicy replied async\n"));
    1245             :                 }
    1246           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1247           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetInfoPolicy, NDR_OUT | NDR_SET_VALUES, r2);
    1248             :                 }
    1249           0 :                 if (dce_call->fault_code != 0) {
    1250           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetInfoPolicy\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1251             :                 }
    1252           0 :                 break;
    1253             :         }
    1254           0 :         case 9: { /* lsa_ClearAuditLog */
    1255           0 :                 struct lsa_ClearAuditLog *r2 = (struct lsa_ClearAuditLog *)r;
    1256           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1257           0 :                         DEBUG(5,("function lsa_ClearAuditLog replied async\n"));
    1258             :                 }
    1259           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1260           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_ClearAuditLog, NDR_OUT | NDR_SET_VALUES, r2);
    1261             :                 }
    1262           0 :                 if (dce_call->fault_code != 0) {
    1263           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_ClearAuditLog\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1264             :                 }
    1265           0 :                 break;
    1266             :         }
    1267           2 :         case 10: { /* lsa_CreateAccount */
    1268           2 :                 struct lsa_CreateAccount *r2 = (struct lsa_CreateAccount *)r;
    1269           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1270           0 :                         DEBUG(5,("function lsa_CreateAccount replied async\n"));
    1271             :                 }
    1272           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1273           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateAccount, NDR_OUT | NDR_SET_VALUES, r2);
    1274             :                 }
    1275           2 :                 if (dce_call->fault_code != 0) {
    1276           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CreateAccount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1277             :                 }
    1278           2 :                 break;
    1279             :         }
    1280           7 :         case 11: { /* lsa_EnumAccounts */
    1281           7 :                 struct lsa_EnumAccounts *r2 = (struct lsa_EnumAccounts *)r;
    1282           7 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1283           0 :                         DEBUG(5,("function lsa_EnumAccounts replied async\n"));
    1284             :                 }
    1285           7 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1286           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumAccounts, NDR_OUT | NDR_SET_VALUES, r2);
    1287             :                 }
    1288           7 :                 if (dce_call->fault_code != 0) {
    1289           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_EnumAccounts\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1290             :                 }
    1291           7 :                 break;
    1292             :         }
    1293           0 :         case 12: { /* lsa_CreateTrustedDomain */
    1294           0 :                 struct lsa_CreateTrustedDomain *r2 = (struct lsa_CreateTrustedDomain *)r;
    1295           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1296           0 :                         DEBUG(5,("function lsa_CreateTrustedDomain replied async\n"));
    1297             :                 }
    1298           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1299           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateTrustedDomain, NDR_OUT | NDR_SET_VALUES, r2);
    1300             :                 }
    1301           0 :                 if (dce_call->fault_code != 0) {
    1302           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CreateTrustedDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1303             :                 }
    1304           0 :                 break;
    1305             :         }
    1306           0 :         case 13: { /* lsa_EnumTrustDom */
    1307           0 :                 struct lsa_EnumTrustDom *r2 = (struct lsa_EnumTrustDom *)r;
    1308           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1309           0 :                         DEBUG(5,("function lsa_EnumTrustDom replied async\n"));
    1310             :                 }
    1311           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1312           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumTrustDom, NDR_OUT | NDR_SET_VALUES, r2);
    1313             :                 }
    1314           0 :                 if (dce_call->fault_code != 0) {
    1315           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_EnumTrustDom\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1316             :                 }
    1317           0 :                 break;
    1318             :         }
    1319        1413 :         case 14: { /* lsa_LookupNames */
    1320        1413 :                 struct lsa_LookupNames *r2 = (struct lsa_LookupNames *)r;
    1321        1413 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1322           0 :                         DEBUG(5,("function lsa_LookupNames replied async\n"));
    1323             :                 }
    1324        1413 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1325           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupNames, NDR_OUT | NDR_SET_VALUES, r2);
    1326             :                 }
    1327        1413 :                 if (dce_call->fault_code != 0) {
    1328           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupNames\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1329             :                 }
    1330        1413 :                 break;
    1331             :         }
    1332        6003 :         case 15: { /* lsa_LookupSids */
    1333        6003 :                 struct lsa_LookupSids *r2 = (struct lsa_LookupSids *)r;
    1334        6003 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1335           0 :                         DEBUG(5,("function lsa_LookupSids replied async\n"));
    1336             :                 }
    1337        6003 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1338           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupSids, NDR_OUT | NDR_SET_VALUES, r2);
    1339             :                 }
    1340        6003 :                 if (dce_call->fault_code != 0) {
    1341           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupSids\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1342             :                 }
    1343        6003 :                 break;
    1344             :         }
    1345          48 :         case 16: { /* lsa_CreateSecret */
    1346          48 :                 struct lsa_CreateSecret *r2 = (struct lsa_CreateSecret *)r;
    1347          48 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1348           0 :                         DEBUG(5,("function lsa_CreateSecret replied async\n"));
    1349             :                 }
    1350          48 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1351           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateSecret, NDR_OUT | NDR_SET_VALUES, r2);
    1352             :                 }
    1353          48 :                 if (dce_call->fault_code != 0) {
    1354           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CreateSecret\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1355             :                 }
    1356          48 :                 break;
    1357             :         }
    1358          14 :         case 17: { /* lsa_OpenAccount */
    1359          14 :                 struct lsa_OpenAccount *r2 = (struct lsa_OpenAccount *)r;
    1360          14 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1361           0 :                         DEBUG(5,("function lsa_OpenAccount replied async\n"));
    1362             :                 }
    1363          14 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1364           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenAccount, NDR_OUT | NDR_SET_VALUES, r2);
    1365             :                 }
    1366          14 :                 if (dce_call->fault_code != 0) {
    1367           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_OpenAccount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1368             :                 }
    1369          14 :                 break;
    1370             :         }
    1371          12 :         case 18: { /* lsa_EnumPrivsAccount */
    1372          12 :                 struct lsa_EnumPrivsAccount *r2 = (struct lsa_EnumPrivsAccount *)r;
    1373          12 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1374           0 :                         DEBUG(5,("function lsa_EnumPrivsAccount replied async\n"));
    1375             :                 }
    1376          12 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1377           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumPrivsAccount, NDR_OUT | NDR_SET_VALUES, r2);
    1378             :                 }
    1379          12 :                 if (dce_call->fault_code != 0) {
    1380           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_EnumPrivsAccount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1381             :                 }
    1382          12 :                 break;
    1383             :         }
    1384           2 :         case 19: { /* lsa_AddPrivilegesToAccount */
    1385           2 :                 struct lsa_AddPrivilegesToAccount *r2 = (struct lsa_AddPrivilegesToAccount *)r;
    1386           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1387           0 :                         DEBUG(5,("function lsa_AddPrivilegesToAccount replied async\n"));
    1388             :                 }
    1389           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1390           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_AddPrivilegesToAccount, NDR_OUT | NDR_SET_VALUES, r2);
    1391             :                 }
    1392           2 :                 if (dce_call->fault_code != 0) {
    1393           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_AddPrivilegesToAccount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1394             :                 }
    1395           2 :                 break;
    1396             :         }
    1397           2 :         case 20: { /* lsa_RemovePrivilegesFromAccount */
    1398           2 :                 struct lsa_RemovePrivilegesFromAccount *r2 = (struct lsa_RemovePrivilegesFromAccount *)r;
    1399           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1400           0 :                         DEBUG(5,("function lsa_RemovePrivilegesFromAccount replied async\n"));
    1401             :                 }
    1402           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1403           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_RemovePrivilegesFromAccount, NDR_OUT | NDR_SET_VALUES, r2);
    1404             :                 }
    1405           2 :                 if (dce_call->fault_code != 0) {
    1406           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_RemovePrivilegesFromAccount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1407             :                 }
    1408           2 :                 break;
    1409             :         }
    1410           0 :         case 21: { /* lsa_GetQuotasForAccount */
    1411           0 :                 struct lsa_GetQuotasForAccount *r2 = (struct lsa_GetQuotasForAccount *)r;
    1412           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1413           0 :                         DEBUG(5,("function lsa_GetQuotasForAccount replied async\n"));
    1414             :                 }
    1415           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1416           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_GetQuotasForAccount, NDR_OUT | NDR_SET_VALUES, r2);
    1417             :                 }
    1418           0 :                 if (dce_call->fault_code != 0) {
    1419           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_GetQuotasForAccount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1420             :                 }
    1421           0 :                 break;
    1422             :         }
    1423           0 :         case 22: { /* lsa_SetQuotasForAccount */
    1424           0 :                 struct lsa_SetQuotasForAccount *r2 = (struct lsa_SetQuotasForAccount *)r;
    1425           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1426           0 :                         DEBUG(5,("function lsa_SetQuotasForAccount replied async\n"));
    1427             :                 }
    1428           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1429           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetQuotasForAccount, NDR_OUT | NDR_SET_VALUES, r2);
    1430             :                 }
    1431           0 :                 if (dce_call->fault_code != 0) {
    1432           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetQuotasForAccount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1433             :                 }
    1434           0 :                 break;
    1435             :         }
    1436          14 :         case 23: { /* lsa_GetSystemAccessAccount */
    1437          14 :                 struct lsa_GetSystemAccessAccount *r2 = (struct lsa_GetSystemAccessAccount *)r;
    1438          14 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1439           0 :                         DEBUG(5,("function lsa_GetSystemAccessAccount replied async\n"));
    1440             :                 }
    1441          14 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1442           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_GetSystemAccessAccount, NDR_OUT | NDR_SET_VALUES, r2);
    1443             :                 }
    1444          14 :                 if (dce_call->fault_code != 0) {
    1445           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_GetSystemAccessAccount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1446             :                 }
    1447          14 :                 break;
    1448             :         }
    1449           0 :         case 24: { /* lsa_SetSystemAccessAccount */
    1450           0 :                 struct lsa_SetSystemAccessAccount *r2 = (struct lsa_SetSystemAccessAccount *)r;
    1451           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1452           0 :                         DEBUG(5,("function lsa_SetSystemAccessAccount replied async\n"));
    1453             :                 }
    1454           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1455           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetSystemAccessAccount, NDR_OUT | NDR_SET_VALUES, r2);
    1456             :                 }
    1457           0 :                 if (dce_call->fault_code != 0) {
    1458           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetSystemAccessAccount\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1459             :                 }
    1460           0 :                 break;
    1461             :         }
    1462           0 :         case 25: { /* lsa_OpenTrustedDomain */
    1463           0 :                 struct lsa_OpenTrustedDomain *r2 = (struct lsa_OpenTrustedDomain *)r;
    1464           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1465           0 :                         DEBUG(5,("function lsa_OpenTrustedDomain replied async\n"));
    1466             :                 }
    1467           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1468           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenTrustedDomain, NDR_OUT | NDR_SET_VALUES, r2);
    1469             :                 }
    1470           0 :                 if (dce_call->fault_code != 0) {
    1471           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_OpenTrustedDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1472             :                 }
    1473           0 :                 break;
    1474             :         }
    1475           0 :         case 26: { /* lsa_QueryTrustedDomainInfo */
    1476           0 :                 struct lsa_QueryTrustedDomainInfo *r2 = (struct lsa_QueryTrustedDomainInfo *)r;
    1477           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1478           0 :                         DEBUG(5,("function lsa_QueryTrustedDomainInfo replied async\n"));
    1479             :                 }
    1480           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1481           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryTrustedDomainInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1482             :                 }
    1483           0 :                 if (dce_call->fault_code != 0) {
    1484           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_QueryTrustedDomainInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1485             :                 }
    1486           0 :                 break;
    1487             :         }
    1488           0 :         case 27: { /* lsa_SetInformationTrustedDomain */
    1489           0 :                 struct lsa_SetInformationTrustedDomain *r2 = (struct lsa_SetInformationTrustedDomain *)r;
    1490           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1491           0 :                         DEBUG(5,("function lsa_SetInformationTrustedDomain replied async\n"));
    1492             :                 }
    1493           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1494           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetInformationTrustedDomain, NDR_OUT | NDR_SET_VALUES, r2);
    1495             :                 }
    1496           0 :                 if (dce_call->fault_code != 0) {
    1497           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetInformationTrustedDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1498             :                 }
    1499           0 :                 break;
    1500             :         }
    1501           0 :         case 28: { /* lsa_OpenSecret */
    1502           0 :                 struct lsa_OpenSecret *r2 = (struct lsa_OpenSecret *)r;
    1503           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1504           0 :                         DEBUG(5,("function lsa_OpenSecret replied async\n"));
    1505             :                 }
    1506           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1507           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenSecret, NDR_OUT | NDR_SET_VALUES, r2);
    1508             :                 }
    1509           0 :                 if (dce_call->fault_code != 0) {
    1510           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_OpenSecret\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1511             :                 }
    1512           0 :                 break;
    1513             :         }
    1514          64 :         case 29: { /* lsa_SetSecret */
    1515          64 :                 struct lsa_SetSecret *r2 = (struct lsa_SetSecret *)r;
    1516          64 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1517           0 :                         DEBUG(5,("function lsa_SetSecret replied async\n"));
    1518             :                 }
    1519          64 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1520           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetSecret, NDR_OUT | NDR_SET_VALUES, r2);
    1521             :                 }
    1522          64 :                 if (dce_call->fault_code != 0) {
    1523           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetSecret\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1524             :                 }
    1525          64 :                 break;
    1526             :         }
    1527          32 :         case 30: { /* lsa_QuerySecret */
    1528          32 :                 struct lsa_QuerySecret *r2 = (struct lsa_QuerySecret *)r;
    1529          32 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1530           0 :                         DEBUG(5,("function lsa_QuerySecret replied async\n"));
    1531             :                 }
    1532          32 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1533           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QuerySecret, NDR_OUT | NDR_SET_VALUES, r2);
    1534             :                 }
    1535          32 :                 if (dce_call->fault_code != 0) {
    1536           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_QuerySecret\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1537             :                 }
    1538          32 :                 break;
    1539             :         }
    1540          19 :         case 31: { /* lsa_LookupPrivValue */
    1541          19 :                 struct lsa_LookupPrivValue *r2 = (struct lsa_LookupPrivValue *)r;
    1542          19 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1543           0 :                         DEBUG(5,("function lsa_LookupPrivValue replied async\n"));
    1544             :                 }
    1545          19 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1546           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupPrivValue, NDR_OUT | NDR_SET_VALUES, r2);
    1547             :                 }
    1548          19 :                 if (dce_call->fault_code != 0) {
    1549           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupPrivValue\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1550             :                 }
    1551          19 :                 break;
    1552             :         }
    1553          50 :         case 32: { /* lsa_LookupPrivName */
    1554          50 :                 struct lsa_LookupPrivName *r2 = (struct lsa_LookupPrivName *)r;
    1555          50 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1556           0 :                         DEBUG(5,("function lsa_LookupPrivName replied async\n"));
    1557             :                 }
    1558          50 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1559           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupPrivName, NDR_OUT | NDR_SET_VALUES, r2);
    1560             :                 }
    1561          50 :                 if (dce_call->fault_code != 0) {
    1562           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupPrivName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1563             :                 }
    1564          50 :                 break;
    1565             :         }
    1566          18 :         case 33: { /* lsa_LookupPrivDisplayName */
    1567          18 :                 struct lsa_LookupPrivDisplayName *r2 = (struct lsa_LookupPrivDisplayName *)r;
    1568          18 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1569           0 :                         DEBUG(5,("function lsa_LookupPrivDisplayName replied async\n"));
    1570             :                 }
    1571          18 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1572           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupPrivDisplayName, NDR_OUT | NDR_SET_VALUES, r2);
    1573             :                 }
    1574          18 :                 if (dce_call->fault_code != 0) {
    1575           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupPrivDisplayName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1576             :                 }
    1577          18 :                 break;
    1578             :         }
    1579          51 :         case 34: { /* lsa_DeleteObject */
    1580          51 :                 struct lsa_DeleteObject *r2 = (struct lsa_DeleteObject *)r;
    1581          51 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1582           0 :                         DEBUG(5,("function lsa_DeleteObject replied async\n"));
    1583             :                 }
    1584          51 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1585           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_DeleteObject, NDR_OUT | NDR_SET_VALUES, r2);
    1586             :                 }
    1587          51 :                 if (dce_call->fault_code != 0) {
    1588           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_DeleteObject\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1589             :                 }
    1590          51 :                 break;
    1591             :         }
    1592          18 :         case 35: { /* lsa_EnumAccountsWithUserRight */
    1593          18 :                 struct lsa_EnumAccountsWithUserRight *r2 = (struct lsa_EnumAccountsWithUserRight *)r;
    1594          18 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1595           0 :                         DEBUG(5,("function lsa_EnumAccountsWithUserRight replied async\n"));
    1596             :                 }
    1597          18 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1598           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumAccountsWithUserRight, NDR_OUT | NDR_SET_VALUES, r2);
    1599             :                 }
    1600          18 :                 if (dce_call->fault_code != 0) {
    1601           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_EnumAccountsWithUserRight\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1602             :                 }
    1603          18 :                 break;
    1604             :         }
    1605          80 :         case 36: { /* lsa_EnumAccountRights */
    1606          80 :                 struct lsa_EnumAccountRights *r2 = (struct lsa_EnumAccountRights *)r;
    1607          80 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1608           0 :                         DEBUG(5,("function lsa_EnumAccountRights replied async\n"));
    1609             :                 }
    1610          80 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1611           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumAccountRights, NDR_OUT | NDR_SET_VALUES, r2);
    1612             :                 }
    1613          80 :                 if (dce_call->fault_code != 0) {
    1614           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_EnumAccountRights\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1615             :                 }
    1616          80 :                 break;
    1617             :         }
    1618          21 :         case 37: { /* lsa_AddAccountRights */
    1619          21 :                 struct lsa_AddAccountRights *r2 = (struct lsa_AddAccountRights *)r;
    1620          21 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1621           0 :                         DEBUG(5,("function lsa_AddAccountRights replied async\n"));
    1622             :                 }
    1623          21 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1624           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_AddAccountRights, NDR_OUT | NDR_SET_VALUES, r2);
    1625             :                 }
    1626          21 :                 if (dce_call->fault_code != 0) {
    1627           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_AddAccountRights\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1628             :                 }
    1629          21 :                 break;
    1630             :         }
    1631          18 :         case 38: { /* lsa_RemoveAccountRights */
    1632          18 :                 struct lsa_RemoveAccountRights *r2 = (struct lsa_RemoveAccountRights *)r;
    1633          18 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1634           0 :                         DEBUG(5,("function lsa_RemoveAccountRights replied async\n"));
    1635             :                 }
    1636          18 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1637           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_RemoveAccountRights, NDR_OUT | NDR_SET_VALUES, r2);
    1638             :                 }
    1639          18 :                 if (dce_call->fault_code != 0) {
    1640           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_RemoveAccountRights\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1641             :                 }
    1642          18 :                 break;
    1643             :         }
    1644           0 :         case 39: { /* lsa_QueryTrustedDomainInfoBySid */
    1645           0 :                 struct lsa_QueryTrustedDomainInfoBySid *r2 = (struct lsa_QueryTrustedDomainInfoBySid *)r;
    1646           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1647           0 :                         DEBUG(5,("function lsa_QueryTrustedDomainInfoBySid replied async\n"));
    1648             :                 }
    1649           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1650           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryTrustedDomainInfoBySid, NDR_OUT | NDR_SET_VALUES, r2);
    1651             :                 }
    1652           0 :                 if (dce_call->fault_code != 0) {
    1653           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_QueryTrustedDomainInfoBySid\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1654             :                 }
    1655           0 :                 break;
    1656             :         }
    1657           0 :         case 40: { /* lsa_SetTrustedDomainInfo */
    1658           0 :                 struct lsa_SetTrustedDomainInfo *r2 = (struct lsa_SetTrustedDomainInfo *)r;
    1659           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1660           0 :                         DEBUG(5,("function lsa_SetTrustedDomainInfo replied async\n"));
    1661             :                 }
    1662           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1663           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetTrustedDomainInfo, NDR_OUT | NDR_SET_VALUES, r2);
    1664             :                 }
    1665           0 :                 if (dce_call->fault_code != 0) {
    1666           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetTrustedDomainInfo\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1667             :                 }
    1668           0 :                 break;
    1669             :         }
    1670           0 :         case 41: { /* lsa_DeleteTrustedDomain */
    1671           0 :                 struct lsa_DeleteTrustedDomain *r2 = (struct lsa_DeleteTrustedDomain *)r;
    1672           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1673           0 :                         DEBUG(5,("function lsa_DeleteTrustedDomain replied async\n"));
    1674             :                 }
    1675           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1676           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_DeleteTrustedDomain, NDR_OUT | NDR_SET_VALUES, r2);
    1677             :                 }
    1678           0 :                 if (dce_call->fault_code != 0) {
    1679           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_DeleteTrustedDomain\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1680             :                 }
    1681           0 :                 break;
    1682             :         }
    1683           0 :         case 42: { /* lsa_StorePrivateData */
    1684           0 :                 struct lsa_StorePrivateData *r2 = (struct lsa_StorePrivateData *)r;
    1685           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1686           0 :                         DEBUG(5,("function lsa_StorePrivateData replied async\n"));
    1687             :                 }
    1688           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1689           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_StorePrivateData, NDR_OUT | NDR_SET_VALUES, r2);
    1690             :                 }
    1691           0 :                 if (dce_call->fault_code != 0) {
    1692           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_StorePrivateData\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1693             :                 }
    1694           0 :                 break;
    1695             :         }
    1696           0 :         case 43: { /* lsa_RetrievePrivateData */
    1697           0 :                 struct lsa_RetrievePrivateData *r2 = (struct lsa_RetrievePrivateData *)r;
    1698           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1699           0 :                         DEBUG(5,("function lsa_RetrievePrivateData replied async\n"));
    1700             :                 }
    1701           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1702           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_RetrievePrivateData, NDR_OUT | NDR_SET_VALUES, r2);
    1703             :                 }
    1704           0 :                 if (dce_call->fault_code != 0) {
    1705           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_RetrievePrivateData\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1706             :                 }
    1707           0 :                 break;
    1708             :         }
    1709         202 :         case 44: { /* lsa_OpenPolicy2 */
    1710         202 :                 struct lsa_OpenPolicy2 *r2 = (struct lsa_OpenPolicy2 *)r;
    1711         202 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1712           0 :                         DEBUG(5,("function lsa_OpenPolicy2 replied async\n"));
    1713             :                 }
    1714         202 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1715           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenPolicy2, NDR_OUT | NDR_SET_VALUES, r2);
    1716             :                 }
    1717         202 :                 if (dce_call->fault_code != 0) {
    1718           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_OpenPolicy2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1719             :                 }
    1720         202 :                 break;
    1721             :         }
    1722          86 :         case 45: { /* lsa_GetUserName */
    1723          86 :                 struct lsa_GetUserName *r2 = (struct lsa_GetUserName *)r;
    1724          86 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1725           0 :                         DEBUG(5,("function lsa_GetUserName replied async\n"));
    1726             :                 }
    1727          86 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1728           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_GetUserName, NDR_OUT | NDR_SET_VALUES, r2);
    1729             :                 }
    1730          86 :                 if (dce_call->fault_code != 0) {
    1731           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_GetUserName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1732             :                 }
    1733          86 :                 break;
    1734             :         }
    1735           0 :         case 46: { /* lsa_QueryInfoPolicy2 */
    1736           0 :                 struct lsa_QueryInfoPolicy2 *r2 = (struct lsa_QueryInfoPolicy2 *)r;
    1737           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1738           0 :                         DEBUG(5,("function lsa_QueryInfoPolicy2 replied async\n"));
    1739             :                 }
    1740           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1741           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryInfoPolicy2, NDR_OUT | NDR_SET_VALUES, r2);
    1742             :                 }
    1743           0 :                 if (dce_call->fault_code != 0) {
    1744           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_QueryInfoPolicy2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1745             :                 }
    1746           0 :                 break;
    1747             :         }
    1748           0 :         case 47: { /* lsa_SetInfoPolicy2 */
    1749           0 :                 struct lsa_SetInfoPolicy2 *r2 = (struct lsa_SetInfoPolicy2 *)r;
    1750           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1751           0 :                         DEBUG(5,("function lsa_SetInfoPolicy2 replied async\n"));
    1752             :                 }
    1753           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1754           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetInfoPolicy2, NDR_OUT | NDR_SET_VALUES, r2);
    1755             :                 }
    1756           0 :                 if (dce_call->fault_code != 0) {
    1757           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetInfoPolicy2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1758             :                 }
    1759           0 :                 break;
    1760             :         }
    1761           0 :         case 48: { /* lsa_QueryTrustedDomainInfoByName */
    1762           0 :                 struct lsa_QueryTrustedDomainInfoByName *r2 = (struct lsa_QueryTrustedDomainInfoByName *)r;
    1763           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1764           0 :                         DEBUG(5,("function lsa_QueryTrustedDomainInfoByName replied async\n"));
    1765             :                 }
    1766           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1767           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryTrustedDomainInfoByName, NDR_OUT | NDR_SET_VALUES, r2);
    1768             :                 }
    1769           0 :                 if (dce_call->fault_code != 0) {
    1770           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_QueryTrustedDomainInfoByName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1771             :                 }
    1772           0 :                 break;
    1773             :         }
    1774           0 :         case 49: { /* lsa_SetTrustedDomainInfoByName */
    1775           0 :                 struct lsa_SetTrustedDomainInfoByName *r2 = (struct lsa_SetTrustedDomainInfoByName *)r;
    1776           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1777           0 :                         DEBUG(5,("function lsa_SetTrustedDomainInfoByName replied async\n"));
    1778             :                 }
    1779           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1780           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetTrustedDomainInfoByName, NDR_OUT | NDR_SET_VALUES, r2);
    1781             :                 }
    1782           0 :                 if (dce_call->fault_code != 0) {
    1783           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetTrustedDomainInfoByName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1784             :                 }
    1785           0 :                 break;
    1786             :         }
    1787           0 :         case 50: { /* lsa_EnumTrustedDomainsEx */
    1788           0 :                 struct lsa_EnumTrustedDomainsEx *r2 = (struct lsa_EnumTrustedDomainsEx *)r;
    1789           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1790           0 :                         DEBUG(5,("function lsa_EnumTrustedDomainsEx replied async\n"));
    1791             :                 }
    1792           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1793           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_EnumTrustedDomainsEx, NDR_OUT | NDR_SET_VALUES, r2);
    1794             :                 }
    1795           0 :                 if (dce_call->fault_code != 0) {
    1796           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_EnumTrustedDomainsEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1797             :                 }
    1798           0 :                 break;
    1799             :         }
    1800           0 :         case 51: { /* lsa_CreateTrustedDomainEx */
    1801           0 :                 struct lsa_CreateTrustedDomainEx *r2 = (struct lsa_CreateTrustedDomainEx *)r;
    1802           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1803           0 :                         DEBUG(5,("function lsa_CreateTrustedDomainEx replied async\n"));
    1804             :                 }
    1805           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1806           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateTrustedDomainEx, NDR_OUT | NDR_SET_VALUES, r2);
    1807             :                 }
    1808           0 :                 if (dce_call->fault_code != 0) {
    1809           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CreateTrustedDomainEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1810             :                 }
    1811           0 :                 break;
    1812             :         }
    1813           0 :         case 52: { /* lsa_CloseTrustedDomainEx */
    1814           0 :                 struct lsa_CloseTrustedDomainEx *r2 = (struct lsa_CloseTrustedDomainEx *)r;
    1815           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1816           0 :                         DEBUG(5,("function lsa_CloseTrustedDomainEx replied async\n"));
    1817             :                 }
    1818           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1819           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CloseTrustedDomainEx, NDR_OUT | NDR_SET_VALUES, r2);
    1820             :                 }
    1821           0 :                 if (dce_call->fault_code != 0) {
    1822           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CloseTrustedDomainEx\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1823             :                 }
    1824           0 :                 break;
    1825             :         }
    1826           0 :         case 53: { /* lsa_QueryDomainInformationPolicy */
    1827           0 :                 struct lsa_QueryDomainInformationPolicy *r2 = (struct lsa_QueryDomainInformationPolicy *)r;
    1828           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1829           0 :                         DEBUG(5,("function lsa_QueryDomainInformationPolicy replied async\n"));
    1830             :                 }
    1831           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1832           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_QueryDomainInformationPolicy, NDR_OUT | NDR_SET_VALUES, r2);
    1833             :                 }
    1834           0 :                 if (dce_call->fault_code != 0) {
    1835           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_QueryDomainInformationPolicy\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1836             :                 }
    1837           0 :                 break;
    1838             :         }
    1839           0 :         case 54: { /* lsa_SetDomainInformationPolicy */
    1840           0 :                 struct lsa_SetDomainInformationPolicy *r2 = (struct lsa_SetDomainInformationPolicy *)r;
    1841           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1842           0 :                         DEBUG(5,("function lsa_SetDomainInformationPolicy replied async\n"));
    1843             :                 }
    1844           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1845           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_SetDomainInformationPolicy, NDR_OUT | NDR_SET_VALUES, r2);
    1846             :                 }
    1847           0 :                 if (dce_call->fault_code != 0) {
    1848           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_SetDomainInformationPolicy\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1849             :                 }
    1850           0 :                 break;
    1851             :         }
    1852           0 :         case 55: { /* lsa_OpenTrustedDomainByName */
    1853           0 :                 struct lsa_OpenTrustedDomainByName *r2 = (struct lsa_OpenTrustedDomainByName *)r;
    1854           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1855           0 :                         DEBUG(5,("function lsa_OpenTrustedDomainByName replied async\n"));
    1856             :                 }
    1857           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1858           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_OpenTrustedDomainByName, NDR_OUT | NDR_SET_VALUES, r2);
    1859             :                 }
    1860           0 :                 if (dce_call->fault_code != 0) {
    1861           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_OpenTrustedDomainByName\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1862             :                 }
    1863           0 :                 break;
    1864             :         }
    1865           0 :         case 56: { /* lsa_TestCall */
    1866           0 :                 struct lsa_TestCall *r2 = (struct lsa_TestCall *)r;
    1867           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1868           0 :                         DEBUG(5,("function lsa_TestCall replied async\n"));
    1869             :                 }
    1870           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1871           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_TestCall, NDR_OUT | NDR_SET_VALUES, r2);
    1872             :                 }
    1873           0 :                 if (dce_call->fault_code != 0) {
    1874           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_TestCall\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1875             :                 }
    1876           0 :                 break;
    1877             :         }
    1878           2 :         case 57: { /* lsa_LookupSids2 */
    1879           2 :                 struct lsa_LookupSids2 *r2 = (struct lsa_LookupSids2 *)r;
    1880           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1881           0 :                         DEBUG(5,("function lsa_LookupSids2 replied async\n"));
    1882             :                 }
    1883           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1884           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupSids2, NDR_OUT | NDR_SET_VALUES, r2);
    1885             :                 }
    1886           2 :                 if (dce_call->fault_code != 0) {
    1887           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupSids2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1888             :                 }
    1889           2 :                 break;
    1890             :         }
    1891           4 :         case 58: { /* lsa_LookupNames2 */
    1892           4 :                 struct lsa_LookupNames2 *r2 = (struct lsa_LookupNames2 *)r;
    1893           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1894           0 :                         DEBUG(5,("function lsa_LookupNames2 replied async\n"));
    1895             :                 }
    1896           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1897           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupNames2, NDR_OUT | NDR_SET_VALUES, r2);
    1898             :                 }
    1899           4 :                 if (dce_call->fault_code != 0) {
    1900           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupNames2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1901             :                 }
    1902           4 :                 break;
    1903             :         }
    1904           0 :         case 59: { /* lsa_CreateTrustedDomainEx2 */
    1905           0 :                 struct lsa_CreateTrustedDomainEx2 *r2 = (struct lsa_CreateTrustedDomainEx2 *)r;
    1906           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1907           0 :                         DEBUG(5,("function lsa_CreateTrustedDomainEx2 replied async\n"));
    1908             :                 }
    1909           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1910           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CreateTrustedDomainEx2, NDR_OUT | NDR_SET_VALUES, r2);
    1911             :                 }
    1912           0 :                 if (dce_call->fault_code != 0) {
    1913           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CreateTrustedDomainEx2\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1914             :                 }
    1915           0 :                 break;
    1916             :         }
    1917           0 :         case 60: { /* lsa_CREDRWRITE */
    1918           0 :                 struct lsa_CREDRWRITE *r2 = (struct lsa_CREDRWRITE *)r;
    1919           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1920           0 :                         DEBUG(5,("function lsa_CREDRWRITE replied async\n"));
    1921             :                 }
    1922           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1923           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRWRITE, NDR_OUT | NDR_SET_VALUES, r2);
    1924             :                 }
    1925           0 :                 if (dce_call->fault_code != 0) {
    1926           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRWRITE\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1927             :                 }
    1928           0 :                 break;
    1929             :         }
    1930           0 :         case 61: { /* lsa_CREDRREAD */
    1931           0 :                 struct lsa_CREDRREAD *r2 = (struct lsa_CREDRREAD *)r;
    1932           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1933           0 :                         DEBUG(5,("function lsa_CREDRREAD replied async\n"));
    1934             :                 }
    1935           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1936           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRREAD, NDR_OUT | NDR_SET_VALUES, r2);
    1937             :                 }
    1938           0 :                 if (dce_call->fault_code != 0) {
    1939           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRREAD\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1940             :                 }
    1941           0 :                 break;
    1942             :         }
    1943           0 :         case 62: { /* lsa_CREDRENUMERATE */
    1944           0 :                 struct lsa_CREDRENUMERATE *r2 = (struct lsa_CREDRENUMERATE *)r;
    1945           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1946           0 :                         DEBUG(5,("function lsa_CREDRENUMERATE replied async\n"));
    1947             :                 }
    1948           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1949           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRENUMERATE, NDR_OUT | NDR_SET_VALUES, r2);
    1950             :                 }
    1951           0 :                 if (dce_call->fault_code != 0) {
    1952           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRENUMERATE\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1953             :                 }
    1954           0 :                 break;
    1955             :         }
    1956           0 :         case 63: { /* lsa_CREDRWRITEDOMAINCREDENTIALS */
    1957           0 :                 struct lsa_CREDRWRITEDOMAINCREDENTIALS *r2 = (struct lsa_CREDRWRITEDOMAINCREDENTIALS *)r;
    1958           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1959           0 :                         DEBUG(5,("function lsa_CREDRWRITEDOMAINCREDENTIALS replied async\n"));
    1960             :                 }
    1961           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1962           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, NDR_OUT | NDR_SET_VALUES, r2);
    1963             :                 }
    1964           0 :                 if (dce_call->fault_code != 0) {
    1965           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRWRITEDOMAINCREDENTIALS\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1966             :                 }
    1967           0 :                 break;
    1968             :         }
    1969           0 :         case 64: { /* lsa_CREDRREADDOMAINCREDENTIALS */
    1970           0 :                 struct lsa_CREDRREADDOMAINCREDENTIALS *r2 = (struct lsa_CREDRREADDOMAINCREDENTIALS *)r;
    1971           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1972           0 :                         DEBUG(5,("function lsa_CREDRREADDOMAINCREDENTIALS replied async\n"));
    1973             :                 }
    1974           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1975           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, NDR_OUT | NDR_SET_VALUES, r2);
    1976             :                 }
    1977           0 :                 if (dce_call->fault_code != 0) {
    1978           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRREADDOMAINCREDENTIALS\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1979             :                 }
    1980           0 :                 break;
    1981             :         }
    1982           0 :         case 65: { /* lsa_CREDRDELETE */
    1983           0 :                 struct lsa_CREDRDELETE *r2 = (struct lsa_CREDRDELETE *)r;
    1984           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1985           0 :                         DEBUG(5,("function lsa_CREDRDELETE replied async\n"));
    1986             :                 }
    1987           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    1988           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRDELETE, NDR_OUT | NDR_SET_VALUES, r2);
    1989             :                 }
    1990           0 :                 if (dce_call->fault_code != 0) {
    1991           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRDELETE\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    1992             :                 }
    1993           0 :                 break;
    1994             :         }
    1995           0 :         case 66: { /* lsa_CREDRGETTARGETINFO */
    1996           0 :                 struct lsa_CREDRGETTARGETINFO *r2 = (struct lsa_CREDRGETTARGETINFO *)r;
    1997           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    1998           0 :                         DEBUG(5,("function lsa_CREDRGETTARGETINFO replied async\n"));
    1999             :                 }
    2000           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2001           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRGETTARGETINFO, NDR_OUT | NDR_SET_VALUES, r2);
    2002             :                 }
    2003           0 :                 if (dce_call->fault_code != 0) {
    2004           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRGETTARGETINFO\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2005             :                 }
    2006           0 :                 break;
    2007             :         }
    2008           0 :         case 67: { /* lsa_CREDRPROFILELOADED */
    2009           0 :                 struct lsa_CREDRPROFILELOADED *r2 = (struct lsa_CREDRPROFILELOADED *)r;
    2010           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2011           0 :                         DEBUG(5,("function lsa_CREDRPROFILELOADED replied async\n"));
    2012             :                 }
    2013           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2014           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRPROFILELOADED, NDR_OUT | NDR_SET_VALUES, r2);
    2015             :                 }
    2016           0 :                 if (dce_call->fault_code != 0) {
    2017           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRPROFILELOADED\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2018             :                 }
    2019           0 :                 break;
    2020             :         }
    2021           4 :         case 68: { /* lsa_LookupNames3 */
    2022           4 :                 struct lsa_LookupNames3 *r2 = (struct lsa_LookupNames3 *)r;
    2023           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2024           0 :                         DEBUG(5,("function lsa_LookupNames3 replied async\n"));
    2025             :                 }
    2026           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2027           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupNames3, NDR_OUT | NDR_SET_VALUES, r2);
    2028             :                 }
    2029           4 :                 if (dce_call->fault_code != 0) {
    2030           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupNames3\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2031             :                 }
    2032           4 :                 break;
    2033             :         }
    2034           0 :         case 69: { /* lsa_CREDRGETSESSIONTYPES */
    2035           0 :                 struct lsa_CREDRGETSESSIONTYPES *r2 = (struct lsa_CREDRGETSESSIONTYPES *)r;
    2036           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2037           0 :                         DEBUG(5,("function lsa_CREDRGETSESSIONTYPES replied async\n"));
    2038             :                 }
    2039           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2040           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRGETSESSIONTYPES, NDR_OUT | NDR_SET_VALUES, r2);
    2041             :                 }
    2042           0 :                 if (dce_call->fault_code != 0) {
    2043           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRGETSESSIONTYPES\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2044             :                 }
    2045           0 :                 break;
    2046             :         }
    2047           0 :         case 70: { /* lsa_LSARREGISTERAUDITEVENT */
    2048           0 :                 struct lsa_LSARREGISTERAUDITEVENT *r2 = (struct lsa_LSARREGISTERAUDITEVENT *)r;
    2049           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2050           0 :                         DEBUG(5,("function lsa_LSARREGISTERAUDITEVENT replied async\n"));
    2051             :                 }
    2052           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2053           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARREGISTERAUDITEVENT, NDR_OUT | NDR_SET_VALUES, r2);
    2054             :                 }
    2055           0 :                 if (dce_call->fault_code != 0) {
    2056           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LSARREGISTERAUDITEVENT\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2057             :                 }
    2058           0 :                 break;
    2059             :         }
    2060           0 :         case 71: { /* lsa_LSARGENAUDITEVENT */
    2061           0 :                 struct lsa_LSARGENAUDITEVENT *r2 = (struct lsa_LSARGENAUDITEVENT *)r;
    2062           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2063           0 :                         DEBUG(5,("function lsa_LSARGENAUDITEVENT replied async\n"));
    2064             :                 }
    2065           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2066           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARGENAUDITEVENT, NDR_OUT | NDR_SET_VALUES, r2);
    2067             :                 }
    2068           0 :                 if (dce_call->fault_code != 0) {
    2069           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LSARGENAUDITEVENT\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2070             :                 }
    2071           0 :                 break;
    2072             :         }
    2073           0 :         case 72: { /* lsa_LSARUNREGISTERAUDITEVENT */
    2074           0 :                 struct lsa_LSARUNREGISTERAUDITEVENT *r2 = (struct lsa_LSARUNREGISTERAUDITEVENT *)r;
    2075           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2076           0 :                         DEBUG(5,("function lsa_LSARUNREGISTERAUDITEVENT replied async\n"));
    2077             :                 }
    2078           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2079           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, NDR_OUT | NDR_SET_VALUES, r2);
    2080             :                 }
    2081           0 :                 if (dce_call->fault_code != 0) {
    2082           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LSARUNREGISTERAUDITEVENT\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2083             :                 }
    2084           0 :                 break;
    2085             :         }
    2086           0 :         case 73: { /* lsa_lsaRQueryForestTrustInformation */
    2087           0 :                 struct lsa_lsaRQueryForestTrustInformation *r2 = (struct lsa_lsaRQueryForestTrustInformation *)r;
    2088           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2089           0 :                         DEBUG(5,("function lsa_lsaRQueryForestTrustInformation replied async\n"));
    2090             :                 }
    2091           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2092           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_lsaRQueryForestTrustInformation, NDR_OUT | NDR_SET_VALUES, r2);
    2093             :                 }
    2094           0 :                 if (dce_call->fault_code != 0) {
    2095           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_lsaRQueryForestTrustInformation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2096             :                 }
    2097           0 :                 break;
    2098             :         }
    2099           0 :         case 74: { /* lsa_lsaRSetForestTrustInformation */
    2100           0 :                 struct lsa_lsaRSetForestTrustInformation *r2 = (struct lsa_lsaRSetForestTrustInformation *)r;
    2101           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2102           0 :                         DEBUG(5,("function lsa_lsaRSetForestTrustInformation replied async\n"));
    2103             :                 }
    2104           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2105           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_lsaRSetForestTrustInformation, NDR_OUT | NDR_SET_VALUES, r2);
    2106             :                 }
    2107           0 :                 if (dce_call->fault_code != 0) {
    2108           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_lsaRSetForestTrustInformation\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2109             :                 }
    2110           0 :                 break;
    2111             :         }
    2112           0 :         case 75: { /* lsa_CREDRRENAME */
    2113           0 :                 struct lsa_CREDRRENAME *r2 = (struct lsa_CREDRRENAME *)r;
    2114           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2115           0 :                         DEBUG(5,("function lsa_CREDRRENAME replied async\n"));
    2116             :                 }
    2117           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2118           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_CREDRRENAME, NDR_OUT | NDR_SET_VALUES, r2);
    2119             :                 }
    2120           0 :                 if (dce_call->fault_code != 0) {
    2121           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_CREDRRENAME\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2122             :                 }
    2123           0 :                 break;
    2124             :         }
    2125           2 :         case 76: { /* lsa_LookupSids3 */
    2126           2 :                 struct lsa_LookupSids3 *r2 = (struct lsa_LookupSids3 *)r;
    2127           2 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2128           0 :                         DEBUG(5,("function lsa_LookupSids3 replied async\n"));
    2129             :                 }
    2130           2 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2131           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupSids3, NDR_OUT | NDR_SET_VALUES, r2);
    2132             :                 }
    2133           2 :                 if (dce_call->fault_code != 0) {
    2134           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupSids3\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2135             :                 }
    2136           2 :                 break;
    2137             :         }
    2138           4 :         case 77: { /* lsa_LookupNames4 */
    2139           4 :                 struct lsa_LookupNames4 *r2 = (struct lsa_LookupNames4 *)r;
    2140           4 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2141           0 :                         DEBUG(5,("function lsa_LookupNames4 replied async\n"));
    2142             :                 }
    2143           4 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2144           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LookupNames4, NDR_OUT | NDR_SET_VALUES, r2);
    2145             :                 }
    2146           4 :                 if (dce_call->fault_code != 0) {
    2147           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LookupNames4\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2148             :                 }
    2149           4 :                 break;
    2150             :         }
    2151           0 :         case 78: { /* lsa_LSAROPENPOLICYSCE */
    2152           0 :                 struct lsa_LSAROPENPOLICYSCE *r2 = (struct lsa_LSAROPENPOLICYSCE *)r;
    2153           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2154           0 :                         DEBUG(5,("function lsa_LSAROPENPOLICYSCE replied async\n"));
    2155             :                 }
    2156           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2157           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSAROPENPOLICYSCE, NDR_OUT | NDR_SET_VALUES, r2);
    2158             :                 }
    2159           0 :                 if (dce_call->fault_code != 0) {
    2160           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LSAROPENPOLICYSCE\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2161             :                 }
    2162           0 :                 break;
    2163             :         }
    2164           0 :         case 79: { /* lsa_LSARADTREGISTERSECURITYEVENTSOURCE */
    2165           0 :                 struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *r2 = (struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE *)r;
    2166           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2167           0 :                         DEBUG(5,("function lsa_LSARADTREGISTERSECURITYEVENTSOURCE replied async\n"));
    2168             :                 }
    2169           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2170           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, NDR_OUT | NDR_SET_VALUES, r2);
    2171             :                 }
    2172           0 :                 if (dce_call->fault_code != 0) {
    2173           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LSARADTREGISTERSECURITYEVENTSOURCE\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2174             :                 }
    2175           0 :                 break;
    2176             :         }
    2177           0 :         case 80: { /* lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE */
    2178           0 :                 struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *r2 = (struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE *)r;
    2179           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2180           0 :                         DEBUG(5,("function lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE replied async\n"));
    2181             :                 }
    2182           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2183           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, NDR_OUT | NDR_SET_VALUES, r2);
    2184             :                 }
    2185           0 :                 if (dce_call->fault_code != 0) {
    2186           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2187             :                 }
    2188           0 :                 break;
    2189             :         }
    2190           0 :         case 81: { /* lsa_LSARADTREPORTSECURITYEVENT */
    2191           0 :                 struct lsa_LSARADTREPORTSECURITYEVENT *r2 = (struct lsa_LSARADTREPORTSECURITYEVENT *)r;
    2192           0 :                 if (dce_call->state_flags & DCESRV_CALL_STATE_FLAG_ASYNC) {
    2193           0 :                         DEBUG(5,("function lsa_LSARADTREPORTSECURITYEVENT replied async\n"));
    2194             :                 }
    2195           0 :                 if (DEBUGLEVEL >= 10 && dce_call->fault_code == 0) {
    2196           0 :                         NDR_PRINT_FUNCTION_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, NDR_OUT | NDR_SET_VALUES, r2);
    2197             :                 }
    2198           0 :                 if (dce_call->fault_code != 0) {
    2199           0 :                         DBG_WARNING("dcerpc_fault %s in lsa_LSARADTREPORTSECURITYEVENT\n", dcerpc_errstr(mem_ctx, dce_call->fault_code));
    2200             :                 }
    2201           0 :                 break;
    2202             :         }
    2203           0 :         default:
    2204           0 :                 dce_call->fault_code = DCERPC_FAULT_OP_RNG_ERROR;
    2205           0 :                 break;
    2206             :         }
    2207             : 
    2208       17353 :         if (dce_call->fault_code != 0) {
    2209           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    2210             :         }
    2211             : 
    2212       17353 :         return NT_STATUS_OK;
    2213             : }
    2214             : 
    2215       17353 : NTSTATUS lsarpc__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
    2216             : {
    2217             :         enum ndr_err_code ndr_err;
    2218       17353 :         uint16_t opnum = dce_call->pkt.u.request.opnum;
    2219             : 
    2220       17353 :         ndr_err = ndr_table_lsarpc.calls[opnum].ndr_push(push, NDR_OUT, r);
    2221       17353 :         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
    2222           0 :                 dce_call->fault_code = DCERPC_FAULT_NDR;
    2223           0 :                 return NT_STATUS_NET_WRITE_FAULT;
    2224             :         }
    2225             : 
    2226       17353 :         return NT_STATUS_OK;
    2227             : }
    2228             : 
    2229           0 : NTSTATUS lsarpc__op_local(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
    2230             : {
    2231           0 :         return lsarpc__op_dispatch_internal(dce_call, mem_ctx, r, S3COMPAT_RPC_DISPATCH_INTERNAL);
    2232             : }
    2233             : 
    2234             : static const struct dcesrv_interface dcesrv_lsarpc_interface = {
    2235             :         .name      = "lsarpc",
    2236             :         .syntax_id = {{0x12345778,0x1234,0xabcd,{0xef,0x00},{0x01,0x23,0x45,0x67,0x89,0xab}},0.0},
    2237             :         .bind      = lsarpc__op_bind,
    2238             :         .unbind    = lsarpc__op_unbind,
    2239             :         .ndr_pull  = lsarpc__op_ndr_pull,
    2240             :         .dispatch  = lsarpc__op_dispatch,
    2241             :         .reply     = lsarpc__op_reply,
    2242             :         .ndr_push  = lsarpc__op_ndr_push,
    2243             :         .local     = lsarpc__op_local,
    2244             : #ifdef DCESRV_INTERFACE_LSARPC_FLAGS
    2245             :         .flags     = DCESRV_INTERFACE_LSARPC_FLAGS
    2246             : #else
    2247             :         .flags     = 0
    2248             : #endif
    2249             : };
    2250             : 
    2251         404 : static NTSTATUS lsarpc__check_register_in_endpoint(const char *name, struct dcerpc_binding *binding) {
    2252         404 :         enum dcerpc_transport_t transport = dcerpc_binding_get_transport(binding);
    2253             :         NTSTATUS status;
    2254             : 
    2255             :         /* If service is disabled, do not register */
    2256         404 :         if (rpc_service_mode(name) == RPC_SERVICE_MODE_DISABLED) {
    2257           0 :                 return NT_STATUS_NOT_IMPLEMENTED;
    2258             :         }
    2259             : 
    2260             :         /* If service is embedded, register only for ncacn_np
    2261             :          * see 8466b3c85e4b835e57e41776853093f4a0edc8b8
    2262             :          */
    2263         404 :         if (rpc_service_mode(name) == RPC_SERVICE_MODE_EMBEDDED && (transport != NCACN_NP && transport != NCALRPC)) {
    2264          31 :                 DBG_INFO("Interface 'lsarpc' not registered in endpoint '%s' as service is embedded\n", name);
    2265          31 :                 return NT_STATUS_NOT_SUPPORTED;
    2266             :         }
    2267             : 
    2268             :         /*
    2269             :          * If rpc service is external then change the default ncalrpc endpoint,
    2270             :          * otherwise if the rpc daemon running this service is configured in
    2271             :          * fork mode the forked process will race with main smbd to accept the
    2272             :          * connections in the default ncalrpc socket, and the forked process
    2273             :          * may not have the requested interface registered.
    2274             :          * For example, in the ad_member test environment:
    2275             :          *
    2276             :          *   rpc_server:lsarpc = external
    2277             :          *   rpc_server:samr = external
    2278             :          *   rpc_server:netlogon = disabled
    2279             :          *   rpc_daemon:lsasd = fork
    2280             :          *
    2281             :          * With these settings both, the main smbd and all the preforked lsasd
    2282             :          * processes would be listening in the default ncalrpc socket if it is
    2283             :          * not changed. If a client connection is accepted by one of the lsasd
    2284             :          * worker processes and the client asks for an interface not registered
    2285             :          * in these processes (winreg for example) it will get an error.
    2286             :          */
    2287         373 :         if (rpc_service_mode(name) == RPC_SERVICE_MODE_EXTERNAL && transport == NCALRPC) {
    2288          70 :                 status = dcerpc_binding_set_string_option(binding, "endpoint", "LSARPC");
    2289          70 :                 if (!NT_STATUS_IS_OK(status)) {
    2290           0 :                         return status;
    2291             :                 }
    2292             :         }
    2293             : 
    2294         373 :         return NT_STATUS_OK;
    2295             : }
    2296             : 
    2297         101 : static NTSTATUS lsarpc__op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    2298             : {
    2299             :         uint32_t i;
    2300             :         NTSTATUS ret;
    2301             :         struct dcerpc_binding *binding;
    2302         101 :         struct dcerpc_binding *binding2 = NULL;
    2303             : 
    2304             : #ifdef DCESRV_INTERFACE_LSARPC_NCACN_NP_SECONDARY_ENDPOINT
    2305         101 :         const char *ncacn_np_secondary_endpoint = DCESRV_INTERFACE_LSARPC_NCACN_NP_SECONDARY_ENDPOINT;
    2306             : #else
    2307             :         const char *ncacn_np_secondary_endpoint = NULL;
    2308             : #endif
    2309             : 
    2310         505 :         for (i=0;i<ndr_table_lsarpc.endpoints->count;i++) {
    2311         404 :                 const char *name = ndr_table_lsarpc.endpoints->names[i];
    2312             : 
    2313         404 :                 ret = dcerpc_parse_binding(dce_ctx, name, &binding);
    2314         404 :                 if (NT_STATUS_IS_ERR(ret)) {
    2315           0 :                         DBG_ERR("Failed to parse binding string '%s'\n", name);
    2316           0 :                         return ret;
    2317             :                 }
    2318             : 
    2319         404 :                 ret = lsarpc__check_register_in_endpoint("lsarpc", binding);
    2320         404 :                 if (NT_STATUS_IS_ERR(ret)) {
    2321          31 :                         talloc_free(binding);
    2322          31 :                         continue;
    2323             :                 }
    2324             : 
    2325         365 :                 if (ncacn_np_secondary_endpoint != NULL) {
    2326         373 :                         ret = dcerpc_parse_binding(dce_ctx, ncacn_np_secondary_endpoint, &binding2);
    2327         373 :                         if (NT_STATUS_IS_ERR(ret)) {
    2328           0 :                                 DBG_ERR("Failed to parse 2nd binding string '%s'\n", ncacn_np_secondary_endpoint);
    2329           0 :                                 TALLOC_FREE(binding);
    2330           0 :                                 return ret;
    2331             :                         }
    2332             :                 }
    2333             : 
    2334         373 :                 ret = dcesrv_interface_register_b(dce_ctx, binding, binding2, &dcesrv_lsarpc_interface, NULL);
    2335         373 :                 TALLOC_FREE(binding);
    2336         373 :                 TALLOC_FREE(binding2);
    2337         373 :                 if (!NT_STATUS_IS_OK(ret)) {
    2338           0 :                         DBG_ERR("Failed to register endpoint '%s'\n",name);
    2339           0 :                         return ret;
    2340             :                 }
    2341             :         }
    2342             : 
    2343         101 :         return NT_STATUS_OK;
    2344             : }
    2345             : 
    2346           0 : static NTSTATUS lsarpc__op_shutdown_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
    2347             : {
    2348           0 :         return NT_STATUS_OK;
    2349             : }
    2350             : 
    2351           0 : static bool lsarpc__op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
    2352             : {
    2353           0 :         if (dcesrv_lsarpc_interface.syntax_id.if_version == if_version && GUID_equal(&dcesrv_lsarpc_interface.syntax_id.uuid, uuid)) {
    2354           0 :                 memcpy(iface,&dcesrv_lsarpc_interface, sizeof(*iface));
    2355           0 :                 return true;
    2356             :         }
    2357             : 
    2358           0 :         return false;
    2359             : }
    2360             : 
    2361           0 : static bool lsarpc__op_interface_by_name(struct dcesrv_interface *iface, const char *name)
    2362             : {
    2363           0 :         if (strcmp(dcesrv_lsarpc_interface.name, name)==0) {
    2364           0 :                 memcpy(iface, &dcesrv_lsarpc_interface, sizeof(*iface));
    2365           0 :                 return true;
    2366             :         }
    2367             : 
    2368           0 :         return false;
    2369             : }
    2370             : 
    2371             : static const struct dcesrv_endpoint_server lsarpc_ep_server = {
    2372             :         /* fill in our name */
    2373             :         .name = "lsarpc",
    2374             : 
    2375             :         /* Initialization flag */
    2376             :         .initialized = false,
    2377             : 
    2378             :         /* fill in all the operations */
    2379             : #ifdef DCESRV_INTERFACE_LSARPC_INIT_SERVER
    2380             :         .init_server = DCESRV_INTERFACE_LSARPC_INIT_SERVER,
    2381             : #else
    2382             :         .init_server = lsarpc__op_init_server,
    2383             : #endif
    2384             : #ifdef DCESRV_INTERFACE_LSARPC_SHUTDOWN_SERVER
    2385             :         .shutdown_server = DCESRV_INTERFACE_LSARPC_SHUTDOWN_SERVER,
    2386             : #else
    2387             :         .shutdown_server = lsarpc__op_shutdown_server,
    2388             : #endif
    2389             :         .interface_by_uuid = lsarpc__op_interface_by_uuid,
    2390             :         .interface_by_name = lsarpc__op_interface_by_name
    2391             : };
    2392             : 
    2393         142 : const struct dcesrv_endpoint_server *lsarpc_get_ep_server(void)
    2394             : {
    2395         142 :         return &lsarpc_ep_server;
    2396             : }

Generated by: LCOV version 1.13