1 /* packet-dcom-typeinfo.c
2 * Routines for DCOM ITypeInfo
3 * Copyright 2019, Alex Sirr <alexsirruw@gmail.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 /* see packet-dcom.c for details about DCOM */
16 #include <epan/packet.h>
18 #include "packet-dcerpc.h"
19 #include "packet-dcom.h"
21 #include "packet-dcerpc-nt.h"
23 void proto_register_dcom_typeinfo(void);
24 void proto_reg_handoff_dcom_typeinfo(void);
26 static int ett_typeinfo_funcdesc
;
27 static int hf_typeinfo_funcdesc
;
28 static int hf_typeinfo_funcdesc_funcflags
;
29 static int ett_typeinfo_funcdesc_funcflags
;
30 static int hf_typeinfo_funcdesc_funcflags_frestricted
;
31 static int hf_typeinfo_funcdesc_funcflags_fsource
;
32 static int hf_typeinfo_funcdesc_funcflags_fbindable
;
33 static int hf_typeinfo_funcdesc_funcflags_frequestedit
;
34 static int hf_typeinfo_funcdesc_funcflags_fdisplaybind
;
35 static int hf_typeinfo_funcdesc_funcflags_fdefaultbind
;
36 static int hf_typeinfo_funcdesc_funcflags_fhidden
;
37 static int hf_typeinfo_funcdesc_funcflags_fusesgetlasterror
;
38 static int hf_typeinfo_funcdesc_funcflags_fdefaultcollelem
;
39 static int hf_typeinfo_funcdesc_funcflags_fuidefault
;
40 static int hf_typeinfo_funcdesc_funcflags_fnowbrowsable
;
41 static int hf_typeinfo_funcdesc_funcflags_freplaceable
;
42 static int hf_typeinfo_funcdesc_funcflags_fimmediatebind
;
44 #define FUNCFLAG_FRESTRICTED 0x00000001
45 #define FUNCFLAG_FSOURCE 0x00000002
46 #define FUNCFLAG_FBINDABLE 0x00000004
47 #define FUNCFLAG_FREQUESTEDIT 0x00000008
48 #define FUNCFLAG_FDISPLAYBIND 0x00000010
49 #define FUNCFLAG_FDEFAULTBIND 0x00000020
50 #define FUNCFLAG_FHIDDEN 0x00000040
51 #define FUNCFLAG_FUSESGETLASTERROR 0x00000080
52 #define FUNCFLAG_FDEFAULTCOLLELEM 0x00000100
53 #define FUNCFLAG_FUIDEFAULT 0x00000200
54 #define FUNCFLAG_FNONBROWSABLE 0x00000400
55 #define FUNCFLAG_FREPLACEABLE 0x00000800
56 #define FUNCFLAG_FIMMEDIATEBIND 0x00001000
58 static int hf_typeinfo_funcdesc_funckind
;
59 static int hf_typeinfo_funcdesc_invkind
;
60 static int hf_typeinfo_funcdesc_callconv
;
61 static int hf_typeinfo_funcdesc_params
;
62 static int hf_typeinfo_funcdesc_paramsopt
;
63 static int hf_typeinfo_funcdesc_memid
;
64 static int hf_typeinfo_funcdesc_vft
;
65 static int hf_typeinfo_funcdesc_resv16
;
66 static int hf_typeinfo_funcdesc_resv32
;
67 static int ett_typeinfo_elemdesc
;
68 static int hf_typeinfo_funcdesc_elemdesc
;
70 static int ett_typeinfo_typedesc
;
71 static int hf_typeinfo_typedesc
;
73 static int ett_typeinfo_paramdesc
;
74 static int hf_typeinfo_paramdesc
;
75 static int ett_typeinfo_paramdesc_paramflags
;
76 static int hf_typeinfo_paramdesc_paramflags
;
77 static int hf_typeinfo_paramdesc_paramflags_fin
;
78 static int hf_typeinfo_paramdesc_paramflags_fout
;
79 static int hf_typeinfo_paramdesc_paramflags_flcid
;
80 static int hf_typeinfo_paramdesc_paramflags_fretval
;
81 static int hf_typeinfo_paramdesc_paramflags_fopt
;
82 static int hf_typeinfo_paramdesc_paramflags_fhasdefault
;
83 static int hf_typeinfo_paramdesc_paramflags_fhascustdata
;
85 #define PARAMFLAG_FIN 0x00000001
86 #define PARAMFLAG_FOUT 0x00000002
87 #define PARAMFLAG_FLCID 0x00000004
88 #define PARAMFLAG_FRETVAL 0x00000008
89 #define PARAMFLAG_FOPT 0x00000010
90 #define PARAMFLAG_FHASDEFAULT 0x00000020
91 #define PARAMFLAG_FHASCUSTDATA 0x00000040
93 static int ett_typeinfo_paramdescex
;
94 static int hf_typeinfo_paramdescex
;
95 static int hf_typeinfo_paramdescex_cbytes
;
96 static int hf_typeinfo_paramdescex_varDefaultValue
;
98 static int hf_typeinfo_typedesc_vtret
;
99 static int hf_typeinfo_typedesc_hreftype
;
101 static int hf_typeinfo_opnum
;
102 static int hf_typeinfo_index
;
104 static int hf_typeinfo_memid
;
105 static int hf_typeinfo_reserved32
;
106 static int hf_typeinfo_reserved16
;
108 static int hf_typeinfo_names
;
109 static int hf_typeinfo_names_value
;
110 static int hf_typeinfo_maxnames
;
112 static int hf_typeinfo_docname
;
113 static int hf_typeinfo_docstring
;
114 static int hf_typeinfo_helpctx
;
115 static int hf_typeinfo_helpfile
;
117 static int ett_typeinfo_docflags
;
118 static int hf_typeinfo_docflags
;
119 static int hf_typeinfo_docflags_name
;
120 static int hf_typeinfo_docflags_docstring
;
121 static int hf_typeinfo_docflags_helpctx
;
122 static int hf_typeinfo_docflags_helpfile
;
124 #define TYPEINFO_DOCFLAGS_NameArg 1
125 #define TYPEINFO_DOCFLAGS_DocStringArg 2
126 #define TYPEINFO_DOCFLAGS_HelpContextArg 4
127 #define TYPEINFO_DOCFLAGS_HelpFileArg 8
129 static int ett_typeinfo_typeflags
;
130 static int hf_typeinfo_typeflags
;
131 static int hf_typeinfo_typeflags_fappobject
;
132 static int hf_typeinfo_typeflags_fcancreate
;
133 static int hf_typeinfo_typeflags_flicensed
;
134 static int hf_typeinfo_typeflags_fpredeclid
;
135 static int hf_typeinfo_typeflags_fhidden
;
136 static int hf_typeinfo_typeflags_fcontrol
;
137 static int hf_typeinfo_typeflags_fdual
;
138 static int hf_typeinfo_typeflags_fnonextensible
;
139 static int hf_typeinfo_typeflags_foleautomation
;
140 static int hf_typeinfo_typeflags_frestricted
;
141 static int hf_typeinfo_typeflags_faggregatable
;
142 static int hf_typeinfo_typeflags_freplaceable
;
143 static int hf_typeinfo_typeflags_fdispatchable
;
144 static int hf_typeinfo_typeflags_fproxy
;
146 #define TYPEINFO_TYPEFLAG_FAPPOBJECT 0x00000001
147 #define TYPEINFO_TYPEFLAG_FCANCREATE 0x00000002
148 #define TYPEINFO_TYPEFLAG_FLICENSED 0x00000004
149 #define TYPEINFO_TYPEFLAG_FPREDECLID 0x00000008
150 #define TYPEINFO_TYPEFLAG_FHIDDEN 0x00000010
151 #define TYPEINFO_TYPEFLAG_FCONTROL 0x00000020
152 #define TYPEINFO_TYPEFLAG_FDUAL 0x00000040
153 #define TYPEINFO_TYPEFLAG_FNONEXTENSIBLE 0x00000080
154 #define TYPEINFO_TYPEFLAG_FOLEAUTOMATION 0x00000100
155 #define TYPEINFO_TYPEFLAG_FRESTRICTED 0x00000200
156 #define TYPEINFO_TYPEFLAG_FAGGREGATABLE 0x00000400
157 #define TYPEINFO_TYPEFLAG_FREPLACEABLE 0x00000800
158 #define TYPEINFO_TYPEFLAG_FDISPATCHABLE 0x00001000
159 #define TYPEINFO_TYPEFLAG_FPROXY 0x00004000
161 static int ett_typeinfo_typeattr
;
162 static int hf_typeinfo_typeattr
;
163 static int hf_typeinfo_guid
;
164 static int hf_typeinfo_lcid
;
165 static int hf_typeinfo_sizeInstance
;
166 static int hf_typeinfo_typekind
;
167 static int hf_typeinfo_cFuncs
;
168 static int hf_typeinfo_cVars
;
169 static int hf_typeinfo_cImplTypes
;
170 static int hf_typeinfo_cbSizeVft
;
171 static int hf_typeinfo_cbAlignment
;
172 static int hf_typeinfo_wMajorVerNum
;
173 static int hf_typeinfo_wMinorVerNum
;
175 static int ett_typeinfo_names
;
177 static e_guid_t uuid_typeinfo
= {0x00020401, 0x0000, 0x0000, {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}};
178 static uint16_t ver_typeinfo
;
179 static int ett_typeinfo
;
180 static int proto_typeinfo
;
182 static const value_string dcom_lcid_vals
[] = {
183 {0x0000, "Language neutral"},
184 {0x0400, "LOCALE_USER_DEFAULT"},
185 {0x0409, "English (United States)"},
186 {0x0800, "LOCALE_SYSTEM_DEFAULT"},
189 static const value_string typekind_vals
[] = {
191 {0x01, "TKIND_RECORD"},
192 {0x02, "TKIND_MODULE"},
193 {0x03, "TKIND_INTERFACE"},
194 {0x04, "TKIND_DISPATCH"},
195 {0x05, "TKIND_COCLASS"},
196 {0x06, "TKIND_ALIAS"},
197 {0x07, "TKIND_UNION"},
202 static int dissect_typeinfo_PARAMDESCEX(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
);
203 static int dissect_typeinfo_PARAMDESCEX_through_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
204 static int dissect_typeinfo_PARAMDESC(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
);
205 static int dissect_typeinfo_TYPEDESC_item(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
206 static int dissect_typeinfo_TYPEDESC(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
);
207 static int dissect_typeinfo_ELEMDESC(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
);
208 static int dissect_typeinfo_ELEMDESC_through_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
209 static int dissect_typeinfo_ELEMDESC_array(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
210 static int dissect_typeinfo_FUNCDESC(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
);
211 static int dissect_typeinfo_TYPEATTR(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
);
212 static int dissect_typeinfo_TYPEATTR_through_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
213 static int dissect_typeinfo_FUNCDESC_through_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
214 static int dissect_ITypeInfo_GetFuncDesc_rqst(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
215 static int dissect_ITypeInfo_GetFuncDesc_resp(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
216 static int dissect_ITypeInfo_GetNames_rqst(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
217 static int dissect_ITypeInfo_GetNames_resp(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
218 static int dissect_ITypeInfo_GetDocumentation_rqst(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
219 static int dissect_ITypeInfo_GetDocumentation_resp(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
220 static int dissect_ITypeInfo_GetTypeAttr_rqst(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
221 static int dissect_ITypeInfo_GetTypeAttr_resp(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
);
223 int dissect_typeinfo_PARAMDESCEX(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
224 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
)
228 proto_item
*sub_item
;
229 proto_tree
*sub_tree
;
230 uint32_t u32SubStart
;
232 /* alignment of 4 needed for a PARAMDESCEX */
235 sub_item
= proto_tree_add_item(tree
, hfindex
, tvb
, offset
, 0, ENC_NA
);
236 sub_tree
= proto_item_add_subtree(sub_item
, ett_typeinfo_paramdescex
);
238 u32SubStart
= offset
;
240 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
241 hf_typeinfo_paramdescex_cbytes
, NULL
);
243 offset
= dissect_dcom_dcerpc_pointer(tvb
, offset
, pinfo
, sub_tree
, di
, drep
, &u32Pointer
);
247 offset
= dissect_dcom_VARIANT(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
248 hf_typeinfo_paramdescex_varDefaultValue
);
251 proto_item_set_len(sub_item
, offset
- u32SubStart
);
255 int dissect_typeinfo_PARAMDESCEX_through_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
256 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
258 return dissect_typeinfo_PARAMDESCEX(tvb
, offset
, pinfo
, tree
, di
, drep
, hf_typeinfo_paramdescex
);
261 int dissect_typeinfo_PARAMDESC(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
262 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
)
264 uint16_t u16wParamFlags
;
266 proto_item
*sub_item
;
267 proto_tree
*sub_tree
;
268 uint32_t u32SubStart
;
270 static int * const flags
[] = {
271 &hf_typeinfo_paramdesc_paramflags_fin
,
272 &hf_typeinfo_paramdesc_paramflags_fout
,
273 &hf_typeinfo_paramdesc_paramflags_flcid
,
274 &hf_typeinfo_paramdesc_paramflags_fretval
,
275 &hf_typeinfo_paramdesc_paramflags_fopt
,
276 &hf_typeinfo_paramdesc_paramflags_fhasdefault
,
277 &hf_typeinfo_paramdesc_paramflags_fhascustdata
,
280 /* alignment of 4 needed for a PARAMDESC */
283 sub_item
= proto_tree_add_item(tree
, hfindex
, tvb
, offset
, 0, ENC_NA
);
284 sub_tree
= proto_item_add_subtree(sub_item
, ett_typeinfo_paramdesc
);
286 u32SubStart
= offset
;
289 offset
= dissect_ndr_embedded_pointer(tvb
, offset
, pinfo
, sub_tree
, di
, drep
, dissect_typeinfo_PARAMDESCEX_through_pointer
,
290 NDR_POINTER_PTR
, "Pointer to ParamDescEx", hf_typeinfo_paramdescex
);
293 uint16_t u16TmpOffset
;
294 u16TmpOffset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, NULL
, di
, drep
, -1, &u16wParamFlags
);
296 proto_tree_add_bitmask_value(sub_tree
, tvb
, offset
, hf_typeinfo_paramdesc_paramflags
,
297 ett_typeinfo_paramdesc_paramflags
, flags
, u16wParamFlags
);
299 offset
= u16TmpOffset
;
301 proto_item_set_len(sub_item
, offset
- u32SubStart
);
305 int dissect_typeinfo_TYPEDESC_item(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
306 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
308 return dissect_typeinfo_TYPEDESC(tvb
, offset
, pinfo
, tree
, di
, drep
, hf_typeinfo_typedesc
);
311 int dissect_typeinfo_TYPEDESC(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
312 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
)
314 uint16_t u16vtrettag
;
316 proto_item
*sub_item
;
317 proto_tree
*sub_tree
;
318 uint32_t u32SubStart
;
320 /* alignment of 4 needed for a TYPEDESC */
323 sub_item
= proto_tree_add_item(tree
, hfindex
, tvb
, offset
, 0, ENC_NA
);
324 sub_tree
= proto_item_add_subtree(sub_item
, ett_typeinfo_typedesc
);
326 u32SubStart
= offset
;
328 // vt of ret (union tag)
329 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
330 hf_typeinfo_typedesc_vtret
, &u16vtrettag
);
332 if (u16vtrettag
== 26 || u16vtrettag
== 27) // WIRESHARK_VT_PTR || WIRESHARK_VT_SAFEARRAY
334 offset
= dissect_ndr_embedded_pointer(tvb
, offset
, pinfo
, sub_tree
, di
, drep
, dissect_typeinfo_TYPEDESC_item
,
335 NDR_POINTER_PTR
, "TypeDesc", hf_typeinfo_typedesc
);
337 else if (u16vtrettag
== 28) //WIRESHARK_VT_CARRAY
341 else if (u16vtrettag
== 29) //WIRESHARK_VT_USERDEFINED
343 // typedef DWORD HREFTYPE;
344 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
345 hf_typeinfo_typedesc_hreftype
, NULL
);
349 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
350 hf_typeinfo_typedesc_vtret
, NULL
);
352 proto_item_set_len(sub_item
, offset
- u32SubStart
);
356 int dissect_typeinfo_ELEMDESC(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
357 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
)
359 proto_item
*sub_item
;
360 proto_tree
*sub_tree
;
361 uint32_t u32SubStart
;
363 /* alignment of 4 needed for a ELEMDESC */
366 sub_item
= proto_tree_add_item(tree
, hfindex
, tvb
, offset
, 0, ENC_NA
);
367 sub_tree
= proto_item_add_subtree(sub_item
, ett_typeinfo_elemdesc
);
369 u32SubStart
= offset
;
371 offset
= dissect_typeinfo_TYPEDESC(tvb
, offset
, pinfo
, sub_tree
, di
, drep
, hf_typeinfo_typedesc
);
372 offset
= dissect_typeinfo_PARAMDESC(tvb
, offset
, pinfo
, sub_tree
, di
, drep
, hf_typeinfo_paramdesc
);
374 proto_item_set_len(sub_item
, offset
- u32SubStart
);
379 int dissect_typeinfo_ELEMDESC_through_pointer(tvbuff_t
*tvb
, int offset
,
380 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
382 return dissect_typeinfo_ELEMDESC(tvb
, offset
, pinfo
, tree
, di
, drep
, hf_typeinfo_funcdesc_elemdesc
);
385 int dissect_typeinfo_ELEMDESC_array(tvbuff_t
*tvb
, int offset
,
386 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
388 return dissect_ndr_ucarray(tvb
, offset
, pinfo
, tree
, di
, drep
, dissect_typeinfo_ELEMDESC_through_pointer
);
391 int dissect_typeinfo_FUNCDESC(tvbuff_t
*tvb
, int offset
,
392 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
)
394 uint16_t u16Funcflags
;
396 proto_item
*sub_item
;
397 proto_tree
*sub_tree
;
399 proto_item
*func_elemdesc_sub_item
;
400 proto_tree
*func_elemdesc_tree
;
402 uint32_t u32SubStart
;
404 static int * const flags
[] = {
405 &hf_typeinfo_funcdesc_funcflags_frestricted
,
406 &hf_typeinfo_funcdesc_funcflags_fsource
,
407 &hf_typeinfo_funcdesc_funcflags_fbindable
,
408 &hf_typeinfo_funcdesc_funcflags_frequestedit
,
409 &hf_typeinfo_funcdesc_funcflags_fdisplaybind
,
410 &hf_typeinfo_funcdesc_funcflags_fdefaultbind
,
411 &hf_typeinfo_funcdesc_funcflags_fhidden
,
412 &hf_typeinfo_funcdesc_funcflags_fusesgetlasterror
,
413 &hf_typeinfo_funcdesc_funcflags_fdefaultcollelem
,
414 &hf_typeinfo_funcdesc_funcflags_fuidefault
,
415 &hf_typeinfo_funcdesc_funcflags_fnowbrowsable
,
416 &hf_typeinfo_funcdesc_funcflags_freplaceable
,
417 &hf_typeinfo_funcdesc_funcflags_fimmediatebind
,
420 sub_item
= proto_tree_add_item(tree
, hfindex
, tvb
, offset
, 0, ENC_NA
);
421 sub_tree
= proto_item_add_subtree(sub_item
, ett_typeinfo_funcdesc
);
423 u32SubStart
= offset
;
426 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
427 hf_typeinfo_funcdesc_memid
, NULL
);
430 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
431 hf_typeinfo_funcdesc_resv32
, NULL
);
433 offset
= dissect_ndr_embedded_pointer(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
434 dissect_typeinfo_ELEMDESC_array
, NDR_POINTER_PTR
, "Parameter ElemDesc", hf_typeinfo_funcdesc_elemdesc
);
437 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
438 hf_typeinfo_funcdesc_funckind
, NULL
);
441 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
442 hf_typeinfo_funcdesc_invkind
, NULL
);
445 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
446 hf_typeinfo_funcdesc_callconv
, NULL
);
449 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
450 hf_typeinfo_funcdesc_params
, NULL
);
453 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
454 hf_typeinfo_funcdesc_paramsopt
, NULL
);
457 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
458 hf_typeinfo_funcdesc_vft
, NULL
);
461 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
462 hf_typeinfo_funcdesc_resv16
, NULL
);
464 // create tree for function element description
465 func_elemdesc_sub_item
= proto_tree_add_item(sub_tree
, hfindex
, tvb
, offset
, 0, ENC_NA
);
466 func_elemdesc_tree
= proto_tree_add_subtree(sub_tree
, tvb
, offset
, 0,
467 ett_typeinfo_elemdesc
, &func_elemdesc_sub_item
, "Function ElemDesc");
469 offset
= dissect_typeinfo_ELEMDESC(tvb
, offset
, pinfo
, func_elemdesc_tree
, di
, drep
, hf_typeinfo_funcdesc_elemdesc
);
472 uint16_t u16TmpOffset
;
473 u16TmpOffset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, NULL
, di
, drep
, -1, &u16Funcflags
);
475 proto_tree_add_bitmask_value(sub_tree
, tvb
, offset
, hf_typeinfo_funcdesc_funcflags
,
476 ett_typeinfo_funcdesc_funcflags
, flags
, u16Funcflags
);
478 offset
= u16TmpOffset
;
480 proto_item_set_len(sub_item
, offset
- u32SubStart
);
485 int dissect_typeinfo_FUNCDESC_through_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
486 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
488 return dissect_typeinfo_FUNCDESC(tvb
, offset
, pinfo
, tree
, di
, drep
, hf_typeinfo_funcdesc
);
491 int dissect_typeinfo_TYPEATTR(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
492 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
, int hfindex
)
494 uint16_t u16wTypeFlags
;
496 proto_item
*sub_item
;
497 proto_tree
*sub_tree
;
498 uint32_t u32SubStart
;
500 static int * const flags
[] = {
501 &hf_typeinfo_typeflags_fappobject
,
502 &hf_typeinfo_typeflags_fcancreate
,
503 &hf_typeinfo_typeflags_flicensed
,
504 &hf_typeinfo_typeflags_fpredeclid
,
505 &hf_typeinfo_typeflags_fhidden
,
506 &hf_typeinfo_typeflags_fcontrol
,
507 &hf_typeinfo_typeflags_fdual
,
508 &hf_typeinfo_typeflags_fnonextensible
,
509 &hf_typeinfo_typeflags_foleautomation
,
510 &hf_typeinfo_typeflags_frestricted
,
511 &hf_typeinfo_typeflags_faggregatable
,
512 &hf_typeinfo_typeflags_freplaceable
,
513 &hf_typeinfo_typeflags_fdispatchable
,
514 &hf_typeinfo_typeflags_fproxy
,
517 sub_item
= proto_tree_add_item(tree
, hfindex
, tvb
, offset
, 0, ENC_NA
);
518 sub_tree
= proto_item_add_subtree(sub_item
, ett_typeinfo_typeattr
);
520 u32SubStart
= offset
;
523 offset
= dissect_dcom_UUID(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
524 hf_typeinfo_guid
, NULL
);
527 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
528 hf_typeinfo_lcid
, NULL
);
531 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
532 hf_typeinfo_reserved32
, NULL
);
535 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
536 hf_typeinfo_reserved32
, NULL
);
539 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
540 hf_typeinfo_reserved32
, NULL
);
543 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
544 hf_typeinfo_reserved32
, NULL
);
547 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
548 hf_typeinfo_sizeInstance
, NULL
);
551 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
552 hf_typeinfo_typekind
, NULL
);
555 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
556 hf_typeinfo_cFuncs
, NULL
);
559 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
560 hf_typeinfo_cVars
, NULL
);
563 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
564 hf_typeinfo_cImplTypes
, NULL
);
567 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
568 hf_typeinfo_cbSizeVft
, NULL
);
571 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
572 hf_typeinfo_cbAlignment
, NULL
);
575 uint16_t u16TmpOffset
;
576 u16TmpOffset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, NULL
, di
, drep
, -1, &u16wTypeFlags
);
578 proto_tree_add_bitmask_value(sub_tree
, tvb
, offset
, hf_typeinfo_typeflags
,
579 ett_typeinfo_typeflags
, flags
, u16wTypeFlags
);
581 offset
= u16TmpOffset
;
584 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
585 hf_typeinfo_wMajorVerNum
, NULL
);
588 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
589 hf_typeinfo_wMinorVerNum
, NULL
);
591 offset
= dissect_typeinfo_TYPEDESC(tvb
, offset
, pinfo
, sub_tree
, di
, drep
, hf_typeinfo_typedesc
);
594 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
595 hf_typeinfo_reserved32
, NULL
);
598 offset
= dissect_dcom_WORD(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
599 hf_typeinfo_reserved16
, NULL
);
601 proto_item_set_len(sub_item
, offset
- u32SubStart
);
606 int dissect_typeinfo_TYPEATTR_through_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
,
607 proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
609 offset
= dissect_typeinfo_TYPEATTR(tvb
, offset
, pinfo
, tree
, di
, drep
, hf_typeinfo_typeattr
);
615 dissect_bstr_through_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
617 char szName
[1000] = {0};
618 offset
= dissect_dcom_BSTR(tvb
, offset
, pinfo
, tree
, di
, drep
,
619 di
->hf_index
, szName
, sizeof(szName
));
624 dissect_dword_through_pointer(tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
626 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, tree
, di
, drep
,
632 int dissect_ITypeInfo_GetFuncDesc_rqst(tvbuff_t
*tvb
, int offset
,
633 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
635 offset
= dissect_dcom_this(tvb
, offset
, pinfo
, tree
, di
, drep
);
637 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, tree
, di
, drep
,
638 hf_typeinfo_index
, NULL
);
643 int dissect_ITypeInfo_GetFuncDesc_resp(tvbuff_t
*tvb
, int offset
,
644 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
646 offset
= dissect_dcom_that(tvb
, offset
, pinfo
, tree
, di
, drep
);
649 offset
= dissect_ndr_toplevel_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
, dissect_typeinfo_FUNCDESC_through_pointer
, NDR_POINTER_UNIQUE
, "Pointer to FuncDesc", hf_typeinfo_funcdesc
);
652 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, tree
, di
, drep
,
653 hf_typeinfo_reserved32
, NULL
);
655 /* HRESULT of call */
656 offset
= dissect_dcom_HRESULT(tvb
, offset
, pinfo
, tree
, di
, drep
,
662 int dissect_ITypeInfo_GetNames_rqst(tvbuff_t
*tvb
, int offset
,
663 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
665 offset
= dissect_dcom_this(tvb
, offset
, pinfo
, tree
, di
, drep
);
668 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, tree
, di
, drep
,
669 hf_typeinfo_memid
, NULL
);
672 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, tree
, di
, drep
,
673 hf_typeinfo_maxnames
, NULL
);
678 int dissect_ITypeInfo_GetNames_resp(tvbuff_t
*tvb
, int offset
,
679 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
681 uint32_t u32ArrayLength
;
684 uint32_t u32VarOffset
;
687 char szName
[1000] = {0};
689 proto_item
*sub_item
;
690 proto_tree
*sub_tree
;
691 uint32_t u32SubStart
;
693 offset
= dissect_dcom_that(tvb
, offset
, pinfo
, tree
, di
, drep
);
695 sub_item
= proto_tree_add_item(tree
, hf_typeinfo_names
, tvb
, offset
, 0, ENC_NA
);
696 sub_tree
= proto_item_add_subtree(sub_item
, ett_typeinfo_names
);
698 u32SubStart
= offset
;
700 offset
= dissect_dcom_dcerpc_array_size(tvb
, offset
, pinfo
, sub_tree
, di
, drep
, NULL
);
701 offset
= dissect_dcom_dcerpc_pointer(tvb
, offset
, pinfo
, sub_tree
, di
, drep
, NULL
);
702 offset
= dissect_dcom_dcerpc_array_size(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
705 u32VarOffset
= offset
+ u32ArrayLength
* 4;
706 u32Tmp
= u32ArrayLength
;
709 offset
= dissect_dcom_dcerpc_pointer(tvb
, offset
, pinfo
, sub_tree
, di
, drep
,
713 u32VarOffset
= dissect_dcom_BSTR(tvb
, u32VarOffset
, pinfo
, sub_tree
, di
, drep
,
714 hf_typeinfo_names_value
, szName
, sizeof(szName
));
717 offset
= u32VarOffset
;
719 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
720 " %u Names", u32ArrayLength
);
722 proto_item_set_len(sub_item
, offset
- u32SubStart
);
725 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, tree
, di
, drep
,
726 hf_typeinfo_maxnames
, NULL
);
728 /* HRESULT of call */
729 offset
= dissect_dcom_HRESULT(tvb
, offset
, pinfo
, tree
, di
, drep
, NULL
);
734 int dissect_ITypeInfo_GetDocumentation_rqst(tvbuff_t
*tvb
, int offset
,
735 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
739 uint32_t u32TmpOffset
;
741 static int * const flags
[] = {
742 &hf_typeinfo_docflags_name
,
743 &hf_typeinfo_docflags_docstring
,
744 &hf_typeinfo_docflags_helpctx
,
745 &hf_typeinfo_docflags_helpfile
,
748 offset
= dissect_dcom_this(tvb
, offset
, pinfo
, tree
, di
, drep
);
751 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, tree
, di
, drep
,
752 hf_typeinfo_memid
, NULL
);
755 u32TmpOffset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, NULL
, di
, drep
, -1, &u32Flags
);
757 proto_tree_add_bitmask_value(tree
, tvb
, offset
, hf_typeinfo_docflags
,
758 ett_typeinfo_docflags
, flags
, u32Flags
);
760 offset
= u32TmpOffset
;
765 int dissect_ITypeInfo_GetDocumentation_resp(tvbuff_t
*tvb
, int offset
,
766 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
768 offset
= dissect_dcom_that(tvb
, offset
, pinfo
, tree
, di
, drep
);
771 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
, dissect_bstr_through_pointer
, NDR_POINTER_UNIQUE
, "Pointer to Doc Name", hf_typeinfo_docname
);
774 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
, dissect_bstr_through_pointer
, NDR_POINTER_UNIQUE
, "Pointer to Doc String", hf_typeinfo_docstring
);
777 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
, dissect_dword_through_pointer
, NDR_POINTER_UNIQUE
, "Pointer to Help Context", hf_typeinfo_helpctx
);
780 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
, dissect_bstr_through_pointer
, NDR_POINTER_UNIQUE
, "Pointer to Help File", hf_typeinfo_helpfile
);
782 /* HRESULT of call */
783 offset
= dissect_dcom_HRESULT(tvb
, offset
, pinfo
, tree
, di
, drep
, NULL
);
787 int dissect_ITypeInfo_GetTypeAttr_rqst(tvbuff_t
*tvb
, int offset
,
788 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
790 offset
= dissect_dcom_this(tvb
, offset
, pinfo
, tree
, di
, drep
);
794 int dissect_ITypeInfo_GetTypeAttr_resp(tvbuff_t
*tvb
, int offset
,
795 packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, uint8_t *drep
)
797 offset
= dissect_dcom_that(tvb
, offset
, pinfo
, tree
, di
, drep
);
799 offset
= dissect_ndr_toplevel_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
, dissect_typeinfo_TYPEATTR_through_pointer
, NDR_POINTER_UNIQUE
, "Pointer to TypeAttr", hf_typeinfo_typeattr
);
802 offset
= dissect_dcom_DWORD(tvb
, offset
, pinfo
, tree
, di
, drep
,
803 hf_typeinfo_reserved32
, NULL
);
805 /* HRESULT of call */
806 offset
= dissect_dcom_HRESULT(tvb
, offset
, pinfo
, tree
, di
, drep
, NULL
);
811 /* sub dissector table of ITypeInfo interface */
812 static const dcerpc_sub_dissector typeinfo_dissectors
[] = {
813 {3, "GetTypeAttr", dissect_ITypeInfo_GetTypeAttr_rqst
, dissect_ITypeInfo_GetTypeAttr_resp
},
814 {4, "GetTypeComp", NULL
, NULL
},
815 {5, "GetFuncDesc", dissect_ITypeInfo_GetFuncDesc_rqst
, dissect_ITypeInfo_GetFuncDesc_resp
},
816 {6, "GetVarDesc", NULL
, NULL
},
817 {7, "GetNames", dissect_ITypeInfo_GetNames_rqst
, dissect_ITypeInfo_GetNames_resp
},
818 {8, "GetRefTypeOfImplType", NULL
, NULL
},
819 {9, "GetImplTypeFlags", NULL
, NULL
},
820 {12, "GetDocumentation", dissect_ITypeInfo_GetDocumentation_rqst
, dissect_ITypeInfo_GetDocumentation_resp
},
821 {13, "GetDllEntry", NULL
, NULL
},
822 {14, "GetRefTypeInfo", NULL
, NULL
},
823 {16, "CreateInstance", NULL
, NULL
},
824 {17, "GetMops", NULL
, NULL
},
825 {18, "GetContainingTypeLib", NULL
, NULL
},
827 {0, NULL
, NULL
, NULL
},
830 void proto_register_dcom_typeinfo(void)
832 static hf_register_info hf_typeinfo_typedesc_array
[] = {
833 {&hf_typeinfo_typedesc
,
834 {"TypeDesc", "typeinfo.typedesc", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
835 {&hf_typeinfo_typedesc_vtret
,
836 {"VT Return Type", "typeinfo.typedesc.vtret", FT_UINT16
, BASE_HEX
, VALS(dcom_variant_type_vals
), 0x0, NULL
, HFILL
}},
837 {&hf_typeinfo_typedesc_hreftype
,
838 {"Ref Type", "typeinfo.typedesc.reftype", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
840 static hf_register_info hf_typeinfo_paramdesc_array
[] = {
841 {&hf_typeinfo_paramdesc
,
842 {"ParamDesc", "typeinfo.paramdesc", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
843 {&hf_typeinfo_paramdesc_paramflags
,
844 {"Param Flags", "typeinfo.paramdesc.paramflags", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
845 {&hf_typeinfo_paramdesc_paramflags_fin
,
846 {"FIN", "typeinfo.paramdesc.paramflags_fin", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), PARAMFLAG_FIN
, NULL
, HFILL
}},
847 {&hf_typeinfo_paramdesc_paramflags_fout
,
848 {"FOUT", "typeinfo.paramdesc.paramflags_fout", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), PARAMFLAG_FOUT
, NULL
, HFILL
}},
849 {&hf_typeinfo_paramdesc_paramflags_flcid
,
850 {"FLCID", "typeinfo.paramdesc.paramflags_flcid", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), PARAMFLAG_FLCID
, NULL
, HFILL
}},
851 {&hf_typeinfo_paramdesc_paramflags_fretval
,
852 {"FRETVAL", "typeinfo.paramdesc.paramflags_fretval", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), PARAMFLAG_FRETVAL
, NULL
, HFILL
}},
853 {&hf_typeinfo_paramdesc_paramflags_fopt
,
854 {"FOPT", "typeinfo.paramdesc.paramflags_fopt", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), PARAMFLAG_FOPT
, NULL
, HFILL
}},
855 {&hf_typeinfo_paramdesc_paramflags_fhasdefault
,
856 {"FHASDEFAULT", "typeinfo.paramdesc.paramflags_fhasdefault", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), PARAMFLAG_FHASDEFAULT
, NULL
, HFILL
}},
857 {&hf_typeinfo_paramdesc_paramflags_fhascustdata
,
858 {"FHASCUSTDATA", "typeinfo.paramdesc.paramflags_fhascustdata", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), PARAMFLAG_FHASCUSTDATA
, NULL
, HFILL
}},
861 static hf_register_info hf_typeinfo_paramdescex_array
[] = {
862 {&hf_typeinfo_paramdescex
,
863 {"ParamDescEx", "typeinfo.paramdescex", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
864 {&hf_typeinfo_paramdescex_cbytes
,
865 {"Length", "typeinfo.paramdescex.len", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
866 {&hf_typeinfo_paramdescex_varDefaultValue
,
867 {"VT Default Value", "typeinfo.paramdescex.vtdefaultval", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
870 static hf_register_info hf_typeinfo_funcdesc_array
[] = {
871 {&hf_typeinfo_funcdesc
,
872 {"FuncDesc", "typeinfo.funcdesc", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
873 {&hf_typeinfo_funcdesc_memid
,
874 {"MemberID", "typeinfo.funcdesc.memberid", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
875 {&hf_typeinfo_funcdesc_funckind
,
876 {"Function Kind", "typeinfo.funcdesc.funckind", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
877 {&hf_typeinfo_funcdesc_invkind
,
878 {"Invoke Kind", "typeinfo.funcdesc.invkind", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
879 {&hf_typeinfo_funcdesc_callconv
,
880 {"Call Conv", "typeinfo.funcdesc.callconv", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
881 {&hf_typeinfo_funcdesc_params
,
882 {"Param Count", "typeinfo.funcdesc.params", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
883 {&hf_typeinfo_funcdesc_paramsopt
,
884 {"Param Optional Count", "typeinfo.funcdesc.paramsopt", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
885 {&hf_typeinfo_funcdesc_vft
,
886 {"VFT Offset", "typeinfo.funcdesc.ovft", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
887 {&hf_typeinfo_funcdesc_resv16
,
888 {"Reserved", "typeinfo.funcdesc.resv", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
889 {&hf_typeinfo_funcdesc_resv32
,
890 {"Reserved", "typeinfo.funcdesc.resv", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
891 {&hf_typeinfo_funcdesc_elemdesc
,
892 {"ElemDesc", "typeinfo.funcdesc.elemdesc", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
894 {&hf_typeinfo_funcdesc_funcflags
,
895 {"FuncFlags", "typeinfo.funcdesc.funcflags", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
896 {&hf_typeinfo_funcdesc_funcflags_frestricted
,
897 {"FRESTRICTED", "typeinfo.funcdesc.funcflags_frestricted", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FRESTRICTED
, NULL
, HFILL
}},
898 {&hf_typeinfo_funcdesc_funcflags_fsource
,
899 {"FSOURCE", "typeinfo.funcdesc.funcflags_fsource", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FSOURCE
, NULL
, HFILL
}},
900 {&hf_typeinfo_funcdesc_funcflags_fbindable
,
901 {"FBINDABLE", "typeinfo.funcdesc.funcflags_fbindable", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FBINDABLE
, NULL
, HFILL
}},
902 {&hf_typeinfo_funcdesc_funcflags_frequestedit
,
903 {"FREQUESTEDIT", "typeinfo.funcdesc.funcflags_frequestedit", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FREQUESTEDIT
, NULL
, HFILL
}},
904 {&hf_typeinfo_funcdesc_funcflags_fdisplaybind
,
905 {"FDISPLAYBIND", "typeinfo.funcdesc.funcflags_fdisplaybind", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FDISPLAYBIND
, NULL
, HFILL
}},
906 {&hf_typeinfo_funcdesc_funcflags_fdefaultbind
,
907 {"FDEFAULTBIND", "typeinfo.funcdesc.funcflags_fdefaultbind", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FDEFAULTBIND
, NULL
, HFILL
}},
908 {&hf_typeinfo_funcdesc_funcflags_fhidden
,
909 {"FHIDDEN", "typeinfo.funcdesc.funcflags_fhidden", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FHIDDEN
, NULL
, HFILL
}},
910 {&hf_typeinfo_funcdesc_funcflags_fusesgetlasterror
,
911 {"FUSESGETLASTERROR", "typeinfo.funcdesc.funcflags_fusesgetlasterror", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FUSESGETLASTERROR
, NULL
, HFILL
}},
912 {&hf_typeinfo_funcdesc_funcflags_fdefaultcollelem
,
913 {"FDEFAULTCOLLELEM", "typeinfo.funcdesc.funcflags_fdefaultcollelem", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FDEFAULTCOLLELEM
, NULL
, HFILL
}},
914 {&hf_typeinfo_funcdesc_funcflags_fuidefault
,
915 {"FUIDEFAULT", "typeinfo.funcdesc.funcflags_fuidefault", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FUIDEFAULT
, NULL
, HFILL
}},
916 {&hf_typeinfo_funcdesc_funcflags_fnowbrowsable
,
917 {"FNONBROWSABLE", "typeinfo.funcdesc.funcflags_fnowbrowsable", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FNONBROWSABLE
, NULL
, HFILL
}},
918 {&hf_typeinfo_funcdesc_funcflags_freplaceable
,
919 {"FREPLACEABLE", "typeinfo.funcdesc.funcflags_freplaceable", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FREPLACEABLE
, NULL
, HFILL
}},
920 {&hf_typeinfo_funcdesc_funcflags_fimmediatebind
,
921 {"FIMMEDIATEBIND", "typeinfo.funcdesc.funcflags_fimmediatebind", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), FUNCFLAG_FIMMEDIATEBIND
, NULL
, HFILL
}},
925 static hf_register_info hf_typeinfo_array
[] = {
927 {"Operation", "typeinfo.opnum", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
929 {"Function Index", "typeinfo.funcindex", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
930 {&hf_typeinfo_reserved32
,
931 {"Reserved", "typeinfo.resv", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
932 {&hf_typeinfo_reserved16
,
933 {"Reserved", "typeinfo.resv", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
936 {"MemberID", "typeinfo.memberid", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
939 {"Names", "typeinfo.names", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
940 {&hf_typeinfo_names_value
,
941 {"Value", "typeinfo.names.value", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
942 {&hf_typeinfo_maxnames
,
943 {"Max Names", "typeinfo.maxnames", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
945 {&hf_typeinfo_docflags
,
946 {"Documentation Flags", "typeinfo.docflags", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
948 {&hf_typeinfo_docflags_name
,
949 {"NameArg", "typeinfo.docflags_namearg", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_DOCFLAGS_NameArg
, NULL
, HFILL
}},
950 {&hf_typeinfo_docflags_docstring
,
951 {"DocStringArg", "typeinfo.docflags_docstringarg", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_DOCFLAGS_DocStringArg
, NULL
, HFILL
}},
952 {&hf_typeinfo_docflags_helpctx
,
953 {"HelpContextArg", "typeinfo.docflags_helpctxarg", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_DOCFLAGS_HelpContextArg
, NULL
, HFILL
}},
954 {&hf_typeinfo_docflags_helpfile
,
955 {"HelpFileArg", "typeinfo.docflags_helpfilearg", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_DOCFLAGS_HelpFileArg
, NULL
, HFILL
}},
957 {&hf_typeinfo_docname
,
958 {"Doc Name", "typeinfo.docname", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
959 {&hf_typeinfo_docstring
,
960 {"Doc String", "typeinfo.docstring", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
961 {&hf_typeinfo_helpfile
,
962 {"Help File", "typeinfo.helpfile", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
963 {&hf_typeinfo_helpctx
,
964 {"Help Ctx", "typeinfo.helpctx", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
966 {&hf_typeinfo_typeattr
,
967 {"TypeAttr", "typeinfo.typeattr", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
969 {"GUID", "typeinfo.guid", FT_GUID
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
971 {"LCID", "typeinfo.lcid", FT_UINT32
, BASE_HEX
, VALS(dcom_lcid_vals
), 0x0, NULL
, HFILL
}},
972 {&hf_typeinfo_sizeInstance
,
973 {"Size Instance", "typeinfo.sizeinstance", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
974 {&hf_typeinfo_typekind
,
975 {"Type Kind", "typeinfo.typekind", FT_UINT32
, BASE_HEX
, VALS(typekind_vals
), 0x0, NULL
, HFILL
}},
976 {&hf_typeinfo_cFuncs
,
977 {"Func Count", "typeinfo.funcs", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
979 {"Variables Count", "typeinfo.vars", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
980 {&hf_typeinfo_cImplTypes
,
981 {"Implemented Interface Count", "typeinfo.impltypes", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
982 {&hf_typeinfo_cbSizeVft
,
983 {"Virtual Table Size", "typeinfo.sizevft", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
984 {&hf_typeinfo_cbAlignment
,
985 {"Byte Alignment", "typeinfo.balignment", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
986 {&hf_typeinfo_wMajorVerNum
,
987 {"MajorVerNum", "typeinfo.majorvernum", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
988 {&hf_typeinfo_wMinorVerNum
,
989 {"MinorVerNum", "typeinfo.minorvernum", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
991 {&hf_typeinfo_typeflags
,
992 {"Type Flags", "typeinfo.typeflags", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
993 {&hf_typeinfo_typeflags_fappobject
,
994 {"FAPPOBJECT", "typeinfo.typeflags_fappobject", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FAPPOBJECT
, NULL
, HFILL
}},
995 {&hf_typeinfo_typeflags_fcancreate
,
996 {"FCANCREATE", "typeinfo.typeflags_fcancreate", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FCANCREATE
, NULL
, HFILL
}},
997 {&hf_typeinfo_typeflags_flicensed
,
998 {"FLICENSED", "typeinfo.typeflags_flicensed", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FLICENSED
, NULL
, HFILL
}},
999 {&hf_typeinfo_typeflags_fpredeclid
,
1000 {"FPREDECLID", "typeinfo.typeflags_fpredeclid", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FPREDECLID
, NULL
, HFILL
}},
1001 {&hf_typeinfo_typeflags_fhidden
,
1002 {"FHIDDEN", "typeinfo.typeflags_fhidden", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FHIDDEN
, NULL
, HFILL
}},
1003 {&hf_typeinfo_typeflags_fcontrol
,
1004 {"FCONTROL", "typeinfo.typeflags_fcontrol", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FCONTROL
, NULL
, HFILL
}},
1005 {&hf_typeinfo_typeflags_fdual
,
1006 {"FDUAL", "typeinfo.typeflags_fdual", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FDUAL
, NULL
, HFILL
}},
1007 {&hf_typeinfo_typeflags_fnonextensible
,
1008 {"FNONEXTENSIBLE", "typeinfo.typeflags_fnonextensible", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FNONEXTENSIBLE
, NULL
, HFILL
}},
1009 {&hf_typeinfo_typeflags_foleautomation
,
1010 {"FOLEAUTOMATION", "typeinfo.typeflags_foleautomation", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FOLEAUTOMATION
, NULL
, HFILL
}},
1011 {&hf_typeinfo_typeflags_frestricted
,
1012 {"FRESTRICTED", "typeinfo.typeflags_frestricted", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FRESTRICTED
, NULL
, HFILL
}},
1013 {&hf_typeinfo_typeflags_faggregatable
,
1014 {"FAGGREGATABLE", "typeinfo.typeflags_faggregatable", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FAGGREGATABLE
, NULL
, HFILL
}},
1015 {&hf_typeinfo_typeflags_freplaceable
,
1016 {"FREPLACEABLE", "typeinfo.typeflags_freplaceable", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FREPLACEABLE
, NULL
, HFILL
}},
1017 {&hf_typeinfo_typeflags_fdispatchable
,
1018 {"FDISPATCHABLE", "typeinfo.typeflags_fdispatchable", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FDISPATCHABLE
, NULL
, HFILL
}},
1019 {&hf_typeinfo_typeflags_fproxy
,
1020 {"FPROXY", "typeinfo.typeflags_fproxy", FT_BOOLEAN
, 32, TFS(&tfs_set_notset
), TYPEINFO_TYPEFLAG_FPROXY
, NULL
, HFILL
}},
1023 static int *ett
[] = {
1025 &ett_typeinfo_docflags
,
1026 &ett_typeinfo_typeflags
,
1027 &ett_typeinfo_names
,
1028 &ett_typeinfo_typeattr
,
1029 &ett_typeinfo_elemdesc
,
1030 &ett_typeinfo_typedesc
,
1031 &ett_typeinfo_paramdesc
,
1032 &ett_typeinfo_paramdesc_paramflags
,
1033 &ett_typeinfo_paramdescex
,
1034 &ett_typeinfo_funcdesc
,
1035 &ett_typeinfo_funcdesc_funcflags
,
1038 /* ITypeInfo currently only partially implemented */
1039 proto_typeinfo
= proto_register_protocol("DCOM ITypeInfo", "ITypeInfo", "typeinfo");
1040 proto_register_field_array(proto_typeinfo
, hf_typeinfo_typedesc_array
, array_length(hf_typeinfo_typedesc_array
));
1041 proto_register_field_array(proto_typeinfo
, hf_typeinfo_paramdesc_array
, array_length(hf_typeinfo_paramdesc_array
));
1042 proto_register_field_array(proto_typeinfo
, hf_typeinfo_paramdescex_array
, array_length(hf_typeinfo_paramdescex_array
));
1043 proto_register_field_array(proto_typeinfo
, hf_typeinfo_funcdesc_array
, array_length(hf_typeinfo_funcdesc_array
));
1044 proto_register_field_array(proto_typeinfo
, hf_typeinfo_array
, array_length(hf_typeinfo_array
));
1045 proto_register_subtree_array(ett
, array_length(ett
));
1048 void proto_reg_handoff_dcom_typeinfo(void)
1050 dcerpc_init_uuid(proto_typeinfo
, ett_typeinfo
,
1051 &uuid_typeinfo
, ver_typeinfo
,
1052 typeinfo_dissectors
, hf_typeinfo_opnum
);
1056 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1061 * indent-tabs-mode: t
1064 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1065 * :indentSize=8:tabSize=8:noTabs=false: