diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-08-18 01:24:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:33:29 -0500 |
commit | ec96a742f7b6ce4cbb4f649dd8aba92ef80f0ff0 (patch) | |
tree | 79de41fa761ca1854c1054161173bec374d371eb /source4/librpc/ndr/ndr.c | |
parent | a8d31eac00cf13c20343374f11224778e470e849 (diff) | |
download | samba-ec96a742f7b6ce4cbb4f649dd8aba92ef80f0ff0.tar.gz samba-ec96a742f7b6ce4cbb4f649dd8aba92ef80f0ff0.tar.bz2 samba-ec96a742f7b6ce4cbb4f649dd8aba92ef80f0ff0.zip |
r9373: - create a hierachical memory tree with recursiv ndr_pull_* functions
- with this it's also possible to talloc_free() the ndr_pull structure
and talloc_steal(ndr->current_mem_ctx); to fetch the whole data of the hierachical tree
- if the toplevel struct is a valid talloc pointer it's also possible to use
NDR_PULL_SET_MEM_CTX(ndr, mem_ctx); to the the toplevel pointer with the struct pointer
(NOTE: no callers are using this yet, but they shortly will)
metze
(This used to be commit 1a2b8369586642cc9bc15d015c1e4256c3a92732)
Diffstat (limited to 'source4/librpc/ndr/ndr.c')
-rw-r--r-- | source4/librpc/ndr/ndr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index a84049a3b0..6bc4198de1 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -50,6 +50,7 @@ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx) ndr = talloc_zero(mem_ctx, struct ndr_pull); if (!ndr) return NULL; + ndr->current_mem_ctx = mem_ctx; ndr->data = blob->data; ndr->data_size = blob->length; @@ -359,6 +360,7 @@ NTSTATUS ndr_pull_subcontext_start(struct ndr_pull *ndr, subndr = talloc_zero(ndr, struct ndr_pull); NT_STATUS_HAVE_NO_MEMORY(subndr); subndr->flags = ndr->flags; + subndr->current_mem_ctx = ndr->current_mem_ctx; subndr->data = ndr->data + ndr->offset; subndr->offset = 0; |