2008-03-28 11:10:55 +01:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright 2008 Alistair Leslie-Hughes
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MSCOREE_PRIVATE__
|
|
|
|
#define __MSCOREE_PRIVATE__
|
|
|
|
|
2011-05-13 17:31:09 +02:00
|
|
|
extern char *WtoA(LPCWSTR wstr) DECLSPEC_HIDDEN;
|
2010-10-05 22:50:01 +02:00
|
|
|
|
2011-05-13 17:31:09 +02:00
|
|
|
extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
|
2013-10-02 07:48:32 +02:00
|
|
|
extern HRESULT CLRMetaHostPolicy_CreateInstance(REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
|
2010-09-22 21:09:04 +02:00
|
|
|
|
2011-01-27 23:05:34 +01:00
|
|
|
extern HRESULT WINAPI CLRMetaHost_GetVersionFromFile(ICLRMetaHost* iface,
|
2011-05-13 17:31:09 +02:00
|
|
|
LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer) DECLSPEC_HIDDEN;
|
2011-01-27 23:05:34 +01:00
|
|
|
|
2011-10-20 20:23:35 +02:00
|
|
|
typedef struct _VTableFixup {
|
|
|
|
DWORD rva;
|
|
|
|
WORD count;
|
|
|
|
WORD type;
|
|
|
|
} VTableFixup;
|
|
|
|
|
2010-09-22 22:27:52 +02:00
|
|
|
typedef struct tagASSEMBLY ASSEMBLY;
|
|
|
|
|
2016-01-30 02:36:49 +01:00
|
|
|
typedef BOOL (WINAPI *NativeEntryPointFunc)(HINSTANCE, DWORD, LPVOID);
|
|
|
|
|
2011-10-20 20:23:35 +02:00
|
|
|
extern HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT assembly_from_hmodule(ASSEMBLY **out, HMODULE hmodule) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT assembly_release(ASSEMBLY *assembly) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT assembly_get_vtable_fixups(ASSEMBLY *assembly, VTableFixup **fixups, DWORD *count) DECLSPEC_HIDDEN;
|
2016-01-30 02:36:49 +01:00
|
|
|
extern HRESULT assembly_get_native_entrypoint(ASSEMBLY *assembly, NativeEntryPointFunc *func) DECLSPEC_HIDDEN;
|
2010-09-22 22:27:52 +02:00
|
|
|
|
2019-11-04 20:34:29 +01:00
|
|
|
#define WINE_MONO_VERSION "4.9.4"
|
2019-04-04 17:05:31 +02:00
|
|
|
|
2011-09-27 01:06:18 +02:00
|
|
|
/* Mono embedding */
|
|
|
|
typedef struct _MonoDomain MonoDomain;
|
|
|
|
typedef struct _MonoAssembly MonoAssembly;
|
|
|
|
typedef struct _MonoAssemblyName MonoAssemblyName;
|
|
|
|
typedef struct _MonoType MonoType;
|
|
|
|
typedef struct _MonoImage MonoImage;
|
|
|
|
typedef struct _MonoClass MonoClass;
|
|
|
|
typedef struct _MonoObject MonoObject;
|
2011-12-15 23:15:11 +01:00
|
|
|
typedef struct _MonoString MonoString;
|
2011-09-27 01:06:18 +02:00
|
|
|
typedef struct _MonoMethod MonoMethod;
|
|
|
|
typedef struct _MonoProfiler MonoProfiler;
|
2012-04-23 21:55:52 +02:00
|
|
|
typedef struct _MonoThread MonoThread;
|
2011-09-27 01:06:18 +02:00
|
|
|
|
2010-09-26 22:54:13 +02:00
|
|
|
typedef struct RuntimeHost RuntimeHost;
|
|
|
|
|
|
|
|
typedef struct CLRRuntimeInfo
|
|
|
|
{
|
2011-08-19 00:43:17 +02:00
|
|
|
ICLRRuntimeInfo ICLRRuntimeInfo_iface;
|
2010-09-26 22:54:13 +02:00
|
|
|
DWORD major;
|
|
|
|
DWORD minor;
|
|
|
|
DWORD build;
|
|
|
|
struct RuntimeHost *loaded_runtime;
|
|
|
|
} CLRRuntimeInfo;
|
|
|
|
|
2011-09-27 01:06:18 +02:00
|
|
|
struct RuntimeHost
|
|
|
|
{
|
|
|
|
ICorRuntimeHost ICorRuntimeHost_iface;
|
|
|
|
ICLRRuntimeHost ICLRRuntimeHost_iface;
|
2016-01-12 15:36:07 +01:00
|
|
|
CLRRuntimeInfo *version;
|
2011-09-27 01:06:18 +02:00
|
|
|
struct list domains;
|
|
|
|
MonoDomain *default_domain;
|
|
|
|
CRITICAL_SECTION lock;
|
|
|
|
LONG ref;
|
|
|
|
};
|
|
|
|
|
2011-10-30 23:15:39 +01:00
|
|
|
typedef struct CorProcess
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
ICorDebugProcess *pProcess;
|
|
|
|
} CorProcess;
|
|
|
|
|
2011-09-29 08:08:06 +02:00
|
|
|
typedef struct CorDebug
|
|
|
|
{
|
|
|
|
ICorDebug ICorDebug_iface;
|
2011-10-30 23:15:39 +01:00
|
|
|
ICorDebugProcessEnum ICorDebugProcessEnum_iface;
|
2011-09-29 08:08:06 +02:00
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
ICLRRuntimeHost *runtimehost;
|
|
|
|
|
|
|
|
/* ICorDebug Callback */
|
|
|
|
ICorDebugManagedCallback *pCallback;
|
|
|
|
ICorDebugManagedCallback2 *pCallback2;
|
2011-10-30 23:15:39 +01:00
|
|
|
|
|
|
|
/* Debug Processes */
|
|
|
|
struct list processes;
|
2011-09-29 08:08:06 +02:00
|
|
|
} CorDebug;
|
|
|
|
|
2010-10-01 21:11:09 +02:00
|
|
|
extern HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file,
|
2019-02-24 16:12:24 +01:00
|
|
|
IStream *config_stream, DWORD startup_flags, DWORD runtimeinfo_flags, BOOL legacy,
|
|
|
|
ICLRRuntimeInfo **result) DECLSPEC_HIDDEN;
|
2010-10-01 21:11:09 +02:00
|
|
|
|
2019-04-13 18:27:33 +02:00
|
|
|
extern BOOL get_mono_path(LPWSTR path, BOOL skip_local) DECLSPEC_HIDDEN;
|
2019-04-04 17:05:32 +02:00
|
|
|
|
2011-05-13 17:31:09 +02:00
|
|
|
extern HRESULT ICLRRuntimeInfo_GetRuntimeHost(ICLRRuntimeInfo *iface, RuntimeHost **result) DECLSPEC_HIDDEN;
|
2010-10-03 20:24:01 +02:00
|
|
|
|
2011-05-13 17:31:09 +02:00
|
|
|
extern HRESULT MetaDataDispenser_CreateInstance(IUnknown **ppUnk) DECLSPEC_HIDDEN;
|
2010-10-05 20:21:25 +02:00
|
|
|
|
2010-10-05 00:37:00 +02:00
|
|
|
typedef struct parsed_config_file
|
|
|
|
{
|
|
|
|
struct list supported_runtimes;
|
2019-10-17 22:12:32 +02:00
|
|
|
LPWSTR private_path;
|
2010-10-05 00:37:00 +02:00
|
|
|
} parsed_config_file;
|
|
|
|
|
|
|
|
typedef struct supported_runtime
|
|
|
|
{
|
|
|
|
struct list entry;
|
|
|
|
LPWSTR version;
|
|
|
|
} supported_runtime;
|
|
|
|
|
2019-10-17 22:12:32 +02:00
|
|
|
extern WCHAR **private_path;
|
|
|
|
|
2011-05-13 17:31:09 +02:00
|
|
|
extern HRESULT parse_config_file(LPCWSTR filename, parsed_config_file *result) DECLSPEC_HIDDEN;
|
2010-10-05 00:37:00 +02:00
|
|
|
|
2019-02-24 16:12:24 +01:00
|
|
|
extern HRESULT parse_config_stream(IStream *stream, parsed_config_file *result) DECLSPEC_HIDDEN;
|
|
|
|
|
2011-05-13 17:31:09 +02:00
|
|
|
extern void free_parsed_config_file(parsed_config_file *file) DECLSPEC_HIDDEN;
|
2010-10-05 00:37:00 +02:00
|
|
|
|
2010-10-05 22:50:01 +02:00
|
|
|
typedef enum {
|
|
|
|
MONO_IMAGE_OK,
|
|
|
|
MONO_IMAGE_ERROR_ERRNO,
|
|
|
|
MONO_IMAGE_MISSING_ASSEMBLYREF,
|
|
|
|
MONO_IMAGE_IMAGE_INVALID
|
|
|
|
} MonoImageOpenStatus;
|
|
|
|
|
2016-01-20 16:03:40 +01:00
|
|
|
typedef MonoAssembly* (CDECL *MonoAssemblyPreLoadFunc)(MonoAssemblyName *aname, char **assemblies_path, void *user_data);
|
2010-04-02 22:33:12 +02:00
|
|
|
|
2016-01-20 16:03:40 +01:00
|
|
|
typedef void (CDECL *MonoProfileFunc)(MonoProfiler *prof);
|
2011-02-21 21:22:02 +01:00
|
|
|
|
2016-01-20 16:03:40 +01:00
|
|
|
typedef void (CDECL *MonoPrintCallback) (const char *string, INT is_stdout);
|
2015-09-04 21:05:00 +02:00
|
|
|
|
2015-03-20 09:50:58 +01:00
|
|
|
extern BOOL is_mono_started DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
extern MonoImage* (CDECL *mono_assembly_get_image)(MonoAssembly *assembly) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoAssembly* (CDECL *mono_assembly_load_from)(MonoImage *image, const char *fname, MonoImageOpenStatus *status) DECLSPEC_HIDDEN;
|
2019-03-08 22:40:41 +01:00
|
|
|
extern const char* (CDECL *mono_assembly_name_get_name)(MonoAssemblyName *aname) DECLSPEC_HIDDEN;
|
2015-03-20 09:50:58 +01:00
|
|
|
extern MonoAssembly* (CDECL *mono_assembly_open)(const char *filename, MonoImageOpenStatus *status) DECLSPEC_HIDDEN;
|
2017-10-05 18:49:34 +02:00
|
|
|
extern void (CDECL *mono_callspec_set_assembly)(MonoAssembly *assembly) DECLSPEC_HIDDEN;
|
2015-03-20 09:50:58 +01:00
|
|
|
extern MonoClass* (CDECL *mono_class_from_mono_type)(MonoType *type) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoClass* (CDECL *mono_class_from_name)(MonoImage *image, const char* name_space, const char *name) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoMethod* (CDECL *mono_class_get_method_from_name)(MonoClass *klass, const char *name, int param_count) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoAssembly* (CDECL *mono_domain_assembly_open)(MonoDomain *domain, const char *name) DECLSPEC_HIDDEN;
|
2016-03-08 22:49:26 +01:00
|
|
|
extern MonoDomain* (CDECL *mono_domain_get)(void) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoDomain* (CDECL *mono_domain_get_by_id)(int id) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL (CDECL *mono_domain_set)(MonoDomain *domain, BOOL force) DECLSPEC_HIDDEN;
|
2016-01-12 15:36:07 +01:00
|
|
|
extern void (CDECL *mono_domain_set_config)(MonoDomain *domain,const char *base_dir,const char *config_file_name) DECLSPEC_HIDDEN;
|
2015-03-20 09:50:58 +01:00
|
|
|
extern int (CDECL *mono_jit_exec)(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]) DECLSPEC_HIDDEN;
|
2015-02-20 19:59:53 +01:00
|
|
|
extern MonoDomain* (CDECL *mono_jit_init_version)(const char *domain_name, const char *runtime_version) DECLSPEC_HIDDEN;
|
2015-03-20 09:50:58 +01:00
|
|
|
extern MonoImage* (CDECL *mono_image_open_from_module_handle)(HMODULE module_handle, char* fname, UINT has_entry_point, MonoImageOpenStatus* status) DECLSPEC_HIDDEN;
|
|
|
|
extern void* (CDECL *mono_marshal_get_vtfixup_ftnptr)(MonoImage *image, DWORD token, WORD type) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoDomain* (CDECL *mono_object_get_domain)(MonoObject *obj) DECLSPEC_HIDDEN;
|
2016-02-17 02:14:19 +01:00
|
|
|
extern MonoMethod* (CDECL *mono_object_get_virtual_method)(MonoObject *obj, MonoMethod *method) DECLSPEC_HIDDEN;
|
2015-03-20 09:50:58 +01:00
|
|
|
extern MonoObject* (CDECL *mono_object_new)(MonoDomain *domain, MonoClass *klass) DECLSPEC_HIDDEN;
|
|
|
|
extern void* (CDECL *mono_object_unbox)(MonoObject *obj) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoType* (CDECL *mono_reflection_type_from_name)(char *name, MonoImage *image) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoObject* (CDECL *mono_runtime_invoke)(MonoMethod *method, void *obj, void **params, MonoObject **exc) DECLSPEC_HIDDEN;
|
|
|
|
extern void (CDECL *mono_runtime_object_init)(MonoObject *this_obj) DECLSPEC_HIDDEN;
|
|
|
|
extern void (CDECL *mono_runtime_quit)(void) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoString* (CDECL *mono_string_new)(MonoDomain *domain, const char *str) DECLSPEC_HIDDEN;
|
|
|
|
extern MonoThread* (CDECL *mono_thread_attach)(MonoDomain *domain) DECLSPEC_HIDDEN;
|
|
|
|
extern void (CDECL *mono_thread_manage)(void) DECLSPEC_HIDDEN;
|
2015-09-04 21:05:00 +02:00
|
|
|
extern void (CDECL *mono_trace_set_print_handler)(MonoPrintCallback callback) DECLSPEC_HIDDEN;
|
|
|
|
extern void (CDECL *mono_trace_set_printerr_handler)(MonoPrintCallback callback) DECLSPEC_HIDDEN;
|
2010-09-26 22:54:13 +02:00
|
|
|
|
|
|
|
/* loaded runtime interfaces */
|
2011-05-13 17:31:09 +02:00
|
|
|
extern void expect_no_runtimes(void) DECLSPEC_HIDDEN;
|
2011-02-21 21:22:02 +01:00
|
|
|
|
2016-01-12 15:36:07 +01:00
|
|
|
extern HRESULT RuntimeHost_Construct(CLRRuntimeInfo *runtime_version, RuntimeHost** result) DECLSPEC_HIDDEN;
|
2010-09-26 22:54:13 +02:00
|
|
|
|
2013-10-24 23:01:11 +02:00
|
|
|
extern void RuntimeHost_ExitProcess(RuntimeHost *This, INT exitcode) DECLSPEC_HIDDEN;
|
|
|
|
|
2011-05-13 17:31:09 +02:00
|
|
|
extern HRESULT RuntimeHost_GetInterface(RuntimeHost *This, REFCLSID clsid, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
2010-09-26 22:54:13 +02:00
|
|
|
|
2011-05-13 17:31:09 +02:00
|
|
|
extern HRESULT RuntimeHost_GetIUnknownForObject(RuntimeHost *This, MonoObject *obj, IUnknown **ppUnk) DECLSPEC_HIDDEN;
|
2010-10-06 00:15:08 +02:00
|
|
|
|
|
|
|
extern HRESULT RuntimeHost_CreateManagedInstance(RuntimeHost *This, LPCWSTR name,
|
2011-05-13 17:31:09 +02:00
|
|
|
MonoDomain *domain, MonoObject **result) DECLSPEC_HIDDEN;
|
2010-10-06 00:15:08 +02:00
|
|
|
|
2013-10-24 23:01:11 +02:00
|
|
|
HRESULT WINAPI CLRMetaHost_ExitProcess(ICLRMetaHost* iface, INT32 iExitCode) DECLSPEC_HIDDEN;
|
|
|
|
|
2011-09-27 01:06:18 +02:00
|
|
|
HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface, LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime) DECLSPEC_HIDDEN;
|
|
|
|
|
2011-09-29 08:08:06 +02:00
|
|
|
extern HRESULT CorDebug_Create(ICLRRuntimeHost *runtimehost, IUnknown** ppUnk) DECLSPEC_HIDDEN;
|
2011-09-27 01:06:18 +02:00
|
|
|
|
2012-01-06 04:33:19 +01:00
|
|
|
extern HRESULT create_monodata(REFIID riid, LPVOID *ppObj) DECLSPEC_HIDDEN;
|
|
|
|
|
2013-06-04 21:10:27 +02:00
|
|
|
extern HRESULT get_file_from_strongname(WCHAR* stringnameW, WCHAR* assemblies_path, int path_length) DECLSPEC_HIDDEN;
|
|
|
|
|
2015-03-20 09:50:58 +01:00
|
|
|
extern void runtimehost_init(void) DECLSPEC_HIDDEN;
|
|
|
|
extern void runtimehost_uninit(void) DECLSPEC_HIDDEN;
|
2012-05-07 17:48:33 +02:00
|
|
|
|
2008-03-28 11:10:55 +01:00
|
|
|
#endif /* __MSCOREE_PRIVATE__ */
|