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 /* Mono 2.6 embedding */
52 typedef struct _MonoDomain MonoDomain
;
53 typedef struct _MonoAssembly MonoAssembly
;
55 extern HMODULE mono_handle
;
57 extern void (*mono_config_parse
)(const char *filename
);
58 extern MonoAssembly
* (*mono_domain_assembly_open
) (MonoDomain
*domain
, const char *name
);
59 extern void (*mono_jit_cleanup
)(MonoDomain
*domain
);
60 extern int (*mono_jit_exec
)(MonoDomain
*domain
, MonoAssembly
*assembly
, int argc
, char *argv
[]);
61 extern MonoDomain
* (*mono_jit_init
)(const char *file
);
62 extern int (*mono_jit_set_trace_options
)(const char* options
);
63 extern void (*mono_set_dirs
)(const char *assembly_dir
, const char *config_dir
);
65 typedef struct loaded_mono
69 void (*mono_config_parse
)(const char *filename
);
70 MonoAssembly
* (*mono_domain_assembly_open
) (MonoDomain
*domain
, const char *name
);
71 void (*mono_jit_cleanup
)(MonoDomain
*domain
);
72 int (*mono_jit_exec
)(MonoDomain
*domain
, MonoAssembly
*assembly
, int argc
, char *argv
[]);
73 MonoDomain
* (*mono_jit_init
)(const char *file
);
74 int (*mono_jit_set_trace_options
)(const char* options
);
75 void (*mono_set_dirs
)(const char *assembly_dir
, const char *config_dir
);
78 /* loaded runtime interfaces */
79 extern void unload_all_runtimes(void);
81 extern HRESULT
RuntimeHost_Construct(const CLRRuntimeInfo
*runtime_version
,
82 const loaded_mono
*loaded_mono
, RuntimeHost
** result
);
84 extern HRESULT
RuntimeHost_GetInterface(RuntimeHost
*This
, REFCLSID clsid
, REFIID riid
, void **ppv
);
86 extern HRESULT
RuntimeHost_Destroy(RuntimeHost
*This
);
88 #endif /* __MSCOREE_PRIVATE__ */