summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-17 11:55:56 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-17 11:55:56 +0000
commitd285c6f14f7ad7037e1a81d59da8b3c892a49884 (patch)
tree07c6ac5184aef953d5cf82b653f9f56dd6942cfd /source4/librpc/ndr/ndr.c
parentfb53302c8eb32603098b17bcf2fad16af66e9a60 (diff)
downloadsamba-d285c6f14f7ad7037e1a81d59da8b3c892a49884.tar.gz
samba-d285c6f14f7ad7037e1a81d59da8b3c892a49884.tar.bz2
samba-d285c6f14f7ad7037e1a81d59da8b3c892a49884.zip
* add another WERR err code
* use the top-level function argument printing to show more detail in RPC-* tests (This used to be commit 33bb8785625b1845750f28f2d810e7096afe9f8e)
Diffstat (limited to 'source4/librpc/ndr/ndr.c')
-rw-r--r--source4/librpc/ndr/ndr.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index 6d2a6a99dd..0d40b32835 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -325,7 +325,7 @@ void ndr_print_union_debug(void (*fn)(struct ndr_print *, const char *, uint16,
{
struct ndr_print ndr;
- ndr.mem_ctx = talloc_init("ndr_print_debug");
+ ndr.mem_ctx = talloc_init("ndr_print_union");
if (!ndr.mem_ctx) return;
ndr.print = ndr_print_debug_helper;
ndr.depth = 1;
@@ -334,6 +334,24 @@ void ndr_print_union_debug(void (*fn)(struct ndr_print *, const char *, uint16,
}
/*
+ a useful helper function for printing idl function calls via DEBUG()
+*/
+void ndr_print_function_debug(void (*fn)(struct ndr_print *, const char *, int , void *),
+ const char *name,
+ int flags,
+ void *ptr)
+{
+ struct ndr_print ndr;
+
+ ndr.mem_ctx = talloc_init("ndr_print_function");
+ if (!ndr.mem_ctx) return;
+ ndr.print = ndr_print_debug_helper;
+ ndr.depth = 1;
+ fn(&ndr, name, flags, ptr);
+ talloc_destroy(ndr.mem_ctx);
+}
+
+/*
return and possibly log an NDR error
*/
NTSTATUS ndr_pull_error(struct ndr_pull *ndr, enum ndr_err_code err, const char *format, ...)