il2cpp-windowsruntime-types.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. #include <stdint.h>
  4. typedef struct Il2CppHString__
  5. {
  6. int unused;
  7. } Il2CppHString__;
  8. typedef Il2CppHString__* Il2CppHString;
  9. typedef struct Il2CppHStringHeader
  10. {
  11. union
  12. {
  13. void* Reserved1;
  14. #if IL2CPP_SIZEOF_VOID_P == 8
  15. char Reserved2[24];
  16. #else
  17. char Reserved2[20];
  18. #endif
  19. } Reserved;
  20. } Il2CppHStringHeader;
  21. // System.Guid
  22. typedef struct Il2CppGuid
  23. {
  24. uint32_t data1;
  25. uint16_t data2;
  26. uint16_t data3;
  27. uint8_t data4[8];
  28. } Il2CppGuid;
  29. typedef struct Il2CppSafeArrayBound
  30. {
  31. uint32_t element_count;
  32. int32_t lower_bound;
  33. } Il2CppSafeArrayBound;
  34. typedef struct Il2CppSafeArray
  35. {
  36. uint16_t dimension_count;
  37. uint16_t features;
  38. uint32_t element_size;
  39. uint32_t lock_count;
  40. void* data;
  41. Il2CppSafeArrayBound bounds[1];
  42. } Il2CppSafeArray;
  43. typedef struct Il2CppWin32Decimal
  44. {
  45. uint16_t reserved;
  46. union
  47. {
  48. struct
  49. {
  50. uint8_t scale;
  51. uint8_t sign;
  52. } s;
  53. uint16_t signscale;
  54. } u;
  55. uint32_t hi32;
  56. union
  57. {
  58. struct
  59. {
  60. uint32_t lo32;
  61. uint32_t mid32;
  62. } s2;
  63. uint64_t lo64;
  64. } u2;
  65. } Il2CppWin32Decimal;
  66. typedef int16_t IL2CPP_VARIANT_BOOL;
  67. #define IL2CPP_VARIANT_TRUE ((IL2CPP_VARIANT_BOOL)-1)
  68. #define IL2CPP_VARIANT_FALSE ((IL2CPP_VARIANT_BOOL)0)
  69. typedef enum Il2CppVarType
  70. {
  71. IL2CPP_VT_EMPTY = 0,
  72. IL2CPP_VT_NULL = 1,
  73. IL2CPP_VT_I2 = 2,
  74. IL2CPP_VT_I4 = 3,
  75. IL2CPP_VT_R4 = 4,
  76. IL2CPP_VT_R8 = 5,
  77. IL2CPP_VT_CY = 6,
  78. IL2CPP_VT_DATE = 7,
  79. IL2CPP_VT_BSTR = 8,
  80. IL2CPP_VT_DISPATCH = 9,
  81. IL2CPP_VT_ERROR = 10,
  82. IL2CPP_VT_BOOL = 11,
  83. IL2CPP_VT_VARIANT = 12,
  84. IL2CPP_VT_UNKNOWN = 13,
  85. IL2CPP_VT_DECIMAL = 14,
  86. IL2CPP_VT_I1 = 16,
  87. IL2CPP_VT_UI1 = 17,
  88. IL2CPP_VT_UI2 = 18,
  89. IL2CPP_VT_UI4 = 19,
  90. IL2CPP_VT_I8 = 20,
  91. IL2CPP_VT_UI8 = 21,
  92. IL2CPP_VT_INT = 22,
  93. IL2CPP_VT_UINT = 23,
  94. IL2CPP_VT_VOID = 24,
  95. IL2CPP_VT_HRESULT = 25,
  96. IL2CPP_VT_PTR = 26,
  97. IL2CPP_VT_SAFEARRAY = 27,
  98. IL2CPP_VT_CARRAY = 28,
  99. IL2CPP_VT_USERDEFINED = 29,
  100. IL2CPP_VT_LPSTR = 30,
  101. IL2CPP_VT_LPWSTR = 31,
  102. IL2CPP_VT_RECORD = 36,
  103. IL2CPP_VT_INT_PTR = 37,
  104. IL2CPP_VT_UINT_PTR = 38,
  105. IL2CPP_VT_FILETIME = 64,
  106. IL2CPP_VT_BLOB = 65,
  107. IL2CPP_VT_STREAM = 66,
  108. IL2CPP_VT_STORAGE = 67,
  109. IL2CPP_VT_STREAMED_OBJECT = 68,
  110. IL2CPP_VT_STORED_OBJECT = 69,
  111. IL2CPP_VT_BLOB_OBJECT = 70,
  112. IL2CPP_VT_CF = 71,
  113. IL2CPP_VT_CLSID = 72,
  114. IL2CPP_VT_VERSIONED_STREAM = 73,
  115. IL2CPP_VT_BSTR_BLOB = 0xfff,
  116. IL2CPP_VT_VECTOR = 0x1000,
  117. IL2CPP_VT_ARRAY = 0x2000,
  118. IL2CPP_VT_BYREF = 0x4000,
  119. IL2CPP_VT_RESERVED = 0x8000,
  120. IL2CPP_VT_ILLEGAL = 0xffff,
  121. IL2CPP_VT_ILLEGALMASKED = 0xfff,
  122. IL2CPP_VT_TYPEMASK = 0xfff,
  123. } Il2CppVarType;
  124. typedef struct Il2CppVariant Il2CppVariant;
  125. typedef struct Il2CppIUnknown Il2CppIUnknown;
  126. typedef struct Il2CppVariant
  127. {
  128. union
  129. {
  130. struct __tagVARIANT
  131. {
  132. uint16_t type;
  133. uint16_t reserved1;
  134. uint16_t reserved2;
  135. uint16_t reserved3;
  136. union
  137. {
  138. int64_t llVal;
  139. int32_t lVal;
  140. uint8_t bVal;
  141. int16_t iVal;
  142. float fltVal;
  143. double dblVal;
  144. IL2CPP_VARIANT_BOOL boolVal;
  145. int32_t scode;
  146. int64_t cyVal;
  147. double date;
  148. Il2CppChar* bstrVal;
  149. Il2CppIUnknown* punkVal;
  150. void* pdispVal;
  151. Il2CppSafeArray* parray;
  152. uint8_t* pbVal;
  153. int16_t* piVal;
  154. int32_t* plVal;
  155. int64_t* pllVal;
  156. float* pfltVal;
  157. double* pdblVal;
  158. IL2CPP_VARIANT_BOOL* pboolVal;
  159. int32_t* pscode;
  160. int64_t* pcyVal;
  161. double* pdate;
  162. Il2CppChar* pbstrVal;
  163. Il2CppIUnknown** ppunkVal;
  164. void** ppdispVal;
  165. Il2CppSafeArray** pparray;
  166. Il2CppVariant* pvarVal;
  167. void* byref;
  168. char cVal;
  169. uint16_t uiVal;
  170. uint32_t ulVal;
  171. uint64_t ullVal;
  172. int intVal;
  173. unsigned int uintVal;
  174. Il2CppWin32Decimal* pdecVal;
  175. char* pcVal;
  176. uint16_t* puiVal;
  177. uint32_t* pulVal;
  178. uint64_t* pullVal;
  179. int* pintVal;
  180. unsigned int* puintVal;
  181. struct __tagBRECORD
  182. {
  183. void* pvRecord;
  184. void* pRecInfo;
  185. } n4;
  186. } n3;
  187. } n2;
  188. Il2CppWin32Decimal decVal;
  189. } n1;
  190. } Il2CppVariant;
  191. typedef struct Il2CppFileTime
  192. {
  193. uint32_t low;
  194. uint32_t high;
  195. } Il2CppFileTime;
  196. typedef struct Il2CppStatStg
  197. {
  198. Il2CppChar* name;
  199. uint32_t type;
  200. uint64_t size;
  201. Il2CppFileTime mtime;
  202. Il2CppFileTime ctime;
  203. Il2CppFileTime atime;
  204. uint32_t mode;
  205. uint32_t locks;
  206. Il2CppGuid clsid;
  207. uint32_t state;
  208. uint32_t reserved;
  209. } Il2CppStatStg;
  210. enum Il2CppWindowsRuntimeTypeKind
  211. {
  212. kTypeKindPrimitive = 0,
  213. kTypeKindMetadata,
  214. kTypeKindCustom
  215. };
  216. struct Il2CppWindowsRuntimeTypeName
  217. {
  218. Il2CppHString typeName;
  219. enum Il2CppWindowsRuntimeTypeKind typeKind;
  220. };
  221. #ifdef __cplusplus
  222. struct LIBIL2CPP_CODEGEN_API NOVTABLE Il2CppIUnknown
  223. {
  224. static const Il2CppGuid IID;
  225. virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) = 0;
  226. virtual uint32_t STDCALL AddRef() = 0;
  227. virtual uint32_t STDCALL Release() = 0;
  228. };
  229. struct NOVTABLE Il2CppISequentialStream : Il2CppIUnknown
  230. {
  231. static const LIBIL2CPP_CODEGEN_API Il2CppGuid IID;
  232. virtual il2cpp_hresult_t STDCALL Read(void* buffer, uint32_t size, uint32_t* read) = 0;
  233. virtual il2cpp_hresult_t STDCALL Write(const void* buffer, uint32_t size, uint32_t* written) = 0;
  234. };
  235. struct NOVTABLE Il2CppIStream : Il2CppISequentialStream
  236. {
  237. static const LIBIL2CPP_CODEGEN_API Il2CppGuid IID;
  238. virtual il2cpp_hresult_t STDCALL Seek(int64_t move, uint32_t origin, uint64_t* position) = 0;
  239. virtual il2cpp_hresult_t STDCALL SetSize(uint64_t size) = 0;
  240. virtual il2cpp_hresult_t STDCALL CopyTo(Il2CppIStream* stream, uint64_t size, uint64_t* read, uint64_t* written) = 0;
  241. virtual il2cpp_hresult_t STDCALL Commit(uint32_t flags) = 0;
  242. virtual il2cpp_hresult_t STDCALL Revert() = 0;
  243. virtual il2cpp_hresult_t STDCALL LockRegion(uint64_t offset, uint64_t size, uint32_t type) = 0;
  244. virtual il2cpp_hresult_t STDCALL UnlockRegion(uint64_t offset, uint64_t size, uint32_t type) = 0;
  245. virtual il2cpp_hresult_t STDCALL Stat(Il2CppStatStg* data, uint32_t flags) = 0;
  246. virtual il2cpp_hresult_t STDCALL Clone(Il2CppIStream** stream) = 0;
  247. };
  248. struct LIBIL2CPP_CODEGEN_API NOVTABLE Il2CppIMarshal : Il2CppIUnknown
  249. {
  250. static const Il2CppGuid IID;
  251. virtual il2cpp_hresult_t STDCALL GetUnmarshalClass(const Il2CppGuid& iid, void* object, uint32_t context, void* reserved, uint32_t flags, Il2CppGuid* clsid) = 0;
  252. virtual il2cpp_hresult_t STDCALL GetMarshalSizeMax(const Il2CppGuid& iid, void* object, uint32_t context, void* reserved, uint32_t flags, uint32_t* size) = 0;
  253. virtual il2cpp_hresult_t STDCALL MarshalInterface(Il2CppIStream* stream, const Il2CppGuid& iid, void* object, uint32_t context, void* reserved, uint32_t flags) = 0;
  254. virtual il2cpp_hresult_t STDCALL UnmarshalInterface(Il2CppIStream* stream, const Il2CppGuid& iid, void** object) = 0;
  255. virtual il2cpp_hresult_t STDCALL ReleaseMarshalData(Il2CppIStream* stream) = 0;
  256. virtual il2cpp_hresult_t STDCALL DisconnectObject(uint32_t reserved) = 0;
  257. };
  258. struct NOVTABLE Il2CppIManagedObject : Il2CppIUnknown
  259. {
  260. static const LIBIL2CPP_CODEGEN_API Il2CppGuid IID;
  261. virtual il2cpp_hresult_t STDCALL GetSerializedBuffer(Il2CppChar** bstr) = 0;
  262. virtual il2cpp_hresult_t STDCALL GetObjectIdentity(Il2CppChar** bstr_guid, int32_t* app_domain_id, intptr_t* ccw) = 0;
  263. };
  264. struct LIBIL2CPP_CODEGEN_API NOVTABLE Il2CppIManagedObjectHolder : Il2CppIUnknown
  265. {
  266. static const Il2CppGuid IID;
  267. virtual Il2CppObject* STDCALL GetManagedObject() = 0;
  268. virtual void STDCALL Destroy() = 0;
  269. };
  270. struct LIBIL2CPP_CODEGEN_API NOVTABLE Il2CppIInspectable : Il2CppIUnknown
  271. {
  272. static const Il2CppGuid IID;
  273. virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) = 0;
  274. virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) = 0;
  275. virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) = 0;
  276. };
  277. struct NOVTABLE Il2CppIActivationFactory : Il2CppIInspectable
  278. {
  279. static const LIBIL2CPP_CODEGEN_API Il2CppGuid IID;
  280. virtual il2cpp_hresult_t STDCALL ActivateInstance(Il2CppIInspectable** instance) = 0;
  281. };
  282. struct NOVTABLE Il2CppIRestrictedErrorInfo : Il2CppIUnknown
  283. {
  284. static const LIBIL2CPP_CODEGEN_API Il2CppGuid IID;
  285. virtual il2cpp_hresult_t STDCALL GetErrorDetails(Il2CppChar** bstrDescription, il2cpp_hresult_t* error, Il2CppChar** bstrRestrictedDescription, Il2CppChar** bstrCapabilitySid) = 0;
  286. virtual il2cpp_hresult_t STDCALL GetReference(Il2CppChar** bstrReference) = 0;
  287. };
  288. struct NOVTABLE Il2CppILanguageExceptionErrorInfo : Il2CppIUnknown
  289. {
  290. static const LIBIL2CPP_CODEGEN_API Il2CppGuid IID;
  291. virtual il2cpp_hresult_t STDCALL GetLanguageException(Il2CppIUnknown** languageException) = 0;
  292. };
  293. struct NOVTABLE Il2CppIAgileObject : Il2CppIUnknown
  294. {
  295. static const LIBIL2CPP_CODEGEN_API Il2CppGuid IID;
  296. virtual il2cpp_hresult_t STDCALL GetLanguageException(Il2CppIUnknown** languageException) = 0;
  297. };
  298. struct NOVTABLE Il2CppIWeakReference : Il2CppIUnknown
  299. {
  300. static const LIBIL2CPP_CODEGEN_API Il2CppGuid IID;
  301. virtual il2cpp_hresult_t STDCALL Resolve(const Il2CppGuid& iid, Il2CppIInspectable** object) = 0;
  302. };
  303. struct NOVTABLE Il2CppIWeakReferenceSource : Il2CppIUnknown
  304. {
  305. static const LIBIL2CPP_CODEGEN_API Il2CppGuid IID;
  306. virtual il2cpp_hresult_t STDCALL GetWeakReference(Il2CppIWeakReference** weakReference) = 0;
  307. };
  308. #endif //__cplusplus