diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-16 06:00:15 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-16 06:00:15 +0000 |
commit | 7b40bd0a5f7adbca91ce42ae36bb4908a4515fa8 (patch) | |
tree | 210387df2fabb2fedc71aea27472bf3c7cd5e642 /source4/librpc/ndr/ndr.c | |
parent | 3d7524c7ae03f2f257c64a8b1f681b798055fff7 (diff) | |
download | samba-7b40bd0a5f7adbca91ce42ae36bb4908a4515fa8.tar.gz samba-7b40bd0a5f7adbca91ce42ae36bb4908a4515fa8.tar.bz2 samba-7b40bd0a5f7adbca91ce42ae36bb4908a4515fa8.zip |
use the "subcontext" magic flag for sec_desc_buf
(This used to be commit 05ed2f6dc986111ce448123c91380f9340799ecc)
Diffstat (limited to 'source4/librpc/ndr/ndr.c')
-rw-r--r-- | source4/librpc/ndr/ndr.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index 5add5112e7..cd744ab778 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -370,3 +370,38 @@ NTSTATUS ndr_push_error(struct ndr_push *ndr, enum ndr_err_code err, const char /* we should map to different status codes */ return NT_STATUS_INVALID_PARAMETER; } + + +/* + handle subcontext buffers, which in midl land are user-marshalled, but + we use magic in pidl to make them easier to cope with +*/ +NTSTATUS ndr_pull_subcontext_fn(struct ndr_pull *ndr, + void *base, + NTSTATUS (*fn)(struct ndr_pull *, void *)) +{ + uint32 size; + struct ndr_pull ndr2; + + NDR_CHECK(ndr_pull_uint32(ndr, &size)); + NDR_CHECK(ndr_pull_subcontext(ndr, &ndr2, size)); + NDR_CHECK(fn(&ndr2, base)); + NDR_CHECK(ndr_pull_advance(ndr, size)); + return NT_STATUS_OK; +} + + +NTSTATUS ndr_pull_subcontext_flags_fn(struct ndr_pull *ndr, + void *base, + NTSTATUS (*fn)(struct ndr_pull *, int , void *)) +{ + uint32 size; + struct ndr_pull ndr2; + + NDR_CHECK(ndr_pull_uint32(ndr, &size)); + NDR_CHECK(ndr_pull_subcontext(ndr, &ndr2, size)); + NDR_CHECK(fn(&ndr2, NDR_SCALARS|NDR_BUFFERS, base)); + NDR_CHECK(ndr_pull_advance(ndr, size)); + return NT_STATUS_OK; +} + |