Vista: Adding a printer connection fails

Gerald (Jerry) Carter jerry at
Fri Feb 9 00:33:40 GMT 2007

Hash: SHA1


> Hello again!

Hello again.  Excellent debugging work on this.
Thanks much.

> If I'm not too confused by all this testing, the 
> reason for the misbehaviour is:
> Windows does not accept any unknown binary registry 
> values under the DsSpooler key via the SetPrinterDataEx
> call.
> Easy to test: Just try a SetPrinterDataEx call with 
> binary data on a XP server under the DsSpooler key:
> error 0x57!
> It looks like Vista tries to store the data to a 
> tempory printer. For each key it leaves the copy loop
> on an error condition. If the DsSpooler key is the last
> key on the Samba server (which is the default),
> GetLastError() after the procedure is the above
> mentioned error.
> If there are more keys, Vista continues to 
> copy these keys and GetLastError() after the
> whole procedure is ERROR_SUCCESS. This
> can be the reason, why adding another key to the
> printer registry leeds to a successfull installation
> of the printer.

I really forgot how annoying the entire spoolss
implementation was.  This brings back some memories....

> On XP machines the PrinterDriverData key seems to 
> be created automaticly. So adding a binary data
> via regedit to the DsSpooler key does not leed to
> this error.
> Possible fixes for Samba could be
> a) Store the objectGUID value in string-representation
> b) Do not store the value under the DsSpooler key
> c) Allways Auto-create an empty PrinterDriverData key
> BTW. the ObjectGUID key can be found in the XP registry 
> as toplevel string.

I'm not sure your analysis is 100% correct.  I see
both Vista and XP creating a REG_BINARY value in the
DsSpoolerKey.  Or are you saying that only Unknown
values are disallowed?

In any case, I don't see an objectGUID stored in DsSpooler
on any client (2K, XP, or Vista).  We store it after
first publishing the printer so we can later refresh
the printer info (in the PRINTER_INFO_7).  I'm tempted to
convert it to a REG_SZ like you suggest.

What I might try doing is just converting the REG_BINARY
to a REG_SZ for just this one instance in unpack_values().

cheers, jerry
Samba                                    -------
Centeris                         -----------
"What man is a man who does not make the world better?"      --Balian
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


More information about the samba-technical mailing list