From 5ee21705191a2f74c984b267bbc80259cbd2e68a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 24 Jan 2005 18:42:33 +0000 Subject: r4966: don't enumerate the drivers for the same architecture string more than once (This used to be commit c488ce9934aaf640c3f63cbdabc3110b8cf70fae) --- source3/rpcclient/cmd_spoolss.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 0b0d015238..fa77af4145 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -31,6 +31,13 @@ struct table_node { int version; }; +/* The version int is used by getdrivers. Note that + all architecture strings that support mutliple + versions must be grouped together since enumdrivers + uses this property to prevent issuing multiple + enumdriver calls for the same arch */ + + static const struct table_node archi_table[]= { {"Windows 4.0", "WIN40", 0 }, @@ -1134,6 +1141,11 @@ static WERROR cmd_spoolss_enum_drivers(struct cli_state *cli, { uint32 needed; + /* check to see if we already asked for this architecture string */ + + if ( i>0 && strequal(archi_table[i].long_archi, archi_table[i-1].long_archi) ) + continue; + werror = cli_spoolss_enumprinterdrivers( cli, mem_ctx, 0, &needed, info_level, archi_table[i].long_archi, &returned, &ctr); -- cgit