s3-spoolss: fix notify_printer_status_byname.
commitc38db71045791fbb41f8652801f314d91ef34a64
authorGünther Deschner <gd@samba.org>
Mon, 23 Feb 2009 10:43:32 +0000 (23 11:43 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 27 Mar 2009 13:15:49 +0000 (27 14:15 +0100)
treece09dbf72be15021ff7c5d16268a2ab396a14e49
parentc08abca4f0f8c5440471b032565b9bfac9d7d568
s3-spoolss: fix notify_printer_status_byname.

This took me almost a week to find, so here a little longer explanation:

When a windows client registers printer *status* change notifies using
spoolss_RemoteFindFirstChangeNotify, it registers them to a print server handle,
not a printer handle. We were then correctly monitoring the printer status
changes but were sending out the spoolss_RouterReplyPrinterEx via the back-channel
connection with job_id set to 0 (which we only may do for monitored printer
change status notifies on printer handlers, not print server handles). Windows
was then showing a new empty dummy printer icon in the explorer as it cannot
route the notify event to the approriate local handle. It also discarded the
content of the notify event message of course. With this, printer change notify for
pausing, resuming and purging printers nicely works again here.

Jerry, Tim and all other printing gurus, please check.

Guenther
(cherry picked from commit 69a8eeb16af7cccdaa524dd85c7e2b648c0547a3)
source/printing/notify.c