summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_basic.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-09 02:21:24 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-09 02:21:24 +0000
commit946d358646977e265cb36b34324a1145c6121870 (patch)
tree7e537d756241e98dfa2d4bbb44f50ee3f4e6d648 /source4/librpc/ndr/ndr_basic.c
parent75a30ad8283c49bb426c087344e40ed09abe95fd (diff)
downloadsamba-946d358646977e265cb36b34324a1145c6121870.tar.gz
samba-946d358646977e265cb36b34324a1145c6121870.tar.bz2
samba-946d358646977e265cb36b34324a1145c6121870.zip
lsa_LookupNames now works
(This used to be commit fba3a7ad22edcbe394861e42b5e5c53709e9d5fe)
Diffstat (limited to 'source4/librpc/ndr/ndr_basic.c')
-rw-r--r--source4/librpc/ndr/ndr_basic.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 3e6d0b30e6..6ada49997f 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -221,7 +221,7 @@ NTSTATUS ndr_push_length4_end(struct ndr_push *ndr, struct ndr_push_save *save)
*/
NTSTATUS ndr_push_ptr(struct ndr_push *ndr, const void *p)
{
- return ndr_push_uint32(ndr, p?1:0);
+ return ndr_push_uint32(ndr, p?0xaabbccdd:0);
}
/*
@@ -243,6 +243,25 @@ NTSTATUS ndr_push_unistr(struct ndr_push *ndr, const char *s)
}
/*
+ push a comformant, variable ucs2 string onto the wire from a C string
+ don't send the null
+*/
+NTSTATUS ndr_push_unistr_noterm(struct ndr_push *ndr, const char *s)
+{
+ char *ws;
+ ssize_t len;
+ len = push_ucs2_talloc(ndr->mem_ctx, (smb_ucs2_t **)&ws, s);
+ if (len == -1) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ NDR_CHECK(ndr_push_uint32(ndr, len/2 - 1));
+ NDR_CHECK(ndr_push_uint32(ndr, 0));
+ NDR_CHECK(ndr_push_uint32(ndr, len/2 - 1));
+ NDR_CHECK(ndr_push_bytes(ndr, ws, len - 2));
+ return NT_STATUS_OK;
+}
+
+/*
pull a comformant, variable ucs2 string from the wire into a C string
*/
NTSTATUS ndr_pull_unistr(struct ndr_pull *ndr, const char **s)
@@ -269,6 +288,14 @@ NTSTATUS ndr_pull_unistr(struct ndr_pull *ndr, const char **s)
}
/*
+ pull a comformant, variable ucs2 string from the wire into a C string
+*/
+NTSTATUS ndr_pull_unistr_noterm(struct ndr_pull *ndr, const char **s)
+{
+ return ndr_pull_unistr(ndr, s);
+}
+
+/*
push a 4 byte offset pointer, remembering where we are so we can later fill
in the correct value
*/