diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2007-02-27 09:37:48 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2007-02-27 09:37:48 +0000 |
commit | bf87640840860862a850a2717404fe2ee9b22bd1 (patch) | |
tree | 82052bd69bd923cc41eb655529170d40b3475493 /epan | |
parent | 6df7878bd5e7bc411e2e49274e44648ada3207f0 (diff) |
add PIDL friendly helper to manage unicode strings
svn path=/trunk/; revision=20941
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-dcerpc.c | 21 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc.h | 6 |
2 files changed, 26 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c index 14b852147d..a847fcf802 100644 --- a/epan/dissectors/packet-dcerpc.c +++ b/epan/dissectors/packet-dcerpc.c @@ -1450,6 +1450,27 @@ dissect_ndr_wchar_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo, FALSE, NULL); } +/* This function is aimed for PIDL useage and dissects a UNIQUE pointer to + * unicode string. + */ +int +PIDL_dissect_wchar_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex, guint32 param) +{ + header_field_info *hf_info; + dcerpc_info *di = (dcerpc_info *)pinfo->private_data; + dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; + + hf_info=proto_registrar_get_nth(hfindex); + + offset = dissect_ndr_pointer_cb( + tvb, offset, pinfo, tree, drep, + dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE, + hf_info->name, hfindex, cb_wstr_postprocess, + GINT_TO_POINTER(param)); + + return offset; +} + /* Dissect an NDR varying string of elements. The length of each element is given by the 'size_is' parameter; the elements are assumed to be characters or wide characters. diff --git a/epan/dissectors/packet-dcerpc.h b/epan/dissectors/packet-dcerpc.h index 8c51fb81d1..d3de382711 100644 --- a/epan/dissectors/packet-dcerpc.h +++ b/epan/dissectors/packet-dcerpc.h @@ -233,6 +233,8 @@ int dissect_ndr_char_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep); int dissect_ndr_wchar_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep); +int PIDL_dissect_wchar_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex, guint32 param); + int dissect_ndr_vstring(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int size_is, int hfinfo, gboolean add_subtree, @@ -431,7 +433,9 @@ init_ndr_pointer_list(packet_info *pinfo); */ #define PIDL_POLHND_OPEN 0x80000000 #define PIDL_POLHND_CLOSE 0x40000000 +/* To "save" a pointer to the string in dcv->private_data */ +#define PIDL_STR_SAVE 0x00020000 /* To make this value appear on the summary line for the packet */ -#define PIDL_SET_COL_INFO 0x20000000 +#define PIDL_SET_COL_INFO 0x00010000 #endif /* packet-dcerpc.h */ |