From 6dd9f24d05e5db92e15dc53399a0f78ccb69f718 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 20 Jul 2002 13:23:57 +0000 Subject: 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) --- source3/registry/reg_frontend.c | 53 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) (limited to 'source3/registry/reg_frontend.c') 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, ®db_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 **********************************************************************/ -- cgit