From 22d12ee65a33c834a75d8b6473b6a865f8566bb0 Mon Sep 17 00:00:00 2001 From: Cho Woong Suk Date: Thu, 12 Oct 2017 14:01:10 +0900 Subject: [PATCH] add plugin api to set coreclr info Change-Id: I83f76c7cfbb939e6b397150db1675c41e264b7fb --- NativeLauncher/launcher/dotnet/dotnet_launcher.cc | 6 ++++++ NativeLauncher/launcher/dotnet/dotnet_launcher.h | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index 6adff4b..7734df5 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -46,6 +46,7 @@ CoreRuntime::CoreRuntime() : pluginInitialize(nullptr), pluginPreload(nullptr), pluginSetAppInfo(nullptr), + pluginSetCoreclrInfo(nullptr), pluginGetDllPath(nullptr), pluginBeforeExecute(nullptr), pluginFinalize(nullptr) @@ -79,6 +80,7 @@ CoreRuntime::CoreRuntime() : pluginInitialize = (plugin_initialize_ptr)dlsym(__pluginLib, "plugin_initialize"); pluginPreload = (plugin_preload_ptr)dlsym(__pluginLib, "plugin_preload"); pluginSetAppInfo = (plugin_set_app_info_ptr)dlsym(__pluginLib, "plugin_set_app_info"); + pluginSetCoreclrInfo = (plugin_set_coreclr_info_ptr)dlsym(__pluginLib, "plugin_set_coreclr_info"); pluginGetDllPath = (plugin_get_dll_path_ptr)dlsym(__pluginLib, "plugin_get_dll_path"); pluginBeforeExecute = (plugin_before_execute_ptr)dlsym(__pluginLib, "plugin_before_execute"); pluginFinalize = (plugin_finalize_ptr)dlsym(__pluginLib, "plugin_finalize"); @@ -211,6 +213,9 @@ bool CoreRuntime::initializeCoreClr(const char* appId, return false; } + if (pluginSetCoreclrInfo) + pluginSetCoreclrInfo(__hostHandle, __domainId); + _DBG("Initialize core clr success"); return true; } @@ -280,6 +285,7 @@ void CoreRuntime::dispose() pluginInitialize = nullptr; pluginPreload = nullptr; pluginSetAppInfo = nullptr; + pluginSetCoreclrInfo = nullptr; pluginGetDllPath = nullptr; pluginBeforeExecute = nullptr; pluginFinalize = nullptr; diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.h b/NativeLauncher/launcher/dotnet/dotnet_launcher.h index 931846c..aaaa9d8 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.h +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.h @@ -56,7 +56,11 @@ extern "C" typedef void (*plugin_set_app_info_ptr)( const char* appId, - const char* hostHandle); + const char* managedAssemblyPath); + + typedef void (*plugin_set_coreclr_info_ptr)( + void* hostHandle, + unsigned int domainId); typedef char* (*plugin_get_dll_path_ptr)(); @@ -103,6 +107,7 @@ class CoreRuntime : public tizen::runtime::LauncherInterface plugin_initialize_ptr pluginInitialize; plugin_preload_ptr pluginPreload; plugin_set_app_info_ptr pluginSetAppInfo; + plugin_set_coreclr_info_ptr pluginSetCoreclrInfo; plugin_get_dll_path_ptr pluginGetDllPath; plugin_before_execute_ptr pluginBeforeExecute; plugin_finalize_ptr pluginFinalize; -- 2.7.4