summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc/ndr/ndr.c')
-rw-r--r--source4/librpc/ndr/ndr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index 3c2ed6e55b..5add5112e7 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -50,6 +50,20 @@ struct ndr_pull *ndr_pull_init_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx)
return ndr;
}
+/*
+ create an ndr sub-context based on an existing context. The new context starts
+ at the current offset, with the given size limit
+*/
+NTSTATUS ndr_pull_subcontext(struct ndr_pull *ndr, struct ndr_pull *ndr2, uint32 size)
+{
+ NDR_PULL_NEED_BYTES(ndr, size);
+ *ndr2 = *ndr;
+ ndr2->data += ndr2->offset;
+ ndr2->offset = 0;
+ ndr2->data_size = size;
+ return NT_STATUS_OK;
+}
+
/* limit the remaining size of the current ndr parse structure to the
given size, starting at the given offset