summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-06 17:52:23 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:30 +0100
commit39ee38d9c1aabf4db065b433d067d0da053d7d61 (patch)
tree5c827c09374873fe386c28ef51415d81a49c939a /source4/lib/registry
parentb440ed3df31b11d520c6d744cf53c54165f61b7a (diff)
downloadsamba-39ee38d9c1aabf4db065b433d067d0da053d7d61.tar.gz
samba-39ee38d9c1aabf4db065b433d067d0da053d7d61.tar.bz2
samba-39ee38d9c1aabf4db065b433d067d0da053d7d61.zip
r26316: Use contexts for conversion functions.
(This used to be commit f6420d933b5b011d428974f3a2a57edf19e6f482)
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/ldb.c4
-rw-r--r--source4/lib/registry/patchfile_preg.c2
-rw-r--r--source4/lib/registry/tests/generic.c6
-rw-r--r--source4/lib/registry/util.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 6ce422049b..0e556da9e2 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -54,7 +54,7 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx, struct ldb_message *msg,
{
case REG_SZ:
case REG_EXPAND_SZ:
- data->length = convert_string_talloc(mem_ctx, CH_UTF8, CH_UTF16,
+ data->length = convert_string_talloc(mem_ctx, global_smb_iconv_convenience, CH_UTF8, CH_UTF16,
val->data, val->length,
(void **)&data->data);
break;
@@ -85,7 +85,7 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
switch (type) {
case REG_SZ:
case REG_EXPAND_SZ:
- val.length = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
+ val.length = convert_string_talloc(mem_ctx, global_smb_iconv_convenience, CH_UTF16, CH_UNIX,
(void *)data.data,
data.length,
(void **)&val.data);
diff --git a/source4/lib/registry/patchfile_preg.c b/source4/lib/registry/patchfile_preg.c
index 90a4f2529a..6af239fc21 100644
--- a/source4/lib/registry/patchfile_preg.c
+++ b/source4/lib/registry/patchfile_preg.c
@@ -36,7 +36,7 @@ static WERROR preg_read_utf16(int fd, char *c)
if (read(fd, &v, 2) < 2) {
return WERR_GENERAL_FAILURE;
}
- push_codepoint(c, v);
+ push_codepoint(global_smb_iconv_convenience, c, v);
return WERR_OK;
}
diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c
index 13e27cd80b..1acb6342e7 100644
--- a/source4/lib/registry/tests/generic.c
+++ b/source4/lib/registry/tests/generic.c
@@ -52,7 +52,7 @@ static bool test_reg_val_data_string_dword(struct torture_context *ctx)
static bool test_reg_val_data_string_sz(struct torture_context *ctx)
{
DATA_BLOB db;
- db.length = convert_string_talloc(ctx, CH_UNIX, CH_UTF16,
+ db.length = convert_string_talloc(ctx, global_smb_iconv_convenience, CH_UNIX, CH_UTF16,
"bla", 3, (void **)&db.data);
torture_assert_str_equal(ctx, "bla",
reg_val_data_string(ctx, REG_SZ, db),
@@ -87,7 +87,7 @@ static bool test_reg_val_data_string_empty(struct torture_context *ctx)
static bool test_reg_val_description(struct torture_context *ctx)
{
DATA_BLOB data;
- data.length = convert_string_talloc(ctx, CH_UNIX, CH_UTF16,
+ data.length = convert_string_talloc(ctx, global_smb_iconv_convenience, CH_UNIX, CH_UTF16,
"stationary traveller",
strlen("stationary traveller"),
(void **)&data.data);
@@ -101,7 +101,7 @@ static bool test_reg_val_description(struct torture_context *ctx)
static bool test_reg_val_description_nullname(struct torture_context *ctx)
{
DATA_BLOB data;
- data.length = convert_string_talloc(ctx, CH_UNIX, CH_UTF16,
+ data.length = convert_string_talloc(ctx, global_smb_iconv_convenience, CH_UNIX, CH_UTF16,
"west berlin",
strlen("west berlin"),
(void **)&data.data);
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c
index ca3e3dd619..f75fc835b5 100644
--- a/source4/lib/registry/util.c
+++ b/source4/lib/registry/util.c
@@ -61,7 +61,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, CH_UTF16, CH_UNIX,
+ convert_string_talloc(mem_ctx, global_smb_iconv_convenience, CH_UTF16, CH_UNIX,
data.data, data.length,
(void **)&ret);
return ret;
@@ -117,7 +117,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, CH_UNIX, CH_UTF16,
+ data->length = convert_string_talloc(mem_ctx, global_smb_iconv_convenience, CH_UNIX, CH_UTF16,
data_str, strlen(data_str),
(void **)&data->data);
break;