summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_prs.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-09-04 07:13:01 +0000
committerAndrew Tridgell <tridge@samba.org>2001-09-04 07:13:01 +0000
commit19fea3242cf6234786b6cbb60631e0071f31ff9f (patch)
tree1de6e79890a80a1e03cf0dce5813513aaf51bc59 /source3/rpc_parse/parse_prs.c
parent55cf37488f66eba2826dba08e80dd4ab6df33fc3 (diff)
downloadsamba-19fea3242cf6234786b6cbb60631e0071f31ff9f.tar.gz
samba-19fea3242cf6234786b6cbb60631e0071f31ff9f.tar.bz2
samba-19fea3242cf6234786b6cbb60631e0071f31ff9f.zip
the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work
(This used to be commit dcd6e735f709a9231860ceb9682db40ff26c9a66)
Diffstat (limited to 'source3/rpc_parse/parse_prs.c')
-rw-r--r--source3/rpc_parse/parse_prs.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 6bab18ba9d..11fa46069a 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -551,6 +551,67 @@ BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32)
return True;
}
+/*******************************************************************
+ Stream a NTSTATUS
+ ********************************************************************/
+
+BOOL prs_ntstatus(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,
+ get_nt_error_msg(*status)));
+
+ ps->data_offset += sizeof(uint32);
+
+ return True;
+}
+
+/*******************************************************************
+ Stream a WERROR
+ ********************************************************************/
+
+BOOL prs_werror(char *name, prs_struct *ps, int depth, WERROR *status)
+{
+ char *q = prs_mem_get(ps, sizeof(uint32));
+ if (q == NULL)
+ return False;
+
+ if (UNMARSHALLING(ps)) {
+ if (ps->bigendian_data)
+ *status = W_ERROR(RIVAL(q,0));
+ else
+ *status = W_ERROR(IVAL(q,0));
+ } else {
+ if (ps->bigendian_data)
+ RSIVAL(q,0,W_ERROR_V(*status));
+ else
+ SIVAL(q,0,W_ERROR_V(*status));
+ }
+
+ DEBUG(5,("%s%04x %s: %s\n", tab_depth(depth), ps->data_offset, name,
+ werror_str(*status)));
+
+ ps->data_offset += sizeof(uint32);
+
+ return True;
+}
+
+
/******************************************************************
Stream an array of uint8s. Length is number of uint8s.
********************************************************************/