summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_prs.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_parse/parse_prs.c')
-rw-r--r--source3/rpc_parse/parse_prs.c85
1 files changed, 24 insertions, 61 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index bc9202cccc..94732b0a74 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -760,6 +760,30 @@ bool prs_int32(const char *name, prs_struct *ps, int depth, int32 *data32)
}
/*******************************************************************
+ Stream a uint64_struct
+ ********************************************************************/
+bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64)
+{
+ if (UNMARSHALLING(ps)) {
+ uint32 high, low;
+
+ if (!prs_uint32(name, ps, depth+1, &low))
+ return False;
+
+ if (!prs_uint32(name, ps, depth+1, &high))
+ return False;
+
+ *data64 = ((uint64_t)high << 32) + low;
+
+ return True;
+ } else {
+ uint32 high = (*data64) >> 32, low = (*data64) & 0xFFFFFFFF;
+ return prs_uint32(name, ps, depth+1, &low) &&
+ prs_uint32(name, ps, depth+1, &high);
+ }
+}
+
+/*******************************************************************
Stream a NTSTATUS
********************************************************************/
@@ -1025,37 +1049,6 @@ bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uin
}
/******************************************************************
- Stream an array of unicode string, length/buffer specified separately,
- in uint16 chars. The unicode string is already in little-endian format.
- ********************************************************************/
-
-bool prs_buffer5(bool charmode, const char *name, prs_struct *ps, int depth, BUFFER5 *str)
-{
- char *p;
- char *q = prs_mem_get(ps, str->buf_len * sizeof(uint16));
- if (q == NULL)
- return False;
-
- /* If the string is empty, we don't have anything to stream */
- if (str->buf_len==0)
- return True;
-
- if (UNMARSHALLING(ps)) {
- str->buffer = PRS_ALLOC_MEM(ps,uint16,str->buf_len);
- if (str->buffer == NULL)
- return False;
- }
-
- p = (char *)str->buffer;
-
- dbg_rw_punival(charmode, name, depth, ps, q, p, str->buf_len);
-
- ps->data_offset += (str->buf_len * sizeof(uint16));
-
- return True;
-}
-
-/******************************************************************
Stream a unicode string, length/buffer specified separately,
in uint16 chars. The unicode string is already in little-endian format.
********************************************************************/
@@ -1093,36 +1086,6 @@ bool prs_unistr2(bool charmode, const char *name, prs_struct *ps, int depth, UNI
return True;
}
-/******************************************************************
- Stream a unicode string, length/buffer specified separately,
- in uint16 chars. The unicode string is already in little-endian format.
- ********************************************************************/
-
-bool prs_unistr3(bool charmode, const char *name, UNISTR3 *str, prs_struct *ps, int depth)
-{
- char *p;
- char *q = prs_mem_get(ps, str->uni_str_len * sizeof(uint16));
- if (q == NULL)
- return False;
-
- if (UNMARSHALLING(ps)) {
- if (str->uni_str_len) {
- str->str.buffer = PRS_ALLOC_MEM(ps,uint16,str->uni_str_len);
- if (str->str.buffer == NULL)
- return False;
- } else {
- str->str.buffer = NULL;
- }
- }
-
- p = (char *)str->str.buffer;
-
- dbg_rw_punival(charmode, name, depth, ps, q, p, str->uni_str_len);
- ps->data_offset += (str->uni_str_len * sizeof(uint16));
-
- return True;
-}
-
/*******************************************************************
Stream a unicode null-terminated string. As the string is already
in little-endian format then do it as a stream of bytes.