summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r--source3/rpc_parse/parse_misc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 69455b7b42..471cb59e1c 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -747,7 +747,7 @@ BOOL make_buf_unistr2(UNISTR2 *str, uint32 *ptr, char *buf)
/*******************************************************************
copies a UNISTR2 structure.
********************************************************************/
-BOOL copy_unistr2(UNISTR2 *str, UNISTR2 *from)
+BOOL copy_unistr2(UNISTR2 *str, const UNISTR2 *from)
{
/* set up string lengths. add one if string is not null-terminated */
str->uni_max_len = from->uni_max_len;
@@ -761,6 +761,24 @@ BOOL copy_unistr2(UNISTR2 *str, UNISTR2 *from)
}
/*******************************************************************
+duplicates a UNISTR2 structure.
+********************************************************************/
+UNISTR2 *unistr2_dup(const UNISTR2 *name)
+{
+ UNISTR2 *copy = (UNISTR2*)malloc(sizeof(*copy));
+ copy_unistr2(copy, name);
+ return copy;
+}
+
+/*******************************************************************
+frees a UNISTR2 structure.
+********************************************************************/
+void unistr2_free(UNISTR2 *name)
+{
+ free(name);
+}
+
+/*******************************************************************
creates a STRING2 structure.
********************************************************************/
BOOL make_string2(STRING2 *str, char *buf, int len)