s3-spoolss: fix notify_printer_status_byname.
authorGünther Deschner <gd@samba.org>
Mon, 23 Feb 2009 10:43:32 +0000 (11:43 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 19 Mar 2009 17:04:02 +0000 (18:04 +0100)
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

source/printing/notify.c

index 860a400d64902c60e9e28664c151a6ea17745706..e54b308115f69b95c698b3f5ff33c6aa39e670f7 100644 (file)
@@ -394,8 +394,10 @@ void notify_printer_status_byname(const char *sharename, uint32 status)
 {
        /* Printer status stored in value1 */
 
+       int snum = print_queue_snum(sharename);
+
        send_notify_field_values(sharename, PRINTER_NOTIFY_TYPE, 
-                                PRINTER_NOTIFY_STATUS, 0, 
+                                PRINTER_NOTIFY_STATUS, snum,
                                 status, 0, 0);
 }