Bug-fix: fix target dll searching logic
[platform/core/dotnet/launcher.git] / NativeLauncher / inc / dotnet_launcher_plugin.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __DOTNET_LAUNCHER_PLUGIN_H__
18 #define __DOTNET_LAUNCHER_PLUGIN_H__
19
20 #include "coreclr_host.h"
21
22 extern "C"
23 {
24         /**
25          * @brief initialize plugin code
26          * @param[in] mode mode of plugin ("default", "inhouse", etc)
27          */
28         void plugin_initialize(const char* mode);
29
30         /**
31          * @brief preload libraries. this fuction is called in the candidate process only
32          */
33         void plugin_preload();
34
35         /**
36          * @brief check whether plugin controls output log or not.
37          * @return true if plugin control logging, otherwise false
38          */
39         bool plugin_has_log_control();
40
41         /**
42          * @brief set appInfo to plugin
43          * @param[in] appID application ID to launch
44          * @param[in] assemblyPath assembly path which has entry point
45          */
46         void plugin_set_app_info(const char* appId,
47                                                          const char* assemblyPath);
48
49         /**
50          * @brief set coreclr info to plugin
51          * @param[in] hostHandle host handle of coreclr
52          * @param[in] domainId current domain ID
53          * @param[in] coreclr_create_delegate_ptr function pointer of coreclr_create_delegate
54          *            delegate function can be used to preload managed code
55          */
56         void plugin_set_coreclr_info(void* hostHandle,
57                                                                  unsigned int domainId,
58                                                                  coreclr_create_delegate_ptr delegateFunc);
59
60         /**
61          * @brief return additional pathes to find platform assembly.
62          * @return ":" seperated pathes
63          */
64         char* plugin_get_dll_path();
65
66         /**
67          * @brief return additional pathes to find app assembly.
68          * @return ":" seperated pathes
69          */
70         char* plugin_get_extra_dll_path();
71
72         /**
73          * @brief return additional searching pathes to find native libraries.
74          * @return ":" seperated pathes
75          */
76         char* plugin_get_native_dll_searching_path();
77
78         /**
79          * @brief function will be called before invoking managed code
80          */
81         void plugin_before_execute();
82
83         /**
84          * @brief function will be called when application is terminated
85          */
86         void plugin_finalize();
87 }
88
89 #endif /* __DOTNET_LAUNCHER_PLUGIN_H__ */