diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-08-10 20:55:42 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:57:49 -0500 |
commit | 1f0ea81ae9ea3ff02b10d0829d1db948bfe4500d (patch) | |
tree | fad4064abea2ecc18dfc72e29e364d089627e46b /source4/build/pidl/packet-dcerpc-eparser.c | |
parent | 2c7c48017b59d666927f6702ac148bf2ccface07 (diff) | |
download | samba-1f0ea81ae9ea3ff02b10d0829d1db948bfe4500d.tar.gz samba-1f0ea81ae9ea3ff02b10d0829d1db948bfe4500d.tar.bz2 samba-1f0ea81ae9ea3ff02b10d0829d1db948bfe4500d.zip |
r1703: - Lots of RPC updates, adding new pipes and protocols.
- More updates/fixes to the ethereal parser generator
(This used to be commit 547f860285b117e291bf3dbaca0707dc268b214e)
Diffstat (limited to 'source4/build/pidl/packet-dcerpc-eparser.c')
-rw-r--r-- | source4/build/pidl/packet-dcerpc-eparser.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/source4/build/pidl/packet-dcerpc-eparser.c b/source4/build/pidl/packet-dcerpc-eparser.c index bef5d82646..bf2b6e7981 100644 --- a/source4/build/pidl/packet-dcerpc-eparser.c +++ b/source4/build/pidl/packet-dcerpc-eparser.c @@ -113,14 +113,33 @@ void ndr_pull_uint64(struct e_ndr_pull *ndr, proto_tree *tree, int hf, void ndr_pull_DATA_BLOB(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gDATA_BLOB *h) { - guint32 len1, ofs, len2; - char *data; + guint32 length; if (!(ndr_flags & NDR_SCALARS)) { return; } - /* FIXME */ + if (ndr->flags & LIBNDR_ALIGN_FLAGS) { + if (ndr->flags & LIBNDR_FLAG_ALIGN2) { + length = NDR_ALIGN(ndr, 2); + } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) { + length = NDR_ALIGN(ndr, 4); + } else if (ndr->flags & LIBNDR_FLAG_ALIGN8) { + length = NDR_ALIGN(ndr, 8); + } + if (ndr->data_size - ndr->offset < length) { + length = ndr->data_size - ndr->offset; + } + } else if (ndr->flags & LIBNDR_FLAG_REMAINING) { + length = ndr->data_size - ndr->offset; + } else { + ndr_pull_uint32(ndr, &length); + } + + h->data = g_malloc(length); + proto_tree_add_bytes(tree, hf_bytes_data, ndr->tvb, ndr->offset, length, h->data); + + ndr->offset += length; } void ndr_pull_string(struct e_ndr_pull *ndr, proto_tree *tree, int ndr_flags) |