summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/libndr.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-13 09:26:53 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-13 09:26:53 +0000
commit3031937d56363cc6322062a66c991182664f40bc (patch)
tree4d2ef00a8f2e269fdefeccc04f6ae2db9dd45d63 /source4/librpc/ndr/libndr.h
parentff02537261e53b4ec60e5dcad32bf4207065b028 (diff)
downloadsamba-3031937d56363cc6322062a66c991182664f40bc.tar.gz
samba-3031937d56363cc6322062a66c991182664f40bc.tar.bz2
samba-3031937d56363cc6322062a66c991182664f40bc.zip
* fixed conformant arrays in structures
* expanded the rpcecho test * started adding the NETDFS pipe (This used to be commit 095ab42cbdd5c1c5ab753e2eb275742ba822c8b9)
Diffstat (limited to 'source4/librpc/ndr/libndr.h')
-rw-r--r--source4/librpc/ndr/libndr.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index da262af00c..287046ad20 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -76,6 +76,12 @@ struct ndr_print {
#define NDR_PRINT_UNION_DEBUG(type, level, p) ndr_print_union_debug((ndr_print_union_fn_t)ndr_print_ ##type, #p, level, p)
+enum ndr_err_code {
+ NDR_ERR_CONFORMANT_SIZE,
+ NDR_ERR_ARRAY_SIZE,
+ NDR_ERR_BAD_SWITCH
+};
+
/*
flags passed to control parse flow
*/
@@ -91,11 +97,14 @@ struct ndr_print {
} while (0)
-#define NDR_ALLOC(ndr, s) do { \
- (s) = talloc(ndr->mem_ctx, sizeof(*(s))); \
+#define NDR_ALLOC_SIZE(ndr, s, size) do { \
+ (s) = talloc(ndr->mem_ctx, size); \
if (!(s)) return NT_STATUS_NO_MEMORY; \
} while (0)
+#define NDR_ALLOC(ndr, s) NDR_ALLOC_SIZE(ndr, s, sizeof(*(s)))
+
+
#define NDR_ALLOC_N_SIZE(ndr, s, n, elsize) do { \
if ((n) == 0) { \
(s) = NULL; \
@@ -104,6 +113,7 @@ struct ndr_print {
if (!(s)) return NT_STATUS_NO_MEMORY; \
} \
} while (0)
+
#define NDR_ALLOC_N(ndr, s, n) NDR_ALLOC_N_SIZE(ndr, s, n, sizeof(*(s)))
/* these are used when generic fn pointers are needed for ndr push/pull fns */