s3-spoolss: add support for _spoolss_EnumPrinterDrivers() level 6.
authorGünther Deschner <gd@samba.org>
Mon, 13 Apr 2009 22:01:03 +0000 (00:01 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 17 Apr 2009 15:27:32 +0000 (17:27 +0200)
Guenther

source3/rpc_server/srv_spoolss_nt.c

index 17ddafa038f19a7dc502f7f6b81ba28c1b717e08..251415adcb4731a6b3783666484499f73e4008f3 100644 (file)
@@ -5008,7 +5008,7 @@ static WERROR fill_printer_driver_info6(TALLOC_CTX *mem_ctx,
        } else {
                r->help_file    = talloc_strdup(mem_ctx, "");
        }
-       W_ERROR_HAVE_NO_MEMORY(r->config_file);
+       W_ERROR_HAVE_NO_MEMORY(r->help_file);
 
        r->monitor_name         = talloc_strdup(mem_ctx, driver->info_3->monitorname);
        W_ERROR_HAVE_NO_MEMORY(r->monitor_name);
@@ -6796,6 +6796,10 @@ static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx,
                                result = fill_printer_driver_info5(info, &info[count+i].info5,
                                                                   &driver, servername);
                                break;
+                       case 6:
+                               result = fill_printer_driver_info6(info, &info[count+i].info6,
+                                                                  &driver, servername);
+                               break;
                        default:
                                result = WERR_UNKNOWN_LEVEL;
                                break;
@@ -6896,6 +6900,21 @@ static WERROR enumprinterdrivers_level5(TALLOC_CTX *mem_ctx,
                                        info_p, count);
 }
 
+/****************************************************************************
+ Enumerates all printer drivers at level 6.
+****************************************************************************/
+
+static WERROR enumprinterdrivers_level6(TALLOC_CTX *mem_ctx,
+                                       const char *servername,
+                                       const char *architecture,
+                                       union spoolss_DriverInfo **info_p,
+                                       uint32_t *count)
+{
+       return enumprinterdrivers_level(mem_ctx, servername, architecture, 6,
+                                       info_p, count);
+}
+
+
 /****************************************************************
  _spoolss_EnumPrinterDrivers
 ****************************************************************/
@@ -6950,6 +6969,11 @@ WERROR _spoolss_EnumPrinterDrivers(pipes_struct *p,
                                                   r->in.environment,
                                                   r->out.info, r->out.count);
                break;
+       case 6:
+               result = enumprinterdrivers_level6(p->mem_ctx, cservername,
+                                                  r->in.environment,
+                                                  r->out.info, r->out.count);
+               break;
        default:
                return WERR_UNKNOWN_LEVEL;
        }