diff options
author | Jeremy Allison <jra@samba.org> | 2001-05-01 01:01:27 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-05-01 01:01:27 +0000 |
commit | cbe87a2449dd8e008810e2d3830ab414e495502e (patch) | |
tree | c68b1c3c179d32576a95565eb75ba1c6fa480376 /source/rpc_parse/parse_misc.c | |
parent | 4d6efef3be6ac1d42361ebe85c020b50efd7c302 (diff) | |
download | samba-cbe87a2449dd8e008810e2d3830ab414e495502e.tar.gz samba-cbe87a2449dd8e008810e2d3830ab414e495502e.tar.xz samba-cbe87a2449dd8e008810e2d3830ab414e495502e.zip |
Added code from "Nigel Williams" <nigel@veritas.com> (yes, the same famous
Nigel Williams who did NIS/GINA !) to implement add/modify/delete shares
for Win2k. Needs testing as I made a few mods to the original code.
Jeremy.
Diffstat (limited to 'source/rpc_parse/parse_misc.c')
-rw-r--r-- | source/rpc_parse/parse_misc.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/rpc_parse/parse_misc.c b/source/rpc_parse/parse_misc.c index 81602a1dc40..4b118dd2b45 100644 --- a/source/rpc_parse/parse_misc.c +++ b/source/rpc_parse/parse_misc.c @@ -1457,6 +1457,37 @@ BOOL smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth) } /******************************************************************* + Create a UNISTR3. +********************************************************************/ + +void init_unistr3(UNISTR3 *str, const char *buf) +{ + size_t len; + + if (buf == NULL) { + str->uni_str_len=0; + str->str.buffer = NULL; + return; + } + + len = strlen(buf) + 1; + + str->uni_str_len=len; + + if (len < MAX_UNISTRLEN) + len = MAX_UNISTRLEN; + + len *= sizeof(uint16); + + str->str.buffer = (uint16 *)talloc_zero(get_talloc_ctx(), len); + if (str->str.buffer == NULL) + smb_panic("init_unistr3: malloc fail\n"); + + /* store the string (null-terminated copy) */ + dos_struni2((char *)str->str.buffer, buf, len); +} + +/******************************************************************* Reads or writes a UNISTR3 structure. ********************************************************************/ |