[Samba] windows print migrator + "add printer command"

Martin Zielinski mz at seh.de
Fri Jan 13 11:56:08 GMT 2006

Gerald (Jerry) Carter wrote:
> Martin Zielinski wrote:
>>2nd, (and the true reason) - the add printer command is not really
>>functional without port handling.
>>E.g. CUPS wants a device uri like "socket://" to know
>>the destination of the printjob.
>>You could use the "location" or "description" in the add printer wizard
>>as a workaround. But that's not really a nice way.
> Do you have any suggestions on how to better handle this?
> I've considered reworking Samba's printer ports.  But the Win32
> api doesn't allow for adding ports remotely (except via the
> registry).  There's supposedly an IOCTL for the spooler api
> but I've not dug into it.  Metze mentioned something several
> months ago.
Sorry, no. Currently the best thing I see, is to put the URI into the 
"location" when calling the add printer wizard (just like you did in 
your example scripts).

I just tried out to add a port on two MS systems and it *looks* like it 
could work with SPOOLSS calls. Unfortunatly some of the packets are not 
decoded by Ethereal.

Looks like this:
--> EnumMonitors
<-- Response: ... Standard TCP / IP Port
--> OpenPrinterEx \\host\,XcvMonitor Standard TCP / IP Port
<-- Response OK
--> UNKNOWN (Opnum 88) You can read "AddPort ... IP_xxxxx ... public ...")
--> ClosePrinterEx

Or are these the registry calls you mentioned?

bye, Martin

Martin Zielinski             mz at seh.de
Software Development
SEH Computertechnik GmbH     www.seh.de

More information about the samba mailing list