Filling the DRIVER_INFO_3 struct from the command line

Gerald Carter gcarter at
Sat Aug 5 03:19:40 GMT 2000

[cross-posted from <imprints-devel at>]

Here's an RFC...

We need to be able fill the DRIVER_INFO_3 struct 
from command line arguments for rpcclient.
Here's the struct declaration from include/rpc_spoolss.h
(in the samba HEAD branch code):

        typedef struct driver_info_3
                uint32 version;
                UNISTR name;
                UNISTR architecture;
                UNISTR driverpath;
                UNISTR datafile;
                UNISTR configfile;
                UNISTR helpfile;
                uint16 *dependentfiles;
                UNISTR monitorname;
                UNISTR defaultdatatype;

Just think of the UNISTR as strings (UNICODE strings 
in reality).

  Jean Francois, why is the 'dependentfiles'
  and unistr16* instead of a UNISTR**?  

There is already a means to do this somewhat established 
by make_printerdef.  So while the tool itself is going 
away, by using a similar command line format as 
the printers.def file currently used by Samba, migration pains
may be a little bit less.  

Here's the format...

<Long Printer Name>:<Driver File Name>:<Data File Name>:\
    <Help File Name>:<Language Monitor Name>:\
    <Default Data Type>:<Comma Separated list of Files>

Of course, this is all on one line.

We will need to add an entry for the 'configfile' string.
This is described in the MSDN docs as the "file name for the
device driver's configuration dynamic-link library".

The nice thing is that this will work for both Windows 
9x and Windows NT 4.0.

So to give you an example...

$ rpcclient -S server -U user%pass \
-c "spooladdprinterdriver win40 \"Apple LaserWriter:PSCRIPT.DRV:\
APPLE230.SPD:PSCRIPT.HLP:PostScript Language Monitor:RAW:\

Horrible looking I know, but it would also allow for

        foreach line in printers.def
                rpcclient ... $line

  JF, I think these are all simple filenames and not 
  necessarily absolute pathnames.  Is this right?

  Also, I do not think there is any reason to support 
  a client side level 6 DRIVER_INFO struct as this is 
  specific to Win2k.  Yes or no?


Cheers, jerry
   /\  Gerald (Jerry) Carter                     Professional Services
 \/  VA Linux Systems    gcarter at       SAMBA Team           jerry at

       "...a hundred billion castaways looking for a home."
                                - Sting "Message in a Bottle" ( 1979 )

More information about the samba-technical mailing list