svn commit: samba r16904 - in trunk/source: registry rpc_server

vlendec at samba.org vlendec at samba.org
Sun Jul 9 20:45:45 GMT 2006


Author: vlendec
Date: 2006-07-09 20:45:44 +0000 (Sun, 09 Jul 2006)
New Revision: 16904

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

Log:
Take snum from construct_dev_mode
Modified:
   trunk/source/registry/reg_printing.c
   trunk/source/rpc_server/srv_spoolss_nt.c


Changeset:
Modified: trunk/source/registry/reg_printing.c
===================================================================
--- trunk/source/registry/reg_printing.c	2006-07-09 19:31:46 UTC (rev 16903)
+++ trunk/source/registry/reg_printing.c	2006-07-09 20:45:44 UTC (rev 16904)
@@ -382,7 +382,6 @@
 	UNISTR2		data;
 	char 		*p;
 	uint32 printer_status = PRINTER_STATUS_OK;
-	int snum;
 	
 	regval_ctr_addvalue( values, "Attributes",       REG_DWORD, (char*)&info2->attributes,       sizeof(info2->attributes) );
 	regval_ctr_addvalue( values, "Priority",         REG_DWORD, (char*)&info2->priority,         sizeof(info2->attributes) );
@@ -438,8 +437,7 @@
 
 	/* stream the device mode */
 		
-	snum = lp_servicenumber(info2->sharename);
-	if ( (devmode = construct_dev_mode( snum )) != NULL ) {			
+	if ( (devmode = construct_dev_mode( info2->sharename )) != NULL ) {
 		if ( spoolss_io_devmode( "devmode", &prs, 0, devmode ) ) {
 			offset = prs_offset( &prs );
 			regval_ctr_addvalue( values, "Default Devmode", REG_BINARY, prs_data_p(&prs), offset );

Modified: trunk/source/rpc_server/srv_spoolss_nt.c
===================================================================
--- trunk/source/rpc_server/srv_spoolss_nt.c	2006-07-09 19:31:46 UTC (rev 16903)
+++ trunk/source/rpc_server/srv_spoolss_nt.c	2006-07-09 20:45:44 UTC (rev 16904)
@@ -4064,7 +4064,7 @@
  Create a DEVMODE struct. Returns malloced memory.
 ****************************************************************************/
 
-DEVICEMODE *construct_dev_mode(int snum)
+DEVICEMODE *construct_dev_mode(const char *servicename)
 {
 	NT_PRINTER_INFO_LEVEL 	*printer = NULL;
 	DEVICEMODE 		*devmode = NULL;
@@ -4073,7 +4073,7 @@
 	
 	DEBUGADD(8,("getting printer characteristics\n"));
 
-	if (!W_ERROR_IS_OK(get_a_printer(NULL, &printer, 2, lp_const_servicename(snum)))) 
+	if (!W_ERROR_IS_OK(get_a_printer(NULL, &printer, 2, servicename)))
 		return NULL;
 
 	if ( !printer->info_2->devmode ) {
@@ -4145,7 +4145,7 @@
 	printer->cjobs = count;							/* jobs */
 	printer->averageppm = ntprinter->info_2->averageppm;			/* average pages per minute */
 			
-	if ( !(printer->devmode = construct_dev_mode(snum)) )
+	if ( !(printer->devmode = construct_dev_mode(lp_const_servicename(snum))) )
 		DEBUG(8, ("Returning NULL Devicemode!\n"));
 
 	printer->secdesc = NULL;
@@ -6528,7 +6528,7 @@
 		
 	/* this should not be a failure condition if the devmode is NULL */
 	
-	devmode = construct_dev_mode(snum);
+	devmode = construct_dev_mode(lp_const_servicename(snum));
 
 	for (i=0; i<*returned; i++)
 		fill_job_info_2(&(info[i]), &queue[i], i, snum, ntprinter, devmode);
@@ -8755,7 +8755,7 @@
 	 */
 	 
 	if ( !(nt_devmode=print_job_devmode( lp_const_servicename(snum), jobid )) )
-		devmode = construct_dev_mode(snum);
+		devmode = construct_dev_mode(lp_const_servicename(snum));
 	else {
 		if ((devmode = SMB_MALLOC_P(DEVICEMODE)) != NULL) {
 			ZERO_STRUCTP( devmode );



More information about the samba-cvs mailing list