From 5b52e4a0eb8cd4a68eb35114576ccc0ae85c2a1a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 14 Oct 2005 21:43:13 +0000 Subject: r11072: add routines for converting REG_MULTI_SZ to and from char** (This used to be commit e858eed813b5a9a8d57262142c5bbde2951b5590) --- source3/registry/reg_util.c | 104 ++++++++++++++++++++++++++++++++++++++++ source3/rpc_server/srv_reg_nt.c | 14 +++++- 2 files changed, 117 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/registry/reg_util.c b/source3/registry/reg_util.c index 9f19db2646..4338699c00 100644 --- a/source3/registry/reg_util.c +++ b/source3/registry/reg_util.c @@ -125,3 +125,107 @@ char* reg_remaining_path( const char *key ) return p; } +/********************************************************************** +*********************************************************************/ + +int regval_convert_multi_sz( uint16 *multi_string, size_t multi_len, char ***values ) +{ + char **sz; + int i; + int num_strings = 0; + fstring buffer; + uint16 *wp; + + *values = NULL; + + /* just count the NULLs */ + + for ( i=0; (itype == REG_MULTI_SZ ) { - + char **str; + int num_strings = regval_convert_multi_sz( (uint16*)regval_data_p(val), regval_size(val), &str ); + uint16 *buffer; + size_t buf_size; + + + if ( num_strings ) + buf_size = regval_build_multi_sz( str, &buffer ); + + TALLOC_FREE( str ); + TALLOC_FREE( buffer ); } +#endif DEBUG(10,("_reg_enum_value: retrieved value named [%s]\n", val->valuename)); -- cgit