libndr: add LIBNDR_FLAG_NO_RELATIVE_REVERSE so that relative reverse processing
authorGünther Deschner <gd@samba.org>
Tue, 9 Feb 2010 17:27:37 +0000 (18:27 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 18 Feb 2010 12:44:02 +0000 (13:44 +0100)
can be disabled for single structure elements.

Guenther

librpc/idl/idl_types.h
librpc/ndr/libndr.h
librpc/ndr/ndr.c

index 193a1f612f15c45a29e99345f6982ed1a4785512..3c6c12cd846a6c0563b01f9dd418f68402eec0a4 100644 (file)
@@ -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
index 39ae25f7e68cb93974d97a028160d965b23cfe53..124c5f0d6e17224a87c8a004595c9bd4c966a4f1 100644 (file)
@@ -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)
 
index 80025d71f07d0f1022e4a1bf5b27095de3a2183c..4e584e102bf629a45392a1ca07b2dd02ecd55e5c 100644 (file)
@@ -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;
 }