Interfaces.au3 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. #include-once
  2. Global Const $sCLSID_CorRuntimeHost = "{CB2F6723-AB3A-11D2-9C40-00C04FA30A3E}"
  3. Global Const $tCLSID_CorRuntimeHost = CLSIDFromString( $sCLSID_CorRuntimeHost )
  4. Global Const $sIID_ICorRuntimeHost = "{CB2F6722-AB3A-11D2-9C40-00C04FA30A3E}"
  5. Global Const $tIID_ICorRuntimeHost = CLSIDFromString( $sIID_ICorRuntimeHost )
  6. Global Const $sTag_ICorRuntimeHost = _
  7. "CreateLogicalThreadState hresult();" & _
  8. "DeleteLogicalThreadState hresult();" & _
  9. "SwitchInLogicalThreadState hresult();" & _
  10. "SwitchOutLogicalThreadState hresult();" & _
  11. "LocksHeldByLogicalThread hresult();" & _
  12. "MapFile hresult();" & _
  13. "GetConfiguration hresult();" & _
  14. "Start hresult();" & _
  15. "Stop hresult();" & _
  16. "CreateDomain hresult();" & _
  17. "GetDefaultDomain hresult(ptr*);" & _
  18. "EnumDomains hresult(ptr*);" & _
  19. "NextDomain hresult(ptr;ptr*);" & _
  20. "CloseEnum hresult();" & _
  21. "CreateDomainEx hresult();" & _
  22. "CreateDomainSetup hresult();" & _
  23. "CreateEvidence hresult();" & _
  24. "UnloadDomain hresult(ptr);" & _
  25. "CurrentDomain hresult();"
  26. Global Const $sIID_IDispatch = "{00020400-0000-0000-C000-000000000046}"
  27. Global Const $sTag_IDispatch = _
  28. "GetTypeInfoCount hresult(dword*);" & _
  29. "GetTypeInfo hresult(dword;dword;ptr*);" & _
  30. "GetIDsOfNames hresult(ptr;ptr;dword;dword;ptr);" & _
  31. "Invoke hresult(dword;ptr;dword;word;ptr;ptr;ptr;ptr);"
  32. ; The interfaces _AppDomain, _Type and _Assembly below that starts with
  33. ; an underscore are the interfaces that can be used from unmanaged code.
  34. Global Const $sIID__AppDomain = "{05F696DC-2B29-3663-AD8B-C4389CF2A713}"
  35. Global Const $sTag__AppDomain = _
  36. $sTag_IDispatch & _
  37. "get_ToString hresult();" & _
  38. "Equals hresult();" & _
  39. "GetHashCode hresult();" & _
  40. "GetType hresult(ptr*);" & _
  41. "InitializeLifetimeService hresult();" & _
  42. "GetLifetimeService hresult();" & _
  43. "get_Evidence hresult();" & _
  44. "add_DomainUnload hresult();" & _
  45. "remove_DomainUnload hresult();" & _
  46. "add_AssemblyLoad hresult();" & _
  47. "remove_AssemblyLoad hresult();" & _
  48. "add_ProcessExit hresult();" & _
  49. "remove_ProcessExit hresult();" & _
  50. "add_TypeResolve hresult();" & _
  51. "remove_TypeResolve hresult();" & _
  52. "add_ResourceResolve hresult();" & _
  53. "remove_ResourceResolve hresult();" & _
  54. "add_AssemblyResolve hresult();" & _
  55. "remove_AssemblyResolve hresult();" & _
  56. "add_UnhandledException hresult();" & _
  57. "remove_UnhandledException hresult();" & _
  58. "DefineDynamicAssembly hresult();" & _
  59. "DefineDynamicAssembly_2 hresult();" & _
  60. "DefineDynamicAssembly_3 hresult();" & _
  61. "DefineDynamicAssembly_4 hresult();" & _
  62. "DefineDynamicAssembly_5 hresult();" & _
  63. "DefineDynamicAssembly_6 hresult();" & _
  64. "DefineDynamicAssembly_7 hresult();" & _
  65. "DefineDynamicAssembly_8 hresult();" & _
  66. "DefineDynamicAssembly_9 hresult();" & _
  67. "CreateInstance hresult(bstr;bstr;object*);" & _
  68. "CreateInstanceFrom hresult();" & _
  69. "CreateInstance_2 hresult();" & _
  70. "CreateInstanceFrom_2 hresult();" & _
  71. "CreateInstance_3 hresult(bstr;bstr;bool;int;ptr;ptr;ptr;ptr;ptr;ptr*);" & _
  72. "CreateInstanceFrom_3 hresult();" & _
  73. "Load hresult();" & _
  74. "Load_2 hresult();" & _
  75. "Load_3 hresult();" & _
  76. "Load_4 hresult();" & _
  77. "Load_5 hresult();" & _
  78. "Load_6 hresult();" & _
  79. "Load_7 hresult();" & _
  80. "ExecuteAssembly hresult();" & _
  81. "ExecuteAssembly_2 hresult();" & _
  82. "ExecuteAssembly_3 hresult();" & _
  83. "get_FriendlyName hresult(bstr*);" & _
  84. "get_BaseDirectory hresult(bstr*);" & _
  85. "get_RelativeSearchPath hresult();" & _
  86. "get_ShadowCopyFiles hresult();" & _
  87. "GetAssemblies hresult(ptr*);" & _
  88. "AppendPrivatePath hresult();" & _
  89. "ClearPrivatePath ) = 0; hresult();" & _
  90. "SetShadowCopyPath hresult();" & _
  91. "ClearShadowCopyPath ) = 0; hresult();" & _
  92. "SetCachePath hresult();" & _
  93. "SetData hresult();" & _
  94. "GetData hresult();" & _
  95. "SetAppDomainPolicy hresult();" & _
  96. "SetThreadPrincipal hresult();" & _
  97. "SetPrincipalPolicy hresult();" & _
  98. "DoCallBack hresult();" & _
  99. "get_DynamicDirectory hresult();"
  100. Global Const $sIID__Type = "{BCA8B44D-AAD6-3A86-8AB7-03349F4F2DA2}"
  101. Global Const $sTag__Type = _
  102. $sTag_IDispatch & _
  103. "get_ToString hresult(bstr*);" & _
  104. "Equals hresult(variant;short*);" & _
  105. "GetHashCode hresult(int*);" & _
  106. "GetType hresult(ptr);" & _
  107. "get_MemberType hresult(ptr);" & _
  108. "get_name hresult(bstr*);" & _
  109. "get_DeclaringType hresult(ptr);" & _
  110. "get_ReflectedType hresult(ptr);" & _
  111. "GetCustomAttributes hresult(ptr;short;ptr);" & _
  112. "GetCustomAttributes_2 hresult(short;ptr);" & _
  113. "IsDefined hresult(ptr;short;short*);" & _
  114. "get_Guid hresult(ptr);" & _
  115. "get_Module hresult(ptr);" & _
  116. "get_Assembly hresult(ptr*);" & _
  117. "get_TypeHandle hresult(ptr);" & _
  118. "get_FullName hresult(bstr*);" & _
  119. "get_Namespace hresult(bstr*);" & _
  120. "get_AssemblyQualifiedName hresult(bstr*);" & _
  121. "GetArrayRank hresult(int*);" & _
  122. "get_BaseType hresult(ptr);" & _
  123. "GetConstructors hresult(ptr;ptr);" & _
  124. "GetInterface hresult(bstr;short;ptr);" & _
  125. "GetInterfaces hresult(ptr);" & _
  126. "FindInterfaces hresult(ptr;variant;ptr);" & _
  127. "GetEvent hresult(bstr;ptr;ptr);" & _
  128. "GetEvents hresult(ptr);" & _
  129. "GetEvents_2 hresult(int;ptr);" & _
  130. "GetNestedTypes hresult(int;ptr);" & _
  131. "GetNestedType hresult(bstr;ptr;ptr);" & _
  132. "GetMember hresult(bstr;ptr;ptr;ptr);" & _
  133. "GetDefaultMembers hresult(ptr);" & _
  134. "FindMembers hresult(ptr;ptr;ptr;variant;ptr);" & _
  135. "GetElementType hresult(ptr);" & _
  136. "IsSubclassOf hresult(ptr;short*);" & _
  137. "IsInstanceOfType hresult(variant;short*);" & _
  138. "IsAssignableFrom hresult(ptr;short*);" & _
  139. "GetInterfaceMap hresult(ptr;ptr);" & _
  140. "GetMethod hresult(bstr;ptr;ptr;ptr;ptr;ptr);" & _
  141. "GetMethod_2 hresult(bstr;ptr;ptr);" & _
  142. "GetMethods hresult(int;ptr);" & _
  143. "GetField hresult(bstr;ptr;ptr);" & _
  144. "GetFields hresult(int;ptr);" & _
  145. "GetProperty hresult(bstr;ptr;ptr);" & _
  146. "GetProperty_2 hresult(bstr;ptr;ptr;ptr;ptr;ptr;ptr);" & _
  147. "GetProperties hresult(ptr;ptr);" & _
  148. "GetMember_2 hresult(bstr;ptr;ptr);" & _
  149. "GetMembers hresult(int;ptr*);" & _
  150. "InvokeMember hresult(bstr;ptr;ptr;variant;ptr;ptr;ptr;ptr;variant*);" & _
  151. "get_UnderlyingSystemType hresult(ptr);" & _
  152. "InvokeMember_2 hresult(bstr;int;ptr;variant;ptr;ptr;variant*);" & _
  153. "InvokeMember_3 hresult(bstr;int;ptr;variant;ptr;variant*);" & _
  154. "GetConstructor hresult(ptr;ptr;ptr;ptr;ptr;ptr);" & _
  155. "GetConstructor_2 hresult(ptr;ptr;ptr;ptr;ptr);" & _
  156. "GetConstructor_3 hresult(ptr;ptr);" & _
  157. "GetConstructors_2 hresult(ptr);" & _
  158. "get_TypeInitializer hresult(ptr);" & _
  159. "GetMethod_3 hresult(bstr;ptr;ptr;ptr;ptr;ptr;ptr);" & _
  160. "GetMethod_4 hresult(bstr;ptr;ptr;ptr);" & _
  161. "GetMethod_5 hresult(bstr;ptr;ptr);" & _
  162. "GetMethod_6 hresult(bstr;ptr);" & _
  163. "GetMethods_2 hresult(ptr);" & _
  164. "GetField_2 hresult(bstr;ptr);" & _
  165. "GetFields_2 hresult(ptr);" & _
  166. "GetInterface_2 hresult(bstr;ptr);" & _
  167. "GetEvent_2 hresult(bstr;ptr);" & _
  168. "GetProperty_3 hresult(bstr;ptr;ptr;ptr;ptr);" & _
  169. "GetProperty_4 hresult(bstr;ptr;ptr;ptr);" & _
  170. "GetProperty_5 hresult(bstr;ptr;ptr);" & _
  171. "GetProperty_6 hresult(bstr;ptr;ptr);" & _
  172. "GetProperty_7 hresult(bstr;ptr);" & _
  173. "GetProperties_2 hresult(ptr);" & _
  174. "GetNestedTypes_2 hresult(ptr);" & _
  175. "GetNestedType_2 hresult(bstr;ptr);" & _
  176. "GetMember_3 hresult(bstr;ptr);" & _
  177. "GetMembers_2 hresult(ptr);" & _
  178. "get_Attributes hresult(ptr);" & _
  179. "get_IsNotPublic hresult(short*);" & _
  180. "get_IsPublic hresult(short*);" & _
  181. "get_IsNestedPublic hresult(short*);" & _
  182. "get_IsNestedPrivate hresult(short*);" & _
  183. "get_IsNestedFamily hresult(short*);" & _
  184. "get_IsNestedAssembly hresult(short*);" & _
  185. "get_IsNestedFamANDAssem hresult(short*);" & _
  186. "get_IsNestedFamORAssem hresult(short*);" & _
  187. "get_IsAutoLayout hresult(short*);" & _
  188. "get_IsLayoutSequential hresult(short*);" & _
  189. "get_IsExplicitLayout hresult(short*);" & _
  190. "get_IsClass hresult(short*);" & _
  191. "get_IsInterface hresult(short*);" & _
  192. "get_IsValueType hresult(short*);" & _
  193. "get_IsAbstract hresult(short*);" & _
  194. "get_IsSealed hresult(short*);" & _
  195. "get_IsEnum hresult(short*);" & _
  196. "get_IsSpecialName hresult(short*);" & _
  197. "get_IsImport hresult(short*);" & _
  198. "get_IsSerializable hresult(short*);" & _
  199. "get_IsAnsiClass hresult(short*);" & _
  200. "get_IsUnicodeClass hresult(short*);" & _
  201. "get_IsAutoClass hresult(short*);" & _
  202. "get_IsArray hresult(short*);" & _
  203. "get_IsByRef hresult(short*);" & _
  204. "get_IsPointer hresult(short*);" & _
  205. "get_IsPrimitive hresult(short*);" & _
  206. "get_IsCOMObject hresult(short*);" & _
  207. "get_HasElementType hresult(short*);" & _
  208. "get_IsContextful hresult(short*);" & _
  209. "get_IsMarshalByRef hresult(short*);" & _
  210. "Equals_2 hresult(ptr;short*);"
  211. ; Binding flags for InvokeMember, InvokeMember_2
  212. ; and InvokeMember_3 methods of _Type interface.
  213. Global Const $BindingFlags_Default = 0x0000
  214. Global Const $BindingFlags_IgnoreCase = 0x0001
  215. Global Const $BindingFlags_DeclaredOnly = 0x0002
  216. Global Const $BindingFlags_Instance = 0x0004
  217. Global Const $BindingFlags_Static = 0x0008
  218. Global Const $BindingFlags_Public = 0x0010
  219. Global Const $BindingFlags_NonPublic = 0x0020
  220. Global Const $BindingFlags_FlattenHierarchy = 0x0040
  221. Global Const $BindingFlags_InvokeMethod = 0x0100
  222. Global Const $BindingFlags_CreateInstance = 0x0200
  223. Global Const $BindingFlags_GetField = 0x0400
  224. Global Const $BindingFlags_SetField = 0x0800
  225. Global Const $BindingFlags_GetProperty = 0x1000
  226. Global Const $BindingFlags_SetProperty = 0x2000
  227. Global Const $BindingFlags_PutDispProperty = 0x4000
  228. Global Const $BindingFlags_PutRefDispProperty = 0x8000
  229. Global Const $BindingFlags_ExactBinding = 0x00010000
  230. Global Const $BindingFlags_SuppressChangeType = 0x00020000
  231. Global Const $BindingFlags_OptionalParamBinding = 0x00040000
  232. Global Const $BindingFlags_IgnoreReturn = 0x01000000
  233. Global Const $BindingFlags_DefaultValue = $BindingFlags_Static + $BindingFlags_Public + $BindingFlags_FlattenHierarchy + $BindingFlags_InvokeMethod
  234. Global Const $sIID__Assembly = "{17156360-2F1A-384A-BC52-FDE93C215C5B}"
  235. Global Const $sTag__Assembly = _
  236. $sTag_IDispatch & _
  237. "get_ToString hresult(bstr*);" & _
  238. "Equals hresult();" & _
  239. "GetHashCode hresult();" & _
  240. "GetType hresult(ptr*);" & _
  241. "get_CodeBase hresult();" & _
  242. "get_EscapedCodeBase hresult();" & _
  243. "GetName hresult();" & _
  244. "GetName_2 hresult();" & _
  245. "get_FullName hresult(bstr*);" & _
  246. "get_EntryPoint hresult();" & _
  247. "GetType_2 hresult(bstr;ptr*);" & _
  248. "GetType_3 hresult();" & _
  249. "GetExportedTypes hresult();" & _
  250. "GetTypes hresult(ptr*);" & _
  251. "GetManifestResourceStream hresult();" & _
  252. "GetManifestResourceStream_2 hresult();" & _
  253. "GetFile hresult();" & _
  254. "GetFiles hresult();" & _
  255. "GetFiles_2 hresult();" & _
  256. "GetManifestResourceNames hresult();" & _
  257. "GetManifestResourceInfo hresult();" & _
  258. "get_Location hresult(bstr*);" & _
  259. "get_Evidence hresult();" & _
  260. "GetCustomAttributes hresult();" & _
  261. "GetCustomAttributes_2 hresult();" & _
  262. "IsDefined hresult();" & _
  263. "GetObjectData hresult();" & _
  264. "add_ModuleResolve hresult();" & _
  265. "remove_ModuleResolve hresult();" & _
  266. "GetType_4 hresult();" & _
  267. "GetSatelliteAssembly hresult();" & _
  268. "GetSatelliteAssembly_2 hresult();" & _
  269. "LoadModule hresult();" & _
  270. "LoadModule_2 hresult();" & _
  271. "CreateInstance hresult(bstr;variant*);" & _
  272. "CreateInstance_2 hresult(bstr;bool;variant*);" & _
  273. "CreateInstance_3 hresult(bstr;bool;int;ptr;ptr;ptr;ptr;variant*);" & _
  274. "GetLoadedModules hresult();" & _
  275. "GetLoadedModules_2 hresult();" & _
  276. "GetModules hresult();" & _
  277. "GetModules_2 hresult();" & _
  278. "GetModule hresult();" & _
  279. "GetReferencedAssemblies hresult();" & _
  280. "get_GlobalAssemblyCache hresult(bool*);"
  281. Func CLSIDFromString( $sGUID )
  282. Static $hOle32Dll = "ole32.dll", $tGUID = DllStructCreate( "ulong Data1;ushort Data2;ushort Data3;byte Data4[8]" ), $pGUID = DllStructGetPtr( $tGUID )
  283. DllCall( $hOle32Dll, "uint", "CLSIDFromString", "wstr", $sGUID, "ptr", $pGUID )
  284. Return $tGUID
  285. EndFunc
  286. Func GUIDFromStringEx( $sGUID, $tGUID )
  287. Static $hOle32Dll = "ole32.dll"
  288. DllCall( $hOle32Dll, "long", "CLSIDFromString", "wstr", $sGUID, "struct*", $tGUID )
  289. EndFunc