diff options
-rw-r--r-- | source3/include/proto.h | 10 | ||||
-rw-r--r-- | source3/include/rpc_svcctl.h | 28 | ||||
-rw-r--r-- | source3/rpc_client/cli_svcctl.c | 67 | ||||
-rw-r--r-- | source3/rpc_parse/parse_svcctl.c | 129 |
4 files changed, 0 insertions, 234 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 96b2e26d30..ff79803a31 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5453,10 +5453,6 @@ WERROR rpccli_spoolss_rffpcnex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, /* The following definitions come from rpc_client/cli_svcctl.c */ -WERROR rpccli_svcctl_enumerate_services( struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - POLICY_HND *hSCM, uint32 type, uint32 state, - uint32 *returned, ENUM_SERVICES_STATUS **service_array ); - /* The following definitions come from rpc_client/init_lsa.c */ void init_lsa_String(struct lsa_String *name, const char *s); @@ -6156,11 +6152,6 @@ bool convert_port_data_1( NT_PORT_DATA_1 *port1, RPC_BUFFER *buf ) ; /* The following definitions come from rpc_parse/parse_svcctl.c */ -bool svcctl_io_enum_services_status( const char *desc, ENUM_SERVICES_STATUS *enum_status, RPC_BUFFER *buffer, int depth ); -uint32 svcctl_sizeof_enum_services_status( ENUM_SERVICES_STATUS *status ); -bool svcctl_io_q_enum_services_status(const char *desc, SVCCTL_Q_ENUM_SERVICES_STATUS *q_u, prs_struct *ps, int depth); -bool svcctl_io_r_enum_services_status(const char *desc, SVCCTL_R_ENUM_SERVICES_STATUS *r_u, prs_struct *ps, int depth); - /* The following definitions come from rpc_server/srv_eventlog.c */ NTSTATUS rpc_eventlog2_init(void); @@ -6398,7 +6389,6 @@ NTSTATUS rpc_svcctl2_init(void); /* The following definitions come from rpc_server/srv_svcctl_nt.c */ bool init_service_op_table( void ); -WERROR _svcctl_enum_services_status(pipes_struct *p, SVCCTL_Q_ENUM_SERVICES_STATUS *q_u, SVCCTL_R_ENUM_SERVICES_STATUS *r_u); /* The following definitions come from rpcclient/cmd_dfs.c */ diff --git a/source3/include/rpc_svcctl.h b/source3/include/rpc_svcctl.h index b12cecb56c..9b5859b07a 100644 --- a/source3/include/rpc_svcctl.h +++ b/source3/include/rpc_svcctl.h @@ -45,33 +45,5 @@ #define SVCCTL_OPEN_SCMANAGER_A 0x1b */ -/* utility structures for RPCs */ - -typedef struct { - UNISTR servicename; - UNISTR displayname; - struct SERVICE_STATUS status; -} ENUM_SERVICES_STATUS; - -/* rpc structures */ - -/**************************/ - -typedef struct { - POLICY_HND handle; - uint32 type; - uint32 state; - uint32 buffer_size; - uint32 *resume; -} SVCCTL_Q_ENUM_SERVICES_STATUS; - -typedef struct { - RPC_BUFFER buffer; - uint32 needed; - uint32 returned; - uint32 *resume; - WERROR status; -} SVCCTL_R_ENUM_SERVICES_STATUS; - #endif /* _RPC_SVCCTL_H */ diff --git a/source3/rpc_client/cli_svcctl.c b/source3/rpc_client/cli_svcctl.c index 51678083d3..360fbc7b89 100644 --- a/source3/rpc_client/cli_svcctl.c +++ b/source3/rpc_client/cli_svcctl.c @@ -23,70 +23,3 @@ /******************************************************************* *******************************************************************/ - -WERROR rpccli_svcctl_enumerate_services( struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - POLICY_HND *hSCM, uint32 type, uint32 state, - uint32 *returned, ENUM_SERVICES_STATUS **service_array ) -{ - SVCCTL_Q_ENUM_SERVICES_STATUS in; - SVCCTL_R_ENUM_SERVICES_STATUS out; - prs_struct qbuf, rbuf; - uint32 resume = 0; - ENUM_SERVICES_STATUS *services; - int i; - - ZERO_STRUCT(in); - ZERO_STRUCT(out); - - /* setup the request */ - - memcpy( &in.handle, hSCM, sizeof(POLICY_HND) ); - - in.type = type; - in.state = state; - in.resume = &resume; - - /* first time is to get the buffer size */ - in.buffer_size = 0; - - CLI_DO_RPC_WERR( cli, mem_ctx, &ndr_table_svcctl.syntax_id, SVCCTL_ENUM_SERVICES_STATUS_W, - in, out, - qbuf, rbuf, - svcctl_io_q_enum_services_status, - svcctl_io_r_enum_services_status, - WERR_GENERAL_FAILURE ); - - /* second time with correct buffer size...should be ok */ - - if ( W_ERROR_EQUAL( out.status, WERR_MORE_DATA ) ) { - in.buffer_size = out.needed; - - CLI_DO_RPC_WERR( cli, mem_ctx, &ndr_table_svcctl.syntax_id, - SVCCTL_ENUM_SERVICES_STATUS_W, - in, out, - qbuf, rbuf, - svcctl_io_q_enum_services_status, - svcctl_io_r_enum_services_status, - WERR_GENERAL_FAILURE ); - } - - if ( !W_ERROR_IS_OK(out.status) ) - return out.status; - - /* pull out the data */ - if (out.returned) { - if ( !(services = TALLOC_ARRAY( mem_ctx, ENUM_SERVICES_STATUS, out.returned )) ) - return WERR_NOMEM; - } else { - services = NULL; - } - - for ( i=0; i<out.returned; i++ ) { - svcctl_io_enum_services_status( "", &services[i], &out.buffer, 0 ); - } - - *service_array = services; - *returned = out.returned; - - return out.status; -} diff --git a/source3/rpc_parse/parse_svcctl.c b/source3/rpc_parse/parse_svcctl.c index 022ece60c9..9cf806a73a 100644 --- a/source3/rpc_parse/parse_svcctl.c +++ b/source3/rpc_parse/parse_svcctl.c @@ -24,132 +24,3 @@ /******************************************************************* ********************************************************************/ - -static bool svcctl_io_service_status( const char *desc, struct SERVICE_STATUS *status, prs_struct *ps, int depth ) -{ - - prs_debug(ps, depth, desc, "svcctl_io_service_status"); - depth++; - - if(!prs_uint32("type", ps, depth, &status->type)) - return False; - - if(!prs_uint32("state", ps, depth, &status->state)) - return False; - - if(!prs_uint32("controls_accepted", ps, depth, &status->controls_accepted)) - return False; - - if(!prs_werror("win32_exit_code", ps, depth, &status->win32_exit_code)) - return False; - - if(!prs_uint32("service_exit_code", ps, depth, &status->service_exit_code)) - return False; - - if(!prs_uint32("check_point", ps, depth, &status->check_point)) - return False; - - if(!prs_uint32("wait_hint", ps, depth, &status->wait_hint)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool svcctl_io_enum_services_status( const char *desc, ENUM_SERVICES_STATUS *enum_status, RPC_BUFFER *buffer, int depth ) -{ - prs_struct *ps=&buffer->prs; - - prs_debug(ps, depth, desc, "svcctl_io_enum_services_status"); - depth++; - - if ( !smb_io_relstr("servicename", buffer, depth, &enum_status->servicename) ) - return False; - if ( !smb_io_relstr("displayname", buffer, depth, &enum_status->displayname) ) - return False; - - if ( !svcctl_io_service_status("svc_status", &enum_status->status, ps, depth) ) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -uint32 svcctl_sizeof_enum_services_status( ENUM_SERVICES_STATUS *status ) -{ - uint32 size = 0; - - size += size_of_relative_string( &status->servicename ); - size += size_of_relative_string( &status->displayname ); - size += sizeof(struct SERVICE_STATUS); - - return size; -} - -/******************************************************************* -********************************************************************/ - -bool svcctl_io_q_enum_services_status(const char *desc, SVCCTL_Q_ENUM_SERVICES_STATUS *q_u, prs_struct *ps, int depth) -{ - if (q_u == NULL) - return False; - - prs_debug(ps, depth, desc, "svcctl_io_q_enum_services_status"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("scm_pol", &q_u->handle, ps, depth)) - return False; - - if(!prs_uint32("type", ps, depth, &q_u->type)) - return False; - if(!prs_uint32("state", ps, depth, &q_u->state)) - return False; - if(!prs_uint32("buffer_size", ps, depth, &q_u->buffer_size)) - return False; - - if(!prs_pointer("resume", ps, depth, (void*)&q_u->resume, sizeof(uint32), (PRS_POINTER_CAST)prs_uint32)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool svcctl_io_r_enum_services_status(const char *desc, SVCCTL_R_ENUM_SERVICES_STATUS *r_u, prs_struct *ps, int depth) -{ - if (r_u == NULL) - return False; - - prs_debug(ps, depth, desc, "svcctl_io_r_enum_services_status"); - depth++; - - if(!prs_align(ps)) - return False; - - if (!prs_rpcbuffer("", ps, depth, &r_u->buffer)) - return False; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("needed", ps, depth, &r_u->needed)) - return False; - if(!prs_uint32("returned", ps, depth, &r_u->returned)) - return False; - - if(!prs_pointer("resume", ps, depth, (void*)&r_u->resume, sizeof(uint32), (PRS_POINTER_CAST)prs_uint32)) - return False; - - if(!prs_werror("status", ps, depth, &r_u->status)) - return False; - - return True; -} |