svn commit: samba r7838 - branches/SAMBA_3_0/source/registry trunk/source/registry

jerry at samba.org jerry at samba.org
Wed Jun 22 18:03:38 GMT 2005


Author: jerry
Date: 2005-06-22 18:03:38 +0000 (Wed, 22 Jun 2005)
New Revision: 7838

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7838

Log:
lie about the printer status when doing the queryvalue() registry call.  Note that if you migrate a printer to a Windows server, the win spooler will remove any printers that have an invalid status value in the registry
Modified:
   branches/SAMBA_3_0/source/registry/reg_printing.c
   trunk/source/registry/reg_printing.c


Changeset:
Modified: branches/SAMBA_3_0/source/registry/reg_printing.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_printing.c	2005-06-22 15:29:54 UTC (rev 7837)
+++ branches/SAMBA_3_0/source/registry/reg_printing.c	2005-06-22 18:03:38 UTC (rev 7838)
@@ -639,6 +639,7 @@
 	
 	if ( !new_path ) {
 		char *p;
+		uint32 printer_status = PRINTER_STATUS_OK;
 
 		/* we are dealing with the printer itself */
 
@@ -652,7 +653,10 @@
 		regval_ctr_addvalue( val, "Priority",         REG_DWORD, (char*)&info2->priority,         sizeof(info2->attributes) );
 		regval_ctr_addvalue( val, "ChangeID",         REG_DWORD, (char*)&info2->changeid,         sizeof(info2->changeid) );
 		regval_ctr_addvalue( val, "Default Priority", REG_DWORD, (char*)&info2->default_priority, sizeof(info2->default_priority) );
-		regval_ctr_addvalue( val, "Status",           REG_DWORD, (char*)&info2->status,           sizeof(info2->status) );
+
+		/* lie and say everything is ok since we don't want to call print_queue_length() to get the real status */
+		regval_ctr_addvalue( val, "Status",           REG_DWORD, (char*)&printer_status,          sizeof(info2->status) );
+
 		regval_ctr_addvalue( val, "StartTime",        REG_DWORD, (char*)&info2->starttime,        sizeof(info2->starttime) );
 		regval_ctr_addvalue( val, "UntilTime",        REG_DWORD, (char*)&info2->untiltime,        sizeof(info2->untiltime) );
 

Modified: trunk/source/registry/reg_printing.c
===================================================================
--- trunk/source/registry/reg_printing.c	2005-06-22 15:29:54 UTC (rev 7837)
+++ trunk/source/registry/reg_printing.c	2005-06-22 18:03:38 UTC (rev 7838)
@@ -639,6 +639,7 @@
 	
 	if ( !new_path ) {
 		char *p;
+		uint32 printer_status = PRINTER_STATUS_OK;
 
 		/* we are dealing with the printer itself */
 
@@ -652,7 +653,10 @@
 		regval_ctr_addvalue( val, "Priority",         REG_DWORD, (char*)&info2->priority,         sizeof(info2->attributes) );
 		regval_ctr_addvalue( val, "ChangeID",         REG_DWORD, (char*)&info2->changeid,         sizeof(info2->changeid) );
 		regval_ctr_addvalue( val, "Default Priority", REG_DWORD, (char*)&info2->default_priority, sizeof(info2->default_priority) );
-		regval_ctr_addvalue( val, "Status",           REG_DWORD, (char*)&info2->status,           sizeof(info2->status) );
+
+		/* lie and say everything is ok since we don't want to call print_queue_length() to get the real status */
+		regval_ctr_addvalue( val, "Status",           REG_DWORD, (char*)&printer_status,          sizeof(info2->status) );
+
 		regval_ctr_addvalue( val, "StartTime",        REG_DWORD, (char*)&info2->starttime,        sizeof(info2->starttime) );
 		regval_ctr_addvalue( val, "UntilTime",        REG_DWORD, (char*)&info2->untiltime,        sizeof(info2->untiltime) );
 



More information about the samba-cvs mailing list