ComObjectBase.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include "il2cpp-object-internals.h"
  3. namespace il2cpp
  4. {
  5. namespace vm
  6. {
  7. struct LIBIL2CPP_CODEGEN_API NOVTABLE ComObjectBase : Il2CppIInspectable, Il2CppIMarshal
  8. {
  9. private:
  10. Il2CppIMarshal* m_FreeThreadedMarshaler;
  11. public:
  12. inline ComObjectBase() :
  13. m_FreeThreadedMarshaler(NULL)
  14. {
  15. }
  16. inline ~ComObjectBase()
  17. {
  18. if (m_FreeThreadedMarshaler)
  19. m_FreeThreadedMarshaler->Release();
  20. }
  21. virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE;
  22. virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE;
  23. virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE;
  24. virtual il2cpp_hresult_t STDCALL GetUnmarshalClass(const Il2CppGuid& iid, void* object, uint32_t context, void* reserved, uint32_t flags, Il2CppGuid* clsid) IL2CPP_OVERRIDE;
  25. virtual il2cpp_hresult_t STDCALL GetMarshalSizeMax(const Il2CppGuid& iid, void* object, uint32_t context, void* reserved, uint32_t flags, uint32_t* size) IL2CPP_OVERRIDE;
  26. virtual il2cpp_hresult_t STDCALL MarshalInterface(Il2CppIStream* stream, const Il2CppGuid& iid, void* object, uint32_t context, void* reserved, uint32_t flags) IL2CPP_OVERRIDE;
  27. virtual il2cpp_hresult_t STDCALL UnmarshalInterface(Il2CppIStream* stream, const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE;
  28. virtual il2cpp_hresult_t STDCALL ReleaseMarshalData(Il2CppIStream* stream) IL2CPP_OVERRIDE;
  29. virtual il2cpp_hresult_t STDCALL DisconnectObject(uint32_t reserved) IL2CPP_OVERRIDE;
  30. protected:
  31. IL2CPP_FORCE_INLINE Il2CppIInspectable* GetIdentity()
  32. {
  33. return this;
  34. }
  35. il2cpp_hresult_t GetRuntimeClassNameImpl(Il2CppHString* className);
  36. private:
  37. ComObjectBase(const ComObjectBase&);
  38. ComObjectBase& operator=(const ComObjectBase&);
  39. il2cpp_hresult_t GetFreeThreadedMarshalerNoAddRef(Il2CppIMarshal** destination);
  40. };
  41. } /* namespace vm */
  42. } /* namespace il2cpp */