s3-spoolss: remove old spoolss_GetPrinterDriverDirectory.
authorGünther Deschner <gd@samba.org>
Thu, 19 Feb 2009 00:59:57 +0000 (01:59 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 19 Feb 2009 01:07:58 +0000 (02:07 +0100)
Guenther

source3/include/proto.h
source3/include/rpc_spoolss.h
source3/rpc_client/cli_spoolss.c
source3/rpc_parse/parse_spoolss.c

index 1972250843f9a5c56347ffe3d46f3b43baeac5bb..80db935967dc32763b28bc0761f6eef60169c6a4 100644 (file)
@@ -5492,10 +5492,6 @@ WERROR rpccli_spoolss_enumprinterdrivers (struct rpc_pipe_client *cli,
                                       uint32 level, const char *env,
                                       uint32 *num_drivers,
                                       PRINTER_DRIVER_CTR *ctr);
-WERROR rpccli_spoolss_getprinterdriverdir (struct rpc_pipe_client *cli, 
-                                       TALLOC_CTX *mem_ctx,
-                                       uint32 level, char *env,
-                                       DRIVER_DIRECTORY_CTR *ctr);
 WERROR rpccli_spoolss_addprinterdriver (struct rpc_pipe_client *cli, 
                                     TALLOC_CTX *mem_ctx, uint32 level,
                                     PRINTER_DRIVER_CTR *ctr);
@@ -5866,7 +5862,6 @@ bool smb_io_printer_driver_info_6(const char *desc, RPC_BUFFER *buffer, DRIVER_I
 bool smb_io_job_info_1(const char *desc, RPC_BUFFER *buffer, JOB_INFO_1 *info, int depth);
 bool smb_io_job_info_2(const char *desc, RPC_BUFFER *buffer, JOB_INFO_2 *info, int depth);
 bool smb_io_form_1(const char *desc, RPC_BUFFER *buffer, FORM_1 *info, int depth);
-bool smb_io_driverdir_1(const char *desc, RPC_BUFFER *buffer, DRIVER_DIRECTORY_1 *info, int depth);
 bool smb_io_port_1(const char *desc, RPC_BUFFER *buffer, PORT_INFO_1 *info, int depth);
 bool smb_io_port_2(const char *desc, RPC_BUFFER *buffer, PORT_INFO_2 *info, int depth);
 bool smb_io_printprocessor_info_1(const char *desc, RPC_BUFFER *buffer, PRINTPROCESSOR_1 *info, int depth);
@@ -5890,7 +5885,6 @@ uint32 spoolss_size_job_info_1(JOB_INFO_1 *info);
 uint32 spoolss_size_job_info_2(JOB_INFO_2 *info);
 uint32 spoolss_size_form_1(FORM_1 *info);
 uint32 spoolss_size_port_info_1(PORT_INFO_1 *info);
-uint32 spoolss_size_driverdir_info_1(DRIVER_DIRECTORY_1 *info);
 uint32 spoolss_size_printprocessordirectory_info_1(PRINTPROCESSOR_DIRECTORY_1 *info);
 uint32 spoolss_size_port_info_2(PORT_INFO_2 *info);
 uint32 spoolss_size_printprocessor_info_1(PRINTPROCESSOR_1 *info);
@@ -5983,11 +5977,6 @@ bool uni_2_asc_printer_driver_6(SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *uni,
                                 NT_PRINTER_DRIVER_INFO_LEVEL_6 **asc);
 bool uni_2_asc_printer_info_2(const SPOOL_PRINTER_INFO_LEVEL_2 *uni,
                               NT_PRINTER_INFO_LEVEL_2  *d);
-bool make_spoolss_q_getprinterdriverdir(SPOOL_Q_GETPRINTERDRIVERDIR *q_u,
-                                fstring servername, fstring env_name, uint32 level,
-                                RPC_BUFFER *buffer, uint32 offered);
-bool spoolss_io_q_getprinterdriverdir(const char *desc, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, prs_struct *ps, int depth);
-bool spoolss_io_r_getprinterdriverdir(const char *desc, SPOOL_R_GETPRINTERDRIVERDIR *r_u, prs_struct *ps, int depth);
 bool spoolss_io_r_enumprintprocessors(const char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r_u, prs_struct *ps, int depth);
 bool spoolss_io_q_enumprintprocessors(const char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, prs_struct *ps, int depth);
 bool spoolss_io_r_enumprintprocdatatypes(const char *desc, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u, prs_struct *ps, int depth);
index 8eb8785bd604b3b2a95eb6d6205c2a96ff50ae55..24a33779aa753b8dbf1c1ef36d89bf3a60936f34 100644 (file)
@@ -1194,39 +1194,6 @@ typedef struct spool_r_addprinterdriverex
 }
 SPOOL_R_ADDPRINTERDRIVEREX;
 
-
-typedef struct driver_directory_1
-{
-       UNISTR name;
-}
-DRIVER_DIRECTORY_1;
-
-typedef struct driver_info_ctr_info
-{
-       DRIVER_DIRECTORY_1 *info1;
-}
-DRIVER_DIRECTORY_CTR;
-
-typedef struct spool_q_getprinterdriverdirectory
-{
-       uint32 name_ptr;
-       UNISTR2 name;
-       uint32 environment_ptr;
-       UNISTR2 environment;
-       uint32 level;
-       RPC_BUFFER *buffer;
-       uint32 offered;
-}
-SPOOL_Q_GETPRINTERDRIVERDIR;
-
-typedef struct spool_r_getprinterdriverdirectory
-{
-       RPC_BUFFER *buffer;
-       uint32 needed;
-       WERROR status;
-}
-SPOOL_R_GETPRINTERDRIVERDIR;
-
 typedef struct spool_q_enumprintprocessors
 {
        uint32 name_ptr;
index 6ecd722113e3eb841efbca4c553e56246da5c00f..23ac6904868e5a18260f7fcdc689069638c9d3ba 100644 (file)
@@ -395,31 +395,6 @@ static bool decode_printer_driver_3(TALLOC_CTX *mem_ctx, RPC_BUFFER *buffer,
 /**********************************************************************
 **********************************************************************/
 
-static bool decode_printerdriverdir_1 (TALLOC_CTX *mem_ctx, RPC_BUFFER *buffer,
-                       uint32 returned, DRIVER_DIRECTORY_1 **info
-)
-{
-       DRIVER_DIRECTORY_1 *inf;
-       inf=TALLOC_P(mem_ctx, DRIVER_DIRECTORY_1);
-       if (!inf) {
-               return False;
-       }
-       memset(inf, 0, sizeof(DRIVER_DIRECTORY_1));
-
-       prs_set_offset(&buffer->prs, 0);
-
-       if (!smb_io_driverdir_1("", buffer, inf, 0)) {
-               return False;
-       }
-       *info=inf;
-       return True;
-}
-
-/**********************************************************************
-**********************************************************************/
-
 static bool decode_jobs_1(TALLOC_CTX *mem_ctx, RPC_BUFFER *buffer, 
                          uint32 num_jobs, JOB_INFO_1 **jobs)
 {
@@ -924,70 +899,6 @@ WERROR rpccli_spoolss_enumprinterdrivers (struct rpc_pipe_client *cli,
        return out.status;
 }
 
-
-/**********************************************************************
-**********************************************************************/
-
-WERROR rpccli_spoolss_getprinterdriverdir (struct rpc_pipe_client *cli, 
-                                       TALLOC_CTX *mem_ctx,
-                                       uint32 level, char *env,
-                                       DRIVER_DIRECTORY_CTR *ctr)
-{
-       prs_struct qbuf, rbuf;
-       SPOOL_Q_GETPRINTERDRIVERDIR in;
-        SPOOL_R_GETPRINTERDRIVERDIR out;
-       RPC_BUFFER buffer;
-       fstring server;
-       uint32 offered;
-
-       ZERO_STRUCT(in);
-       ZERO_STRUCT(out);
-
-        slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
-        strupper_m(server);
-
-       offered = 0;
-       if (!rpcbuf_init(&buffer, offered, mem_ctx))
-               return WERR_NOMEM;
-       make_spoolss_q_getprinterdriverdir( &in, server, env, level, 
-               &buffer, offered );
-
-       CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_GETPRINTERDRIVERDIRECTORY,
-                   in, out, 
-                   qbuf, rbuf,
-                   spoolss_io_q_getprinterdriverdir,
-                   spoolss_io_r_getprinterdriverdir, 
-                   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_getprinterdriverdir( &in, server, env, level, 
-                       &buffer, offered );
-
-               CLI_DO_RPC_WERR( cli, mem_ctx, &syntax_spoolss, SPOOLSS_GETPRINTERDRIVERDIRECTORY,
-                           in, out, 
-                           qbuf, rbuf,
-                           spoolss_io_q_getprinterdriverdir,
-                           spoolss_io_r_getprinterdriverdir, 
-                           WERR_GENERAL_FAILURE );
-       }
-       
-       if (!W_ERROR_IS_OK(out.status))
-               return out.status;
-               
-       if (!decode_printerdriverdir_1(mem_ctx, out.buffer, 1, &ctr->info1)) {
-               return WERR_GENERAL_FAILURE;
-       }
-
-       return out.status;
-}
-
 /**********************************************************************
 **********************************************************************/
 
index 2862b550fc3e0ac4afa22fd81989be2fc8c88f19..19738cfd2a40302b8cd4ff07e2173b9bfd6f9186 100644 (file)
@@ -1960,27 +1960,6 @@ bool smb_io_form_1(const char *desc, RPC_BUFFER *buffer, FORM_1 *info, int depth
        return True;
 }
 
-
-
-/*******************************************************************
- Parse a DRIVER_DIRECTORY_1 structure.
-********************************************************************/  
-
-bool smb_io_driverdir_1(const char *desc, RPC_BUFFER *buffer, DRIVER_DIRECTORY_1 *info, int depth)
-{
-       prs_struct *ps=&buffer->prs;
-
-       prs_debug(ps, depth, desc, "smb_io_driverdir_1");
-       depth++;
-
-       buffer->struct_start=prs_offset(ps);
-
-       if (!smb_io_unistr(desc, &info->name, ps, depth))
-               return False;
-
-       return True;
-}
-
 /*******************************************************************
  Parse a PORT_INFO_1 structure.
 ********************************************************************/  
@@ -2493,21 +2472,6 @@ uint32 spoolss_size_port_info_1(PORT_INFO_1 *info)
 return the size required by a struct in the stream
 ********************************************************************/  
 
-uint32 spoolss_size_driverdir_info_1(DRIVER_DIRECTORY_1 *info)
-{
-       int size=0;
-
-       size=str_len_uni(&info->name);  /* the string length       */
-       size=size+1;                    /* add the leading zero    */
-       size=size*2;                    /* convert in char         */
-
-       return size;
-}
-
-/*******************************************************************
-return the size required by a struct in the stream
-********************************************************************/  
-
 uint32 spoolss_size_printprocessordirectory_info_1(PRINTPROCESSOR_DIRECTORY_1 *info)
 {
        int size=0;
@@ -4350,93 +4314,6 @@ bool uni_2_asc_printer_info_2(const SPOOL_PRINTER_INFO_LEVEL_2 *uni,
        return True;
 }
 
-/*******************************************************************
- * init a structure.
- ********************************************************************/
-
-bool make_spoolss_q_getprinterdriverdir(SPOOL_Q_GETPRINTERDRIVERDIR *q_u,
-                                fstring servername, fstring env_name, uint32 level,
-                                RPC_BUFFER *buffer, uint32 offered)
-{
-       init_buf_unistr2(&q_u->name, &q_u->name_ptr, servername);
-       init_buf_unistr2(&q_u->environment, &q_u->environment_ptr, env_name);
-
-       q_u->level=level;
-       q_u->buffer=buffer;
-       q_u->offered=offered;
-
-       return True;
-}
-
-/*******************************************************************
- Parse a SPOOL_Q_GETPRINTERDRIVERDIR structure.
-********************************************************************/  
-
-bool spoolss_io_q_getprinterdriverdir(const char *desc, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, prs_struct *ps, int depth)
-{
-       prs_debug(ps, depth, desc, "spoolss_io_q_getprinterdriverdir");
-       depth++;
-
-       if(!prs_align(ps))
-               return False;
-       if(!prs_uint32("name_ptr", ps, depth, &q_u->name_ptr))
-               return False;
-       if(!smb_io_unistr2("", &q_u->name, q_u->name_ptr, ps, depth))
-               return False;
-
-       if(!prs_align(ps))
-               return False;
-               
-       if(!prs_uint32("", ps, depth, &q_u->environment_ptr))
-               return False;
-       if(!smb_io_unistr2("", &q_u->environment, q_u->environment_ptr, ps, depth))
-               return False;
-               
-       if(!prs_align(ps))
-               return False;
-
-       if(!prs_uint32("level", ps, depth, &q_u->level))
-               return False;
-               
-       if(!prs_rpcbuffer_p("", ps, depth, &q_u->buffer))
-               return False;
-               
-       if(!prs_align(ps))
-               return False;
-               
-       if(!prs_uint32("offered", ps, depth, &q_u->offered))
-               return False;
-
-       return True;
-}
-
-/*******************************************************************
- Parse a SPOOL_R_GETPRINTERDRIVERDIR structure.
-********************************************************************/  
-
-bool spoolss_io_r_getprinterdriverdir(const char *desc, SPOOL_R_GETPRINTERDRIVERDIR *r_u, prs_struct *ps, int depth)
-{              
-       prs_debug(ps, depth, desc, "spoolss_io_r_getprinterdriverdir");
-       depth++;
-
-       if (!prs_align(ps))
-               return False;
-               
-       if (!prs_rpcbuffer_p("", 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_werror("status", ps, depth, &r_u->status))
-               return False;
-
-       return True;            
-}
-
 /*******************************************************************
 ********************************************************************/