diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/printing/nt_printing.c | 29 |
2 files changed, 25 insertions, 6 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 4afe952705..073a0dc989 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4888,6 +4888,8 @@ WERROR get_a_printer_search( Printer_entry *print_hnd, uint32 level, const char *sharename); uint32 free_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level); +bool driver_info_ctr_to_info8(struct spoolss_AddDriverInfoCtr *r, + struct spoolss_DriverInfo8 *_info8); uint32_t add_a_printer_driver(TALLOC_CTX *mem_ctx, struct spoolss_AddDriverInfoCtr *r, char **driver_name, diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 56f5d18691..ba667c3251 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -4660,17 +4660,13 @@ uint32 free_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level) /**************************************************************************** ****************************************************************************/ -uint32_t add_a_printer_driver(TALLOC_CTX *mem_ctx, - struct spoolss_AddDriverInfoCtr *r, - char **driver_name, - uint32_t *version) +bool driver_info_ctr_to_info8(struct spoolss_AddDriverInfoCtr *r, + struct spoolss_DriverInfo8 *_info8) { struct spoolss_DriverInfo8 info8; ZERO_STRUCT(info8); - DEBUG(10,("adding a printer at level [%d]\n", r->level)); - switch (r->level) { case 3: info8.version = r->info.info3->version; @@ -4742,6 +4738,27 @@ uint32_t add_a_printer_driver(TALLOC_CTX *mem_ctx, info8.min_inbox_driver_ver_version = r->info.info8->min_inbox_driver_ver_version; break; default: + return false; + } + + *_info8 = info8; + + return true; +} + + +uint32_t add_a_printer_driver(TALLOC_CTX *mem_ctx, + struct spoolss_AddDriverInfoCtr *r, + char **driver_name, + uint32_t *version) +{ + struct spoolss_DriverInfo8 info8; + + ZERO_STRUCT(info8); + + DEBUG(10,("adding a printer at level [%d]\n", r->level)); + + if (!driver_info_ctr_to_info8(r, &info8)) { return -1; } |