Use pidl for _svcctl_OpenSCManagerW().
authorGünther Deschner <gd@samba.org>
Mon, 18 Feb 2008 10:55:31 +0000 (11:55 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 18 Feb 2008 10:55:31 +0000 (11:55 +0100)
Guenther

source/rpc_server/srv_svcctl.c
source/rpc_server/srv_svcctl_nt.c

index ce81a242027d1a2df05fa952c019d9be3ea3337b..ba939ac11a405d5136d0ecaad794ca1957abb2a5 100644 (file)
@@ -53,23 +53,7 @@ static bool api_svcctl_close_service(pipes_struct *p)
 
 static bool api_svcctl_open_scmanager(pipes_struct *p)
 {
-       SVCCTL_Q_OPEN_SCMANAGER q_u;
-       SVCCTL_R_OPEN_SCMANAGER r_u;
-       prs_struct *data = &p->in_data.data;
-       prs_struct *rdata = &p->out_data.rdata;
-
-       ZERO_STRUCT(q_u);
-       ZERO_STRUCT(r_u);
-
-       if(!svcctl_io_q_open_scmanager("", &q_u, data, 0))
-               return False;
-
-       r_u.status = _svcctl_open_scmanager(p, &q_u, &r_u);
-
-       if(!svcctl_io_r_open_scmanager("", &r_u, rdata, 0))
-               return False;
-
-       return True;
+       return proxy_svcctl_call(p, NDR_SVCCTL_OPENSCMANAGERW);
 }
 
 /*******************************************************************
index 11b7ab6ca2101d660b084acaf23cb048f3afe695..459def11c7efcb507602a28826083ff87f2e3c64 100644 (file)
@@ -263,7 +263,8 @@ done:
 /********************************************************************
 ********************************************************************/
 
-WERROR _svcctl_open_scmanager(pipes_struct *p, SVCCTL_Q_OPEN_SCMANAGER *q_u, SVCCTL_R_OPEN_SCMANAGER *r_u)
+WERROR _svcctl_OpenSCManagerW(pipes_struct *p,
+                             struct svcctl_OpenSCManagerW *r)
 {
        SEC_DESC *sec_desc;
        uint32 access_granted = 0;
@@ -274,12 +275,12 @@ WERROR _svcctl_open_scmanager(pipes_struct *p, SVCCTL_Q_OPEN_SCMANAGER *q_u, SVC
        if ( !(sec_desc = construct_scm_sd( p->mem_ctx )) )
                return WERR_NOMEM;
 
-       se_map_generic( &q_u->access, &scm_generic_map );
-       status = svcctl_access_check( sec_desc, p->pipe_user.nt_user_token, q_u->access, &access_granted );
+       se_map_generic( &r->in.access_mask, &scm_generic_map );
+       status = svcctl_access_check( sec_desc, p->pipe_user.nt_user_token, r->in.access_mask, &access_granted );
        if ( !NT_STATUS_IS_OK(status) )
                return ntstatus_to_werror( status );
 
-       return create_open_service_handle( p, &r_u->handle, SVC_HANDLE_IS_SCM, NULL, access_granted );
+       return create_open_service_handle( p, r->out.handle, SVC_HANDLE_IS_SCM, NULL, access_granted );
 }
 
 /********************************************************************
@@ -964,12 +965,6 @@ WERROR _svcctl_EnumServicesStatusW(pipes_struct *p, struct svcctl_EnumServicesSt
        return WERR_NOT_SUPPORTED;
 }
 
-WERROR _svcctl_OpenSCManagerW(pipes_struct *p, struct svcctl_OpenSCManagerW *r)
-{
-       p->rng_fault_state = True;
-       return WERR_NOT_SUPPORTED;
-}
-
 WERROR _svcctl_OpenServiceW(pipes_struct *p, struct svcctl_OpenServiceW *r)
 {
        p->rng_fault_state = True;