diff options
author | Günther Deschner <gd@samba.org> | 2006-03-22 14:41:07 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:15:41 -0500 |
commit | 6e17934ee614f5f129b69898be7eceb09486a48f (patch) | |
tree | 9cd50b28c53f12862d287c40b7e7e9b12ecc7080 /source3/rpc_parse/parse_prs.c | |
parent | 1839b4be14e905428257eb999def184d73dcf08f (diff) | |
download | samba-6e17934ee614f5f129b69898be7eceb09486a48f.tar.gz samba-6e17934ee614f5f129b69898be7eceb09486a48f.tar.bz2 samba-6e17934ee614f5f129b69898be7eceb09486a48f.zip |
r14643: Merge dcerpc_errstr from Samba 4.
Might need to rework prs_dcerpc_status().
Guenther
(This used to be commit 38b18f428ba941f4d9a14fa2de45cb0cd793a754)
Diffstat (limited to 'source3/rpc_parse/parse_prs.c')
-rw-r--r-- | source3/rpc_parse/parse_prs.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index 474e93cc1f..f2b002c48c 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -768,6 +768,37 @@ BOOL prs_ntstatus(const char *name, prs_struct *ps, int depth, NTSTATUS *status) } /******************************************************************* + Stream a DCE error code + ********************************************************************/ + +BOOL prs_dcerpc_status(const char *name, prs_struct *ps, int depth, NTSTATUS *status) +{ + char *q = prs_mem_get(ps, sizeof(uint32)); + if (q == NULL) + return False; + + if (UNMARSHALLING(ps)) { + if (ps->bigendian_data) + *status = NT_STATUS(RIVAL(q,0)); + else + *status = NT_STATUS(IVAL(q,0)); + } else { + if (ps->bigendian_data) + RSIVAL(q,0,NT_STATUS_V(*status)); + else + SIVAL(q,0,NT_STATUS_V(*status)); + } + + DEBUG(5,("%s%04x %s: %s\n", tab_depth(depth), ps->data_offset, name, + dcerpc_errstr(NT_STATUS_V(*status)))); + + ps->data_offset += sizeof(uint32); + + return True; +} + + +/******************************************************************* Stream a WERROR ********************************************************************/ |