2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __DOTNET_LAUNCHER_H__
18 #define __DOTNET_LAUNCHER_H__
24 typedef int (*coreclr_initialize_ptr)(
26 const char* appDomainFriendlyName,
28 const char** propertyKeys,
29 const char** propertyValues,
31 unsigned int* domainId);
33 typedef int (*coreclr_execute_assembly_ptr)(
35 unsigned int domainId,
38 const char* managedAssemblyPath,
39 unsigned int* exitCode);
41 typedef int (*coreclr_shutdown_ptr)(
43 unsigned int domainId);
45 typedef int (*coreclr_create_delegate_ptr)(
47 unsigned int domainId,
48 const char* entryPointAssemblyName,
49 const char* entryPointTypeName,
50 const char* entryPointMethodName,
53 typedef void (*plugin_initialize_ptr)();
55 typedef void (*plugin_preload_ptr)();
57 typedef void (*plugin_set_app_info_ptr)(
59 const char* managedAssemblyPath);
61 typedef void (*plugin_set_coreclr_info_ptr)(
63 unsigned int domainId);
65 typedef char* (*plugin_get_dll_path_ptr)();
67 typedef void (*plugin_before_execute_ptr)();
69 typedef void (*plugin_finalize_ptr)();
74 namespace dotnetcore {
76 typedef void (*PreparedFunctionPtr)();
77 typedef bool (*LaunchFunctionPtr)(const char* root, const char* path, int argc, char* argv[]);
79 class CoreRuntime : public tizen::runtime::LauncherInterface
84 int initialize(bool standalone) override;
85 void dispose() override;
86 int launch(const char* appId, const char* root, const char* path, int argc, char* argv[]) override;
89 bool initializeCoreClr(const char* appId, const char* assemblyProbePaths, const char* pinvokeProbePaths, const char* tpaList);
90 coreclr_initialize_ptr initializeClr;
91 coreclr_execute_assembly_ptr executeAssembly;
92 coreclr_shutdown_ptr shutdown;
93 coreclr_create_delegate_ptr createDelegate;
94 std::string __deviceAPIDirectory;
95 std::string __runtimeDirectory;
96 std::string __nativeLibDirectory;
97 std::string __refAPIDirectory;
100 unsigned int __domainId;
101 PreparedFunctionPtr preparedFunction;
102 LaunchFunctionPtr launchFunction;
103 // plugin function pointer
105 plugin_initialize_ptr pluginInitialize;
106 plugin_preload_ptr pluginPreload;
107 plugin_set_app_info_ptr pluginSetAppInfo;
108 plugin_set_coreclr_info_ptr pluginSetCoreclrInfo;
109 plugin_get_dll_path_ptr pluginGetDllPath;
110 plugin_before_execute_ptr pluginBeforeExecute;
111 plugin_finalize_ptr pluginFinalize;
116 } // namespace runtime
119 #endif /* __DOTNET_LAUNCHER_H__ */