summaryrefslogtreecommitdiff
path: root/source3/registry/reg_frontend.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-07-20 13:23:57 +0000
committerGerald Carter <jerry@samba.org>2002-07-20 13:23:57 +0000
commit6dd9f24d05e5db92e15dc53399a0f78ccb69f718 (patch)
tree234454eee6950cf09745f658eebad80756ef6590 /source3/registry/reg_frontend.c
parent29075c97d3b7111e2565ede1cd0f000fd2534375 (diff)
downloadsamba-6dd9f24d05e5db92e15dc53399a0f78ccb69f718.tar.gz
samba-6dd9f24d05e5db92e15dc53399a0f78ccb69f718.tar.bz2
samba-6dd9f24d05e5db92e15dc53399a0f78ccb69f718.zip
another intermediate checkin on the way to enumerating forms
via the registry. There is a seg fault here which shouldn't bother anyone until I can get it fixed. I just need a check point in case I need to roll back to this version later on. (This used to be commit e62ae94823461e142978a786b2860ea97906cfb3)
Diffstat (limited to 'source3/registry/reg_frontend.c')
-rw-r--r--source3/registry/reg_frontend.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c
index 4e3f09fe4e..6e550c1a0d 100644
--- a/source3/registry/reg_frontend.c
+++ b/source3/registry/reg_frontend.c
@@ -32,7 +32,6 @@ extern REGISTRY_OPS regdb_ops; /* these are the default */
REGISTRY_HOOK reg_hooks[] = {
- { KEY_TREE_ROOT, &regdb_ops },
{ KEY_PRINTING, &printing_ops },
{ NULL, NULL }
};
@@ -283,6 +282,58 @@ int regval_ctr_numvals( REGVAL_CTR *ctr )
return ctr->num_values;
}
+REGISTRY_VALUE* regval_ctr_specific_value( REGVAL_CTR *ctr, uint32 idx )
+{
+ if ( !(idx < ctr->num_values) )
+ return NULL;
+
+ return ctr->values[idx];
+}
+
+/***********************************************************************
+ Ad a new regostry value to the array
+ **********************************************************************/
+
+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 );
+
+ 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;
+ }
+
+ fstrcpy( ctr->values[ctr->num_values]->valuename, name );
+ ctr->values[ctr->num_values]->type = type;
+ switch ( type )
+ {
+ case REG_SZ:
+ ctr->values[ctr->num_values]->data.string = talloc_strdup( ctr->ctx, data_p );
+ break;
+ case REG_DWORD:
+ break;
+ case REG_BINARY:
+ ctr->values[ctr->num_values]->data.binary = talloc_memdup( ctr->ctx, data_p, size );
+ break;
+
+ }
+ ctr->values[ctr->num_values]->size = size;
+
+ ctr->num_values++;
+ }
+
+ return ctr->num_values;
+}
+
/***********************************************************************
free memory held by a REGVAL_CTR structure
**********************************************************************/