mscoree: Use the new architecture to implement _CorExeMain.
[wine] / dlls / mscoree / mscoree_private.h
1 /*
2  *
3  * Copyright 2008 Alistair Leslie-Hughes
4  *
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.
9  *
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.
14  *
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
18  */
19
20 #ifndef __MSCOREE_PRIVATE__
21 #define __MSCOREE_PRIVATE__
22
23 extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj);
24
25 typedef struct tagASSEMBLY ASSEMBLY;
26
27 HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file);
28 HRESULT assembly_release(ASSEMBLY *assembly);
29 HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version);
30
31 typedef struct RuntimeHost RuntimeHost;
32
33 typedef struct CLRRuntimeInfo
34 {
35     const struct ICLRRuntimeInfoVtbl *ICLRRuntimeInfo_vtbl;
36     LPCWSTR mono_libdir;
37     DWORD major;
38     DWORD minor;
39     DWORD build;
40     int mono_abi_version;
41     WCHAR mono_path[MAX_PATH];
42     WCHAR mscorlib_path[MAX_PATH];
43     struct RuntimeHost *loaded_runtime;
44 } CLRRuntimeInfo;
45
46 extern HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file,
47     DWORD startup_flags, DWORD runtimeinfo_flags, BOOL legacy, ICLRRuntimeInfo **result);
48
49 extern HRESULT force_get_runtime_info(ICLRRuntimeInfo **result);
50
51 extern HRESULT ICLRRuntimeInfo_GetRuntimeHost(ICLRRuntimeInfo *iface, RuntimeHost **result);
52
53 /* Mono 2.6 embedding */
54 typedef struct _MonoDomain MonoDomain;
55 typedef struct _MonoAssembly MonoAssembly;
56
57 typedef struct loaded_mono
58 {
59     HMODULE mono_handle;
60
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);
68 } loaded_mono;
69
70 /* loaded runtime interfaces */
71 extern void unload_all_runtimes(void);
72
73 extern HRESULT RuntimeHost_Construct(const CLRRuntimeInfo *runtime_version,
74     const loaded_mono *loaded_mono, RuntimeHost** result);
75
76 extern HRESULT RuntimeHost_GetInterface(RuntimeHost *This, REFCLSID clsid, REFIID riid, void **ppv);
77
78 extern HRESULT RuntimeHost_Destroy(RuntimeHost *This);
79
80 #endif   /* __MSCOREE_PRIVATE__ */