From 6ef03e7a846a4b858eec0b9953f03306f46b77e3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 1 Nov 2004 12:40:43 +0000 Subject: r3432: Support WERROR's in arguments (not just as return type). Some of the DCOM calls are wrappers around several local calls, so you get things like: WERROR foobar ( [in] int num_ifaces, [in,size_is(num_ifaces)] IID *ifaces, [out,size_is(num_ifaces)] WERROR *results); (This used to be commit 0873bf2cbe3589988e518cf68ad4d14343b9240b) --- source4/librpc/ndr/ndr_basic.c | 54 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) (limited to 'source4/librpc/ndr') diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 19db8c99a3..95d8c28e75 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -190,9 +190,9 @@ NTSTATUS ndr_push_WERROR(struct ndr_push *ndr, WERROR status) return ndr_push_uint32(ndr, W_ERROR_V(status)); } -void ndr_print_WERROR(struct ndr_print *ndr, const char *name, WERROR *r) +void ndr_print_WERROR(struct ndr_print *ndr, const char *name, WERROR r) { - ndr->print(ndr, "%-25s: %s", name, win_errstr(*r)); + ndr->print(ndr, "%-25s: %s", name, win_errstr(r)); } /* @@ -263,6 +263,23 @@ NTSTATUS ndr_pull_array_HYPER_T(struct ndr_pull *ndr, int ndr_flags, HYPER_T *da return NT_STATUS_OK; } +/* + pull a const array of WERROR +*/ +NTSTATUS ndr_pull_array_WERROR(struct ndr_pull *ndr, int ndr_flags, WERROR *data, uint32_t n) +{ + uint32_t i; + if (!(ndr_flags & NDR_SCALARS)) { + return NT_STATUS_OK; + } + for (i=0;iprint(ndr, "UNKNOWN LEVEL %u", level); } +void ndr_print_array_WERROR(struct ndr_print *ndr, const char *name, + const WERROR *data, uint32_t count) +{ + int i; + + ndr->print(ndr, "%s: ARRAY(%d)", name, count); + ndr->depth++; + for (i=0;idepth--; +} + void ndr_print_array_HYPER_T(struct ndr_print *ndr, const char *name, const HYPER_T *data, uint32_t count) { -- cgit