diff options
Diffstat (limited to 'src/dnchost/hostfxr.h')
-rw-r--r-- | src/dnchost/hostfxr.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/src/dnchost/hostfxr.h b/src/dnchost/hostfxr.h new file mode 100644 index 00000000..85e6e0ab --- /dev/null +++ b/src/dnchost/hostfxr.h | |||
@@ -0,0 +1,96 @@ | |||
1 | // Licensed to the .NET Foundation under one or more agreements. | ||
2 | // The .NET Foundation licenses this file to you under the MIT license. | ||
3 | // See the LICENSE file in the project root for more information. | ||
4 | |||
5 | |||
6 | |||
7 | // ***** ABOUT THIS HEADER ***** | ||
8 | // ************************************************************************************** | ||
9 | // | ||
10 | // This is the version on 2019-12-22 from | ||
11 | // https://github.com/dotnet/runtime/blob/master/src/installer/corehost/cli/hostfxr.h | ||
12 | // | ||
13 | // ************************************************************************************** | ||
14 | // **************************** | ||
15 | |||
16 | |||
17 | #ifndef __HOSTFXR_H__ | ||
18 | #define __HOSTFXR_H__ | ||
19 | |||
20 | #include <stddef.h> | ||
21 | #include <stdint.h> | ||
22 | |||
23 | #if defined(_WIN32) | ||
24 | #define HOSTFXR_CALLTYPE __cdecl | ||
25 | #ifdef _WCHAR_T_DEFINED | ||
26 | typedef wchar_t char_t; | ||
27 | #else | ||
28 | typedef unsigned short char_t; | ||
29 | #endif | ||
30 | #else | ||
31 | #define HOSTFXR_CALLTYPE | ||
32 | typedef char char_t; | ||
33 | #endif | ||
34 | |||
35 | enum hostfxr_delegate_type | ||
36 | { | ||
37 | hdt_com_activation, | ||
38 | hdt_load_in_memory_assembly, | ||
39 | hdt_winrt_activation, | ||
40 | hdt_com_register, | ||
41 | hdt_com_unregister, | ||
42 | hdt_load_assembly_and_get_function_pointer | ||
43 | }; | ||
44 | |||
45 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_main_fn)(const int argc, const char_t **argv); | ||
46 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_main_startupinfo_fn)( | ||
47 | const int argc, | ||
48 | const char_t **argv, | ||
49 | const char_t *host_path, | ||
50 | const char_t *dotnet_root, | ||
51 | const char_t *app_path); | ||
52 | |||
53 | typedef void(HOSTFXR_CALLTYPE *hostfxr_error_writer_fn)(const char_t *message); | ||
54 | typedef hostfxr_error_writer_fn(HOSTFXR_CALLTYPE *hostfxr_set_error_writer_fn)(hostfxr_error_writer_fn error_writer); | ||
55 | |||
56 | typedef void* hostfxr_handle; | ||
57 | struct hostfxr_initialize_parameters | ||
58 | { | ||
59 | size_t size; | ||
60 | const char_t *host_path; | ||
61 | const char_t *dotnet_root; | ||
62 | }; | ||
63 | |||
64 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_initialize_for_dotnet_command_line_fn)( | ||
65 | int argc, | ||
66 | const char_t **argv, | ||
67 | const struct hostfxr_initialize_parameters *parameters, | ||
68 | /*out*/ hostfxr_handle *host_context_handle); | ||
69 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_initialize_for_runtime_config_fn)( | ||
70 | const char_t *runtime_config_path, | ||
71 | const struct hostfxr_initialize_parameters *parameters, | ||
72 | /*out*/ hostfxr_handle *host_context_handle); | ||
73 | |||
74 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_get_runtime_property_value_fn)( | ||
75 | const hostfxr_handle host_context_handle, | ||
76 | const char_t *name, | ||
77 | /*out*/ const char_t **value); | ||
78 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_set_runtime_property_value_fn)( | ||
79 | const hostfxr_handle host_context_handle, | ||
80 | const char_t *name, | ||
81 | const char_t *value); | ||
82 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_get_runtime_properties_fn)( | ||
83 | const hostfxr_handle host_context_handle, | ||
84 | /*inout*/ size_t * count, | ||
85 | /*out*/ const char_t **keys, | ||
86 | /*out*/ const char_t **values); | ||
87 | |||
88 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_run_app_fn)(const hostfxr_handle host_context_handle); | ||
89 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_get_runtime_delegate_fn)( | ||
90 | const hostfxr_handle host_context_handle, | ||
91 | enum hostfxr_delegate_type type, | ||
92 | /*out*/ void **delegate); | ||
93 | |||
94 | typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_close_fn)(const hostfxr_handle host_context_handle); | ||
95 | |||
96 | #endif //__HOSTFXR_H__ \ No newline at end of file | ||