diff options
author | Simo Sorce <idra@samba.org> | 2010-04-14 20:46:55 -0400 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-23 16:23:49 +0200 |
commit | 8f56cdfaee571a5b4bb735290dfd668ef8c4d730 (patch) | |
tree | e76f5741d98505ddd28373fb35c7ae893cbf355a /source3/printing | |
parent | 94a8482261526c7bb3ae15194bf3939978b324b6 (diff) | |
download | samba-8f56cdfaee571a5b4bb735290dfd668ef8c4d730.tar.gz samba-8f56cdfaee571a5b4bb735290dfd668ef8c4d730.tar.bz2 samba-8f56cdfaee571a5b4bb735290dfd668ef8c4d730.zip |
s3-spoolss: Move info_ctr conversion to a public helper.
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/nt_printing.c | 29 |
1 files changed, 23 insertions, 6 deletions
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; } |