diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-03-29 20:36:32 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-03-29 20:36:32 +0200 |
commit | 90d2902c73715c7777ad67b2a33f32a79f72764c (patch) | |
tree | 89641b23f86e73dcb6320a8cd1b26e22faab502c | |
parent | 8efea429481fcab2e67fa4f3f3f4ceee1857f8ac (diff) | |
download | samba-90d2902c73715c7777ad67b2a33f32a79f72764c.tar.gz samba-90d2902c73715c7777ad67b2a33f32a79f72764c.tar.bz2 samba-90d2902c73715c7777ad67b2a33f32a79f72764c.zip |
s4:registry - move the UTF16 length calculation for "reg_key_get_info" into the RPC server code
It does fit better there.
-rw-r--r-- | source4/lib/registry/ldb.c | 8 | ||||
-rw-r--r-- | source4/rpc_server/winreg/rpc_winreg.c | 9 |
2 files changed, 9 insertions, 8 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index b897641f33..36761e5273 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -916,9 +916,6 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx, el = ldb_msg_find_element(kd->subkeys[i], "key"); *max_subkeynamelen = MAX(*max_subkeynamelen, el->values[0].length); } - - /* for UTF16 encoding */ - *max_subkeynamelen *= 2; } if (max_valnamelen != NULL || max_valbufsize != NULL) { @@ -948,11 +945,6 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx, talloc_free(data.data); } } - - if (max_valnamelen != NULL) { - /* for UTF16 encoding */ - *max_valnamelen *= 2; - } } talloc_free(default_value.data); diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c index 1b4044ffb7..002eb685ea 100644 --- a/source4/rpc_server/winreg/rpc_winreg.c +++ b/source4/rpc_server/winreg/rpc_winreg.c @@ -464,6 +464,15 @@ static WERROR dcesrv_winreg_QueryInfoKey(struct dcesrv_call_state *dce_call, r->out.last_changed_time, r->out.max_subkeylen, r->out.max_valnamelen, r->out.max_valbufsize); + if (r->out.max_subkeylen != NULL) { + /* for UTF16 encoding */ + *r->out.max_subkeylen *= 2; + } + if (r->out.max_valnamelen != NULL) { + /* for UTF16 encoding */ + *r->out.max_valnamelen *= 2; + } + if (classname != NULL) { r->out.classname->name = classname; r->out.classname->name_len = 2*strlen_m_term(classname); |