[Fwd: Re: Printing, drivers and Samba]

Gerald Carter gcarter at valinux.com
Fri Aug 25 06:18:56 GMT 2000


Forwarded to samba-technical for 
corrections, comments. etc...




jerry


-------- Original Message --------
Subject: Re: Printing, drivers and Samba
Date: Fri, 25 Aug 2000 00:50:44 -0500
From: Gerald Carter <gcarter at valinux.com>
Organization: VA Linux Systems
To: papowell at astart.com
CC: jerry at samba.org
References: <200008181601.JAA20485 at h4.private>

papowell at astart.com wrote:
> 
> Every time I have talked to somebody about the 
> SMB protocols, drivers, downloading, etc., I have 
> come away totally baffled and with my neurons
> severely damaged.

Ain't printing a wonderful thing?! :-)

> But I am curious.  Could you please take the time to answer the
> following questions - and post this so the other mail addressees
> could see it?  If there is sufficient interest/information I will
> reformat this and post to the list.

Sorry.  I lost the other addresses you mentioned.  What 
were they?

> a) What is the difference between 'TNG' and the 'CVS' release?
>    What is 'TNG' - 'The Next Generation'?
>    Should I be using TNG for patches/fixes that I send.

TNG is an experiemental branch for testing PDC support.
It is vastly different that HEAD.  All NT printing support
is going into HEAD.  Things from TNG will be ported to 
HEAD as needed.

> I posted an updated version of the PRINTER_DRIVER.txt document
> in which I 'Englishified' the various items.  You might want to
> look at this,  it is at the end of this posting.

Will do.  I still need to check in your previous changes.
Sorry for the delay.

> b) What is the sequence of events (BRIEFLY) that Win95 systems
>    use to download drivers?  Is there an RPC call that they use?

Windows 9x does not use any RPCs what so ever.  Rather i 
uses the CIFS Remote administration protocol operations (RAP).
I can send you a trace of the download.  Ethereal 
(www.zing.org) is fairly good for this.  The client 
issues api_DosPrintQEnum() call among other thigns with 
an info level of 52.  See the function by the same name in 
smbd/lanman.c.  Actually, there are a lot of api_DosPrintQEnum
issued from the traces I have seen (of differing info levels
I presume). 

Once the client has the printer and driver information,
it will actually download the files from the servers
print driver share (the path was returned as part of the 
response to api_DosPrintQEnum infor level 52).

The best thing to do is to use a symbolic debugger and 
set a break point in smbd at this function, then just follow
what is ging on when a Win9x client attempts to install a
Samba served printer.

> c)  Is it possible to write a 'fake download driver' test program
>   for Samba to test that the setup for downloading is OK?  This is
>   the reason for b)s questions.

rpcclient/smbclient can be used to implement a UNIX
Add Printer Wizard.  I've done this an we're wrapping it
in the Imprints project now (imprints.sourceforge.net)

As far as installing a printer, hmmm...there's not 
a test program currently (other than an NT box).

> d) What is the sequence of events (whimper) that NT 
> uses to download drivers?

Not all that bad.  Basically the client

  - issues a OpenPrinter(), GetPrinter(), ClosePrinter() RPC
  - Issues a GetPrinterDriver() for the driver outlined in 
    the GetPrinter() response
  - connects to \\server\print$ and downloads the drivers
  - issues and AddPrinterDriver() locally
  - issues and AddPrinter() locally for the remote printer
  - calls a few EnumForms() & EnumPrinterData() to set 
    defaults for printer properties

viola!

> e) How are you integrating this into Samba?

Server support you mean?  We are implementing the
necessary RPCs by hand. :-)   Actually Jean Francois
did most of it.

> f) How do you set up the download of drivers?

Using either the tools we are developing as part of Imprints
or an NT client's Add Printer Wizard.  Either way, the 
sequence of events is...

  - GetPrinterDriverDirectory() for the appropriate client
    architecture (Windows NT x86, Windows 4.0, etc...)
  - upload the drivers to the server's directory
  - call AddPrinterDriver() for the remote server
  - call AddPrinterEx() for the remote server

> g) Is it possible to write a 'fake download driver' test program
>   for Samba to test that the setup for downloading is OK?  This is
>   the reason for b)s and f) questions.

See previous comments about smbclient/rpcclient.

> I am sorry to ask this directly,  but I have tried 
> to find docs/information in the postings and have 
> been overwhelmed by stuff that seems to address
> small parts of the problem but nothing overall.

It is pretty hairy actually.  In fact, the current Windows 9x
support will get a facelift when 2.2.0 comes out.  Printer
driver installation for 9x drivers will be handled just as 
NT driver uploads are (NT APW or imprints tools).

Some parameters are going away as well (depreciated 
I should say)

	printer driver location (S)
	printer driver file (G)
	printer driver (S)

as they will no longer be necessary.

Hope this helps.





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