summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c29
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;
}