diff options
-rw-r--r-- | source3/include/proto.h | 6 | ||||
-rw-r--r-- | source3/include/rpc_spoolss.h | 16 | ||||
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 185 |
3 files changed, 0 insertions, 207 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 6f9fce4156..3806c9657e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5964,12 +5964,6 @@ bool make_spoolss_driver_info_3(TALLOC_CTX *mem_ctx, bool make_spoolss_buffer5(TALLOC_CTX *mem_ctx, BUFFER5 *buf5, uint32 len, uint16 *src); bool spoolss_io_q_addprinterdriver(const char *desc, SPOOL_Q_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth); bool spoolss_io_r_addprinterdriver(const char *desc, SPOOL_R_ADDPRINTERDRIVER *q_u, prs_struct *ps, int depth); -bool spoolss_io_q_addprinterdriverex(const char *desc, SPOOL_Q_ADDPRINTERDRIVEREX *q_u, prs_struct *ps, int depth); -bool spoolss_io_r_addprinterdriverex(const char *desc, SPOOL_R_ADDPRINTERDRIVEREX *q_u, prs_struct *ps, int depth); -bool uni_2_asc_printer_driver_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *uni, - NT_PRINTER_DRIVER_INFO_LEVEL_3 **asc); -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 spoolss_io_r_enumprintprocessors(const char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r_u, prs_struct *ps, int depth); diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index d7d93e3226..99da007d32 100644 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -1178,22 +1178,6 @@ typedef struct spool_r_addprinterdriver } SPOOL_R_ADDPRINTERDRIVER; -typedef struct spool_q_addprinterdriverex -{ - uint32 server_name_ptr; - UNISTR2 server_name; - uint32 level; - SPOOL_PRINTER_DRIVER_INFO_LEVEL info; - uint32 copy_flags; -} -SPOOL_Q_ADDPRINTERDRIVEREX; - -typedef struct spool_r_addprinterdriverex -{ - WERROR status; -} -SPOOL_R_ADDPRINTERDRIVEREX; - typedef struct spool_q_enumprintprocessors { uint32 name_ptr; diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index b798eef455..577ba73a42 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -3859,47 +3859,6 @@ bool spool_io_printer_driver_info_level_6(const char *desc, SPOOL_PRINTER_DRIVER } /******************************************************************* - convert a buffer of UNICODE strings null terminated - the buffer is terminated by a NULL - - convert to an dos codepage array (null terminated) - - dynamically allocate memory - -********************************************************************/ - -static bool uniarray_2_dosarray(BUFFER5 *buf5, fstring **ar) -{ - fstring f; - int n = 0; - char *src; - - if (buf5==NULL) - return False; - - src = (char *)buf5->buffer; - *ar = SMB_MALLOC_ARRAY(fstring, 1); - if (!*ar) { - return False; - } - - while (src < ((char *)buf5->buffer) + buf5->buf_len*2) { - rpcstr_pull(f, src, sizeof(f)-1, -1, STR_TERMINATE); - src = skip_unibuf(src, 2*buf5->buf_len - PTR_DIFF(src,buf5->buffer)); - *ar = SMB_REALLOC_ARRAY(*ar, fstring, n+2); - if (!*ar) { - return False; - } - fstrcpy((*ar)[n], f); - n++; - } - - fstrcpy((*ar)[n], ""); - - return True; -} - -/******************************************************************* read a UNICODE array with null terminated strings and null terminated array and size of array at beginning @@ -4125,152 +4084,8 @@ bool spoolss_io_r_addprinterdriver(const char *desc, SPOOL_R_ADDPRINTERDRIVER *q } /******************************************************************* - fill in the prs_struct for a ADDPRINTERDRIVER request PDU ********************************************************************/ -bool spoolss_io_q_addprinterdriverex(const char *desc, SPOOL_Q_ADDPRINTERDRIVEREX *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_q_addprinterdriverex"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("server_name_ptr", ps, depth, &q_u->server_name_ptr)) - return False; - if(!smb_io_unistr2("server_name", &q_u->server_name, q_u->server_name_ptr, ps, depth)) - return False; - - if(!prs_align(ps)) - return False; - if(!prs_uint32("info_level", ps, depth, &q_u->level)) - return False; - - if(!spool_io_printer_driver_info_level("", &q_u->info, ps, depth)) - return False; - - if(!prs_align(ps)) - return False; - if(!prs_uint32("copy flags", ps, depth, &q_u->copy_flags)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool spoolss_io_r_addprinterdriverex(const char *desc, SPOOL_R_ADDPRINTERDRIVEREX *q_u, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "spoolss_io_r_addprinterdriverex"); - depth++; - - if(!prs_werror("status", ps, depth, &q_u->status)) - return False; - - return True; -} - -/******************************************************************* -********************************************************************/ - -bool uni_2_asc_printer_driver_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *uni, - NT_PRINTER_DRIVER_INFO_LEVEL_3 **asc) -{ - NT_PRINTER_DRIVER_INFO_LEVEL_3 *d; - - DEBUG(7,("uni_2_asc_printer_driver_3: Converting from UNICODE to ASCII\n")); - - if (*asc==NULL) - { - *asc=SMB_MALLOC_P(NT_PRINTER_DRIVER_INFO_LEVEL_3); - if(*asc == NULL) - return False; - ZERO_STRUCTP(*asc); - } - - d=*asc; - - d->cversion=uni->cversion; - - unistr2_to_ascii(d->name, &uni->name, sizeof(d->name)); - unistr2_to_ascii(d->environment, &uni->environment, sizeof(d->environment)); - unistr2_to_ascii(d->driverpath, &uni->driverpath, sizeof(d->driverpath)); - unistr2_to_ascii(d->datafile, &uni->datafile, sizeof(d->datafile)); - unistr2_to_ascii(d->configfile, &uni->configfile, sizeof(d->configfile)); - unistr2_to_ascii(d->helpfile, &uni->helpfile, sizeof(d->helpfile)); - unistr2_to_ascii(d->monitorname, &uni->monitorname, sizeof(d->monitorname)); - unistr2_to_ascii(d->defaultdatatype, &uni->defaultdatatype, sizeof(d->defaultdatatype)); - - DEBUGADD(8,( "version: %d\n", d->cversion)); - DEBUGADD(8,( "name: %s\n", d->name)); - DEBUGADD(8,( "environment: %s\n", d->environment)); - DEBUGADD(8,( "driverpath: %s\n", d->driverpath)); - DEBUGADD(8,( "datafile: %s\n", d->datafile)); - DEBUGADD(8,( "configfile: %s\n", d->configfile)); - DEBUGADD(8,( "helpfile: %s\n", d->helpfile)); - DEBUGADD(8,( "monitorname: %s\n", d->monitorname)); - DEBUGADD(8,( "defaultdatatype: %s\n", d->defaultdatatype)); - - if (uniarray_2_dosarray(&uni->dependentfiles, &d->dependentfiles )) - return True; - - SAFE_FREE(*asc); - return False; -} - -/******************************************************************* -********************************************************************/ -bool uni_2_asc_printer_driver_6(SPOOL_PRINTER_DRIVER_INFO_LEVEL_6 *uni, - NT_PRINTER_DRIVER_INFO_LEVEL_6 **asc) -{ - NT_PRINTER_DRIVER_INFO_LEVEL_6 *d; - - DEBUG(7,("uni_2_asc_printer_driver_6: Converting from UNICODE to ASCII\n")); - - if (*asc==NULL) - { - *asc=SMB_MALLOC_P(NT_PRINTER_DRIVER_INFO_LEVEL_6); - if(*asc == NULL) - return False; - ZERO_STRUCTP(*asc); - } - - d=*asc; - - d->version=uni->version; - - unistr2_to_ascii(d->name, &uni->name, sizeof(d->name)); - unistr2_to_ascii(d->environment, &uni->environment, sizeof(d->environment)); - unistr2_to_ascii(d->driverpath, &uni->driverpath, sizeof(d->driverpath)); - unistr2_to_ascii(d->datafile, &uni->datafile, sizeof(d->datafile)); - unistr2_to_ascii(d->configfile, &uni->configfile, sizeof(d->configfile)); - unistr2_to_ascii(d->helpfile, &uni->helpfile, sizeof(d->helpfile)); - unistr2_to_ascii(d->monitorname, &uni->monitorname, sizeof(d->monitorname)); - unistr2_to_ascii(d->defaultdatatype, &uni->defaultdatatype, sizeof(d->defaultdatatype)); - - DEBUGADD(8,( "version: %d\n", d->version)); - DEBUGADD(8,( "name: %s\n", d->name)); - DEBUGADD(8,( "environment: %s\n", d->environment)); - DEBUGADD(8,( "driverpath: %s\n", d->driverpath)); - DEBUGADD(8,( "datafile: %s\n", d->datafile)); - DEBUGADD(8,( "configfile: %s\n", d->configfile)); - DEBUGADD(8,( "helpfile: %s\n", d->helpfile)); - DEBUGADD(8,( "monitorname: %s\n", d->monitorname)); - DEBUGADD(8,( "defaultdatatype: %s\n", d->defaultdatatype)); - - if (!uniarray_2_dosarray(&uni->dependentfiles, &d->dependentfiles )) - goto error; - if (!uniarray_2_dosarray(&uni->previousnames, &d->previousnames )) - goto error; - - return True; - -error: - SAFE_FREE(*asc); - return False; -} - bool uni_2_asc_printer_info_2(const SPOOL_PRINTER_INFO_LEVEL_2 *uni, NT_PRINTER_INFO_LEVEL_2 *d) { |