mfplat: Read queue subscriber within the critical section.
[wine/zf.git] / dlls / mscoree / mscoree_private.h
blobe396d855e71b62de4ae72143f4132a47da917b11
1 /*
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 char *WtoA(LPCWSTR wstr) DECLSPEC_HIDDEN;
25 extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
26 extern HRESULT CLRMetaHostPolicy_CreateInstance(REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
28 extern HRESULT WINAPI CLRMetaHost_GetVersionFromFile(ICLRMetaHost* iface,
29 LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer) DECLSPEC_HIDDEN;
31 typedef struct _VTableFixup {
32 DWORD rva;
33 WORD count;
34 WORD type;
35 } VTableFixup;
37 typedef struct tagASSEMBLY ASSEMBLY;
39 typedef BOOL (WINAPI *NativeEntryPointFunc)(HINSTANCE, DWORD, LPVOID);
41 extern HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file) DECLSPEC_HIDDEN;
42 extern HRESULT assembly_from_hmodule(ASSEMBLY **out, HMODULE hmodule) DECLSPEC_HIDDEN;
43 extern HRESULT assembly_release(ASSEMBLY *assembly) DECLSPEC_HIDDEN;
44 extern HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version) DECLSPEC_HIDDEN;
45 extern HRESULT assembly_get_vtable_fixups(ASSEMBLY *assembly, VTableFixup **fixups, DWORD *count) DECLSPEC_HIDDEN;
46 extern HRESULT assembly_get_native_entrypoint(ASSEMBLY *assembly, NativeEntryPointFunc *func) DECLSPEC_HIDDEN;
48 #define WINE_MONO_VERSION "6.1.1"
50 /* Mono embedding */
51 typedef struct _MonoDomain MonoDomain;
52 typedef struct _MonoAssembly MonoAssembly;
53 typedef struct _MonoAssemblyName MonoAssemblyName;
54 typedef struct _MonoType MonoType;
55 typedef struct _MonoImage MonoImage;
56 typedef struct _MonoClass MonoClass;
57 typedef struct _MonoObject MonoObject;
58 typedef struct _MonoString MonoString;
59 typedef struct _MonoMethod MonoMethod;
60 typedef struct _MonoProfiler MonoProfiler;
61 typedef struct _MonoThread MonoThread;
63 typedef struct RuntimeHost RuntimeHost;
65 typedef struct CLRRuntimeInfo
67 ICLRRuntimeInfo ICLRRuntimeInfo_iface;
68 DWORD major;
69 DWORD minor;
70 DWORD build;
71 struct RuntimeHost *loaded_runtime;
72 } CLRRuntimeInfo;
74 struct RuntimeHost
76 ICorRuntimeHost ICorRuntimeHost_iface;
77 ICLRRuntimeHost ICLRRuntimeHost_iface;
78 CLRRuntimeInfo *version;
79 CRITICAL_SECTION lock;
80 LONG ref;
83 typedef struct CorProcess
85 struct list entry;
86 ICorDebugProcess *pProcess;
87 } CorProcess;
89 typedef struct CorDebug
91 ICorDebug ICorDebug_iface;
92 ICorDebugProcessEnum ICorDebugProcessEnum_iface;
93 LONG ref;
95 ICLRRuntimeHost *runtimehost;
97 /* ICorDebug Callback */
98 ICorDebugManagedCallback *pCallback;
99 ICorDebugManagedCallback2 *pCallback2;
101 /* Debug Processes */
102 struct list processes;
103 } CorDebug;
105 extern HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file,
106 IStream *config_stream, DWORD startup_flags, DWORD runtimeinfo_flags, BOOL legacy,
107 ICLRRuntimeInfo **result) DECLSPEC_HIDDEN;
109 extern BOOL get_mono_path(LPWSTR path, BOOL skip_local) DECLSPEC_HIDDEN;
111 extern MonoDomain* get_root_domain(void);
113 extern HRESULT ICLRRuntimeInfo_GetRuntimeHost(ICLRRuntimeInfo *iface, RuntimeHost **result) DECLSPEC_HIDDEN;
115 extern HRESULT MetaDataDispenser_CreateInstance(IUnknown **ppUnk) DECLSPEC_HIDDEN;
117 typedef struct parsed_config_file
119 struct list supported_runtimes;
120 LPWSTR private_path;
121 } parsed_config_file;
123 typedef struct supported_runtime
125 struct list entry;
126 LPWSTR version;
127 } supported_runtime;
129 extern WCHAR **private_path;
131 extern HRESULT parse_config_file(LPCWSTR filename, parsed_config_file *result) DECLSPEC_HIDDEN;
133 extern HRESULT parse_config_stream(IStream *stream, parsed_config_file *result) DECLSPEC_HIDDEN;
135 extern void free_parsed_config_file(parsed_config_file *file) DECLSPEC_HIDDEN;
137 typedef enum {
138 MONO_IMAGE_OK,
139 MONO_IMAGE_ERROR_ERRNO,
140 MONO_IMAGE_MISSING_ASSEMBLYREF,
141 MONO_IMAGE_IMAGE_INVALID
142 } MonoImageOpenStatus;
144 typedef MonoAssembly* (CDECL *MonoAssemblyPreLoadFunc)(MonoAssemblyName *aname, char **assemblies_path, void *user_data);
146 typedef void (CDECL *MonoProfileFunc)(MonoProfiler *prof);
148 typedef void (CDECL *MonoPrintCallback) (const char *string, INT is_stdout);
150 typedef enum {
151 MONO_AOT_MODE_NONE,
152 MONO_AOT_MODE_NORMAL,
153 MONO_AOT_MODE_HYBRID,
154 MONO_AOT_MODE_FULL,
155 MONO_AOT_MODE_LLVMONLY,
156 MONO_AOT_MODE_INTERP,
157 MONO_AOT_MODE_INTERP_LLVMONLY,
158 MONO_AOT_MODE_LLVMONLY_INTERP,
159 MONO_AOT_MODE_INTERP_ONLY
160 } MonoAotMode;
162 extern BOOL is_mono_started DECLSPEC_HIDDEN;
164 extern MonoImage* (CDECL *mono_assembly_get_image)(MonoAssembly *assembly) DECLSPEC_HIDDEN;
165 extern MonoAssembly* (CDECL *mono_assembly_load_from)(MonoImage *image, const char *fname, MonoImageOpenStatus *status) DECLSPEC_HIDDEN;
166 extern const char* (CDECL *mono_assembly_name_get_name)(MonoAssemblyName *aname) DECLSPEC_HIDDEN;
167 extern MonoAssembly* (CDECL *mono_assembly_open)(const char *filename, MonoImageOpenStatus *status) DECLSPEC_HIDDEN;
168 extern void (CDECL *mono_callspec_set_assembly)(MonoAssembly *assembly) DECLSPEC_HIDDEN;
169 extern MonoClass* (CDECL *mono_class_from_mono_type)(MonoType *type) DECLSPEC_HIDDEN;
170 extern MonoClass* (CDECL *mono_class_from_name)(MonoImage *image, const char* name_space, const char *name) DECLSPEC_HIDDEN;
171 extern MonoMethod* (CDECL *mono_class_get_method_from_name)(MonoClass *klass, const char *name, int param_count) DECLSPEC_HIDDEN;
172 extern MonoDomain* (CDECL *mono_domain_get)(void) DECLSPEC_HIDDEN;
173 extern MonoDomain* (CDECL *mono_domain_get_by_id)(int id) DECLSPEC_HIDDEN;
174 extern BOOL (CDECL *mono_domain_set)(MonoDomain *domain, BOOL force) DECLSPEC_HIDDEN;
175 extern void (CDECL *mono_domain_set_config)(MonoDomain *domain,const char *base_dir,const char *config_file_name) DECLSPEC_HIDDEN;
176 extern MonoImage* (CDECL *mono_get_corlib)(void) DECLSPEC_HIDDEN;
177 extern int (CDECL *mono_jit_exec)(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]) DECLSPEC_HIDDEN;
178 extern MonoDomain* (CDECL *mono_jit_init_version)(const char *domain_name, const char *runtime_version) DECLSPEC_HIDDEN;
179 extern MonoImage* (CDECL *mono_image_open_from_module_handle)(HMODULE module_handle, char* fname, UINT has_entry_point, MonoImageOpenStatus* status) DECLSPEC_HIDDEN;
180 extern void* (CDECL *mono_marshal_get_vtfixup_ftnptr)(MonoImage *image, DWORD token, WORD type) DECLSPEC_HIDDEN;
181 extern MonoDomain* (CDECL *mono_object_get_domain)(MonoObject *obj) DECLSPEC_HIDDEN;
182 extern MonoMethod* (CDECL *mono_object_get_virtual_method)(MonoObject *obj, MonoMethod *method) DECLSPEC_HIDDEN;
183 extern MonoObject* (CDECL *mono_object_new)(MonoDomain *domain, MonoClass *klass) DECLSPEC_HIDDEN;
184 extern void* (CDECL *mono_object_unbox)(MonoObject *obj) DECLSPEC_HIDDEN;
185 extern MonoType* (CDECL *mono_reflection_type_from_name)(char *name, MonoImage *image) DECLSPEC_HIDDEN;
186 extern MonoObject* (CDECL *mono_runtime_invoke)(MonoMethod *method, void *obj, void **params, MonoObject **exc) DECLSPEC_HIDDEN;
187 extern void (CDECL *mono_runtime_object_init)(MonoObject *this_obj) DECLSPEC_HIDDEN;
188 extern void (CDECL *mono_runtime_quit)(void) DECLSPEC_HIDDEN;
189 extern MonoString* (CDECL *mono_string_new)(MonoDomain *domain, const char *str) DECLSPEC_HIDDEN;
190 extern MonoThread* (CDECL *mono_thread_attach)(MonoDomain *domain) DECLSPEC_HIDDEN;
191 extern void (CDECL *mono_thread_manage)(void) DECLSPEC_HIDDEN;
192 extern void (CDECL *mono_trace_set_print_handler)(MonoPrintCallback callback) DECLSPEC_HIDDEN;
193 extern void (CDECL *mono_trace_set_printerr_handler)(MonoPrintCallback callback) DECLSPEC_HIDDEN;
195 /* loaded runtime interfaces */
196 extern void expect_no_runtimes(void) DECLSPEC_HIDDEN;
198 extern HRESULT RuntimeHost_Construct(CLRRuntimeInfo *runtime_version, RuntimeHost** result) DECLSPEC_HIDDEN;
200 extern void RuntimeHost_ExitProcess(RuntimeHost *This, INT exitcode) DECLSPEC_HIDDEN;
202 extern HRESULT RuntimeHost_GetInterface(RuntimeHost *This, REFCLSID clsid, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
204 extern HRESULT RuntimeHost_GetIUnknownForObject(RuntimeHost *This, MonoObject *obj, IUnknown **ppUnk) DECLSPEC_HIDDEN;
206 extern HRESULT RuntimeHost_CreateManagedInstance(RuntimeHost *This, LPCWSTR name,
207 MonoDomain *domain, MonoObject **result) DECLSPEC_HIDDEN;
209 HRESULT WINAPI CLRMetaHost_ExitProcess(ICLRMetaHost* iface, INT32 iExitCode) DECLSPEC_HIDDEN;
211 HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface, LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime) DECLSPEC_HIDDEN;
213 extern HRESULT CorDebug_Create(ICLRRuntimeHost *runtimehost, IUnknown** ppUnk) DECLSPEC_HIDDEN;
215 extern HRESULT create_monodata(REFIID riid, LPVOID *ppObj) DECLSPEC_HIDDEN;
217 extern HRESULT get_file_from_strongname(WCHAR* stringnameW, WCHAR* assemblies_path, int path_length) DECLSPEC_HIDDEN;
219 extern void runtimehost_init(void) DECLSPEC_HIDDEN;
220 extern void runtimehost_uninit(void) DECLSPEC_HIDDEN;
222 #endif /* __MSCOREE_PRIVATE__ */