From 0393c99302dc12f18f06db83201f096624682ea2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 13 Apr 2009 15:27:55 +0200 Subject: s3-spoolss: add generic enumprinterdrivers_level function. Guenther --- source3/rpc_server/srv_spoolss_nt.c | 86 +++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) (limited to 'source3') diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 718f69f6a9..4102a1c894 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -6608,6 +6608,92 @@ WERROR _spoolss_SetJob(pipes_struct *p, return errcode; } +/**************************************************************************** + Enumerates all printer drivers by level. +****************************************************************************/ + +static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx, + const char *servername, + const char *architecture, + uint32_t level, + union spoolss_DriverInfo **info_p, + uint32_t *count_p) +{ + int i; + int ndrivers; + uint32_t version; + fstring *list = NULL; + NT_PRINTER_DRIVER_INFO_LEVEL driver; + union spoolss_DriverInfo *info = NULL; + uint32_t count = 0; + WERROR result = WERR_OK; + + *count_p = 0; + *info_p = NULL; + + for (version=0; version