WindowsRuntime.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "il2cpp-windowsruntime-types.h"
  3. #include "utils/Expected.h"
  4. #include "utils/StringView.h"
  5. namespace il2cpp
  6. {
  7. namespace os
  8. {
  9. class LIBIL2CPP_CODEGEN_API WindowsRuntime
  10. {
  11. public:
  12. static il2cpp_hresult_t GetActivationFactory(Il2CppHString className, Il2CppIActivationFactory** activationFactory);
  13. static il2cpp_hresult_t CreateHStringReference(const utils::StringView<Il2CppNativeChar>& str, Il2CppHStringHeader* header, Il2CppHString* hstring);
  14. static il2cpp_hresult_t CreateHString(const utils::StringView<Il2CppChar>& str, Il2CppHString* hstring);
  15. #if !IL2CPP_TARGET_WINDOWS // Il2CppChar and Il2CppNativeChar are the same on Windows
  16. static il2cpp_hresult_t CreateHString(const utils::StringView<Il2CppNativeChar>& str, Il2CppHString* hstring);
  17. #endif
  18. static il2cpp_hresult_t DuplicateHString(Il2CppHString hstring, Il2CppHString* duplicated);
  19. static il2cpp_hresult_t DeleteHString(Il2CppHString hstring);
  20. static utils::Expected<const Il2CppChar*> GetHStringBuffer(Il2CppHString hstring, uint32_t* length);
  21. static utils::Expected<const Il2CppNativeChar*> GetNativeHStringBuffer(Il2CppHString hstring, uint32_t* length);
  22. static utils::Expected<il2cpp_hresult_t> PreallocateHStringBuffer(uint32_t length, Il2CppNativeChar** mutableBuffer, void** bufferHandle);
  23. static utils::Expected<il2cpp_hresult_t> PromoteHStringBuffer(void* bufferHandle, Il2CppHString* hstring);
  24. static utils::Expected<il2cpp_hresult_t> DeleteHStringBuffer(void* bufferHandle);
  25. static Il2CppIRestrictedErrorInfo* GetRestrictedErrorInfo();
  26. typedef Il2CppIUnknown* (*GetOrCreateFunc)(Il2CppObject* obj, const Il2CppGuid& iid);
  27. static void OriginateLanguageException(il2cpp_hresult_t hresult, Il2CppException* ex, Il2CppString* exceptionString, GetOrCreateFunc createCCWCallback);
  28. static void EnableErrorReporting();
  29. };
  30. }
  31. }