From 6928c5ce47e2ba37f844d030aa06f6b78c6ad64b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 9 Mar 2009 18:18:35 +0100 Subject: s3-spoolss: remove old rpccli_spoolss_enumprinterdrivers wrapper. Guenther --- source3/include/proto.h | 10 --- source3/rpc_client/cli_spoolss.c | 178 -------------------------------------- source3/rpc_parse/parse_spoolss.c | 20 ----- 3 files changed, 208 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index 1aa59cb9a8..5eac7afda3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5526,11 +5526,6 @@ WERROR rpccli_spoolss_enumprinterdrivers(struct rpc_pipe_client *cli, WERROR rpccli_spoolss_enum_printers(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, char *name, uint32 flags, uint32 level, uint32 *num_printers, PRINTER_INFO_CTR *ctr); -WERROR rpccli_spoolss_enumprinterdrivers (struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32 level, const char *env, - uint32 *num_drivers, - PRINTER_DRIVER_CTR *ctr); WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, const char *valuename, REGISTRY_VALUE *value); @@ -5880,11 +5875,6 @@ bool spoolss_io_r_enumprinters(const char *desc, SPOOL_R_ENUMPRINTERS *r_u, prs_ bool spoolss_io_r_getprinter(const char *desc, SPOOL_R_GETPRINTER *r_u, prs_struct *ps, int depth); bool spoolss_io_q_getprinter(const char *desc, SPOOL_Q_GETPRINTER *q_u, prs_struct *ps, int depth); bool spoolss_io_r_enumprinterdrivers(const char *desc, SPOOL_R_ENUMPRINTERDRIVERS *r_u, prs_struct *ps, int depth); -bool make_spoolss_q_enumprinterdrivers(SPOOL_Q_ENUMPRINTERDRIVERS *q_u, - const char *name, - const char *environment, - uint32 level, - RPC_BUFFER *buffer, uint32 offered); bool spoolss_io_q_enumprinterdrivers(const char *desc, SPOOL_Q_ENUMPRINTERDRIVERS *q_u, prs_struct *ps, int depth); bool make_spoolss_buffer5(TALLOC_CTX *mem_ctx, BUFFER5 *buf5, uint32 len, uint16 *src); bool spoolss_io_r_enumprinterdata(const char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_struct *ps, int depth); diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index 13ba499cdd..fa70cd8aad 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -786,99 +786,6 @@ static bool decode_printer_info_3(TALLOC_CTX *mem_ctx, RPC_BUFFER *buffer, /********************************************************************** **********************************************************************/ -static bool decode_printer_driver_1(TALLOC_CTX *mem_ctx, RPC_BUFFER *buffer, - uint32 returned, DRIVER_INFO_1 **info) -{ - uint32 i; - DRIVER_INFO_1 *inf; - - if (returned) { - inf=TALLOC_ARRAY(mem_ctx, DRIVER_INFO_1, returned); - if (!inf) { - return False; - } - memset(inf, 0, returned*sizeof(DRIVER_INFO_1)); - } else { - inf = NULL; - } - - prs_set_offset(&buffer->prs,0); - - for (i=0; iprs,0); - - for (i=0; iprs,0); - - for (i=0; idesthost); - strupper_m(server); - - offered = 0; - if (!rpcbuf_init(&buffer, offered, mem_ctx)) - return WERR_NOMEM; - make_spoolss_q_enumprinterdrivers( &in, server, env, level, - &buffer, offered); - - CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_ENUMPRINTERDRIVERS, - in, out, - qbuf, rbuf, - spoolss_io_q_enumprinterdrivers, - spoolss_io_r_enumprinterdrivers, - WERR_GENERAL_FAILURE ); - - if ( W_ERROR_EQUAL( out.status, WERR_INSUFFICIENT_BUFFER ) ) { - offered = out.needed; - - ZERO_STRUCT(in); - ZERO_STRUCT(out); - - if (!rpcbuf_init(&buffer, offered, mem_ctx)) - return WERR_NOMEM; - make_spoolss_q_enumprinterdrivers( &in, server, env, level, - &buffer, offered); - - CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_ENUMPRINTERDRIVERS, - in, out, - qbuf, rbuf, - spoolss_io_q_enumprinterdrivers, - spoolss_io_r_enumprinterdrivers, - WERR_GENERAL_FAILURE ); - } - - *num_drivers = out.returned; - - if ( !W_ERROR_IS_OK(out.status) ) - return out.status; - - if ( out.returned ) { - - switch (level) { - case 1: - if (!decode_printer_driver_1(mem_ctx, out.buffer, out.returned, &ctr->info1)) { - return WERR_GENERAL_FAILURE; - } - break; - case 2: - if (!decode_printer_driver_2(mem_ctx, out.buffer, out.returned, &ctr->info2)) { - return WERR_GENERAL_FAILURE; - } - break; - case 3: - if (!decode_printer_driver_3(mem_ctx, out.buffer, out.returned, &ctr->info3)) { - return WERR_GENERAL_FAILURE; - } - break; - default: - return WERR_UNKNOWN_LEVEL; - } - } - - return out.status; -} - -/********************************************************************** -**********************************************************************/ - WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, const char *valuename, REGISTRY_VALUE *value) diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 1b47dbea3f..522c4ddbda 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -1529,26 +1529,6 @@ bool spoolss_io_r_enumprinterdrivers(const char *desc, SPOOL_R_ENUMPRINTERDRIVER return True; } -/******************************************************************* - * init a structure. - ********************************************************************/ - -bool make_spoolss_q_enumprinterdrivers(SPOOL_Q_ENUMPRINTERDRIVERS *q_u, - const char *name, - const char *environment, - uint32 level, - RPC_BUFFER *buffer, uint32 offered) -{ - init_buf_unistr2(&q_u->name, &q_u->name_ptr, name); - init_buf_unistr2(&q_u->environment, &q_u->environment_ptr, environment); - - q_u->level=level; - q_u->buffer=buffer; - q_u->offered=offered; - - return True; -} - /******************************************************************* Parse a SPOOL_Q_ENUMPRINTERDRIVERS structure. ********************************************************************/ -- cgit