summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-05-13 15:35:55 +0200
committerGünther Deschner <gd@samba.org>2009-06-08 21:24:31 +0200
commit6dd1f99ec09aff71f04d103554e848e0ddcf0cb7 (patch)
treed762b424d4a3cd934ad25345cf340e0716b0d40b /source3/rpc_server
parentd11d4382b965b72532dcb797089a614aa774af7e (diff)
downloadsamba-6dd1f99ec09aff71f04d103554e848e0ddcf0cb7.tar.gz
samba-6dd1f99ec09aff71f04d103554e848e0ddcf0cb7.tar.bz2
samba-6dd1f99ec09aff71f04d103554e848e0ddcf0cb7.zip
s3-spoolss: add server-support for queries for the "all" architecture in printdriver enum calls.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c74
1 files changed, 67 insertions, 7 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 8280011cc2..f71099434b 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -6708,16 +6708,28 @@ WERROR _spoolss_SetJob(pipes_struct *p,
return errcode;
}
+static const struct print_architecture_table_node archi_table[]= {
+
+ {"Windows 4.0", SPL_ARCH_WIN40, 0 },
+ {"Windows NT x86", SPL_ARCH_W32X86, 2 },
+ {"Windows NT R4000", SPL_ARCH_W32MIPS, 2 },
+ {"Windows NT Alpha_AXP", SPL_ARCH_W32ALPHA, 2 },
+ {"Windows NT PowerPC", SPL_ARCH_W32PPC, 2 },
+ {"Windows IA64", SPL_ARCH_IA64, 3 },
+ {"Windows x64", SPL_ARCH_X64, 3 },
+ {NULL, "", -1 }
+};
+
/****************************************************************************
- Enumerates all printer drivers by level.
+ Enumerates all printer drivers by level and architecture.
****************************************************************************/
-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)
+static WERROR enumprinterdrivers_level_by_architecture(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;
@@ -6820,6 +6832,54 @@ static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx,
}
/****************************************************************************
+ 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)
+{
+ uint32_t a,i;
+ WERROR result = WERR_OK;
+
+ if (strequal(architecture, "all")) {
+
+ for (a=0; archi_table[a].long_archi != NULL; a++) {
+
+ union spoolss_DriverInfo *info = NULL;
+ uint32_t count = 0;
+
+ result = enumprinterdrivers_level_by_architecture(mem_ctx,
+ servername,
+ archi_table[a].long_archi,
+ level,
+ &info,
+ &count);
+ if (!W_ERROR_IS_OK(result)) {
+ continue;
+ }
+
+ for (i=0; i < count; i++) {
+ ADD_TO_ARRAY(mem_ctx, union spoolss_DriverInfo,
+ info[i], info_p, count_p);
+ }
+ }
+
+ return result;
+ }
+
+ return enumprinterdrivers_level_by_architecture(mem_ctx,
+ servername,
+ architecture,
+ level,
+ info_p,
+ count_p);
+}
+
+/****************************************************************************
Enumerates all printer drivers at level 1.
****************************************************************************/