diff options
author | metze <metze@0c0555d6-39d7-0310-84fc-f1cc0bd64818> | 2007-11-09 19:24:25 +0000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-11-09 21:23:16 +0100 |
commit | 5290ea864e6871651c2cd4eb565641b79c124a48 (patch) | |
tree | f10a61f6cfabccd0a4639b9ce9a29b2a42344366 | |
parent | 08ace73dbbcef5543bbaee9ba7ee16a0bd42a395 (diff) | |
download | samba-5290ea864e6871651c2cd4eb565641b79c124a48.tar.gz samba-5290ea864e6871651c2cd4eb565641b79c124a48.tar.bz2 samba-5290ea864e6871651c2cd4eb565641b79c124a48.zip |
ndr: change NTSTAUS into enum ndr_err_code (ndrdump)
librpc/tools/ndrdump.c
metze
git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25919 0c0555d6-39d7-0310-84fc-f1cc0bd64818
(This used to be commit 95530073de6d5b112391312bed373229af1824b0)
-rw-r--r-- | source3/librpc/tools/ndrdump.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source3/librpc/tools/ndrdump.c b/source3/librpc/tools/ndrdump.c index 01ae2253ff..dc7f2be32f 100644 --- a/source3/librpc/tools/ndrdump.c +++ b/source3/librpc/tools/ndrdump.c @@ -144,6 +144,7 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug int flags; poptContext pc; NTSTATUS status; + enum ndr_err_code ndr_err; void *st; void *v_st; const char *ctx_filename = NULL; @@ -296,13 +297,14 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug ndr_pull = ndr_pull_init_blob(&blob, mem_ctx); ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = f->ndr_pull(ndr_pull, NDR_IN, st); + ndr_err = f->ndr_pull(ndr_pull, NDR_IN, st); if (ndr_pull->offset != ndr_pull->data_size) { printf("WARNING! %d unread bytes while parsing context file\n", ndr_pull->data_size - ndr_pull->offset); } - if (!NT_STATUS_IS_OK(status)) { + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + status = ndr_map_error2ntstatus(ndr_err); printf("pull for context file returned %s\n", nt_errstr(status)); exit(1); } @@ -332,7 +334,8 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug ndr_pull = ndr_pull_init_blob(&blob, mem_ctx); ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = f->ndr_pull(ndr_pull, flags, st); + ndr_err = f->ndr_pull(ndr_pull, flags, st); + status = ndr_map_error2ntstatus(ndr_err); printf("pull returned %s\n", nt_errstr(status)); @@ -367,8 +370,10 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug ndr_v_push = ndr_push_init_ctx(mem_ctx); - status = f->ndr_push(ndr_v_push, flags, st); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = f->ndr_push(ndr_v_push, flags, st); + status = ndr_map_error2ntstatus(ndr_err); + printf("push returned %s\n", nt_errstr(status)); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { printf("validate push FAILED\n"); exit(1); } @@ -383,13 +388,14 @@ static const struct ndr_interface_table *load_iface_from_plugin(const char *plug ndr_v_pull = ndr_pull_init_blob(&v_blob, mem_ctx); ndr_v_pull->flags |= LIBNDR_FLAG_REF_ALLOC; - status = f->ndr_pull(ndr_v_pull, flags, v_st); - if (!NT_STATUS_IS_OK(status)) { + ndr_err = f->ndr_pull(ndr_v_pull, flags, v_st); + status = ndr_map_error2ntstatus(ndr_err); + printf("pull returned %s\n", nt_errstr(status)); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { printf("validate pull FAILED\n"); exit(1); } - printf("pull returned %s\n", nt_errstr(status)); if (ndr_v_pull->offset != ndr_v_pull->data_size) { printf("WARNING! %d unread bytes in validation\n", ndr_v_pull->data_size - ndr_v_pull->offset); |