summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-08-16 15:36:37 +0000
committerGerald Carter <jerry@samba.org>2002-08-16 15:36:37 +0000
commit4ed429481c6aa2517b8b1615f95900d7db372cd6 (patch)
tree2cf8802fff6846a328065b3b468112101a9207a9 /source3/registry
parentb84315e2d583ad4bf06b5e43c3c1046a751326b6 (diff)
downloadsamba-4ed429481c6aa2517b8b1615f95900d7db372cd6.tar.gz
samba-4ed429481c6aa2517b8b1615f95900d7db372cd6.tar.bz2
samba-4ed429481c6aa2517b8b1615f95900d7db372cd6.zip
Fairly large change to printing code.
* removed support for PHANTOM_DEVMODE printer data * s/NT_PRINTER_PARAM/REGISTRY_VALUE/g - This was a good bit of work. Everything seems stable, but is not complete. * support for printer data keys other than PrinterDriverData in the store and fetch routines. Still needs to be plugged into the XxxPrinterDataEx() calls. Tested against NT4.0 & 2k. Like I said, it's not done, but doesn't crash so it shouldn't upset anyone (unless you're trying to build a Samba printer server off of HEAD). More work to come. Should settle by Monday. jerry (This used to be commit 7ba7c04c0e961618c82c2112b9627af114c6cc42)
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_frontend.c91
-rw-r--r--source3/registry/reg_printing.c6
2 files changed, 93 insertions, 4 deletions
diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c
index c0788c1b75..45c1f24001 100644
--- a/source3/registry/reg_frontend.c
+++ b/source3/registry/reg_frontend.c
@@ -188,6 +188,38 @@ void free_registry_value( REGISTRY_VALUE *val )
return;
}
+/**********************************************************************
+ *********************************************************************/
+
+uint8* regval_data_p( REGISTRY_VALUE *val )
+{
+ return val->data_p;
+}
+
+/**********************************************************************
+ *********************************************************************/
+
+int regval_size( REGISTRY_VALUE *val )
+{
+ return val->size;
+}
+
+/**********************************************************************
+ *********************************************************************/
+
+char* regval_name( REGISTRY_VALUE *val )
+{
+ return val->valuename;
+}
+
+/**********************************************************************
+ *********************************************************************/
+
+uint32 regval_type( REGISTRY_VALUE *val )
+{
+ return val->type;
+}
+
/***********************************************************************
Retreive a pointer to a specific value. Caller shoud dup the structure
since this memory may go away with a regval_ctr_destroy()
@@ -214,7 +246,7 @@ TALLOC_CTX* regval_ctr_getctx( REGVAL_CTR *val )
}
/***********************************************************************
- Add a new regostry value to the array
+ Add a new registry value to the array
**********************************************************************/
int regval_ctr_addvalue( REGVAL_CTR *ctr, char *name, uint16 type,
@@ -237,7 +269,7 @@ int regval_ctr_addvalue( REGVAL_CTR *ctr, char *name, uint16 type,
ctr->values = ppreg;
}
- /* allocate a new valuie and store the pointer in the arrya */
+ /* allocate a new value and store the pointer in the arrya */
ctr->values[ctr->num_values] = talloc( ctr->ctx, sizeof(REGISTRY_VALUE) );
@@ -254,6 +286,61 @@ int regval_ctr_addvalue( REGVAL_CTR *ctr, char *name, uint16 type,
}
/***********************************************************************
+ Delete a single value from the registry container.
+ No need to free memory since it is talloc'd.
+ **********************************************************************/
+
+int regval_ctr_delvalue( REGVAL_CTR *ctr, char *name )
+{
+ int i;
+
+ /* search for the value */
+
+ for ( i=0; i<ctr->num_values; i++ ) {
+ if ( strcmp( ctr->values[i]->valuename, name ) == 0)
+ break;
+ }
+
+ /* just return if we don't find it */
+
+ if ( i == ctr->num_values )
+ return ctr->num_values;
+
+ /* just shift everything down one */
+
+ for ( /* use previous i */; i<(ctr->num_values-1); i++ )
+ memcpy( ctr->values[i], ctr->values[i+1], sizeof(REGISTRY_VALUE) );
+
+ /* paranoia */
+
+ ZERO_STRUCTP( ctr->values[i] );
+
+ ctr->num_values--;
+
+ return ctr->num_values;
+}
+
+/***********************************************************************
+ Delete a single value from the registry container.
+ No need to free memory since it is talloc'd.
+ **********************************************************************/
+
+REGISTRY_VALUE* regval_ctr_getvalue( REGVAL_CTR *ctr, char *name )
+{
+ int i;
+
+ /* search for the value */
+
+ for ( i=0; i<ctr->num_values; i++ ) {
+ if ( strcmp( ctr->values[i]->valuename, name ) == 0)
+ return ctr->values[i];
+
+ }
+
+ return NULL;
+}
+
+/***********************************************************************
free memory held by a REGVAL_CTR structure
**********************************************************************/
diff --git a/source3/registry/reg_printing.c b/source3/registry/reg_printing.c
index 3fd3680489..8f53fe9ea5 100644
--- a/source3/registry/reg_printing.c
+++ b/source3/registry/reg_printing.c
@@ -492,7 +492,7 @@ static int print_subpath_printers( char *key, REGSUBKEY_CTR *subkeys )
free_a_printer( &printer, 2 );
- regsubkey_ctr_addkey( subkeys, "PrinterDriverData" );
+ regsubkey_ctr_addkey( subkeys, SPOOL_PRINTERDATA_KEY );
}
/* no other subkeys below here */
@@ -620,7 +620,7 @@ static int print_subpath_values_printers( char *key, REGVAL_CTR *val )
/* here should be no more path components here */
- if ( new_path || strcmp(base, "PrinterDriverData") )
+ if ( new_path || strcmp(base, SPOOL_PRINTERDATA_KEY) )
goto done;
/* now enumerate the PrinterDriverData key */
@@ -632,10 +632,12 @@ static int print_subpath_values_printers( char *key, REGVAL_CTR *val )
/* iterate over all printer data and fill the regval container */
+#if 0 /* JERRY */
for ( i=0; get_specific_param_by_index(*printer, 2, i, valuename, &data, &type, &data_len); i++ )
{
regval_ctr_addvalue( val, valuename, type, data, data_len );
}
+#endif
free_a_printer( &printer, 2 );