Filling the DRIVER_INFO_3 struct from the command line
Gerald Carter
gcarter at valinux.com
Sat Aug 5 03:19:40 GMT 2000
[cross-posted from <imprints-devel at sourceforge.net>]
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;
}
DRIVER_INFO_3;
Just think of the UNISTR as strings (UNICODE strings
in reality).
<aside>
Jean Francois, why is the 'dependentfiles'
and unistr16* instead of a UNISTR**?
</aside>
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:\
APPLE230.SPD,PSCRIPT.DRV,PSCRIPT.HLP,PSCRIPT.INI,TESTPS.TXT,\
APPLE380.SPD,FONTS.MFM,ICONLIB.DLL,PSMON.DLL\""
Horrible looking I know, but it would also allow for
foreach line in printers.def
rpcclient ... $line
done
<aside>
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?
</aside>
Comments?
Cheers, jerry
--
----------------------------------------------------------------------
/\ Gerald (Jerry) Carter Professional Services
\/ http://www.valinux.com VA Linux Systems gcarter at valinux.com
http://www.samba.org SAMBA Team jerry at samba.org
http://www.eng.auburn.edu/~cartegw
"...a hundred billion castaways looking for a home."
- Sting "Message in a Bottle" ( 1979 )
More information about the samba-technical
mailing list