CCW.h 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "gc/GarbageCollector.h"
  3. struct Il2CppIUnknown;
  4. struct Il2CppObject;
  5. struct Il2CppException;
  6. namespace il2cpp
  7. {
  8. namespace vm
  9. {
  10. class LIBIL2CPP_CODEGEN_API CCW
  11. {
  12. public:
  13. // CreateCCW returns upcasted Il2CppIManagedObjectHolder if the CCW is cachable!
  14. static Il2CppIUnknown* CreateCCW(Il2CppObject* obj);
  15. static inline Il2CppIUnknown* GetOrCreate(Il2CppObject* obj, const Il2CppGuid& iid)
  16. {
  17. return gc::GarbageCollector::GetOrCreateCCW(obj, iid);
  18. }
  19. static Il2CppObject* Unpack(Il2CppIUnknown* unknown);
  20. static il2cpp_hresult_t HandleInvalidIPropertyConversion(const char* fromType, const char* toType);
  21. static il2cpp_hresult_t HandleInvalidIPropertyConversion(Il2CppObject* value, const char* fromType, const char* toType);
  22. static il2cpp_hresult_t HandleInvalidIPropertyArrayConversion(const char* fromArrayType, const char* fromElementType, const char* toElementType, il2cpp_array_size_t index);
  23. static il2cpp_hresult_t HandleInvalidIPropertyArrayConversion(Il2CppObject* value, const char* fromArrayType, const char* fromElementType, const char* toElementType, il2cpp_array_size_t index);
  24. };
  25. } /* namespace vm */
  26. } /* namespace il2cpp */