The technical side of the spoolss pipe

Jean-Francois Micouleau Jean-Francois.Micouleau at utc.fr
Wed Mar 18 17:45:46 GMT 1998


As luke asked me to post a summary of my work on the spoolss pipe on
samba-ntdom and samba-technical, here it is.

On samba-ntdom, I've sum up the user visible side, here I sum up the
technical side for people interrested by what I'm doing.

All the spoolss pipe is build around printer handlers, which are quite
like the policy handler of lsa_hnd.c

There are 2 kind of object you can manage:
	- a print server (the samba ntdom server)
	- a printer managed by the print server.

A lot of things are common to both. For example you can call
RpcRemoteFind*PrinterChangeNotification on both type of object. In the
first case it will return the list of printers (and their corresponding
status) managed by a printer server. In the second case, it will return
the list of jobs managed by a printer.

On the coding side, I split the functions in 2 categories. The one which
are DCE/RPC vers 2 compliant, and they all have a nice structure with the
pointers and so on, structure pointing to structure, UNISTR2 strings, etc.

On the other side, there is a number of function, which use a char buffer
to pass the parameters. This ones are not decoded by netmon, otherwise it
would have be too easy ! I think this functions are 'older' than the
DCE/RPC vers 2, and have been included in NT since a long time (If someone
want me to check I can reinstall NT 3.1, but I have other things to do).


Now some example of how things are going on the spoolss pipe.

To list printers from 'Network Nei. icon' -> samba server -> Printer
folder

OpenPrinterEx(\\printserver); -> return an handle
RemoteFindFirstPrinterChangeNotification(handle, things to notify);
RemoteFindNextPrinterChangeNotification(handle); -> send the list of
						printers and their status
RemoteFindClosePrinterChangeNotification(handle)
ClosePrinter(handle)

If you click on the printer in the previous case:
OpenPrinterEx(\\printserver\PRINTER); -> return an handle
RemoteFindFirstPrinterChangeNotification(handle, things to notify);
RemoteFindNextPrinterChangeNotification(handle); -> send the list of
                                                jobs and their status
RemoteFindClosePrinterChangeNotification(handle)
ClosePrinter(handle)


The previous calls normally don't close the printer as soon as it's done,
because the server can send info to the workstation on change state. I
think it's like the notify of SMB NT calls

To know the list of printers on a print server (the old way but it's how
it's done when you do Start->Control Panel->Printers-> Add a network
Printer)

OpenPrinterEx(\\printserver); -> return an handle
EnumPrinters(handle); -> send the list of printers
ClosePrinter(handle);

How to print:

OpenPrinterEx(\\printserver\printer)
StartDoc(handle, job infos)

   For(number of page)
   {	
	StartPage(handle, page info)
		WritePrinter(handle,data)
                WritePrinter(handle,data_next)
                WritePrinter(handle,data_next)

		and so on
	EndPage(handle)
   }
EndDoc(handle)
ClosePrinter(handle)

The printing is not yet implemented for 2 good reasons:

	1) I want to clean the previous code, it's a little messy because
I only worked from netmon trace and didn't look at other microsoft's
informations like MSDN.
	2) I'm back as a student right now and if I want my diploma
quickly, I have to give to samba less priority.

But I started to code it and I WANT to finish it.


Now several questions that I would like to be answered by the samba-team


Could someone explain me how the notify things will be implemented ? I
already ask jeremy but he is too busy right now, and as I have to
implement notify in \\pipe\spoolss, I want to do it as the rest of samba
(not reinventing the wheel).

Luke said he wants to include DFS in samba. What do you plan ? To have
samba shares in a NT DFS tree ? Or samba acting as a DFS server ?

Is someone working on adding BDC support to samba ?

What's the next deadline for samba 1.9.20 or 2.0 ? 


		Jean Francois

-----------------------------------------------------------
: Jean Francois Micouleau       : Email: jfm at utc.fr       :
: Universite de                 : Tel  : 03 44 23 47 78   :
: Technologie de                :  Service Informatique   :
: Compiegne              France :     Division IRNM       :
-----------------------------------------------------------








More information about the samba-technical mailing list