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 IUnknown* create_corruntimehost(void);
25 extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj);
27 typedef struct tagASSEMBLY ASSEMBLY;
29 HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file);
30 HRESULT assembly_release(ASSEMBLY *assembly);
31 HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version);
33 typedef struct RuntimeHost RuntimeHost;
35 typedef struct CLRRuntimeInfo
37 const struct ICLRRuntimeInfoVtbl *ICLRRuntimeInfo_vtbl;
43 WCHAR mono_path[MAX_PATH];
44 WCHAR mscorlib_path[MAX_PATH];
45 struct RuntimeHost *loaded_runtime;
48 extern HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file,
49 DWORD startup_flags, DWORD runtimeinfo_flags, BOOL legacy, ICLRRuntimeInfo **result);
51 extern HRESULT force_get_runtime_info(ICLRRuntimeInfo **result);
53 /* Mono 2.6 embedding */
54 typedef struct _MonoDomain MonoDomain;
55 typedef struct _MonoAssembly MonoAssembly;
57 extern HMODULE mono_handle;
59 extern void (*mono_config_parse)(const char *filename);
60 extern MonoAssembly* (*mono_domain_assembly_open) (MonoDomain *domain, const char *name);
61 extern void (*mono_jit_cleanup)(MonoDomain *domain);
62 extern int (*mono_jit_exec)(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]);
63 extern MonoDomain* (*mono_jit_init)(const char *file);
64 extern int (*mono_jit_set_trace_options)(const char* options);
65 extern void (*mono_set_dirs)(const char *assembly_dir, const char *config_dir);
67 typedef struct loaded_mono
71 /* loaded runtime interfaces */
72 extern void unload_all_runtimes(void);
74 extern HRESULT RuntimeHost_Construct(const CLRRuntimeInfo *runtime_version,
75 const loaded_mono *loaded_mono, RuntimeHost** result);
77 extern HRESULT RuntimeHost_GetInterface(RuntimeHost *This, REFCLSID clsid, REFIID riid, void **ppv);
79 extern HRESULT RuntimeHost_Destroy(RuntimeHost *This);
81 #endif /* __MSCOREE_PRIVATE__ */