ilMeta.mli 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204
  1. (*
  2. * This file is part of ilLib
  3. * Copyright (c)2004-2013 Haxe Foundation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  18. *)
  19. open PeData;;
  20. (* useful types for describing CLI metadata *)
  21. type guid = string
  22. (* reference from the #GUID stream *)
  23. type stringref = string
  24. (* reference from the #Strings stream *)
  25. type blobref = string
  26. (* reference from the #Blob stream *)
  27. type id = stringref
  28. (* a stringref that references an identifier. *)
  29. (* must begin with an alphabetic character, or the following characters: *)
  30. (* #, $, @, _ *)
  31. (* and continue with alphanumeric characters or one of the following: *)
  32. (* ?, $, @, _, ` *)
  33. type ns = id list
  34. type rid = int
  35. (* record id on a specified meta table *)
  36. type clr_meta_idx =
  37. (* strongly-type each table index *)
  38. | IModule | ITypeRef | ITypeDef | IFieldPtr
  39. | IField | IMethodPtr | IMethod | IParamPtr
  40. | IParam | IInterfaceImpl | IMemberRef | IConstant
  41. | ICustomAttribute | IFieldMarshal | IDeclSecurity
  42. | IClassLayout | IFieldLayout | IStandAloneSig
  43. | IEventMap | IEventPtr | IEvent | IPropertyMap
  44. | IPropertyPtr | IProperty | IMethodSemantics
  45. | IMethodImpl | IModuleRef | ITypeSpec | IImplMap
  46. | IFieldRVA | IENCLog | IENCMap | IAssembly
  47. | IAssemblyProcessor | IAssemblyOS | IAssemblyRef
  48. | IAssemblyRefProcessor | IAssemblyRefOS
  49. | IFile | IExportedType | IManifestResource | INestedClass
  50. | IGenericParam | IMethodSpec | IGenericParamConstraint
  51. (* reserved metas *)
  52. | IR0x2D | IR0x2E | IR0x2F
  53. | IR0x30 | IR0x31 | IR0x32 | IR0x33 | IR0x34 | IR0x35 | IR0x36 | IR0x37
  54. | IR0x38 | IR0x39 | IR0x3A | IR0x3B | IR0x3C | IR0x3D | IR0x3E | IR0x3F
  55. (* coded tokens *)
  56. | ITypeDefOrRef | IHasConstant | IHasCustomAttribute
  57. | IHasFieldMarshal | IHasDeclSecurity | IMemberRefParent
  58. | IHasSemantics | IMethodDefOrRef | IMemberForwarded | IImplementation
  59. | ICustomAttributeType | IResolutionScope | ITypeOrMethodDef
  60. type meta_pointer = clr_meta_idx * rid
  61. (* generic reference to the meta table *)
  62. (* starting with all annotations of special coded types *)
  63. type type_def_or_ref = clr_meta
  64. and has_const = clr_meta
  65. and has_custom_attribute = clr_meta
  66. and has_field_marshal = clr_meta
  67. and has_decl_security = clr_meta
  68. and member_ref_parent = clr_meta
  69. and has_semantics = clr_meta
  70. and method_def_or_ref = clr_meta
  71. and member_forwarded = clr_meta
  72. and implementation = clr_meta
  73. and custom_attribute_type = clr_meta
  74. and resolution_scope = clr_meta
  75. and type_or_method_def = clr_meta
  76. and clr_meta =
  77. | Module of meta_module
  78. (* the current module descriptor *)
  79. | TypeRef of meta_type_ref
  80. (* class reference descriptors *)
  81. | TypeDef of meta_type_def
  82. (* class or interface definition descriptors *)
  83. | FieldPtr of meta_field_ptr
  84. (* a class-to-fields lookup table - does not exist in optimized metadatas *)
  85. | Field of meta_field
  86. (* field definition descriptors *)
  87. | MethodPtr of meta_method_ptr
  88. (* a class-to-methods lookup table - does not exist in optimized metadatas *)
  89. | Method of meta_method
  90. (* method definition descriptors *)
  91. | ParamPtr of meta_param_ptr
  92. (* a method-to-parameters lookup table - does not exist in optimized metadatas *)
  93. | Param of meta_param
  94. (* parameter definition descriptors *)
  95. | InterfaceImpl of meta_interface_impl
  96. (* interface implementation descriptors *)
  97. | MemberRef of meta_member_ref
  98. (* member (field or method) reference descriptors *)
  99. | Constant of meta_constant
  100. (* constant value that map the default values stored in the #Blob stream to *)
  101. (* respective fields, parameters and properties *)
  102. | CustomAttribute of meta_custom_attribute
  103. (* custom attribute descriptors *)
  104. | FieldMarshal of meta_field_marshal
  105. (* field or parameter marshaling descriptors for managed/unmanaged interop *)
  106. | DeclSecurity of meta_decl_security
  107. (* security descriptors *)
  108. | ClassLayout of meta_class_layout
  109. (* class layout descriptors that hold information about how the loader should lay out respective classes *)
  110. | FieldLayout of meta_field_layout
  111. (* field layout descriptors that specify the offset or oridnal of individual fields *)
  112. | StandAloneSig of meta_stand_alone_sig
  113. (* stand-alone signature descriptors. used in two capacities: *)
  114. (* as composite signatures of local variables of methods *)
  115. (* and as parameters of the call indirect (calli) IL instruction *)
  116. | EventMap of meta_event_map
  117. (* a class-to-events mapping table. exists also in optimized metadatas *)
  118. | EventPtr of meta_event_ptr
  119. (* an event map-to-events lookup table - does not exist in optimized metadata *)
  120. | Event of meta_event
  121. (* event descriptors *)
  122. | PropertyMap of meta_property_map
  123. (* a class-to-properties mapping table. exists also in optimized metadatas *)
  124. | PropertyPtr of meta_property_ptr
  125. (* a property map-to-properties lookup table - does not exist in optimized metadata *)
  126. | Property of meta_property
  127. (* property descriptors *)
  128. | MethodSemantics of meta_method_semantics
  129. (* method semantics descriptors that hold information about which method is associated *)
  130. (* with a specific property or event and in what capacity *)
  131. | MethodImpl of meta_method_impl
  132. (* method implementation descriptors *)
  133. | ModuleRef of meta_module_ref
  134. (* module reference descriptors *)
  135. | TypeSpec of meta_type_spec
  136. (* Type specification descriptors *)
  137. | ImplMap of meta_impl_map
  138. (* implementation map descriptors used for platform invocation (P/Invoke) *)
  139. | FieldRVA of meta_field_rva
  140. (* field-to-data mapping descriptors *)
  141. | ENCLog of meta_enc_log
  142. (* edit-and-continue log descriptors that hold information about what changes *)
  143. (* have been made to specific metadata items during in-memory editing *)
  144. (* this table does not exist on optimized metadata *)
  145. | ENCMap of meta_enc_map
  146. (* edit-and-continue mapping descriptors. does not exist on optimized metadata *)
  147. | Assembly of meta_assembly
  148. (* the current assembly descriptor, which should appear only in the prime module metadata *)
  149. | AssemblyProcessor of meta_assembly_processor | AssemblyOS of meta_assembly_os
  150. (* unused *)
  151. | AssemblyRef of meta_assembly_ref
  152. (* assembly reference descriptors *)
  153. | AssemblyRefProcessor of meta_assembly_ref_processor | AssemblyRefOS of meta_assembly_ref_os
  154. (* unused *)
  155. | File of meta_file
  156. (* file descriptors that contain information about other files in the current assembly *)
  157. | ExportedType of meta_exported_type
  158. (* exported type descriptors that contain information about public classes *)
  159. (* exported by the current assembly, which are declared in other modules of the assembly *)
  160. (* only the prime module of the assembly should carry this table *)
  161. | ManifestResource of meta_manifest_resource
  162. (* managed resource descriptors *)
  163. | NestedClass of meta_nested_class
  164. (* nested class descriptors that provide mapping of nested classes to their respective enclosing classes *)
  165. | GenericParam of meta_generic_param
  166. (* type parameter descriptors for generic classes and methods *)
  167. | MethodSpec of meta_method_spec
  168. (* generic method instantiation descriptors *)
  169. | GenericParamConstraint of meta_generic_param_constraint
  170. (* descriptors of constraints specified for type parameters of generic classes and methods *)
  171. | UnknownMeta of int
  172. (* all fields here need to be mutable, as they will first be initialized empty *)
  173. and meta_root = {
  174. root_id : int;
  175. }
  176. and meta_root_ptr = {
  177. ptr_id : int;
  178. ptr_to : meta_root;
  179. }
  180. and meta_module = {
  181. mutable md_id : int;
  182. mutable md_generation : int;
  183. mutable md_name : id;
  184. mutable md_vid : guid;
  185. mutable md_encid : guid;
  186. mutable md_encbase_id : guid;
  187. }
  188. and meta_type_ref = {
  189. mutable tr_id : int;
  190. mutable tr_resolution_scope : resolution_scope;
  191. mutable tr_name : id;
  192. mutable tr_namespace : ns;
  193. }
  194. and meta_type_def = {
  195. mutable td_id : int;
  196. mutable td_flags : type_def_flags;
  197. mutable td_name : id;
  198. mutable td_namespace : ns;
  199. mutable td_extends : type_def_or_ref option;
  200. mutable td_field_list : meta_field list;
  201. mutable td_method_list : meta_method list;
  202. (* extra field *)
  203. mutable td_extra_enclosing : meta_type_def option;
  204. }
  205. and meta_field_ptr = {
  206. mutable fp_id : int;
  207. mutable fp_field : meta_field;
  208. }
  209. and meta_field = {
  210. mutable f_id : int;
  211. mutable f_flags : field_flags;
  212. mutable f_name : id;
  213. mutable f_signature : ilsig;
  214. }
  215. and meta_method_ptr = {
  216. mutable mp_id : int;
  217. mutable mp_method : meta_method;
  218. }
  219. and meta_method = {
  220. mutable m_id : int;
  221. mutable m_rva : rva;
  222. mutable m_flags : method_flags;
  223. mutable m_name : id;
  224. mutable m_signature : ilsig;
  225. mutable m_param_list : meta_param list; (* rid: Param *)
  226. (* extra field *)
  227. mutable m_declaring : meta_type_def option;
  228. }
  229. and meta_param_ptr = {
  230. mutable pp_id : int;
  231. mutable pp_param : meta_param;
  232. }
  233. and meta_param = {
  234. mutable p_id : int;
  235. mutable p_flags : param_flags;
  236. mutable p_sequence : int;
  237. (* 0 means return value *)
  238. mutable p_name : id;
  239. }
  240. and meta_interface_impl = {
  241. mutable ii_id : int;
  242. mutable ii_class : meta_type_def; (* TypeDef rid *)
  243. mutable ii_interface : type_def_or_ref;
  244. }
  245. and meta_member_ref = {
  246. mutable memr_id : int;
  247. mutable memr_class : member_ref_parent;
  248. mutable memr_name : id;
  249. mutable memr_signature : ilsig;
  250. }
  251. and meta_constant = {
  252. mutable c_id : int;
  253. mutable c_type : constant_type;
  254. mutable c_parent : has_const;
  255. mutable c_value : constant;
  256. }
  257. and named_attribute = bool * string * instance (* is_property * name * instance *)
  258. and meta_custom_attribute = {
  259. mutable ca_id : int;
  260. mutable ca_parent : has_custom_attribute;
  261. mutable ca_type : custom_attribute_type;
  262. mutable ca_value : (instance list * named_attribute list) option;
  263. (* can be 0 *)
  264. }
  265. and meta_field_marshal = {
  266. mutable fm_id : int;
  267. mutable fm_parent : has_field_marshal;
  268. mutable fm_native_type : nativesig;
  269. }
  270. and meta_decl_security = {
  271. mutable ds_id : int;
  272. mutable ds_action : action_security;
  273. mutable ds_parent : has_decl_security;
  274. mutable ds_permission_set : blobref;
  275. (* an xml with the permission set *)
  276. }
  277. and meta_class_layout = {
  278. mutable cl_id : int;
  279. mutable cl_packing_size : int;
  280. (* power of two; from 1 through 128 *)
  281. mutable cl_class_size : int;
  282. mutable cl_parent : meta_type_def; (* TypeDef rid *)
  283. }
  284. and meta_field_layout = {
  285. mutable fl_id : int;
  286. mutable fl_offset : int;
  287. (* offset in bytes or ordinal *)
  288. mutable fl_field : meta_field; (* Field rid *)
  289. }
  290. and meta_stand_alone_sig = {
  291. mutable sa_id : int;
  292. mutable sa_signature : ilsig;
  293. }
  294. and meta_event_map = {
  295. mutable em_id : int;
  296. mutable em_parent : meta_type_def; (* TypeDef rid *)
  297. mutable em_event_list : meta_event list; (* Event rid *)
  298. }
  299. and meta_event_ptr = {
  300. mutable ep_id : int;
  301. mutable ep_event : meta_event; (* Event rid *)
  302. }
  303. and meta_event = {
  304. mutable e_id : int;
  305. mutable e_flags : event_flags;
  306. mutable e_name : stringref;
  307. mutable e_event_type : type_def_or_ref;
  308. }
  309. and meta_property_map = {
  310. mutable pm_id : int;
  311. mutable pm_parent : meta_type_def; (* TypeDef rid *)
  312. mutable pm_property_list : meta_property list; (* Property rid *)
  313. }
  314. and meta_property_ptr = {
  315. mutable prp_id : int;
  316. mutable prp_property : meta_property; (* Property rid *)
  317. }
  318. and meta_property = {
  319. mutable prop_id : int;
  320. mutable prop_flags : property_flags;
  321. mutable prop_name : stringref;
  322. mutable prop_type : ilsig;
  323. }
  324. and meta_method_semantics = {
  325. mutable ms_id : int;
  326. mutable ms_semantic : semantic_flags;
  327. mutable ms_method : meta_method; (* Method rid *)
  328. mutable ms_association : has_semantics;
  329. }
  330. and meta_method_impl = {
  331. mutable mi_id : int;
  332. mutable mi_class : meta_type_def; (* TypeDef rid *)
  333. mutable mi_method_body : method_def_or_ref;
  334. (* overriding method *)
  335. mutable mi_method_declaration : method_def_or_ref;
  336. (* overridden method *)
  337. }
  338. and meta_module_ref = {
  339. mutable modr_id : int;
  340. mutable modr_name : stringref;
  341. }
  342. and meta_type_spec = {
  343. mutable ts_id : int;
  344. mutable ts_signature : ilsig;
  345. }
  346. (* reserved ? *)
  347. and meta_enc_log = {
  348. mutable el_id : int;
  349. mutable el_token : to_det;
  350. mutable el_func_code : to_det;
  351. }
  352. and meta_impl_map = {
  353. mutable im_id : int;
  354. mutable im_flags : impl_flags; (* mapping_flags *)
  355. mutable im_forwarded : member_forwarded; (* method only *)
  356. mutable im_import_name : stringref;
  357. mutable im_import_scope : meta_module_ref; (* ModuleRef rid *)
  358. }
  359. (* reserved ? *)
  360. and meta_enc_map = {
  361. mutable encm_id : int;
  362. mutable encm_token : to_det;
  363. }
  364. and meta_field_rva = {
  365. mutable fr_id : int;
  366. mutable fr_rva : rva;
  367. mutable fr_field : meta_field; (* Field rid *)
  368. }
  369. and meta_assembly = {
  370. mutable a_id : int;
  371. mutable a_hash_algo : hash_algo;
  372. mutable a_major : int;
  373. mutable a_minor : int;
  374. mutable a_build : int;
  375. mutable a_rev : int;
  376. mutable a_flags : assembly_flags; (* assembly_flags *)
  377. mutable a_public_key : blobref;
  378. mutable a_name : stringref;
  379. mutable a_locale : stringref;
  380. }
  381. (* unused *)
  382. and meta_assembly_processor = {
  383. mutable ap_id : int;
  384. mutable ap_processor : to_det;
  385. }
  386. (* unused *)
  387. and meta_assembly_os = {
  388. mutable aos_id : int;
  389. mutable aos_platform_id : to_det;
  390. mutable aos_major_version : to_det;
  391. mutable aos_minor_version : to_det;
  392. }
  393. and meta_assembly_ref = {
  394. mutable ar_id : int;
  395. mutable ar_major : int;
  396. mutable ar_minor : int;
  397. mutable ar_build : int;
  398. mutable ar_rev : int;
  399. mutable ar_flags : assembly_flags;
  400. mutable ar_public_key : blobref;
  401. mutable ar_name : stringref; (* no path, no extension *)
  402. mutable ar_locale : stringref;
  403. mutable ar_hash_value : blobref;
  404. }
  405. (* unused *)
  406. and meta_assembly_ref_processor = {
  407. mutable arp_id : int;
  408. mutable arp_processor : to_det;
  409. mutable arp_assembly_ref : meta_assembly_ref; (* AssemblyRef rid *)
  410. }
  411. (* unused *)
  412. and meta_assembly_ref_os = {
  413. mutable aros_id : int;
  414. mutable aros_platform_id : to_det;
  415. mutable aros_major : int;
  416. mutable aros_minor : int;
  417. mutable aros_assembly_ref : meta_assembly_ref; (* AssemblyRef rid *)
  418. }
  419. and meta_file = {
  420. mutable file_id : int;
  421. mutable file_flags : file_flag; (* file_flags *)
  422. mutable file_name : stringref; (* no path; only file name *)
  423. mutable file_hash_value : blobref;
  424. }
  425. and meta_exported_type = {
  426. mutable et_id : int;
  427. mutable et_flags : type_def_flags;
  428. mutable et_type_def_id : int;
  429. (* TypeDef token in another module *)
  430. mutable et_type_name : stringref;
  431. mutable et_type_namespace : ns;
  432. mutable et_implementation : implementation;
  433. }
  434. and meta_manifest_resource = {
  435. mutable mr_id : int;
  436. mutable mr_offset : int;
  437. mutable mr_flags : manifest_resource_flag; (* manifest_resource_flags *)
  438. mutable mr_name : stringref;
  439. mutable mr_implementation : implementation option;
  440. }
  441. and meta_nested_class = {
  442. mutable nc_id : int;
  443. mutable nc_nested : meta_type_def; (* TypeDef rid *)
  444. mutable nc_enclosing : meta_type_def; (* TypeDef rid *)
  445. }
  446. and meta_generic_param = {
  447. mutable gp_id : int;
  448. mutable gp_number : int; (* ordinal *)
  449. mutable gp_flags : generic_flags;
  450. mutable gp_owner : type_or_method_def;
  451. (* generic type or method *)
  452. mutable gp_name : stringref option;
  453. }
  454. and meta_method_spec = {
  455. mutable mspec_id : int;
  456. mutable mspec_method : method_def_or_ref;
  457. (* instantiated method *)
  458. mutable mspec_instantiation : ilsig;
  459. (* instantiated signature *)
  460. }
  461. and meta_generic_param_constraint = {
  462. mutable gc_id : int;
  463. mutable gc_owner : meta_generic_param; (* GenericParam rid *)
  464. (* constrained parameter *)
  465. mutable gc_constraint : type_def_or_ref;
  466. (* type the parameter must extend or implement *)
  467. }
  468. and to_det = int
  469. and not_implemented = int
  470. and constant =
  471. | IBool of bool
  472. | IChar of int
  473. | IByte of int
  474. | IShort of int
  475. | IInt of int32
  476. | IInt64 of int64
  477. | IFloat32 of float
  478. | IFloat64 of float
  479. | IString of string
  480. | INull
  481. and instance =
  482. | InstConstant of constant
  483. | InstBoxed of instance
  484. | InstType of string
  485. | InstArray of instance list
  486. | InstEnum of int
  487. and constant_type =
  488. | CBool (* 0x2 *)
  489. | CChar (* 0x3 *)
  490. | CInt8 (* 0x4 *)
  491. | CUInt8 (* 0x5 *)
  492. | CInt16 (* 0x6 *)
  493. | CUInt16 (* 0x7 *)
  494. | CInt32 (* 0x8 *)
  495. | CUInt32 (* 0x9 *)
  496. | CInt64 (* 0xA *)
  497. | CUInt64 (* 0xB *)
  498. | CFloat32 (* 0xC *)
  499. | CFloat64 (* 0xD *)
  500. | CString (* 0xE *)
  501. | CNullRef (* 0x12 *)
  502. (* null object reference - the value of the constant *)
  503. (* of this type must be a 4-byte integer containing 0 *)
  504. and type_def_vis =
  505. (* visibility flags - mask 0x7 *)
  506. | VPrivate (* 0x0 *)
  507. (* type is not visible outside the assembly. default *)
  508. | VPublic (* 0x1 *)
  509. (* type visible outside the assembly *)
  510. | VNestedPublic (* 0x2 *)
  511. (* the nested type has public visibility *)
  512. | VNestedPrivate (* 0x3 *)
  513. (* nested type has private visibility - it's not visible outside the enclosing class *)
  514. | VNestedFamily (* 0x4 *)
  515. (* nested type has family visibility - it's visible to descendants of the enclosing class only *)
  516. | VNestedAssembly (* 0x5 *)
  517. (* nested type visible within the assembly only *)
  518. | VNestedFamAndAssem (* 0x6 *)
  519. (* nested type is visible to the descendants of the enclosing class residing in the same assembly *)
  520. | VNestedFamOrAssem (* 0x7 *)
  521. (* nested type is visible to the descendants of the enclosing class either within *)
  522. (* or outside the assembly and to every type within the assembly *)
  523. and type_def_layout =
  524. (* layout flags - mask 0x18 *)
  525. | LAuto (* 0x0 *)
  526. (* type fields are laid out automatically *)
  527. | LSequential (* 0x8 *)
  528. (* loader must preserve the order of the instance fields *)
  529. | LExplicit (* 0x10 *)
  530. (* type layout is specified explicitly *)
  531. and type_def_semantics =
  532. (* semantics flags - mask 0x5A0 *)
  533. | SInterface (* 0x20 *)
  534. (* type is an interface. If specified, the default parent is set to nil *)
  535. | SAbstract (* 0x80 *)
  536. | SSealed (* 0x100 *)
  537. | SSpecialName (* 0x400 *)
  538. (* type has a special name. how special depends on the name itself *)
  539. (* e.g. .ctor or .cctor *)
  540. and type_def_impl =
  541. (* type implementation flags - mask 0x103000 *)
  542. | IImport (* 0x1000 *)
  543. (* the type is imported from a COM type library *)
  544. | ISerializable (* 0x2000 *)
  545. (* the type can be serialized into sequential data *)
  546. | IBeforeFieldInit (* 0x00100000 *)
  547. (* the type can be initialized any time before the first access *)
  548. (* to a static field. *)
  549. and type_def_string =
  550. (* string formatting flags - mask 0x00030000 *)
  551. | SAnsi (* 0x0 *)
  552. (* managed strings are marshaled to and from ANSI strings *)
  553. | SUnicode (* 0x00010000 *)
  554. (* managed strings are marshaled to and from UTF-16 *)
  555. | SAutoChar (* 0x00020000 *)
  556. (* marshaling is defined by the underlying platform *)
  557. and type_def_flags = {
  558. tdf_vis : type_def_vis;
  559. tdf_layout : type_def_layout;
  560. tdf_semantics : type_def_semantics list;
  561. tdf_impl : type_def_impl list;
  562. tdf_string : type_def_string;
  563. }
  564. and field_access =
  565. (* access flags - mask 0x07 *)
  566. | FAPrivateScope (* 0x0 *)
  567. (* default - exempt from the requirement of having a unique triad of owner, name and signature *)
  568. (* so it must always be referenced by a FieldDef token and never by a MemberRef *)
  569. (* privatescope fields are accessible from anywhere within the current module *)
  570. | FAPrivate (* 0x1 *)
  571. (* field is accessible from its owner and from classes nested in the field's owner. *)
  572. (* global private fields are accessible from anywhere within current module *)
  573. | FAFamAndAssem (* 0x2 *)
  574. (* accessible from types belonging to the owner's family defined in the current assembly *)
  575. (* family means the type itself and all its descendants *)
  576. | FAAssembly (* 0x3 *)
  577. (* accessible from types defined in the current assembly *)
  578. | FAFamily (* 0x4 *)
  579. (* accessible from the owner's family - defined in this or any other assembly *)
  580. | FAFamOrAssem (* 0x5 *)
  581. (* accessible from the owner's family and from all types defined in the current assembly *)
  582. | FAPublic (* 0x6 *)
  583. (* field is accessible from any type *)
  584. and field_contract =
  585. (* contract flags - mask 0x02F0 *)
  586. | CStatic (* 0x10 *)
  587. (* static field. global fields must be static *)
  588. | CInitOnly (* 0x20 *)
  589. (* field can be initialized only and cannot be written to later. *)
  590. (* Initialization takes place in an instance constructor (.ctor) for instance fields *)
  591. (* and in a class constructor (.cctor) for static fields. *)
  592. (* this flag is not enforced by the CLR *)
  593. | CLiteral (* 0x40 *)
  594. (* field is a compile-time constant. the loader does not lay out this field *)
  595. (* and does not create an internal handle for it *)
  596. (* it cannot be directly addressed from IL and can only be used as a Reflection reference *)
  597. | CNotSerialized (* 0x80 *)
  598. (* field is not serialized when the owner is remoted *)
  599. | CSpecialName (* 0x200 *)
  600. (* the field is special in some way, as defined by its name *)
  601. (* example is the field value__ of an enumeration type *)
  602. and field_reserved =
  603. (* reserved flags - cannot be set explicitly. mask 0x9500 *)
  604. | RSpecialName (* 0x400 *)
  605. (* has a special name that is reserved for internal use of the CLR *)
  606. (* two field names are reserved: value_, for instance fields in enumerations *)
  607. (* and _Deleted* for fields marked for deletion but not actually removed from metadata *)
  608. | RMarshal (* 0x1000 *)
  609. (* The field has an associated FieldMarshal record specifying how the field must be *)
  610. (* marshaled when consumed by unmanaged code. *)
  611. | RConstant (* 0x8000 *)
  612. (* field has an associated Constant record *)
  613. | RFieldRVA (* 0x0100 *)
  614. (* field is mapped to data and has an associated FieldRVA record *)
  615. and field_flags = {
  616. ff_access : field_access;
  617. ff_contract : field_contract list;
  618. ff_reserved : field_reserved list;
  619. }
  620. and method_contract =
  621. (* contract flags - mask 0xF0 *)
  622. | CMStatic (* 0x10 *)
  623. | CMFinal (* 0x20 *)
  624. (* must be paired with the virtual flag - otherwise it is meaningless *)
  625. | CMVirtual (* 0x40 *)
  626. | CMHideBySig (* 0x80 *)
  627. (* the method hides all methods of the parent classes that have a matching *)
  628. (* signature and name (as opposed to having a matching name only). ignored by the CLR *)
  629. and method_vtable =
  630. (* vtable flags - mask 0x300 *)
  631. | VNewSlot (* 0x100 *)
  632. (* a new vtable slot is created, so it doesn't override the old implementation *)
  633. | VStrict (* 0x200 *)
  634. (* virtual method can be overridden only if it is accessible from the overriding class *)
  635. and method_impl =
  636. (* implementation flags - mask 0x2C08 *)
  637. | IAbstract (* 0x0400 *)
  638. | ISpecialName (* 0x0800 *)
  639. | IPInvokeImpl (* 0x2000 *)
  640. (* the method has an unmanaged implementation and is called through the platform *)
  641. (* invocation mechanism. the rva field must be 0, since the method is implemented externally *)
  642. | IUnmanagedExp (* 0x0008 *)
  643. (* the managed method is exposed as an unmanaged export. not used by the CLR currently *)
  644. and method_reserved =
  645. (* reserved flags - cannot be set explicitly. mask 0xD000 *)
  646. | RTSpecialName (* 0x1000 *)
  647. (* has a special name: .ctor, .cctor, _VtblGap* and _Deleted* *)
  648. | RHasSecurity (* 0x4000 *)
  649. (* either has an associated DeclSecurity metadata or the custom attribte *)
  650. (* System.Security.SuppressUnmanagedCodeSecurityAttribute *)
  651. | RReqSecObj (* 0x8000 *)
  652. (* this method calls another method containing security code, so it requires *)
  653. (* an additional stack slot for a security object. *)
  654. and method_code_type =
  655. (* code type - mask 0x3 *)
  656. | CCil (* 0x0 *)
  657. | CNative (* 0x1 *)
  658. (* implemented in native platform-specific code *)
  659. | COptIl (* 0x2 *)
  660. (* optimized il - not supported; must not be set *)
  661. | CRuntime (* 0x3 *)
  662. (* automatically generated by the runtime itself (intrinsic) *)
  663. and method_code_mngmt =
  664. (* code management - mask 0x4 *)
  665. | MManaged (* 0x0 *)
  666. | MUnmanaged (* 0x4 *)
  667. (* must be paired with the native flag *)
  668. and method_interop =
  669. (* method implementation and interop - mask 0x10D8 *)
  670. | OForwardRef (* 0x10 *)
  671. (* managed object fiels and edit-and-continue scenarios only *)
  672. | OPreserveSig (* 0x80 *)
  673. (* method signature must not be mangled during interop with classic COM code *)
  674. | OInternalCall (* 0x1000 *)
  675. (* reserved for internal use. if set, RVA must be 0 *)
  676. | OSynchronized (* 0x20 *)
  677. (* automatically insert code to take a lock on entry to the method and release it *)
  678. (* on exit from the method. Value types cannot have this flag set *)
  679. | ONoInlining (* 0x08 *)
  680. (* the runtime is not allowed to inline the method *)
  681. and method_flags = {
  682. mf_access : field_access;
  683. mf_contract : method_contract list;
  684. mf_vtable : method_vtable list;
  685. mf_impl : method_impl list;
  686. mf_reserved : method_reserved list;
  687. mf_code_type : method_code_type;
  688. mf_code_mngmt : method_code_mngmt;
  689. mf_interop : method_interop list;
  690. }
  691. and param_io =
  692. (* input/output flags - mask 0x13 *)
  693. | PIn (* 0x1 *)
  694. | POut (* 0x2 *)
  695. | POpt (* 0x10 *)
  696. and param_reserved =
  697. (* reserved flags - mask 0xF000 *)
  698. | PHasConstant (* 0x1000 *)
  699. (* the parameter has an associated Constant record *)
  700. | PMarshal (* 0x2000 *)
  701. (* the parameter has an associated FieldMarshal record specifying how the parameter *)
  702. (* must be marshaled when consumed by unmanaged code *)
  703. and param_flags = {
  704. pf_io : param_io list;
  705. pf_reserved : param_reserved list;
  706. }
  707. and event_flag =
  708. | ESpecialName (* 0x0200 *)
  709. (* event is special *)
  710. | ERTSpecialName (* 0x0400 *)
  711. (* CLI provides special behavior, depending on the name of the event *)
  712. and event_flags = event_flag list
  713. and property_flag =
  714. | PSpecialName (* 0x0200 *)
  715. (* property is special *)
  716. | PRTSpecialName (* 0x0400 *)
  717. (* runtime (intrinsic) should check name encoding *)
  718. | PHasDefault (* 0x1000 *)
  719. (* property has default *)
  720. | PUnused (* 0xE9FF *)
  721. (* reserved *)
  722. and property_flags = property_flag list
  723. and semantic_flag =
  724. | SSetter (* 0x0001 *)
  725. (* setter for property *)
  726. | SGetter (* 0x0002 *)
  727. (* getter for property *)
  728. | SOther (* 0x0004 *)
  729. (* other method for property or event *)
  730. | SAddOn (* 0x0008 *)
  731. (* addon method for event - refers to the required add_ method for events *)
  732. | SRemoveOn (* 0x0010 *)
  733. (* removeon method for event - refers to the required remove_ method for events *)
  734. | SFire (* 0x0020 *)
  735. (* fire method for event. this refers to the optional raise_ method for events *)
  736. and semantic_flags = semantic_flag list
  737. and action_security =
  738. | SecNull
  739. | SecRequest (* 0x1 *)
  740. | SecDemand (* 0x2 *)
  741. | SecAssert (* 0x3 *)
  742. | SecDeny (* 0x4 *)
  743. | SecPermitOnly (* 0x5 *)
  744. | SecLinkCheck (* 0x6 *)
  745. | SecInheritCheck (* 0x7 *)
  746. | SecReqMin (* 0x8 *)
  747. | SecReqOpt (* 0x9 *)
  748. | SecReqRefuse (* 0xA *)
  749. | SecPreJitGrant (* 0xB *)
  750. | SecPreJitDeny (* 0xC *)
  751. | SecNonCasDemand (* 0xD *)
  752. | SecNonCasLinkDemand (* 0xE *)
  753. | SecNonCasInheritance (* 0xF *)
  754. and impl_charset =
  755. | IDefault (* 0x0 *)
  756. | IAnsi (* 0x2 *)
  757. (* method parameters of type string must be marshaled as ANSI zero-terminated *)
  758. (* strings unless explicitly specified otherwise *)
  759. | IUnicode (* 0x4 *)
  760. (* method parameters of type string must be marshaled as Unicode strings *)
  761. | IAutoChar (* 0x6 *)
  762. (* method parameters of type string must be marshaled as ANSI or Unicode strings *)
  763. (* depending on the platform *)
  764. and impl_callconv =
  765. | IDefaultCall (* 0x0 *)
  766. | IWinApi (* 0x100 *)
  767. (* the native method uses the calling convention standard for the underlying platform *)
  768. | ICDecl (* 0x200 *)
  769. (* the native method uses the C/C++ style calling convention *)
  770. | IStdCall (* 0x300 *)
  771. (* native method uses the standard Win32 API calling convention *)
  772. | IThisCall (* 0x400 *)
  773. (* native method uses the C++ member method (non-vararg) calling convention *)
  774. | IFastCall (* 0x500 *)
  775. and impl_flag =
  776. | INoMangle (* 0x1 *)
  777. (* exported method's name must be matched literally *)
  778. | IBestFit (* 0x10 *)
  779. (* allow "best fit" guessing when converting the strings *)
  780. | IBestFitOff (* 0x20 *)
  781. (* disallow "best fit" guessing *)
  782. | ILastErr (* 0x40 *)
  783. (* the native method supports the last error querying by the Win32 API GetLastError *)
  784. | ICharMapError (* 0x1000 *)
  785. (* throw an exception when an unmappable character is encountered in a string *)
  786. | ICharMapErrorOff (* 0x2000 *)
  787. (* don't throw an exception when an unmappable character is encountered *)
  788. and impl_flags = {
  789. if_charset : impl_charset;
  790. if_callconv : impl_callconv;
  791. if_flags : impl_flag list;
  792. }
  793. and hash_algo =
  794. | HNone (* 0x0 *)
  795. | HReserved (* 0x8003 *)
  796. (* MD5 ? *)
  797. | HSha1 (* 0x8004 *)
  798. (* SHA1 *)
  799. and assembly_flag =
  800. | APublicKey (* 0x1 *)
  801. (* assembly reference holds the full (unhashed) public key *)
  802. | ARetargetable (* 0x100 *)
  803. (* implementation of this assembly used at runtime is not expected to match *)
  804. (* the version seen at compile-time *)
  805. | ADisableJitCompileOptimizer (* 0x4000 *)
  806. (* Reserved *)
  807. | AEnableJitCompileTracking (* 0x8000 *)
  808. (* Reserved *)
  809. and assembly_flags = assembly_flag list
  810. and file_flag =
  811. | ContainsMetadata (* 0x0 *)
  812. | ContainsNoMetadata (* 0x1 *)
  813. and manifest_resource_flag =
  814. (* mask 0x7 *)
  815. | RNone (* 0x0 *)
  816. | RPublic (* 0x1 *)
  817. | RPrivate (* 0x2 *)
  818. and generic_variance =
  819. (* mask 0x3 *)
  820. | VNone (* 0x0 *)
  821. | VCovariant (* 0x1 *)
  822. | VContravariant (* 0x2 *)
  823. and generic_constraint =
  824. (* mask 0x1C *)
  825. | CInstanceType (* 0x4 *)
  826. (* generic parameter has the special class constraint *)
  827. | CValueType (* 0x8 *)
  828. (* generic parameter has the special valuetype constraint *)
  829. | CDefaultCtor (* 0x10 *)
  830. (* has the special .ctor constraint *)
  831. and generic_flags = {
  832. gf_variance : generic_variance;
  833. gf_constraint : generic_constraint list;
  834. }
  835. and ilsig =
  836. (* primitive types *)
  837. | SVoid (* 0x1 *)
  838. | SBool (* 0x2 *)
  839. | SChar (* 0x3 *)
  840. | SInt8 (* 0x4 *)
  841. | SUInt8 (* 0x5 *)
  842. | SInt16 (* 0x6 *)
  843. | SUInt16 (* 0x7 *)
  844. | SInt32 (* 0x8 *)
  845. | SUInt32 (* 0x9 *)
  846. | SInt64 (* 0xA *)
  847. | SUInt64 (* 0xB *)
  848. | SFloat32 (* 0xC *)
  849. | SFloat64 (* 0xD *)
  850. | SString (* 0xE *)
  851. | SPointer of ilsig (* 0xF *)
  852. (* unmanaged pointer to type ( * ) *)
  853. | SManagedPointer of ilsig (* 0x10 *)
  854. (* managed pointer to type ( & ) *)
  855. | SValueType of type_def_or_ref (* 0x11 *)
  856. (* a value type modifier, followed by TypeDef or TypeRef token *)
  857. | SClass of type_def_or_ref (* 0x12 *)
  858. (* a class type modifier, followed by TypeDef or TypeRef token *)
  859. | STypeParam of int (* 0x13 *)
  860. (* generic parameter in a generic type definition. represented by a number *)
  861. | SArray of ilsig * (int option * int option) array (* 0x14 *)
  862. (* ilsig * ( bound * size ) *)
  863. (* a multi-dimensional array type modifier *)
  864. (* encoded like: *)
  865. (* SArray <underlying type><rank><num_sizes><size1>...<sizeN>
  866. <num_lower_bounds><lower_bound1>...<lower_boundM> *)
  867. (* <rank> is the number of dimensions (K>0) *)
  868. (* <num_sizes> num of specified sizes for dimensions (N <= K) *)
  869. (* <num_lower_bounds> num of lower bounds (M <= K) *)
  870. (* all int values are compressed *)
  871. | SGenericInst of ilsig * (ilsig list) (* 0x15 *)
  872. (* A generic type instantiation. encoded like: *)
  873. (* SGenericInst <type> <type-arg-count> <type1>...<typeN> *)
  874. | STypedReference (* 0x16 *)
  875. (* typed reference, carrying both a reference to a type *)
  876. (* and information identifying the referenced type *)
  877. | SIntPtr (* 0x18 *)
  878. (* pointer-sized managed integer *)
  879. | SUIntPtr (* 0x19 *)
  880. (* pointer-size managed unsigned integer *)
  881. (* | SNativeFloat (* 0x1A *) *)
  882. (* refer to http://stackoverflow.com/questions/13961205/native-float-type-usage-in-clr *)
  883. | SFunPtr of callconv list * ilsig * (ilsig list) (* 0x1B *)
  884. (* a pointer to a function, followed by full method signature *)
  885. | SObject (* 0x1C *)
  886. (* System.Object *)
  887. | SVector of ilsig (* 0x1D *)
  888. (* followed by the encoding of the underlying type *)
  889. | SMethodTypeParam of int (* 0x1E *)
  890. (* generic parameter in a generic method definition *)
  891. | SReqModifier of type_def_or_ref * ilsig (* 0x1F *)
  892. (* modreq: required custom modifier : indicate that the item to which they are attached *)
  893. (* must be treated in a special way *)
  894. | SOptModifier of type_def_or_ref * ilsig (* 0x20 *)
  895. (* modopt: optional custom modifier *)
  896. | SSentinel (* 0x41 *)
  897. (* ... - signifies the beginning of optional arguments supplied for a vararg method call *)
  898. (* This can only appear at call site, since varargs optional parameters are not specified *)
  899. (* when a method is declared *)
  900. | SPinned of ilsig (* 0x45 *)
  901. (* pinned reference: it's only applicable to local variables only *)
  902. (* special undocumented (yay) *)
  903. | SType (* 0x50 *)
  904. | SBoxed (* 0x51 *)
  905. | SEnum of string (* 0x55 *)
  906. and callconv =
  907. | CallDefault (* 0x0 *)
  908. | CallCDecl (* 0x1 *)
  909. | CallStdCall (* 0x2 *)
  910. | CallThisCall (* 0x3 *)
  911. | CallFastCall (* 0x4 *)
  912. | CallVararg (* 0x5 *)
  913. | CallField (* 0x6 *)
  914. (* field call *)
  915. | CallLocal (* 0x7 *)
  916. (* local variable call *)
  917. | CallProp (* 0x8 *)
  918. (* property call *)
  919. | CallUnmanaged (* 0x9 *)
  920. (* unmanaged calling convention. not used *)
  921. | CallGenericInst (* 0xA *)
  922. (* generic instantiation - MethodSpec *)
  923. | CallGeneric of int (* 0x10 *)
  924. (* also contains the number of generic arguments *)
  925. | CallHasThis (* 0x20 *)
  926. (* instance method that has an instance pointer (this) *)
  927. (* as an implicit first argument - ilasm 'instance' *)
  928. | CallExplicitThis (* 0x40 *)
  929. (* the first explicitly specified parameter is the instance pointer *)
  930. (* ilasm 'explicit' *)
  931. and nativesig =
  932. | NVoid (* 0x01 *)
  933. (* obsolete *)
  934. | NBool (* 0x02 *)
  935. | NInt8 (* 0x03 *)
  936. | NUInt8 (* 0x4 *)
  937. | NInt16 (* 0x5 *)
  938. | NUInt16 (* 0x6 *)
  939. | NInt32 (* 0x7 *)
  940. | NUInt32 (* 0x8 *)
  941. | NInt64 (* 0x9 *)
  942. | NUInt64 (* 0xA *)
  943. | NFloat32 (* 0xB *)
  944. | NFloat64 (* 0xC *)
  945. | NSysChar (* 0xD *)
  946. (* obsolete *)
  947. | NVariant (* 0xE *)
  948. (* obsolete *)
  949. | NCurrency (* 0xF *)
  950. | NPointer (* 0x10 *)
  951. (* obsolete - use NativeInt *)
  952. | NDecimal (* 0x11 *)
  953. (* obsolete *)
  954. | NDate (* 0x12 *)
  955. (* obsolete *)
  956. | NBStr (* 0x13 *)
  957. (* unicode VB-style: used in COM operations *)
  958. | NLPStr (* 0x14 *)
  959. (* pointer to a zero-terminated ANSI string *)
  960. | NLPWStr (* 0x15 *)
  961. (* pointer to a zero-terminated Unicode string *)
  962. | NLPTStr (* 0x16 *)
  963. (* pointer to a zero-terminated ANSI or Unicode string - depends on platform *)
  964. | NFixedString of int (* 0x17 *)
  965. (* fixed-size system string of size <size> bytes; applicable to field marshalling only *)
  966. | NObjectRef (* 0x18 *)
  967. (* obsolete *)
  968. | NUnknown (* 0x19 *)
  969. (* IUnknown interface pointer *)
  970. | NDispatch (* 0x1A *)
  971. (* IDispatch interface pointer *)
  972. | NStruct (* 0x1B *)
  973. (* C-style structure, for marshaling the formatted managed types *)
  974. | NInterface (* 0x1C *)
  975. (* interface pointer *)
  976. | NSafeArray of variantsig (* 0x1D *)
  977. (* safe array of type <variant-type> *)
  978. | NFixedArray of int * variantsig (* 0x1E *)
  979. (* fixed-size array, of size <size> bytes *)
  980. | NIntPointer (* 0x1F *)
  981. (* signed pointer-size integer *)
  982. | NUIntPointer (* 0x20 *)
  983. (* unsigned pointer-sized integer *)
  984. | NNestedStruct (* 0x21 *)
  985. (* obsolete *)
  986. | NByValStr (* 0x22 *)
  987. (* VB-style string in a fixed-length buffer *)
  988. | NAnsiBStr (* 0x23 *)
  989. (* ansi bstr - ANSI VB-style string *)
  990. | NTBStr (* 0x24 *)
  991. (* tbstr - bstr or ansi bstr, depending on the platform *)
  992. | NVariantBool (* 0x25 *)
  993. (* variant bool - 2-byte Boolean: true = -1; false = 0 *)
  994. | NFunctionPtr (* 0x26 *)
  995. | NAsAny (* 0x28 *)
  996. (* as any - object: type defined at run time (?) *)
  997. | NArray of nativesig * int * int * int (* 0x2A *)
  998. (* fixed-size array of a native type *)
  999. (* if size is empty, the size of the native array is derived from the size *)
  1000. (* of the managed type being marshaled *)
  1001. | NLPStruct (* 0x2B *)
  1002. (* pointer to a c-style structure *)
  1003. | NCustomMarshaler of string * string (* 0x2C *)
  1004. (* custom (<class_str>, <cookie_str>) *)
  1005. | NError (* 0x2D *)
  1006. (* maps in32 to VT_HRESULT *)
  1007. | NCustom of int
  1008. and variantsig =
  1009. | VT_EMPTY (* 0x00 *)
  1010. (* No <empty> *)
  1011. | VT_NULL (* 0x01 *)
  1012. (* No null *)
  1013. | VT_I2 (* 0x02 *)
  1014. (* Yes int16 *)
  1015. | VT_I4 (* 0x03 *)
  1016. (* Yes int32 *)
  1017. | VT_R4 (* 0x04 *)
  1018. (* Yes float32 *)
  1019. | VT_R8 (* 0x05 *)
  1020. (* Yes float64 *)
  1021. | VT_CY (* 0x06 *)
  1022. (* Yes currency *)
  1023. | VT_DATE (* 0x07 *)
  1024. (* Yes date *)
  1025. | VT_BSTR (* 0x08 *)
  1026. (* Yes bstr *)
  1027. | VT_DISPATCH (* 0x09 *)
  1028. (* Yes idispatch *)
  1029. | VT_ERROR (* 0x0A *)
  1030. (* Yes error *)
  1031. | VT_BOOL (* 0x0B *)
  1032. (* Yes bool *)
  1033. | VT_VARIANT (* 0x0C *)
  1034. (* Yes variant *)
  1035. | VT_UNKNOWN (* 0x0D *)
  1036. (* Yes iunknown *)
  1037. | VT_DECIMAL (* 0x0E *)
  1038. (* Yes decimal *)
  1039. | VT_I1 (* 0x10 *)
  1040. (* Yes int8 *)
  1041. | VT_UI1 (* 0x11 *)
  1042. (* Yes unsigned int8, uint8 *)
  1043. | VT_UI2 (* 0x12 *)
  1044. (* Yes unsigned int16, uint16 *)
  1045. | VT_UI4 (* 0x13 *)
  1046. (* Yes unsigned int32, uint32 *)
  1047. | VT_I8 (* 0x14 *)
  1048. (* No int64 *)
  1049. | VT_UI8 (* 0x15 *)
  1050. (* No unsigned int64, uint64 *)
  1051. | VT_INT (* 0x16 *)
  1052. (* Yes int *)
  1053. | VT_UINT (* 0x17 *)
  1054. (* Yes unsigned int, uint *)
  1055. | VT_VOID (* 0x18 *)
  1056. (* No void *)
  1057. | VT_HRESULT (* 0x19 *)
  1058. (* No hresult *)
  1059. | VT_PTR (* 0x1A *)
  1060. (* No * *)
  1061. | VT_SAFEARRAY (* 0x1B *)
  1062. (* No safearray *)
  1063. | VT_CARRAY (* 0x1C *)
  1064. (* No carray *)
  1065. | VT_USERDEFINED (* 0x1D *)
  1066. (* No userdefined *)
  1067. | VT_LPSTR (* 0x1E *)
  1068. (* No lpstr *)
  1069. | VT_LPWSTR (* 0x1F *)
  1070. (* No lpwstr *)
  1071. | VT_RECORD (* 0x24 *)
  1072. (* Yes record *)
  1073. | VT_FILETIME (* 0x40 *)
  1074. (* No filetime *)
  1075. | VT_BLOB (* 0x41 *)
  1076. (* No blob *)
  1077. | VT_STREAM (* 0x42 *)
  1078. (* No stream *)
  1079. | VT_STORAGE (* 0x43 *)
  1080. (* No storage *)
  1081. | VT_STREAMED_OBJECT (* 0x44 *)
  1082. (* No streamed_object *)
  1083. | VT_STORED_OBJECT (* 0x45 *)
  1084. (* No stored_object *)
  1085. | VT_BLOB_OBJECT (* 0x46 *)
  1086. (* No blob_object *)
  1087. | VT_CF (* 0x47 *)
  1088. (* No cf *)
  1089. | VT_CLSID (* 0x48 *)
  1090. (* No clsid *)
  1091. (* | VT_VECTOR of variantsig (* 0x1000 *) *)
  1092. (* (* Yes <v_type> vector *) *)
  1093. (* | VT_ARRAY of variantsig (* 0x2000 *) *)
  1094. (* (* Yes <v_type> [ ] *) *)
  1095. (* | VT_BYREF of variantsig (* 0x4000 *) *)
  1096. (* (* Yes <v_type> & *) *)