52 0, 0, { (
DWORD_PTR)(__FILE__
": runtime_list_cs") }
56#define NUM_ABI_VERSIONS 2
71 static const WCHAR pathW[] = {
'P',
'A',
'T',
'H',0};
76 path_env[
len++] =
';';
88 MESSAGE(
"wine: Install Mono 2.6 for Windows to run .NET 1.1 applications.\n");
89 else if (
This->major == 2)
90 MESSAGE(
"wine: Install Mono for Windows to run .NET 2.0 applications.\n");
91 else if (
This->major == 4)
92 MESSAGE(
"wine: Install Mono 2.8 or greater for Windows to run .NET 4.0 applications.\n");
97 static const WCHAR bin[] = {
'\\',
'b',
'i',
'n',0};
98 static const WCHAR lib[] = {
'\\',
'l',
'i',
'b',0};
99 static const WCHAR etc[] = {
'\\',
'e',
't',
'c',0};
100 static const WCHAR glibdll[] = {
'l',
'i',
'b',
'g',
'l',
'i',
'b',
'-',
'2',
'.',
'0',
'-',
'0',
'.',
'd',
'l',
'l',0};
105 char trace_setting[256];
115 if ((*result)->is_shutdown)
117 ERR(
"Cannot load Mono after it has been shut down.\n");
122 if (!(*result)->mono_handle)
140 if (!(*result)->mono_handle)
goto fail;
142#define LOAD_MONO_FUNCTION(x) do { \
143 (*result)->x = (void*)GetProcAddress((*result)->mono_handle, #x); \
144 if (!(*result)->x) { \
177 if (
This->mono_abi_version == 1)
180 if (!(*result)->glib_handle)
goto fail;
182 (*result)->mono_free = (
void*)
GetProcAddress((*result)->glib_handle,
"g_free");
183 if (!(*result)->mono_free)
goto fail;
190#undef LOAD_MONO_FUNCTION
192#define LOAD_OPT_VOID_MONO_FUNCTION(x) do { \
193 (*result)->x = (void*)GetProcAddress((*result)->mono_handle, #x); \
194 if (!(*result)->x) { \
195 (*result)->x = do_nothing; \
204#undef LOAD_OPT_VOID_MONO_FUNCTION
208 (*result)->mono_set_dirs(mono_lib_path_a, mono_etc_path_a);
210 (*result)->mono_config_parse(
NULL);
218 (*result)->mono_jit_set_trace_options(trace_setting);
225 ERR(
"Could not load Mono into this process\n");
228 (*result)->mono_handle =
NULL;
229 (*result)->glib_handle =
NULL;
245 if (
This->loaded_runtime)
276 mono->mono_threads_set_shutting_down();
277 mono->mono_runtime_set_shutting_down();
278 mono->mono_thread_pool_cleanup();
279 mono->mono_thread_suspend_all_other_threads();
280 mono->mono_runtime_quit();
298 ERR(
"Process exited with a Mono runtime loaded.\n");
326 ICLRRuntimeInfo_AddRef( iface );
350 TRACE(
"%p %p %p\n", iface, pwzBuffer, pcchBuffer);
371 const WCHAR dotnet_key[] = {
'S',
'O',
'F',
'T',
'W',
'A',
'R',
'E',
'\\',
'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
'\\',
'.',
'N',
'E',
'T',
'F',
'r',
'a',
'm',
'e',
'w',
'o',
'r',
'k',
'\\',0};
372 const WCHAR install_root[] = {
'I',
'n',
's',
't',
'a',
'l',
'l',
'R',
'o',
'o',
't',0};
394 static const WCHAR slash[] = {
'\\',0};
401 TRACE(
"%p %p %p\n", iface, pwzBuffer, pcchBuffer);
405 ERR(
"error reading registry key for installroot\n");
411 ICLRRuntimeInfo_GetVersionString(iface,
version, &version_size);
422 strcpyW(pwzBuffer, system_dir);
433 FIXME(
"%p %p %p\n", iface, hndProcess, pbLoaded);
441 FIXME(
"%p %u %p %p %x\n", iface, iResourceID, pwzBuffer, pcchBuffer, iLocaleid);
490 FIXME(
"%p %p\n", iface, pbLoadable);
498 FIXME(
"%p %x %s\n", iface, dwStartupFlags,
debugstr_w(pwzHostConfigFile));
504 DWORD *pdwStartupFlags,
LPWSTR pwzHostConfigFile,
DWORD *pcchHostConfigFile)
506 FIXME(
"%p %p %p %p\n", iface, pdwStartupFlags, pwzHostConfigFile, pcchHostConfigFile);
513 FIXME(
"%p\n", iface);
521 FIXME(
"%p %p %p\n", iface, pbStarted, pdwStartupFlags);
554static const WCHAR libmono2_arch_dll[] = {
'\\',
'b',
'i',
'n',
'\\',
'l',
'i',
'b',
'm',
'o',
'n',
'o',
'-',
'2',
'.',
'0',
'-',
'x',
'8',
'6',
'.',
'd',
'l',
'l',0};
555#elif defined(__x86_64__)
556static const WCHAR libmono2_arch_dll[] = {
'\\',
'b',
'i',
'n',
'\\',
'l',
'i',
'b',
'm',
'o',
'n',
'o',
'-',
'2',
'.',
'0',
'-',
'x',
'8',
'6',
'_',
'6',
'4',
'.',
'd',
'l',
'l',0};
558static const WCHAR libmono2_arch_dll[] = {
'\\',
'b',
'i',
'n',
'\\',
'l',
'i',
'b',
'm',
'o',
'n',
'o',
'-',
'2',
'.',
'0',
'.',
'd',
'l',
'l',0};
563 static const WCHAR mono_dll[] = {
'\\',
'b',
'i',
'n',
'\\',
'm',
'o',
'n',
'o',
'.',
'd',
'l',
'l',0};
564 static const WCHAR libmono_dll[] = {
'\\',
'b',
'i',
'n',
'\\',
'l',
'i',
'b',
'm',
'o',
'n',
'o',
'.',
'd',
'l',
'l',0};
565 static const WCHAR mono2_dll[] = {
'\\',
'b',
'i',
'n',
'\\',
'm',
'o',
'n',
'o',
'-',
'2',
'.',
'0',
'.',
'd',
'l',
'l',0};
566 static const WCHAR libmono2_dll[] = {
'\\',
'b',
'i',
'n',
'\\',
'l',
'i',
'b',
'm',
'o',
'n',
'o',
'-',
'2',
'.',
'0',
'.',
'd',
'l',
'l',0};
569 if (abi_version == 1)
578 strcatW(dll_path, libmono_dll);
582 else if (abi_version == 2)
598 strcatW(dll_path, libmono2_dll);
608 static const WCHAR mono_key[] = {
'S',
'o',
'f',
't',
'w',
'a',
'r',
'e',
'\\',
'N',
'o',
'v',
'e',
'l',
'l',
'\\',
'M',
'o',
'n',
'o',0};
609 static const WCHAR defaul_clr[] = {
'D',
'e',
'f',
'a',
'u',
'l',
't',
'C',
'L',
'R',0};
610 static const WCHAR install_root[] = {
'S',
'd',
'k',
'I',
'n',
's',
't',
'a',
'l',
'l',
'R',
'o',
'o',
't',0};
611 static const WCHAR slash[] = {
'\\',0};
649 static const WCHAR mono_one_dot_zero[] = {
'\\',
'm',
'o',
'n',
'o',
'-',
'1',
'.',
'0', 0};
650 static const WCHAR mono_two_dot_zero[] = {
'\\',
'm',
'o',
'n',
'o',
'-',
'2',
'.',
'0', 0};
656 if (abi_version == 1)
658 else if (abi_version == 2)
668 static const WCHAR subdir_mono[] = {
'\\',
'm',
'o',
'n',
'o',0};
669 static const WCHAR sibling_mono[] = {
'\\',
'.',
'.',
'\\',
'm',
'o',
'n',
'o',0};
671 const char *unix_data_dir;
678 strcatW(base_path, subdir_mono);
703 strcpyW(base_path, dos_data_dir);
721 static const WCHAR libmono[] = {
'\\',
'l',
'i',
'b',
'\\',
'm',
'o',
'n',
'o',
'\\',0};
722 static const WCHAR mscorlib[] = {
'\\',
'm',
's',
'c',
'o',
'r',
'l',
'i',
'b',
'.',
'd',
'l',
'l',0};
748 runtimes[
i].mono_abi_version = abi_version;
753 any_runtimes_found =
TRUE;
759 if (!any_runtimes_found)
803 IEnumUnknown_AddRef( iface );
813 TRACE(
"(%p) refcount=%u\n", iface,
ref);
823 TRACE(
"(%p) refcount=%u\n", iface,
ref);
841 TRACE(
"(%p,%u,%p,%p)\n", iface, celt, rgelt, pceltFetched);
843 while (num_fetched < celt)
853 IUnknown_AddRef(
item);
854 rgelt[num_fetched] =
item;
861 *pceltFetched = num_fetched;
872 TRACE(
"(%p,%u)\n", iface, celt);
874 while (num_fetched < celt)
895 TRACE(
"(%p)\n", iface);
907 TRACE(
"(%p)\n", iface);
956 ICLRMetaHost_AddRef( iface );
1002 *build = *build * 10 + (*
version++ -
'0');
1035 return ICLRRuntimeInfo_QueryInterface(&
runtimes[
i].ICLRRuntimeInfo_iface, iid,
1089 TRACE(
"%p\n", ppEnumerator);
1109 FIXME(
"%p %p\n", hndProcess, ppEnumerator);
1117 FIXME(
"%p\n", pCallbackFunction);
1132 FIXME(
"%i: stub\n", iExitCode);
1165 char *stringname=
NULL;
1167 int stringnameW_size;
1173 static WCHAR fusiondll[] = {
'f',
'u',
's',
'i',
'o',
'n',0};
1181 if (!stringname)
return NULL;
1185 if (!pCreateAssemblyCache)
1191 pCreateAssemblyCache = (
void*)
GetProcAddress(hfusion,
"CreateAssemblyCache");
1192 if (!pCreateAssemblyCache)
1198 hr = pCreateAssemblyCache(&asmcache, 0);
1212 info.cbAssemblyInfo =
sizeof(
info);
1213 info.pszCurrentAssemblyPathBuf =
path;
1217 hr = IAssemblyCache_QueryAssemblyInfo(asmcache, 0, stringnameW, &
info);
1222 IAssemblyCache_Release(asmcache);
1242 mono->mono_free(stringname);
1250 static const WCHAR dotconfig[] = {
'.',
'c',
'o',
'n',
'f',
'i',
'g',0};
1251 static const DWORD supported_startup_flags = 0;
1260 if (startup_flags & ~supported_startup_flags)
1261 FIXME(
"unsupported startup flags %x\n", startup_flags & ~supported_startup_flags);
1263 if (runtimeinfo_flags & ~supported_runtime_flags)
1264 FIXME(
"unsupported runtimeinfo flags %x\n", runtimeinfo_flags & ~supported_runtime_flags);
1266 if (exefile && !config_file)
1268 strcpyW(local_config_file, exefile);
1269 strcatW(local_config_file, dotconfig);
1271 config_file = local_config_file;
1294 WARN(
"failed to parse config file %s, hr=%x\n",
debugstr_w(config_file),
hr);
1345 return ICLRRuntimeInfo_QueryInterface(&
runtimes[
i].ICLRRuntimeInfo_iface,
1346 &IID_ICLRRuntimeInfo, (
void **)
result);
#define InterlockedIncrement
#define InterlockedDecrement
#define RegCloseKey(hKey)
#define CLR_E_SHIM_RUNTIME
HRESULT RuntimeHost_GetInterface(RuntimeHost *This, REFCLSID clsid, REFIID riid, void **ppv)
HRESULT RuntimeHost_Destroy(RuntimeHost *This)
HRESULT RuntimeHost_Construct(const CLRRuntimeInfo *runtime_version, loaded_mono *loaded_mono, RuntimeHost **result)
#define ERROR_INSUFFICIENT_BUFFER
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define GetEnvironmentVariableW(x, y, z)
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
#define wine_get_dos_file_name(__x)
#define WideCharToMultiByte
#define GetEnvironmentVariableA(x, y, z)
#define MultiByteToWideChar
static const WCHAR version[]
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableW(IN LPCWSTR lpName, IN LPCWSTR lpValue)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
VOID WINAPI ExitProcess(IN UINT uExitCode)
HRESULT parse_config_file(LPCWSTR filename, parsed_config_file *result)
void free_parsed_config_file(parsed_config_file *file)
HRESULT assembly_release(ASSEMBLY *assembly)
HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version)
HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
const char * wine_get_build_dir(void)
const char * wine_get_data_dir(void)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
static struct _PeImage bin
@ RUNTIME_INFO_UPGRADE_VERSION
char * WtoA(LPCWSTR wstr)
HRESULT WINAPI LoadLibraryShim(LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll)
struct _MonoProfiler MonoProfiler
struct _MonoAssemblyName MonoAssemblyName
struct _MonoAssembly MonoAssembly
const GUID IID_IEnumUnknown
#define IsEqualGUID(rguid1, rguid2)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
WCHAR mscorlib_path[MAX_PATH]
struct RuntimeHost * loaded_runtime
WCHAR mono_path[MAX_PATH]
ICLRRuntimeInfo ICLRRuntimeInfo_iface
IEnumUnknown IEnumUnknown_iface
LIST_ENTRY ProcessLocksList
char *CDECL * mono_stringify_assembly_name(MonoAssemblyName *aname)
MonoAssembly *CDECL * mono_assembly_open(const char *filename, MonoImageOpenStatus *status)
struct list supported_runtimes
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
void build_tree(deflate_state *s, tree_desc *desc)
#define CONTAINING_RECORD(address, type, field)
#define INVALID_FILE_ATTRIBUTES
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define HRESULT_FROM_WIN32(x)
#define HKEY_LOCAL_MACHINE