[email protected]
[Top] [All Lists]

Re: Vista: Adding a printer connection fails

Subject: Re: Vista: Adding a printer connection fails
From: Martin Zielinski
Date: Tue, 06 Feb 2007 15:24:31 +0100
Hello again!

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.

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.



Martin Zielinski schrieb:
Hello list!

The error case has been originally described in the samba list with the subject "Vista can't use samba hosted printer drivers"

Using samba 3.0.23d and a printer with a "HP 4000 PCL6" driver from XP.

When one tries to install a network printer from samba the execution aborts with the error 0x00000057 ( = invalid parameter).

How to reproduce:
1st. Make a fresh install: remove ntprinters.tdb and assign the driver via an rpcclient call.
 => If you try now to connect with vista, everything is ok

2nd. Enter the printers folder from Vista or XP and rightclick on the printer -> properties -> publish printer in the ADS. => Try now to connect with vista and this time Vista produces the error. (And the properties dialog shows no "printing preferences" button).

What fails:
The failed System call is an "GetPrinterDriver" call from the Vista client. Not to mistake with the RPC call itself. It's the library call the produces lots of traffic afterwards (GetPrinter calls, enum the registry etc.)

When does it fail:
When publishing the printer to the ADS, Samba adds a binary registry value "objectGUID" to the DsSpooler key. (BTW - my XP client publishes the printer automaticly when I open the properties dialog in the "Printers and Faxes" folder on the Samba server with admin rights).

I renamed the key - no change
I changed the size of the data - no change
Added a random key after that key (buffer size???) - no change

I changed the key type from REG_BINARY to REG_SZ - no error anymore!
Also, if I add another key to the printers registry (FOO) - no error!

Why does it fail:
I have no idea at the moment. Anyone?
Tried to find alignment issues or sizes - found nothing.
Also the enumeration of the printers registry is successfull - in every case.

If I could see this error somewhere on XP, I'd assume it is a Vista bug.
But until then - It stays at Samba.

I hope someone gets an idea due to this observations.



Martin Zielinski             [email protected]
Software Development
SEH Computertechnik GmbH     www.seh.de

<Prev in Thread] Current Thread [Next in Thread>