/unity_decoder/libil2cpp/icalls/mscorlib/System.Runtime.InteropServices/Marshal.h

https://github.com/nevermoe/unity_metadata_loader · C Header · 95 lines · 89 code · 6 blank · 0 comment · 0 complexity · 6c1c3e4261f65e73e00f6b766c267c59 MD5 · raw file

  1. #pragma once
  2. #include <stdint.h>
  3. #include "il2cpp-config.h"
  4. #include "object-internals.h"
  5. struct mscorlib_System_Guid;
  6. struct mscorlib_System_Reflection_MemberInfo;
  7. struct Il2CppObject;
  8. struct Il2CppDelegate;
  9. struct Il2CppReflectionType;
  10. struct Il2CppString;
  11. namespace il2cpp
  12. {
  13. namespace icalls
  14. {
  15. namespace mscorlib
  16. {
  17. namespace System
  18. {
  19. namespace Runtime
  20. {
  21. namespace InteropServices
  22. {
  23. class LIBIL2CPP_CODEGEN_API Marshal
  24. {
  25. public:
  26. static int32_t GetLastWin32Error();
  27. static int32_t AddRefInternal(Il2CppIntPtr pUnk);
  28. static Il2CppIntPtr AllocCoTaskMem(int32_t size);
  29. static Il2CppIntPtr AllocHGlobal(Il2CppIntPtr size);
  30. static void DestroyStructure(Il2CppIntPtr ptr, Il2CppReflectionType* structureType);
  31. static void FreeBSTR(Il2CppIntPtr ptr);
  32. static void FreeCoTaskMem(Il2CppIntPtr ptr);
  33. static void FreeHGlobal(Il2CppIntPtr hglobal);
  34. static Il2CppIntPtr GetCCW(Il2CppObject* o, Il2CppReflectionType * T);
  35. static int32_t GetComSlotForMethodInfoInternal(mscorlib_System_Reflection_MemberInfo * m);
  36. static Il2CppDelegate* GetDelegateForFunctionPointerInternal(Il2CppIntPtr ptr, Il2CppReflectionType* t);
  37. static Il2CppIntPtr GetFunctionPointerForDelegateInternal(Il2CppDelegate* d);
  38. static Il2CppIntPtr GetIDispatchForObjectInternal(Il2CppObject* o);
  39. static Il2CppIntPtr GetIUnknownForObjectInternal(Il2CppObject* o);
  40. static Il2CppObject* GetObjectForCCW(Il2CppIntPtr pUnk);
  41. static bool IsComObject(Il2CppObject* o);
  42. static Il2CppIntPtr OffsetOf(Il2CppReflectionType* t, Il2CppString* fieldName);
  43. static void Prelink(Il2CppReflectionMethod* m);
  44. static void PrelinkAll(Il2CppReflectionType* c);
  45. static Il2CppString* PtrToStringAnsi_mscorlib_System_String_mscorlib_System_IntPtr(Il2CppIntPtr ptr);
  46. static Il2CppString* PtrToStringAnsi_mscorlib_System_String_mscorlib_System_IntPtr_mscorlib_System_Int32(Il2CppIntPtr ptr, int32_t len);
  47. static Il2CppString* PtrToStringBSTR(Il2CppIntPtr ptr);
  48. static Il2CppString* PtrToStringUni_mscorlib_System_String_mscorlib_System_IntPtr(Il2CppIntPtr ptr);
  49. static Il2CppString* PtrToStringUni_mscorlib_System_String_mscorlib_System_IntPtr_mscorlib_System_Int32(Il2CppIntPtr ptr, int32_t len);
  50. static Il2CppObject* PtrToStructure(Il2CppIntPtr ptr, Il2CppReflectionType * structureType);
  51. static void PtrToStructureObject(Il2CppIntPtr ptr, Il2CppObject* structure);
  52. static int32_t QueryInterfaceInternal(Il2CppIntPtr pUnk, mscorlib_System_Guid * iid, Il2CppIntPtr* ppv);
  53. static Il2CppIntPtr ReAllocCoTaskMem(Il2CppIntPtr ptr, int32_t size);
  54. static Il2CppIntPtr ReAllocHGlobal(Il2CppIntPtr ptr, Il2CppIntPtr size);
  55. static uint8_t ReadByte(Il2CppIntPtr ptr, int32_t ofs);
  56. static int16_t ReadInt16(Il2CppIntPtr ptr, int32_t ofs);
  57. static int32_t ReadInt32(Il2CppIntPtr ptr, int32_t ofs);
  58. static int64_t ReadInt64(Il2CppIntPtr ptr, int32_t ofs);
  59. static Il2CppIntPtr ReadIntPtr(Il2CppIntPtr ptr, int32_t ofs);
  60. static int32_t ReleaseComObjectInternal(Il2CppObject* co);
  61. static int32_t ReleaseInternal(Il2CppIntPtr pUnk);
  62. static int SizeOf(Il2CppReflectionType * rtype);
  63. static Il2CppIntPtr StringToBSTR(Il2CppString* s);
  64. static Il2CppIntPtr StringToHGlobalAnsi(Il2CppString* s);
  65. static Il2CppIntPtr StringToHGlobalUni(Il2CppString* s);
  66. static void StructureToPtr(Il2CppObject* structure, Il2CppIntPtr ptr, bool deleteOld);
  67. static Il2CppIntPtr UnsafeAddrOfPinnedArrayElement(Il2CppArray* arr, int32_t index);
  68. static void WriteByte(Il2CppIntPtr ptr, int32_t ofs, uint8_t val);
  69. static void WriteInt16(Il2CppIntPtr ptr, int32_t ofs, int16_t val);
  70. static void WriteInt32(Il2CppIntPtr ptr, int32_t ofs, int32_t val);
  71. static void WriteInt64(Il2CppIntPtr ptr, int32_t ofs, int64_t val);
  72. static void copy_from_unmanaged(Il2CppIntPtr, int, Il2CppArray *, int);
  73. static void copy_to_unmanaged(Il2CppArray * source, int32_t startIndex, Il2CppIntPtr destination, int32_t length);
  74. static void WriteIntPtr(Il2CppIntPtr ptr, int32_t ofs, Il2CppIntPtr val);
  75. #if NET_4_0
  76. static Il2CppIntPtr BufferToBSTR(Il2CppArray* ptr, int32_t slen);
  77. #endif
  78. #if NET_4_0
  79. static int32_t GetHRForException_WinRT(Il2CppException* e);
  80. static Il2CppIntPtr GetRawIUnknownForComObjectNoAddRef(Il2CppObject* o);
  81. static Il2CppObject* GetNativeActivationFactory(Il2CppObject* type);
  82. #endif
  83. };
  84. } /* namespace InteropServices */
  85. } /* namespace Runtime */
  86. } /* namespace System */
  87. } /* namespace mscorlib */
  88. } /* namespace icalls */
  89. } /* namespace il2cpp */