LibraryLoader.h 998 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. #include "utils/StringView.h"
  4. #include <string>
  5. struct PInvokeArguments;
  6. namespace il2cpp
  7. {
  8. namespace os
  9. {
  10. class LibraryLoader
  11. {
  12. public:
  13. static Il2CppMethodPointer GetHardcodedPInvokeDependencyFunctionPointer(const il2cpp::utils::StringView<Il2CppNativeChar>& nativeDynamicLibrary, const il2cpp::utils::StringView<char>& entryPoint);
  14. static void* LoadDynamicLibrary(const utils::StringView<Il2CppNativeChar>& nativeDynamicLibrary);
  15. static void* LoadDynamicLibrary(const utils::StringView<Il2CppNativeChar>& nativeDynamicLibrary, int flags);
  16. static Il2CppMethodPointer GetFunctionPointer(void* dynamicLibrary, const PInvokeArguments& pinvokeArgs);
  17. static Il2CppMethodPointer GetFunctionPointer(void* dynamicLibrary, const char* functionName);
  18. static void CleanupLoadedLibraries();
  19. static bool CloseLoadedLibrary(void*& dynamicLibrary);
  20. };
  21. } /* namespace os */
  22. } /* namespace il2cpp*/