WindowsRuntime.cpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #include "il2cpp-config.h"
  2. #include "os/WindowsRuntime.h"
  3. #include "utils/Expected.h"
  4. #include "utils/Il2CppError.h"
  5. #if IL2CPP_USE_GENERIC_WINDOWSRUNTIME
  6. namespace il2cpp
  7. {
  8. namespace os
  9. {
  10. il2cpp_hresult_t WindowsRuntime::GetActivationFactory(Il2CppHString className, Il2CppIActivationFactory** activationFactory)
  11. {
  12. NO_UNUSED_WARNING(className);
  13. NO_UNUSED_WARNING(activationFactory);
  14. IL2CPP_ASSERT(className != NULL);
  15. IL2CPP_ASSERT(activationFactory != NULL);
  16. return IL2CPP_REGDB_E_CLASSNOTREG;
  17. }
  18. il2cpp_hresult_t WindowsRuntime::CreateHStringReference(const utils::StringView<Il2CppNativeChar>& str, Il2CppHStringHeader* header, Il2CppHString* hstring)
  19. {
  20. NO_UNUSED_WARNING(str);
  21. NO_UNUSED_WARNING(header);
  22. NO_UNUSED_WARNING(hstring);
  23. IL2CPP_ASSERT(header != NULL);
  24. IL2CPP_ASSERT(hstring != NULL);
  25. return IL2CPP_COR_E_PLATFORMNOTSUPPORTED;
  26. }
  27. il2cpp_hresult_t WindowsRuntime::CreateHString(const utils::StringView<Il2CppChar>& str, Il2CppHString* hstring)
  28. {
  29. NO_UNUSED_WARNING(str);
  30. NO_UNUSED_WARNING(hstring);
  31. return IL2CPP_COR_E_PLATFORMNOTSUPPORTED;
  32. }
  33. #if !IL2CPP_TARGET_WINDOWS // Il2CppChar and Il2CppNativeChar are the same on Windows
  34. il2cpp_hresult_t WindowsRuntime::CreateHString(const utils::StringView<Il2CppNativeChar>& str, Il2CppHString* hstring)
  35. {
  36. NO_UNUSED_WARNING(str);
  37. NO_UNUSED_WARNING(hstring);
  38. return IL2CPP_COR_E_PLATFORMNOTSUPPORTED;
  39. }
  40. #endif
  41. il2cpp_hresult_t WindowsRuntime::DuplicateHString(Il2CppHString hstring, Il2CppHString* duplicated)
  42. {
  43. NO_UNUSED_WARNING(hstring);
  44. NO_UNUSED_WARNING(duplicated);
  45. return IL2CPP_COR_E_PLATFORMNOTSUPPORTED;
  46. }
  47. il2cpp_hresult_t WindowsRuntime::DeleteHString(Il2CppHString hstring)
  48. {
  49. NO_UNUSED_WARNING(hstring);
  50. return IL2CPP_COR_E_PLATFORMNOTSUPPORTED;
  51. }
  52. utils::Expected<const Il2CppChar*> WindowsRuntime::GetHStringBuffer(Il2CppHString hstring, uint32_t* length)
  53. {
  54. NO_UNUSED_WARNING(hstring);
  55. NO_UNUSED_WARNING(length);
  56. return utils::Il2CppError(utils::ComError, IL2CPP_COR_E_PLATFORMNOTSUPPORTED);
  57. }
  58. utils::Expected<const Il2CppNativeChar*> WindowsRuntime::GetNativeHStringBuffer(Il2CppHString hstring, uint32_t* length)
  59. {
  60. NO_UNUSED_WARNING(hstring);
  61. NO_UNUSED_WARNING(length);
  62. return utils::Il2CppError(utils::ComError, IL2CPP_COR_E_PLATFORMNOTSUPPORTED);
  63. }
  64. utils::Expected<il2cpp_hresult_t> WindowsRuntime::PreallocateHStringBuffer(uint32_t length, Il2CppNativeChar** mutableBuffer, void** bufferHandle)
  65. {
  66. NO_UNUSED_WARNING(length);
  67. NO_UNUSED_WARNING(mutableBuffer);
  68. NO_UNUSED_WARNING(bufferHandle);
  69. return IL2CPP_COR_E_PLATFORMNOTSUPPORTED;
  70. }
  71. utils::Expected<il2cpp_hresult_t> WindowsRuntime::PromoteHStringBuffer(void* bufferHandle, Il2CppHString* hstring)
  72. {
  73. NO_UNUSED_WARNING(bufferHandle);
  74. NO_UNUSED_WARNING(hstring);
  75. return IL2CPP_COR_E_PLATFORMNOTSUPPORTED;
  76. }
  77. utils::Expected<il2cpp_hresult_t> WindowsRuntime::DeleteHStringBuffer(void* bufferHandle)
  78. {
  79. NO_UNUSED_WARNING(bufferHandle);
  80. return IL2CPP_COR_E_PLATFORMNOTSUPPORTED;
  81. }
  82. Il2CppIRestrictedErrorInfo* WindowsRuntime::GetRestrictedErrorInfo()
  83. {
  84. return NULL;
  85. }
  86. void WindowsRuntime::OriginateLanguageException(il2cpp_hresult_t hresult, Il2CppException* ex, Il2CppString* exceptionString, GetOrCreateFunc createCCWCallback)
  87. {
  88. NO_UNUSED_WARNING(ex);
  89. NO_UNUSED_WARNING(exceptionString);
  90. NO_UNUSED_WARNING(createCCWCallback);
  91. }
  92. void WindowsRuntime::EnableErrorReporting()
  93. {
  94. }
  95. }
  96. }
  97. #endif