From 08777336e85b0df3d0f314dfee1056ce2f0e31f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Mon, 14 Dec 2009 14:08:34 +0100 Subject: libndr: add ndr_push_relative_ptr2_start and ndr_push_relative_ptr2_end. Guenther (cherry picked from commit f52de6e2293de4a7ba4726025dd936228b51b5b5) --- librpc/ndr/libndr.h | 2 ++ librpc/ndr/ndr.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h index 7109b73d2a9..9b71efb83f5 100644 --- a/librpc/ndr/libndr.h +++ b/librpc/ndr/libndr.h @@ -370,6 +370,8 @@ enum ndr_err_code ndr_push_setup_relative_base_offset1(struct ndr_push *ndr, con enum ndr_err_code ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *p); enum ndr_err_code ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p); enum ndr_err_code ndr_push_relative_ptr2(struct ndr_push *ndr, const void *p); +enum ndr_err_code ndr_push_relative_ptr2_start(struct ndr_push *ndr, const void *p); +enum ndr_err_code ndr_push_relative_ptr2_end(struct ndr_push *ndr, const void *p); uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr); void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset); enum ndr_err_code ndr_pull_setup_relative_base_offset1(struct ndr_pull *ndr, const void *p, uint32_t offset); diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c index 8188ec998fe..9b4edacd9df 100644 --- a/librpc/ndr/ndr.c +++ b/librpc/ndr/ndr.c @@ -1062,6 +1062,30 @@ _PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2(struct ndr_push *ndr, const vo return NDR_ERR_SUCCESS; } +/* + push a relative object - stage2 start + this is called during buffers processing +*/ +_PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2_start(struct ndr_push *ndr, const void *p) +{ + if (p == NULL) { + return NDR_ERR_SUCCESS; + } + return ndr_push_relative_ptr2(ndr, p); +} + +/* + push a relative object - stage2 end + this is called during buffers processing +*/ +_PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2_end(struct ndr_push *ndr, const void *p) +{ + if (p == NULL) { + return NDR_ERR_SUCCESS; + } + return NDR_ERR_SUCCESS; +} + /* get the current base for relative pointers for the pull */ -- cgit v1.2.1