summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-12-14 14:08:34 +0100
committerKarolin Seeger <kseeger@samba.org>2010-02-22 15:50:35 +0100
commit08777336e85b0df3d0f314dfee1056ce2f0e31f9 (patch)
treee54fcda74910009db0baecf972b23c2e6836fb50
parent678672b787cbddf5cf31fd2acf6e11a239d5a57b (diff)
downloadsamba-08777336e85b0df3d0f314dfee1056ce2f0e31f9.tar.gz
samba-08777336e85b0df3d0f314dfee1056ce2f0e31f9.tar.xz
samba-08777336e85b0df3d0f314dfee1056ce2f0e31f9.zip
libndr: add ndr_push_relative_ptr2_start and ndr_push_relative_ptr2_end.
Guenther (cherry picked from commit f52de6e2293de4a7ba4726025dd936228b51b5b5)
-rw-r--r--librpc/ndr/libndr.h2
-rw-r--r--librpc/ndr/ndr.c24
2 files changed, 26 insertions, 0 deletions
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
@@ -1063,6 +1063,30 @@ _PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2(struct ndr_push *ndr, const vo
}
/*
+ 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
*/
_PUBLIC_ uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr)