summaryrefslogtreecommitdiff
path: root/source4/lib/registry/util.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-21 16:01:19 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-21 16:01:19 +0100
commit48307b54f95395fbd201d92d738b482f80cd15ef (patch)
treefde46141ad4c47fe726718a19e68743227ef56c0 /source4/lib/registry/util.c
parent263a77c5618daddb0c1e4f0ad0a922bca55faf0d (diff)
downloadsamba-48307b54f95395fbd201d92d738b482f80cd15ef.tar.gz
samba-48307b54f95395fbd201d92d738b482f80cd15ef.tar.bz2
samba-48307b54f95395fbd201d92d738b482f80cd15ef.zip
Remove more uses of global_loadparm.
(This used to be commit 3430cc60972b94d0d238bc39f473feed96949c5d)
Diffstat (limited to 'source4/lib/registry/util.c')
-rw-r--r--source4/lib/registry/util.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c
index a251ae49a5..68efd56a86 100644
--- a/source4/lib/registry/util.c
+++ b/source4/lib/registry/util.c
@@ -51,7 +51,9 @@ _PUBLIC_ const char *str_regtype(int type)
return "Unknown";
}
-_PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, uint32_t type,
+_PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx,
+ struct smb_iconv_convenience *iconv_convenience,
+ uint32_t type,
const DATA_BLOB data)
{
char *ret = NULL;
@@ -62,7 +64,7 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, uint32_t type,
switch (type) {
case REG_EXPAND_SZ:
case REG_SZ:
- convert_string_talloc(mem_ctx, lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX,
+ convert_string_talloc(mem_ctx, iconv_convenience, CH_UTF16, CH_UNIX,
data.data, data.length,
(void **)&ret);
return ret;
@@ -85,16 +87,20 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, uint32_t type,
}
/** Generate a string that describes a registry value */
-_PUBLIC_ char *reg_val_description(TALLOC_CTX *mem_ctx, const char *name,
+_PUBLIC_ char *reg_val_description(TALLOC_CTX *mem_ctx,
+ struct smb_iconv_convenience *iconv_convenience,
+ const char *name,
uint32_t data_type,
const DATA_BLOB data)
{
return talloc_asprintf(mem_ctx, "%s = %s : %s", name?name:"<No Name>",
str_regtype(data_type),
- reg_val_data_string(mem_ctx, data_type, data));
+ reg_val_data_string(mem_ctx, iconv_convenience, data_type, data));
}
-_PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx, const char *type_str,
+_PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx,
+ struct smb_iconv_convenience *iconv_convenience,
+ const char *type_str,
const char *data_str, uint32_t *type,
DATA_BLOB *data)
{
@@ -118,7 +124,7 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx, const char *type_str,
{
case REG_SZ:
case REG_EXPAND_SZ:
- data->length = convert_string_talloc(mem_ctx, lp_iconv_convenience(global_loadparm), CH_UNIX, CH_UTF16,
+ data->length = convert_string_talloc(mem_ctx, iconv_convenience, CH_UNIX, CH_UTF16,
data_str, strlen(data_str),
(void **)&data->data);
break;