WindowsRuntime.h 1.7 KB

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