[Samba] GetPrinter Level 2 does not get devmode

Rohit.Wadhwa at tabs.toshiba.com Rohit.Wadhwa at tabs.toshiba.com
Thu Oct 10 18:15:01 GMT 2002

Hi Jerry,

I followed the steps as outlined by Gregory in one of the posts to the
list.  That is

1. Define your printer as a share or in CUPS as needed.
2. Define PRINT$ share with only admin users having write access.
3. Restart Samba and make sure printer appears in the server Printers
4. Right-click on the printer in question and choose Properties.
5. Respond "NO" to the "Install Driver now prompt"  - Question:  Why
"No" at this point? All docs say to do so without explanation.
6. Once in the driver dialog go to the Advanced Tab and click on "New
7. Select your driver from wherever and make sure it copies to
8. Click on Apply to make sure dialog gets updated with printer-specific
configuration tabs.
9. On General tab, choose Printing Preferences - Basics and switch page
layouts between portrait and landscape clicking OK in between to update the
driver.  - I assume at this point the driver Devmode is being set, correct?
10.  The printer is now ready to install on Workstations.

I see a little bit of a different behaviour. After step 8, I do not see the
"Printing Preferences" button on the General Tab. I only see the "Printing
Preferences" button if instead of "Apply" I hit "Ok" and bring up the
printer properties again. (This I was able to reproduce with a HP LaserJet
8100 Series PCL 6 driver). (I am running Samba-2.2.4.)

Then if I do step 9, I see that the devmode for my printer is written under
HKEY_CURRENT_USER\Printers\DevModePerUser and
HKEY_CURRENT_USER\Printers\DevModes2 on the Windows machine from which I
was uploading the driver. If I run my program again to get the devmode, the
Windows API call gets the devmode from the local registry. If I delete
these registry values, it can only get the PRINTER_INFO_2 with null devmode
from the server.

Any pointers as to where the problem may lie would be very helpful.

Thanks and regards,


                    Gerald Carter                                                                                                             
                    <jerry at samba.        To:     Rohit Wadhwa/DSE/IRV/TOSHIBA-TABS at TOSHIBA-TABS                                               
                    org>                 cc:     samba at samba.org                                                                              
                                         Subject:     Re: [Samba] GetPrinter Level 2 does not get devmode                                     
                    04:56 PM                                                                                                                  

On Thu, 10 Oct 2002 Rohit.Wadhwa at tabs.toshiba.com wrote:

> I uploaded the drivers from a Windows 2000 workstation, with the APW. No
> errors were reported on the windows machine. This is supposed to set
> the, printer_info and devmode on the samba server, right? No other step
> from the client is needed to set these, as far as I know.


Setting the devmode requires that the driver be executed (which
samba can't do).  Please read the Printing section regarding this in

> Also, PRINTER_INFO_2 is NOT null. PRINTER_INFO_2->devmode is null, (just
> to clarify). I have not checked the log while uploading, but while
> downloading I have and I see a message "Returning NULL devicemode!" .

Yes.  I know exactly of the problem which you speak.  :-)

cheers, jerry
 Hewlett-Packard                                     http://www.hp.com
 SAMBA Team                                       http://www.samba.org
 --                                            http://www.plainjoe.org
 "SAMS Teach Yourself Samba in 24 Hours" 2ed.       ISBN 0-672-32269-2
 --"I never saved anything for the swim back." Ethan Hawk in Gattaca--

More information about the samba mailing list