From a2c34296fa6ca2ffb69cb69698a9b5f81803e8a8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 9 Feb 2010 18:27:37 +0100 Subject: libndr: add LIBNDR_FLAG_NO_RELATIVE_REVERSE so that relative reverse processing can be disabled for single structure elements. Guenther --- librpc/idl/idl_types.h | 1 + librpc/ndr/libndr.h | 3 +++ librpc/ndr/ndr.c | 3 +++ 3 files changed, 7 insertions(+) (limited to 'librpc') diff --git a/librpc/idl/idl_types.h b/librpc/idl/idl_types.h index 193a1f612f..3c6c12cd84 100644 --- a/librpc/idl/idl_types.h +++ b/librpc/idl/idl_types.h @@ -69,3 +69,4 @@ #define NDR_PAHEX LIBNDR_PRINT_ARRAY_HEX #define NDR_RELATIVE_REVERSE LIBNDR_FLAG_RELATIVE_REVERSE +#define NDR_NO_RELATIVE_REVERSE LIBNDR_FLAG_NO_RELATIVE_REVERSE diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h index 39ae25f7e6..124c5f0d6e 100644 --- a/librpc/ndr/libndr.h +++ b/librpc/ndr/libndr.h @@ -124,6 +124,9 @@ struct ndr_print { #define LIBNDR_FLAG_STR_UTF8 (1<<12) #define LIBNDR_STRING_FLAGS (0x7FFC) +/* set if relative pointers should *not* be marshalled in reverse order */ +#define LIBNDR_FLAG_NO_RELATIVE_REVERSE (1<<18) + /* set if relative pointers are marshalled in reverse order */ #define LIBNDR_FLAG_RELATIVE_REVERSE (1<<19) diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c index 80025d71f0..4e584e102b 100644 --- a/librpc/ndr/ndr.c +++ b/librpc/ndr/ndr.c @@ -367,6 +367,9 @@ _PUBLIC_ void ndr_set_flags(uint32_t *pflags, uint32_t new_flags) if (new_flags & LIBNDR_ALIGN_FLAGS) { (*pflags) &= ~LIBNDR_FLAG_REMAINING; } + if (new_flags & LIBNDR_FLAG_NO_RELATIVE_REVERSE) { + (*pflags) &= ~LIBNDR_FLAG_RELATIVE_REVERSE; + } (*pflags) |= new_flags; } -- cgit