diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-11-09 19:24:25 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:44:57 +0100 |
commit | b2ddeeb79d2622b3fd216465716dfa6b8c3e0b86 (patch) | |
tree | 3002c69e6729dfb2115689a1ba90c78e8344e2b0 /source4/librpc | |
parent | 910ab408afe0ed866d378fb6d58e795dffcbfa58 (diff) | |
download | samba-b2ddeeb79d2622b3fd216465716dfa6b8c3e0b86.tar.gz samba-b2ddeeb79d2622b3fd216465716dfa6b8c3e0b86.tar.bz2 samba-b2ddeeb79d2622b3fd216465716dfa6b8c3e0b86.zip |
r25919: ndr: change NTSTAUS into enum ndr_err_code (ndrdump)
librpc/tools/ndrdump.c
metze
(This used to be commit c788fe3eecae49187a84561783ddbe8f0199ac70)
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/tools/ndrdump.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source4/librpc/tools/ndrdump.c b/source4/librpc/tools/ndrdump.c index 0faabdd225..a86b349aa9 100644 --- a/source4/librpc/tools/ndrdump.c +++ b/source4/librpc/tools/ndrdump.c @@ -153,6 +153,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) int flags; poptContext pc; NTSTATUS status; + enum ndr_err_code ndr_err; void *st; void *v_st; const char *ctx_filename = NULL; @@ -305,13 +306,14 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) 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); } @@ -341,7 +343,8 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) 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)); @@ -378,8 +381,10 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) 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); } @@ -394,13 +399,14 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force) 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); |