Working on spoolss_getprinterdriver() as it does not display all the
authorGerald Carter <jerry@samba.org>
Thu, 10 Aug 2000 14:05:19 +0000 (14:05 +0000)
committerGerald Carter <jerry@samba.org>
Thu, 10 Aug 2000 14:05:19 +0000 (14:05 +0000)
dependentfiles.

jery

source/rpcclient/cmd_spoolss.c
source/rpcclient/display_spool.c

index 6cec9ae1cd29d08256bf121b5d637522f2d44227..2bf59bc4a138aad56b96ae838c44091de6ea0a08 100644 (file)
@@ -736,6 +736,12 @@ uint32 cmd_spoolss_addprinterdriver(struct client_info *info, int argc, char *ar
                report( out_hnd, "spoolss_addprinterdriver: Add Printer failed [%d]\n",
                        result);
        }
+       else
+       {
+               fstring driver_name;
+               unistr_to_ascii (driver_name, info3.name.buffer, sizeof(driver_name)-1);
+               report( out_hnd, "cmd_spoolss_addprinterdriver: Printer Driver [%s] added successfully\n", driver_name);
+       }
        
        free_drv_info_3(&info3);
        
index 1a88eed5ad3beb23dcfe8f05797b0d105b19a5e7..54162a99b733ffad1d3f2ea34b2a403b7a6051a9 100644 (file)
@@ -737,7 +737,8 @@ static void display_print_driver_3(FILE *out_hnd, DRIVER_INFO_3 *i1)
        fstring monitorname;
        fstring defaultdatatype;
        
-       int longueur=0;
+       int length=0;
+       BOOL valid = True;
        
        if (i1 == NULL)
                return;
@@ -760,12 +761,20 @@ static void display_print_driver_3(FILE *out_hnd, DRIVER_INFO_3 *i1)
        report(out_hnd, "\tconfigfile:[%s]\n", configfile);
        report(out_hnd, "\thelpfile:[%s]\n\n", helpfile);
 
-       do {
-               unistr_to_ascii(dependentfiles, i1->dependentfiles+longueur, sizeof(dependentfiles)-1);
-               longueur+=strlen(dependentfiles)+1;
+       while (valid)
+       {
+               unistr_to_ascii(dependentfiles, i1->dependentfiles+length, sizeof(dependentfiles)-1);
+               length+=strlen(dependentfiles)+1;
                
-               report(out_hnd, "\tdependentfiles:[%s]\n", dependentfiles);
-       } while (dependentfiles[0]!='\0');
+               if (strlen(dependentfiles) > 0)
+               {
+                       report(out_hnd, "\tdependentfiles:[%s]\n", dependentfiles);
+               }
+               else
+               {
+                       valid = False;
+               }
+       }
        
        report(out_hnd, "\n\tmonitorname:[%s]\n", monitorname);
        report(out_hnd, "\tdefaultdatatype:[%s]\n", defaultdatatype);