5#include "flutter/fml/native_library.h"
9#include "flutter/fml/platform/win/wstring_conversion.h"
13NativeLibrary::NativeLibrary(
const char*
path)
15 if (
path ==
nullptr) {
22NativeLibrary::NativeLibrary(Handle handle,
bool close_handle)
23 :
handle_(handle), close_handle_(close_handle) {}
25NativeLibrary::~NativeLibrary() {
26 if (
handle_ !=
nullptr && close_handle_) {
31NativeLibrary::Handle NativeLibrary::GetHandle()
const {
37 return library->GetHandle() !=
nullptr ? library :
nullptr;
42 bool close_handle_when_done) {
44 fml::AdoptRef(
new NativeLibrary(handle, close_handle_when_done));
45 return library->GetHandle() !=
nullptr ? library :
nullptr;
49 return fml::AdoptRef(
new NativeLibrary(::GetModuleHandle(
nullptr),
false));
53 if (symbol ==
nullptr ||
handle_ ==
nullptr) {
56 return ::GetProcAddress(
handle_, symbol);
static sk_sp< Effect > Create()
static FunctionPtr Resolve(Thread *thread, Zone *zone, const GrowableArray< const Instance * > &caller_arguments, const Class &receiver_class, const String &name, const Array &descriptor)
static Dart_Handle LoadLibrary(Thread *T, const ExternalTypedData &td)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
std::wstring Utf8ToWideString(const std::string_view str)
RefPtr< T > AdoptRef(T *ptr)