3 * Copyright 2008 Alistair Leslie-Hughes
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __MSCOREE_PRIVATE__
21 #define __MSCOREE_PRIVATE__
23 extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj);
25 typedef struct tagASSEMBLY ASSEMBLY;
27 HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file);
28 HRESULT assembly_release(ASSEMBLY *assembly);
29 HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version);
31 typedef struct RuntimeHost RuntimeHost;
33 typedef struct CLRRuntimeInfo
35 const struct ICLRRuntimeInfoVtbl *ICLRRuntimeInfo_vtbl;
41 WCHAR mono_path[MAX_PATH];
42 WCHAR mscorlib_path[MAX_PATH];
43 struct RuntimeHost *loaded_runtime;
46 extern HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file,
47 DWORD startup_flags, DWORD runtimeinfo_flags, BOOL legacy, ICLRRuntimeInfo **result);
49 extern HRESULT force_get_runtime_info(ICLRRuntimeInfo **result);
51 extern HRESULT ICLRRuntimeInfo_GetRuntimeHost(ICLRRuntimeInfo *iface, RuntimeHost **result);
53 /* Mono 2.6 embedding */
54 typedef struct _MonoDomain MonoDomain;
55 typedef struct _MonoAssembly MonoAssembly;
57 typedef struct loaded_mono
61 void (*mono_config_parse)(const char *filename);
62 MonoAssembly* (*mono_domain_assembly_open) (MonoDomain *domain, const char *name);
63 void (*mono_jit_cleanup)(MonoDomain *domain);
64 int (*mono_jit_exec)(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]);
65 MonoDomain* (*mono_jit_init)(const char *file);
66 int (*mono_jit_set_trace_options)(const char* options);
67 void (*mono_set_dirs)(const char *assembly_dir, const char *config_dir);
70 /* loaded runtime interfaces */
71 extern void unload_all_runtimes(void);
73 extern HRESULT RuntimeHost_Construct(const CLRRuntimeInfo *runtime_version,
74 const loaded_mono *loaded_mono, RuntimeHost** result);
76 extern HRESULT RuntimeHost_GetInterface(RuntimeHost *This, REFCLSID clsid, REFIID riid, void **ppv);
78 extern HRESULT RuntimeHost_Destroy(RuntimeHost *This);
80 #endif /* __MSCOREE_PRIVATE__ */