Filling the DRIVER_INFO_3 struct from the command line

Gerald Carter gcarter at valinux.com
Sat Aug 5 03:24:42 GMT 2000


Warning!!!  Lot's of hex numbers to follow.  Not 
many questions.  More information than anything else.

<summary>

* The Drivername is the name of the previously 
  installed WinNT driver.  Q?  Do you always have 
  to install a Winedows NT printer driver prior to
  a Windows 9x one?

* The configfile field has a value.  Since make_printerdef
  does not save this valie currently, I wonder why it 
  was considered to not be important.  Also, I will need 
  to check the printer's INF file to see where it came from.

* new command line format for DRIVER_INFO_3 struct
  should be
  <Long Printer Name>:<Driver File Name>:<Data File Name>:\
     <Config File Name>:<Help File Name>:\
     <Language Monitor Name>:<Default Data Type>:\
     <Comma Separated list of Files>

</summary>



Cheers, jerry

Gerald Carter wrote:
> 
>         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;

Here's the actual strut put out over the wire:

        typedef struct spool_printer_driver_info_level_3
        {
                uint32 cversion;
                uint32 name_ptr;
                uint32 environment_ptr;
                uint32 driverpath_ptr;
                uint32 datafile_ptr;
                uint32 configfile_ptr;
                uint32 helpfile_ptr;
                uint32 monitorname_ptr;
                uint32 defaultdatatype_ptr;
                uint32 dependentfilessize;
                uint32 dependentfiles_ptr;

                UNISTR2 name;
                UNISTR2 environment;
                UNISTR2 driverpath;
                UNISTR2 datafile;
                UNISTR2 configfile;
                UNISTR2 helpfile;
                UNISTR2 monitorname;
                UNISTR2 defaultdatatype;
                BUFFER5 dependentfiles;
        }
        SPOOL_PRINTER_DRIVER_INFO_LEVEL_3;

>
> 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".

Here's the data from a AddPrinterDriver() called by
an NT client in order to add a Windows 95 driver on 
the print server.

; beginning of struct containing
{       
        uint32 cversion;
        uint32 name_ptr;
        uint32 environment_ptr;
        uint32 driverpath_ptr;
        uint32 datafile_ptr;
        uint32 configfile_ptr;
        uint32 helpfile_ptr;
        uint32 monitorname_ptr;
        uint32 defaultdatatype_ptr;
        uint32 dependentfilessize;
        uint32 dependentfiles_ptr;
}
                  88 5E 14 00 0C 00 00 00 00 00       .^........
00 00 0C 00 00 00 5C 00 5C 00 51 00 55 00 45 00 ......\.\.Q.U.E.
53 00 4F 00 2D 00 4E 00 54 00 34 00 00 00 03 00 S.O.-.N.T.4.....
00 00 03 00 00 00 88 B5 B8 00 00 00 00 00 E4 5E ...............^
14 00 30 5F 14 00 54 5F 14 00 78 5F 14 00 A0 5F ..0_..T_..x_..._
14 00 C4 5F 14 00 E8 5F 14 00 00 00 00 00 6A 00 ..._..._......j.
00 00 24 60 14 00                               ..$`..

; name - notice that this the name of
; of the Windows NT driver already installed.
; **not ** the name of the driver selected 
; from the Win9x INF file.  
                  1F 00 00 00 00 00 00 00 1F 00        .........
00 00 41 00 70 00 70 00 6C 00 65 00 20 00 4C 00 ..A.p.p.l.e...L.
61 00 73 00 65 00 72 00 57 00 72 00 69 00 74 00 a.s.e.r.W.r.i.t.
65 00 72 00 20 00 49 00 49 00 20 00 4E 00 54 00 e.r...I.I...N.T.
58 00 20 00 76 00 35 00 31 00 2E 00 38 00 00 00 X...v.5.1...8...
43 00                                           C.

; environment - this is add you would expect
      0C 00 00 00 00 00 00 00 0C 00 00 00 57 00   ............W.
69 00 6E 00 64 00 6F 00 77 00 73 00 20 00 34 00 i.n.d.o.w.s...4.
2E 00 30 00 00 00                               ..0...

; driverpath
                  0C 00 00 00 00 00 00 00 0C 00        .........
00 00 50 00 53 00 43 00 52 00 49 00 50 00 54 00 ..P.S.C.R.I.P.T.
2E 00 44 00 52 00 56 00 00 00                   ..D.R.V...

; datafile
                              0D 00 00 00 00 00            .....
00 00 0D 00 00 00 4C 00 57 00 4E 00 54 00 58 00 ......L.W.N.T.X.
34 00 37 00 30 00 2E 00 53 00 50 00 44 00 00 00 4.7.0...S.P.D...
00 00           
                                ..
; configfile - where did we get this from?
; the current make_printerdef does not seem 
; to include it.
      0C 00 00 00 00 00 00 00 0C 00 00 00 50 00   ............P.
53 00 43 00 52 00 49 00 50 00 54 00 2E 00 44 00 S.C.R.I.P.T...D.
52 00 56 00 00 00                               R.V...

; remainder of stuff I'm not interested in 
; at the moment
                  0C 00 00 00 00 00 00 00 0C 00        .........
00 00 50 00 53 00 43 00 52 00 49 00 50 00 54 00 ..P.S.C.R.I.P.T.
2E 00 48 00 4C 00 50 00 00 00 1C 00 00 00 00 00 ..H.L.P.........
00 00 1C 00 00 00 50 00 6F 00 73 00 74 00 53 00 ......P.o.s.t.S.
63 00 72 00 69 00 70 00 74 00 20 00 4C 00 61 00 c.r.i.p.t...L.a.
6E 00 67 00 75 00 61 00 67 00 65 00 20 00 4D 00 n.g.u.a.g.e...M.
6F 00 6E 00 69 00 74 00 6F 00 72 00 00 00 6A 00 o.n.i.t.o.r...j.
00 00 4C 00 57 00 4E 00 54 00 58 00 34 00 37 00 ..L.W.N.T.X.4.7.
30 00 2E 00 53 00 50 00 44 00 00 00 50 00 53 00 0...S.P.D...P.S.
43 00 52 00 49 00 50 00 54 00 2E 00 44 00 52 00 C.R.I.P.T...D.R.
56 00 00 00 50 00 53 00 43 00 52 00 49 00 50 00 V...P.S.C.R.I.P.
54 00 2E 00 48 00 4C 00 50 00 00 00 50 00 53 00 T...H.L.P...P.S.
43 00 52 00 49 00 50 00 54 00 2E 00 49 00 4E 00 C.R.I.P.T...I.N.
49 00 00 00 54 00 45 00 53 00 54 00 50 00 53 00 I...T.E.S.T.P.S.
2E 00 54 00 58 00 54 00 00 00 41 00 50 00 50 00 ..T.X.T...A.P.P.
4C 00 45 00 33 00 38 00 30 00 2E 00 53 00 50 00 L.E.3.8.0...S.P.
44 00 00 00 46 00 4F 00 4E 00 54 00 53 00 2E 00 D...F.O.N.T.S...
4D 00 46 00 4D 00 00 00 49 00 43 00 4F 00 4E 00 M.F.M...I.C.O.N.
4C 00 49 00 42 00 2E 00 44 00 4C 00 4C 00 00 00 L.I.B...D.L.L...
50 00 53 00 4D 00 4F 00 4E 00 2E 00 44 00 4C 00 P.S.M.O.N...D.L.
4C 00 00 00 00 00                               L.....          


-- 
----------------------------------------------------------------------
   /\  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