summaryrefslogtreecommitdiff
path: root/source3/registry/reg_frontend.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-08-22 21:16:11 +0000
committerGerald Carter <jerry@samba.org>2002-08-22 21:16:11 +0000
commit2bd75e4714f664a4cddf406a18f665b5cd590f29 (patch)
tree8c3fd886a9d5668ac47b98795adc96ad31990587 /source3/registry/reg_frontend.c
parent02f8ed71103ca57135980a203d99785a97563455 (diff)
downloadsamba-2bd75e4714f664a4cddf406a18f665b5cd590f29.tar.gz
samba-2bd75e4714f664a4cddf406a18f665b5cd590f29.tar.bz2
samba-2bd75e4714f664a4cddf406a18f665b5cd590f29.zip
fix registry editor API for printing backend after I changed
the NT_PRINTER_PARAM to a REGISTRY_VALUE (This used to be commit 8d510abe125e15a8d71c58a13d170dc3d6371368)
Diffstat (limited to 'source3/registry/reg_frontend.c')
-rw-r--r--source3/registry/reg_frontend.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c
index f31f675997..05bcd989b4 100644
--- a/source3/registry/reg_frontend.c
+++ b/source3/registry/reg_frontend.c
@@ -253,12 +253,9 @@ int regval_ctr_addvalue( REGVAL_CTR *ctr, char *name, uint16 type,
char *data_p, size_t size )
{
REGISTRY_VALUE **ppreg;
- uint16 len;
if ( name )
{
- len = strlen( name );
-
/* allocate a slot in the array of pointers */
if ( ctr->num_values == 0 )
@@ -286,6 +283,42 @@ int regval_ctr_addvalue( REGVAL_CTR *ctr, char *name, uint16 type,
}
/***********************************************************************
+ Add a new registry value to the array
+ **********************************************************************/
+
+int regval_ctr_copyvalue( REGVAL_CTR *ctr, REGISTRY_VALUE *val )
+{
+ REGISTRY_VALUE **ppreg;
+
+ if ( val )
+ {
+ /* allocate a slot in the array of pointers */
+
+ if ( ctr->num_values == 0 )
+ ctr->values = talloc( ctr->ctx, sizeof(REGISTRY_VALUE*) );
+ else {
+ ppreg = talloc_realloc( ctr->ctx, ctr->values, sizeof(REGISTRY_VALUE*)*(ctr->num_values+1) );
+ if ( ppreg )
+ ctr->values = ppreg;
+ }
+
+ /* allocate a new value and store the pointer in the arrya */
+
+ ctr->values[ctr->num_values] = talloc( ctr->ctx, sizeof(REGISTRY_VALUE) );
+
+ /* init the value */
+
+ fstrcpy( ctr->values[ctr->num_values]->valuename, val->valuename );
+ ctr->values[ctr->num_values]->type = val->type;
+ ctr->values[ctr->num_values]->data_p = talloc_memdup( ctr->ctx, val->data_p, val->size );
+ ctr->values[ctr->num_values]->size = val->size;
+ 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.
**********************************************************************/