ReactOS 0.4.15-dev-8241-g63935f8
metahost.c File Reference
#include "mscoree_private.h"
#include <stdio.h>
#include <assert.h>
#include <wine/library.h>
#include <fusion.h>
Include dependency graph for metahost.c:

Go to the source code of this file.

Classes

struct  InstalledRuntimeEnum
 
struct  CLRMetaHost
 

Macros

#define NUM_RUNTIMES   3
 
#define NUM_ABI_VERSIONS   2
 
#define LOAD_MONO_FUNCTION(x)
 
#define LOAD_OPT_VOID_MONO_FUNCTION(x)
 

Functions

static BOOL find_mono_dll (LPCWSTR path, LPWSTR dll_path, int abi_version)
 
static MonoAssemblymono_assembly_search_hook_fn (MonoAssemblyName *aname, char **assemblies_path, void *user_data)
 
static void mono_shutdown_callback_fn (MonoProfiler *prof)
 
static void set_environment (LPCWSTR bin_path)
 
static void CDECL do_nothing (void)
 
static void missing_runtime_message (const CLRRuntimeInfo *This)
 
static HRESULT load_mono (CLRRuntimeInfo *This, loaded_mono **result)
 
static HRESULT CLRRuntimeInfo_GetRuntimeHost (CLRRuntimeInfo *This, RuntimeHost **result)
 
void unload_all_runtimes (void)
 
void expect_no_runtimes (void)
 
static CLRRuntimeInfoimpl_from_ICLRRuntimeInfo (ICLRRuntimeInfo *iface)
 
static HRESULT WINAPI CLRRuntimeInfo_QueryInterface (ICLRRuntimeInfo *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI CLRRuntimeInfo_AddRef (ICLRRuntimeInfo *iface)
 
static ULONG WINAPI CLRRuntimeInfo_Release (ICLRRuntimeInfo *iface)
 
static HRESULT WINAPI CLRRuntimeInfo_GetVersionString (ICLRRuntimeInfo *iface, LPWSTR pwzBuffer, DWORD *pcchBuffer)
 
static BOOL get_install_root (LPWSTR install_dir)
 
static HRESULT WINAPI CLRRuntimeInfo_GetRuntimeDirectory (ICLRRuntimeInfo *iface, LPWSTR pwzBuffer, DWORD *pcchBuffer)
 
static HRESULT WINAPI CLRRuntimeInfo_IsLoaded (ICLRRuntimeInfo *iface, HANDLE hndProcess, BOOL *pbLoaded)
 
static HRESULT WINAPI CLRRuntimeInfo_LoadErrorString (ICLRRuntimeInfo *iface, UINT iResourceID, LPWSTR pwzBuffer, DWORD *pcchBuffer, LONG iLocaleid)
 
static HRESULT WINAPI CLRRuntimeInfo_LoadLibrary (ICLRRuntimeInfo *iface, LPCWSTR pwzDllName, HMODULE *phndModule)
 
static HRESULT WINAPI CLRRuntimeInfo_GetProcAddress (ICLRRuntimeInfo *iface, LPCSTR pszProcName, LPVOID *ppProc)
 
static HRESULT WINAPI CLRRuntimeInfo_GetInterface (ICLRRuntimeInfo *iface, REFCLSID rclsid, REFIID riid, LPVOID *ppUnk)
 
static HRESULT WINAPI CLRRuntimeInfo_IsLoadable (ICLRRuntimeInfo *iface, BOOL *pbLoadable)
 
static HRESULT WINAPI CLRRuntimeInfo_SetDefaultStartupFlags (ICLRRuntimeInfo *iface, DWORD dwStartupFlags, LPCWSTR pwzHostConfigFile)
 
static HRESULT WINAPI CLRRuntimeInfo_GetDefaultStartupFlags (ICLRRuntimeInfo *iface, DWORD *pdwStartupFlags, LPWSTR pwzHostConfigFile, DWORD *pcchHostConfigFile)
 
static HRESULT WINAPI CLRRuntimeInfo_BindAsLegacyV2Runtime (ICLRRuntimeInfo *iface)
 
static HRESULT WINAPI CLRRuntimeInfo_IsStarted (ICLRRuntimeInfo *iface, BOOL *pbStarted, DWORD *pdwStartupFlags)
 
HRESULT ICLRRuntimeInfo_GetRuntimeHost (ICLRRuntimeInfo *iface, RuntimeHost **result)
 
static BOOL get_mono_path_from_registry (LPWSTR path, int abi_version)
 
static BOOL get_mono_path_from_folder (LPCWSTR folder, LPWSTR mono_path, int abi_version)
 
static BOOL get_mono_path (LPWSTR path, int abi_version)
 
static void find_runtimes (void)
 
static struct InstalledRuntimeEnumimpl_from_IEnumUnknown (IEnumUnknown *iface)
 
static HRESULT WINAPI InstalledRuntimeEnum_QueryInterface (IEnumUnknown *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI InstalledRuntimeEnum_AddRef (IEnumUnknown *iface)
 
static ULONG WINAPI InstalledRuntimeEnum_Release (IEnumUnknown *iface)
 
static HRESULT WINAPI InstalledRuntimeEnum_Next (IEnumUnknown *iface, ULONG celt, IUnknown **rgelt, ULONG *pceltFetched)
 
static HRESULT WINAPI InstalledRuntimeEnum_Skip (IEnumUnknown *iface, ULONG celt)
 
static HRESULT WINAPI InstalledRuntimeEnum_Reset (IEnumUnknown *iface)
 
static HRESULT WINAPI InstalledRuntimeEnum_Clone (IEnumUnknown *iface, IEnumUnknown **ppenum)
 
static HRESULT WINAPI CLRMetaHost_QueryInterface (ICLRMetaHost *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI CLRMetaHost_AddRef (ICLRMetaHost *iface)
 
static ULONG WINAPI CLRMetaHost_Release (ICLRMetaHost *iface)
 
static BOOL parse_runtime_version (LPCWSTR version, DWORD *major, DWORD *minor, DWORD *build)
 
HRESULT WINAPI CLRMetaHost_GetRuntime (ICLRMetaHost *iface, LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime)
 
HRESULT WINAPI CLRMetaHost_GetVersionFromFile (ICLRMetaHost *iface, LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer)
 
static HRESULT WINAPI CLRMetaHost_EnumerateInstalledRuntimes (ICLRMetaHost *iface, IEnumUnknown **ppEnumerator)
 
static HRESULT WINAPI CLRMetaHost_EnumerateLoadedRuntimes (ICLRMetaHost *iface, HANDLE hndProcess, IEnumUnknown **ppEnumerator)
 
static HRESULT WINAPI CLRMetaHost_RequestRuntimeLoadedNotification (ICLRMetaHost *iface, RuntimeLoadedCallbackFnPtr pCallbackFunction)
 
static HRESULT WINAPI CLRMetaHost_QueryLegacyV2RuntimeBinding (ICLRMetaHost *iface, REFIID riid, LPVOID *ppUnk)
 
static HRESULT WINAPI CLRMetaHost_ExitProcess (ICLRMetaHost *iface, INT32 iExitCode)
 
HRESULT CLRMetaHost_CreateInstance (REFIID riid, void **ppobj)
 
HRESULT get_runtime_info (LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file, DWORD startup_flags, DWORD runtimeinfo_flags, BOOL legacy, ICLRRuntimeInfo **result)
 

Variables

static const WCHAR net_11_subdir [] = {'1','.','0',0}
 
static const WCHAR net_20_subdir [] = {'2','.','0',0}
 
static const WCHAR net_40_subdir [] = {'4','.','0',0}
 
static const struct ICLRRuntimeInfoVtbl CLRRuntimeInfoVtbl
 
static struct CLRRuntimeInfo runtimes [NUM_RUNTIMES]
 
static int runtimes_initialized
 
static CRITICAL_SECTION runtime_list_cs = { &runtime_list_cs_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG runtime_list_cs_debug
 
static loaded_mono loaded_monos [NUM_ABI_VERSIONS]
 
static const WCHAR libmono2_arch_dll [] = {'\\','b','i','n','\\','l','i','b','m','o','n','o','-','2','.','0','.','d','l','l',0}
 
static const struct IEnumUnknownVtbl InstalledRuntimeEnum_Vtbl
 
static struct CLRMetaHost GlobalCLRMetaHost
 
static const struct ICLRMetaHostVtbl CLRMetaHost_vtbl
 

Macro Definition Documentation

◆ LOAD_MONO_FUNCTION

#define LOAD_MONO_FUNCTION (   x)
Value:
do { \
(*result)->x = (void*)GetProcAddress((*result)->mono_handle, #x); \
if (!(*result)->x) { \
goto fail; \
} \
} while (0);
#define GetProcAddress(x, y)
Definition: compat.h:753
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

◆ LOAD_OPT_VOID_MONO_FUNCTION

#define LOAD_OPT_VOID_MONO_FUNCTION (   x)
Value:
do { \
(*result)->x = (void*)GetProcAddress((*result)->mono_handle, #x); \
if (!(*result)->x) { \
(*result)->x = do_nothing; \
} \
} while (0);
static void CDECL do_nothing(void)
Definition: metahost.c:81

◆ NUM_ABI_VERSIONS

#define NUM_ABI_VERSIONS   2

Definition at line 56 of file metahost.c.

◆ NUM_RUNTIMES

#define NUM_RUNTIMES   3

Definition at line 36 of file metahost.c.

Function Documentation

◆ CLRMetaHost_AddRef()

static ULONG WINAPI CLRMetaHost_AddRef ( ICLRMetaHost iface)
static

Definition at line 961 of file metahost.c.

962{
963 return 2;
964}

◆ CLRMetaHost_CreateInstance()

HRESULT CLRMetaHost_CreateInstance ( REFIID  riid,
void **  ppobj 
)

Definition at line 1155 of file metahost.c.

1156{
1157 return ICLRMetaHost_QueryInterface(&GlobalCLRMetaHost.ICLRMetaHost_iface, riid, ppobj);
1158}
static struct CLRMetaHost GlobalCLRMetaHost
Definition: metahost.c:937
REFIID riid
Definition: atlbase.h:39

Referenced by CLRCreateInstance().

◆ CLRMetaHost_EnumerateInstalledRuntimes()

static HRESULT WINAPI CLRMetaHost_EnumerateInstalledRuntimes ( ICLRMetaHost iface,
IEnumUnknown **  ppEnumerator 
)
static

Definition at line 1084 of file metahost.c.

1086{
1087 struct InstalledRuntimeEnum *new_enum;
1088
1089 TRACE("%p\n", ppEnumerator);
1090
1091 find_runtimes();
1092
1093 new_enum = HeapAlloc(GetProcessHeap(), 0, sizeof(*new_enum));
1094 if (!new_enum)
1095 return E_OUTOFMEMORY;
1096
1098 new_enum->ref = 1;
1099 new_enum->pos = 0;
1100
1101 *ppEnumerator = &new_enum->IEnumUnknown_iface;
1102
1103 return S_OK;
1104}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
static const struct IEnumUnknownVtbl InstalledRuntimeEnum_Vtbl
Definition: metahost.c:780
static void find_runtimes(void)
Definition: metahost.c:718
#define S_OK
Definition: intsafe.h:52
#define TRACE(s)
Definition: solgame.cpp:4
IEnumUnknown IEnumUnknown_iface
Definition: metahost.c:775

◆ CLRMetaHost_EnumerateLoadedRuntimes()

static HRESULT WINAPI CLRMetaHost_EnumerateLoadedRuntimes ( ICLRMetaHost iface,
HANDLE  hndProcess,
IEnumUnknown **  ppEnumerator 
)
static

Definition at line 1106 of file metahost.c.

1108{
1109 FIXME("%p %p\n", hndProcess, ppEnumerator);
1110
1111 return E_NOTIMPL;
1112}
#define FIXME(fmt,...)
Definition: debug.h:114
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CLRMetaHost_ExitProcess()

static HRESULT WINAPI CLRMetaHost_ExitProcess ( ICLRMetaHost iface,
INT32  iExitCode 
)
static

Definition at line 1130 of file metahost.c.

1131{
1132 FIXME("%i: stub\n", iExitCode);
1133
1134 ExitProcess(iExitCode);
1135}
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487

◆ CLRMetaHost_GetRuntime()

HRESULT WINAPI CLRMetaHost_GetRuntime ( ICLRMetaHost iface,
LPCWSTR  pwzVersion,
REFIID  iid,
LPVOID ppRuntime 
)

Definition at line 1010 of file metahost.c.

1012{
1013 int i;
1014 DWORD major, minor, build;
1015
1016 TRACE("%s %s %p\n", debugstr_w(pwzVersion), debugstr_guid(iid), ppRuntime);
1017
1018 if (!pwzVersion)
1019 return E_POINTER;
1020
1021 if (!parse_runtime_version(pwzVersion, &major, &minor, &build))
1022 {
1023 ERR("Cannot parse %s\n", debugstr_w(pwzVersion));
1024 return CLR_E_SHIM_RUNTIME;
1025 }
1026
1027 find_runtimes();
1028
1029 for (i=0; i<NUM_RUNTIMES; i++)
1030 {
1031 if (runtimes[i].major == major && runtimes[i].minor == minor &&
1032 runtimes[i].build == build)
1033 {
1034 if (runtimes[i].mono_abi_version)
1035 return ICLRRuntimeInfo_QueryInterface(&runtimes[i].ICLRRuntimeInfo_iface, iid,
1036 ppRuntime);
1037 else
1038 {
1040 return CLR_E_SHIM_RUNTIME;
1041 }
1042 }
1043 }
1044
1045 FIXME("Unrecognized version %s\n", debugstr_w(pwzVersion));
1046 return CLR_E_SHIM_RUNTIME;
1047}
#define ERR(fmt,...)
Definition: debug.h:113
#define CLR_E_SHIM_RUNTIME
Definition: corerror.h:127
static struct CLRRuntimeInfo runtimes[NUM_RUNTIMES]
Definition: metahost.c:38
static BOOL parse_runtime_version(LPCWSTR version, DWORD *major, DWORD *minor, DWORD *build)
Definition: metahost.c:971
#define NUM_RUNTIMES
Definition: metahost.c:36
static void missing_runtime_message(const CLRRuntimeInfo *This)
Definition: metahost.c:85
unsigned long DWORD
Definition: ntddk_ex.h:95
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
Definition: glfuncs.h:248
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
#define E_POINTER
Definition: winerror.h:2365

Referenced by CreateDebuggingInterfaceFromVersion(), and get_runtime_info().

◆ CLRMetaHost_GetVersionFromFile()

HRESULT WINAPI CLRMetaHost_GetVersionFromFile ( ICLRMetaHost iface,
LPCWSTR  pwzFilePath,
LPWSTR  pwzBuffer,
DWORD pcchBuffer 
)

Definition at line 1049 of file metahost.c.

1051{
1053 HRESULT hr;
1054 LPSTR version;
1055 ULONG buffer_size=*pcchBuffer;
1056
1057 TRACE("%s %p %p\n", debugstr_w(pwzFilePath), pwzBuffer, pcchBuffer);
1058
1059 hr = assembly_create(&assembly, pwzFilePath);
1060
1061 if (SUCCEEDED(hr))
1062 {
1064
1065 if (SUCCEEDED(hr))
1066 {
1067 *pcchBuffer = MultiByteToWideChar(CP_UTF8, 0, version, -1, NULL, 0);
1068
1069 if (pwzBuffer)
1070 {
1071 if (buffer_size >= *pcchBuffer)
1072 MultiByteToWideChar(CP_UTF8, 0, version, -1, pwzBuffer, buffer_size);
1073 else
1075 }
1076 }
1077
1079 }
1080
1081 return hr;
1082}
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
static const WCHAR version[]
Definition: asmname.c:66
HRESULT assembly_release(ASSEMBLY *assembly)
Definition: assembly.c:694
HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version)
Definition: assembly.c:865
HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file)
Definition: assembly.c:641
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define CP_UTF8
Definition: nls.h:20
HRESULT hr
Definition: shlfolder.c:183
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
Definition: swimpl.c:888
uint32_t ULONG
Definition: typedefs.h:59
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
char * LPSTR
Definition: xmlstorage.h:182

Referenced by get_runtime_info(), and GetFileVersion().

◆ CLRMetaHost_QueryInterface()

static HRESULT WINAPI CLRMetaHost_QueryInterface ( ICLRMetaHost iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 939 of file metahost.c.

942{
943 TRACE("%s %p\n", debugstr_guid(riid), ppvObject);
944
945 if ( IsEqualGUID( riid, &IID_ICLRMetaHost ) ||
947 {
948 *ppvObject = iface;
949 }
950 else
951 {
952 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
953 return E_NOINTERFACE;
954 }
955
956 ICLRMetaHost_AddRef( iface );
957
958 return S_OK;
959}
const GUID IID_IUnknown
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ CLRMetaHost_QueryLegacyV2RuntimeBinding()

static HRESULT WINAPI CLRMetaHost_QueryLegacyV2RuntimeBinding ( ICLRMetaHost iface,
REFIID  riid,
LPVOID ppUnk 
)
static

Definition at line 1122 of file metahost.c.

1124{
1125 FIXME("%s %p\n", debugstr_guid(riid), ppUnk);
1126
1127 return E_NOTIMPL;
1128}

◆ CLRMetaHost_Release()

static ULONG WINAPI CLRMetaHost_Release ( ICLRMetaHost iface)
static

Definition at line 966 of file metahost.c.

967{
968 return 1;
969}

◆ CLRMetaHost_RequestRuntimeLoadedNotification()

static HRESULT WINAPI CLRMetaHost_RequestRuntimeLoadedNotification ( ICLRMetaHost iface,
RuntimeLoadedCallbackFnPtr  pCallbackFunction 
)
static

Definition at line 1114 of file metahost.c.

1116{
1117 FIXME("%p\n", pCallbackFunction);
1118
1119 return E_NOTIMPL;
1120}

◆ CLRRuntimeInfo_AddRef()

static ULONG WINAPI CLRRuntimeInfo_AddRef ( ICLRRuntimeInfo iface)
static

Definition at line 331 of file metahost.c.

332{
333 return 2;
334}

◆ CLRRuntimeInfo_BindAsLegacyV2Runtime()

static HRESULT WINAPI CLRRuntimeInfo_BindAsLegacyV2Runtime ( ICLRRuntimeInfo iface)
static

Definition at line 511 of file metahost.c.

512{
513 FIXME("%p\n", iface);
514
515 return E_NOTIMPL;
516}

◆ CLRRuntimeInfo_GetDefaultStartupFlags()

static HRESULT WINAPI CLRRuntimeInfo_GetDefaultStartupFlags ( ICLRRuntimeInfo iface,
DWORD pdwStartupFlags,
LPWSTR  pwzHostConfigFile,
DWORD pcchHostConfigFile 
)
static

Definition at line 503 of file metahost.c.

505{
506 FIXME("%p %p %p %p\n", iface, pdwStartupFlags, pwzHostConfigFile, pcchHostConfigFile);
507
508 return E_NOTIMPL;
509}

◆ CLRRuntimeInfo_GetInterface()

static HRESULT WINAPI CLRRuntimeInfo_GetInterface ( ICLRRuntimeInfo iface,
REFCLSID  rclsid,
REFIID  riid,
LPVOID ppUnk 
)
static

Definition at line 470 of file metahost.c.

472{
475 HRESULT hr;
476
477 TRACE("%p %s %s %p\n", iface, debugstr_guid(rclsid), debugstr_guid(riid), ppUnk);
478
480
481 if (SUCCEEDED(hr))
482 hr = RuntimeHost_GetInterface(host, rclsid, riid, ppUnk);
483
484 return hr;
485}
HRESULT RuntimeHost_GetInterface(RuntimeHost *This, REFCLSID clsid, REFIID riid, void **ppv)
static HRESULT CLRRuntimeInfo_GetRuntimeHost(CLRRuntimeInfo *This, RuntimeHost **result)
Definition: metahost.c:240
static CLRRuntimeInfo * impl_from_ICLRRuntimeInfo(ICLRRuntimeInfo *iface)
Definition: metahost.c:304
char * host
Definition: whois.c:55

◆ CLRRuntimeInfo_GetProcAddress()

static HRESULT WINAPI CLRRuntimeInfo_GetProcAddress ( ICLRRuntimeInfo iface,
LPCSTR  pszProcName,
LPVOID ppProc 
)
static

Definition at line 462 of file metahost.c.

464{
465 FIXME("%p %s %p\n", iface, debugstr_a(pszProcName), ppProc);
466
467 return E_NOTIMPL;
468}
#define debugstr_a
Definition: kernel32.h:31

◆ CLRRuntimeInfo_GetRuntimeDirectory()

static HRESULT WINAPI CLRRuntimeInfo_GetRuntimeDirectory ( ICLRRuntimeInfo iface,
LPWSTR  pwzBuffer,
DWORD pcchBuffer 
)
static

Definition at line 391 of file metahost.c.

393{
394 static const WCHAR slash[] = {'\\',0};
395 DWORD buffer_size = *pcchBuffer;
396 WCHAR system_dir[MAX_PATH];
398 DWORD version_size, size;
399 HRESULT hr = S_OK;
400
401 TRACE("%p %p %p\n", iface, pwzBuffer, pcchBuffer);
402
403 if (!get_install_root(system_dir))
404 {
405 ERR("error reading registry key for installroot\n");
406 return E_FAIL;
407 }
408 else
409 {
410 version_size = MAX_PATH;
411 ICLRRuntimeInfo_GetVersionString(iface, version, &version_size);
412 lstrcatW(system_dir, version);
413 lstrcatW(system_dir, slash);
414 size = lstrlenW(system_dir) + 1;
415 }
416
417 *pcchBuffer = size;
418
419 if (pwzBuffer)
420 {
421 if (buffer_size >= size)
422 strcpyW(pwzBuffer, system_dir);
423 else
425 }
426
427 return hr;
428}
#define E_FAIL
Definition: ddrawi.h:102
#define MAX_PATH
Definition: compat.h:34
#define lstrlenW
Definition: compat.h:750
static BOOL get_install_root(LPWSTR install_dir)
Definition: metahost.c:369
GLsizeiptr size
Definition: glext.h:5919
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define strcpyW(d, s)
Definition: unicode.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ CLRRuntimeInfo_GetRuntimeHost()

static HRESULT CLRRuntimeInfo_GetRuntimeHost ( CLRRuntimeInfo This,
RuntimeHost **  result 
)
static

Definition at line 240 of file metahost.c.

241{
242 HRESULT hr = S_OK;
243 loaded_mono *ploaded_mono;
244
245 if (This->loaded_runtime)
246 {
247 *result = This->loaded_runtime;
248 return hr;
249 }
250
252
253 hr = load_mono(This, &ploaded_mono);
254
255 if (SUCCEEDED(hr))
256 hr = RuntimeHost_Construct(This, ploaded_mono, &This->loaded_runtime);
257
259
260 if (SUCCEEDED(hr))
261 *result = This->loaded_runtime;
262
263 return hr;
264}
HRESULT RuntimeHost_Construct(const CLRRuntimeInfo *runtime_version, loaded_mono *loaded_mono, RuntimeHost **result)
static HRESULT load_mono(CLRRuntimeInfo *This, loaded_mono **result)
Definition: metahost.c:95
static CRITICAL_SECTION runtime_list_cs
Definition: metahost.c:46
GLuint64EXT * result
Definition: glext.h:11304
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by CLRRuntimeInfo_GetInterface(), and ICLRRuntimeInfo_GetRuntimeHost().

◆ CLRRuntimeInfo_GetVersionString()

static HRESULT WINAPI CLRRuntimeInfo_GetVersionString ( ICLRRuntimeInfo iface,
LPWSTR  pwzBuffer,
DWORD pcchBuffer 
)
static

Definition at line 341 of file metahost.c.

343{
345 DWORD buffer_size = *pcchBuffer;
346 HRESULT hr = S_OK;
347 char version[11];
348 DWORD size;
349
350 TRACE("%p %p %p\n", iface, pwzBuffer, pcchBuffer);
351
352 size = snprintf(version, sizeof(version), "v%u.%u.%u", This->major, This->minor, This->build);
353
354 assert(size <= sizeof(version));
355
356 *pcchBuffer = MultiByteToWideChar(CP_UTF8, 0, version, -1, NULL, 0);
357
358 if (pwzBuffer)
359 {
360 if (buffer_size >= *pcchBuffer)
361 MultiByteToWideChar(CP_UTF8, 0, version, -1, pwzBuffer, buffer_size);
362 else
364 }
365
366 return hr;
367}
#define assert(x)
Definition: debug.h:53
#define snprintf
Definition: wintirpc.h:48

◆ CLRRuntimeInfo_IsLoadable()

static HRESULT WINAPI CLRRuntimeInfo_IsLoadable ( ICLRRuntimeInfo iface,
BOOL pbLoadable 
)
static

Definition at line 487 of file metahost.c.

489{
490 FIXME("%p %p\n", iface, pbLoadable);
491
492 return E_NOTIMPL;
493}

◆ CLRRuntimeInfo_IsLoaded()

static HRESULT WINAPI CLRRuntimeInfo_IsLoaded ( ICLRRuntimeInfo iface,
HANDLE  hndProcess,
BOOL pbLoaded 
)
static

Definition at line 430 of file metahost.c.

432{
433 FIXME("%p %p %p\n", iface, hndProcess, pbLoaded);
434
435 return E_NOTIMPL;
436}

◆ CLRRuntimeInfo_IsStarted()

static HRESULT WINAPI CLRRuntimeInfo_IsStarted ( ICLRRuntimeInfo iface,
BOOL pbStarted,
DWORD pdwStartupFlags 
)
static

Definition at line 518 of file metahost.c.

520{
521 FIXME("%p %p %p\n", iface, pbStarted, pdwStartupFlags);
522
523 return E_NOTIMPL;
524}

◆ CLRRuntimeInfo_LoadErrorString()

static HRESULT WINAPI CLRRuntimeInfo_LoadErrorString ( ICLRRuntimeInfo iface,
UINT  iResourceID,
LPWSTR  pwzBuffer,
DWORD pcchBuffer,
LONG  iLocaleid 
)
static

Definition at line 438 of file metahost.c.

440{
441 FIXME("%p %u %p %p %x\n", iface, iResourceID, pwzBuffer, pcchBuffer, iLocaleid);
442
443 return E_NOTIMPL;
444}

◆ CLRRuntimeInfo_LoadLibrary()

static HRESULT WINAPI CLRRuntimeInfo_LoadLibrary ( ICLRRuntimeInfo iface,
LPCWSTR  pwzDllName,
HMODULE phndModule 
)
static

Definition at line 446 of file metahost.c.

448{
450 HRESULT hr;
452
453 TRACE("%p %s %p\n", iface, debugstr_w(pwzDllName), phndModule);
454
456 hr = ICLRRuntimeInfo_GetVersionString(iface, version, &cchBuffer);
457 if (FAILED(hr)) return hr;
458
459 return LoadLibraryShim(pwzDllName, version, NULL, phndModule);
460}
static DWORD cchBuffer
Definition: fusion.c:85
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT WINAPI LoadLibraryShim(LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll)
Definition: mscoree_main.c:351

◆ CLRRuntimeInfo_QueryInterface()

static HRESULT WINAPI CLRRuntimeInfo_QueryInterface ( ICLRRuntimeInfo iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 309 of file metahost.c.

312{
313 TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
314
315 if ( IsEqualGUID( riid, &IID_ICLRRuntimeInfo ) ||
317 {
318 *ppvObject = iface;
319 }
320 else
321 {
322 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
323 return E_NOINTERFACE;
324 }
325
326 ICLRRuntimeInfo_AddRef( iface );
327
328 return S_OK;
329}

◆ CLRRuntimeInfo_Release()

static ULONG WINAPI CLRRuntimeInfo_Release ( ICLRRuntimeInfo iface)
static

Definition at line 336 of file metahost.c.

337{
338 return 1;
339}

◆ CLRRuntimeInfo_SetDefaultStartupFlags()

static HRESULT WINAPI CLRRuntimeInfo_SetDefaultStartupFlags ( ICLRRuntimeInfo iface,
DWORD  dwStartupFlags,
LPCWSTR  pwzHostConfigFile 
)
static

Definition at line 495 of file metahost.c.

497{
498 FIXME("%p %x %s\n", iface, dwStartupFlags, debugstr_w(pwzHostConfigFile));
499
500 return E_NOTIMPL;
501}

◆ do_nothing()

static void CDECL do_nothing ( void  )
static

Definition at line 81 of file metahost.c.

82{
83}

◆ expect_no_runtimes()

void expect_no_runtimes ( void  )

Definition at line 289 of file metahost.c.

290{
291 int i;
292
293 for (i=0; i<NUM_ABI_VERSIONS; i++)
294 {
295 loaded_mono *mono = &loaded_monos[i];
296 if (mono->mono_handle && mono->is_started && !mono->is_shutdown)
297 {
298 ERR("Process exited with a Mono runtime loaded.\n");
299 return;
300 }
301 }
302}
static loaded_mono loaded_monos[NUM_ABI_VERSIONS]
Definition: metahost.c:58
#define NUM_ABI_VERSIONS
Definition: metahost.c:56
HMODULE mono_handle

Referenced by DllMain().

◆ find_mono_dll()

static BOOL find_mono_dll ( LPCWSTR  path,
LPWSTR  dll_path,
int  abi_version 
)
static

Definition at line 561 of file metahost.c.

562{
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};
568
569 if (abi_version == 1)
570 {
571 strcpyW(dll_path, path);
572 strcatW(dll_path, mono_dll);
573 attributes = GetFileAttributesW(dll_path);
574
575 if (attributes == INVALID_FILE_ATTRIBUTES)
576 {
577 strcpyW(dll_path, path);
578 strcatW(dll_path, libmono_dll);
579 attributes = GetFileAttributesW(dll_path);
580 }
581 }
582 else if (abi_version == 2)
583 {
584 strcpyW(dll_path, path);
585 strcatW(dll_path, libmono2_arch_dll);
586 attributes = GetFileAttributesW(dll_path);
587
588 if (attributes == INVALID_FILE_ATTRIBUTES)
589 {
590 strcpyW(dll_path, path);
591 strcatW(dll_path, mono2_dll);
592 attributes = GetFileAttributesW(dll_path);
593 }
594
595 if (attributes == INVALID_FILE_ATTRIBUTES)
596 {
597 strcpyW(dll_path, path);
598 strcatW(dll_path, libmono2_dll);
599 attributes = GetFileAttributesW(dll_path);
600 }
601 }
602
603 return (attributes != INVALID_FILE_ATTRIBUTES);
604}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
static const WCHAR libmono2_arch_dll[]
Definition: metahost.c:558
#define strcatW(d, s)
Definition: unicode.h:36
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by get_mono_path_from_folder(), get_mono_path_from_registry(), and load_mono().

◆ find_runtimes()

static void find_runtimes ( void  )
static

Definition at line 718 of file metahost.c.

719{
720 int abi_version, i;
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};
723 WCHAR mono_path[MAX_PATH], lib_path[MAX_PATH];
724 BOOL any_runtimes_found = FALSE;
725
726 if (runtimes_initialized) return;
727
729
730 if (runtimes_initialized) goto end;
731
732 for (abi_version=NUM_ABI_VERSIONS; abi_version>0; abi_version--)
733 {
734 if (!get_mono_path(mono_path, abi_version))
735 continue;
736
737 for (i=0; i<NUM_RUNTIMES; i++)
738 {
739 if (runtimes[i].mono_abi_version == 0)
740 {
741 strcpyW(lib_path, mono_path);
742 strcatW(lib_path, libmono);
743 strcatW(lib_path, runtimes[i].mono_libdir);
744 strcatW(lib_path, mscorlib);
745
747 {
748 runtimes[i].mono_abi_version = abi_version;
749
750 strcpyW(runtimes[i].mono_path, mono_path);
751 strcpyW(runtimes[i].mscorlib_path, lib_path);
752
753 any_runtimes_found = TRUE;
754 }
755 }
756 }
757 }
758
759 if (!any_runtimes_found)
760 {
761 /* Report all runtimes are available if Mono isn't installed.
762 * FIXME: Remove this when Mono is properly packaged. */
763 for (i=0; i<NUM_RUNTIMES; i++)
764 runtimes[i].mono_abi_version = -1;
765 }
766
768
769end:
771}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static BOOL get_mono_path(LPWSTR path, int abi_version)
Definition: metahost.c:666
static int runtimes_initialized
Definition: metahost.c:44
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint GLuint end
Definition: gl.h:1545

Referenced by CLRMetaHost_EnumerateInstalledRuntimes(), CLRMetaHost_GetRuntime(), and get_runtime_info().

◆ get_install_root()

static BOOL get_install_root ( LPWSTR  install_dir)
static

Definition at line 369 of file metahost.c.

370{
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};
373
374 DWORD len;
375 HKEY key;
376
377 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key))
378 return FALSE;
379
380 len = MAX_PATH * sizeof(WCHAR);
381 if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len))
382 {
384 return FALSE;
385 }
387
388 return TRUE;
389}
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
GLenum GLsizei len
Definition: glext.h:6722
#define KEY_READ
Definition: nt_native.h:1023
Definition: copy.c:22
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CLRRuntimeInfo_GetRuntimeDirectory().

◆ get_mono_path()

static BOOL get_mono_path ( LPWSTR  path,
int  abi_version 
)
static

Definition at line 666 of file metahost.c.

667{
668 static const WCHAR subdir_mono[] = {'\\','m','o','n','o',0};
669 static const WCHAR sibling_mono[] = {'\\','.','.','\\','m','o','n','o',0};
670 WCHAR base_path[MAX_PATH];
671 const char *unix_data_dir;
672 WCHAR *dos_data_dir;
673 int build_tree=0;
674 static WCHAR* (CDECL *wine_get_dos_file_name)(const char*);
675
676 /* First try c:\windows\mono */
677 GetWindowsDirectoryW(base_path, MAX_PATH);
678 strcatW(base_path, subdir_mono);
679
680 if (get_mono_path_from_folder(base_path, path, abi_version))
681 return TRUE;
682
683 /* Next: /usr/share/wine/mono */
684 unix_data_dir = wine_get_data_dir();
685
686 if (!unix_data_dir)
687 {
688 unix_data_dir = wine_get_build_dir();
689 build_tree = 1;
690 }
691
692 if (unix_data_dir)
693 {
695 wine_get_dos_file_name = (void*)GetProcAddress(GetModuleHandleA("kernel32"), "wine_get_dos_file_name");
696
698 {
699 dos_data_dir = wine_get_dos_file_name(unix_data_dir);
700
701 if (dos_data_dir)
702 {
703 strcpyW(base_path, dos_data_dir);
704 strcatW(base_path, build_tree ? sibling_mono : subdir_mono);
705
706 HeapFree(GetProcessHeap(), 0, dos_data_dir);
707
708 if (get_mono_path_from_folder(base_path, path, abi_version))
709 return TRUE;
710 }
711 }
712 }
713
714 /* Last: the registry */
715 return get_mono_path_from_registry(path, abi_version);
716}
#define CDECL
Definition: compat.h:29
#define HeapFree(x, y, z)
Definition: compat.h:735
#define wine_get_dos_file_name(__x)
Definition: compat.h:61
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
static BOOL get_mono_path_from_folder(LPCWSTR folder, LPWSTR mono_path, int abi_version)
Definition: metahost.c:647
static BOOL get_mono_path_from_registry(LPWSTR path, int abi_version)
Definition: metahost.c:606
const char * wine_get_build_dir(void)
Definition: config.c:30
const char * wine_get_data_dir(void)
Definition: config.c:24
void build_tree(deflate_state *s, tree_desc *desc)
Definition: trees.c:615

Referenced by find_runtimes().

◆ get_mono_path_from_folder()

static BOOL get_mono_path_from_folder ( LPCWSTR  folder,
LPWSTR  mono_path,
int  abi_version 
)
static

Definition at line 647 of file metahost.c.

648{
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};
651 WCHAR mono_dll_path[MAX_PATH];
652 BOOL found = FALSE;
653
654 strcpyW(mono_path, folder);
655
656 if (abi_version == 1)
657 strcatW(mono_path, mono_one_dot_zero);
658 else if (abi_version == 2)
659 strcatW(mono_path, mono_two_dot_zero);
660
661 found = find_mono_dll(mono_path, mono_dll_path, abi_version);
662
663 return found;
664}
static BOOL find_mono_dll(LPCWSTR path, LPWSTR dll_path, int abi_version)
Definition: metahost.c:561
Definition: fci.c:116

Referenced by get_mono_path().

◆ get_mono_path_from_registry()

static BOOL get_mono_path_from_registry ( LPWSTR  path,
int  abi_version 
)
static

Definition at line 606 of file metahost.c.

607{
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};
612
613 WCHAR version[64], version_key[MAX_PATH];
614 DWORD len;
615 HKEY key;
616 WCHAR dll_path[MAX_PATH];
617
618 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, mono_key, 0, KEY_READ, &key))
619 return FALSE;
620
621 len = sizeof(version);
622 if (RegQueryValueExW(key, defaul_clr, 0, NULL, (LPBYTE)version, &len))
623 {
625 return FALSE;
626 }
628
629 lstrcpyW(version_key, mono_key);
630 lstrcatW(version_key, slash);
631 lstrcatW(version_key, version);
632
633 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, version_key, 0, KEY_READ, &key))
634 return FALSE;
635
636 len = sizeof(WCHAR) * MAX_PATH;
637 if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)path, &len))
638 {
640 return FALSE;
641 }
643
644 return find_mono_dll(path, dll_path, abi_version);
645}
#define lstrcpyW
Definition: compat.h:749

Referenced by get_mono_path().

◆ get_runtime_info()

HRESULT get_runtime_info ( LPCWSTR  exefile,
LPCWSTR  version,
LPCWSTR  config_file,
DWORD  startup_flags,
DWORD  runtimeinfo_flags,
BOOL  legacy,
ICLRRuntimeInfo **  result 
)

Definition at line 1247 of file metahost.c.

1249{
1250 static const WCHAR dotconfig[] = {'.','c','o','n','f','i','g',0};
1251 static const DWORD supported_startup_flags = 0;
1252 static const DWORD supported_runtime_flags = RUNTIME_INFO_UPGRADE_VERSION;
1253 int i;
1254 WCHAR local_version[MAX_PATH];
1255 ULONG local_version_size = MAX_PATH;
1256 WCHAR local_config_file[MAX_PATH];
1257 HRESULT hr;
1258 parsed_config_file parsed_config;
1259
1260 if (startup_flags & ~supported_startup_flags)
1261 FIXME("unsupported startup flags %x\n", startup_flags & ~supported_startup_flags);
1262
1263 if (runtimeinfo_flags & ~supported_runtime_flags)
1264 FIXME("unsupported runtimeinfo flags %x\n", runtimeinfo_flags & ~supported_runtime_flags);
1265
1266 if (exefile && !config_file)
1267 {
1268 strcpyW(local_config_file, exefile);
1269 strcatW(local_config_file, dotconfig);
1270
1271 config_file = local_config_file;
1272 }
1273
1274 if (config_file)
1275 {
1276 int found=0;
1277 hr = parse_config_file(config_file, &parsed_config);
1278
1279 if (SUCCEEDED(hr))
1280 {
1283 {
1284 hr = CLRMetaHost_GetRuntime(0, entry->version, &IID_ICLRRuntimeInfo, (void**)result);
1285 if (SUCCEEDED(hr))
1286 {
1287 found = 1;
1288 break;
1289 }
1290 }
1291 }
1292 else
1293 {
1294 WARN("failed to parse config file %s, hr=%x\n", debugstr_w(config_file), hr);
1295 }
1296
1297 free_parsed_config_file(&parsed_config);
1298
1299 if (found)
1300 return S_OK;
1301 }
1302
1303 if (exefile && !version)
1304 {
1305 hr = CLRMetaHost_GetVersionFromFile(0, exefile, local_version, &local_version_size);
1306
1307 version = local_version;
1308
1309 if (FAILED(hr)) return hr;
1310 }
1311
1312 if (version)
1313 {
1314 hr = CLRMetaHost_GetRuntime(0, version, &IID_ICLRRuntimeInfo, (void**)result);
1315 if(SUCCEEDED(hr))
1316 return hr;
1317 }
1318
1319 if (runtimeinfo_flags & RUNTIME_INFO_UPGRADE_VERSION)
1320 {
1321 DWORD major, minor, build;
1322
1323 if (version && !parse_runtime_version(version, &major, &minor, &build))
1324 {
1325 ERR("Cannot parse %s\n", debugstr_w(version));
1326 return CLR_E_SHIM_RUNTIME;
1327 }
1328
1329 find_runtimes();
1330
1331 if (legacy)
1332 i = 2;
1333 else
1334 i = NUM_RUNTIMES;
1335
1336 while (i--)
1337 {
1338 if (runtimes[i].mono_abi_version)
1339 {
1340 /* Must be greater or equal to the version passed in. */
1341 if (!version || ((runtimes[i].major >= major && runtimes[i].minor >= minor && runtimes[i].build >= build) ||
1342 (runtimes[i].major >= major && runtimes[i].minor > minor) ||
1343 (runtimes[i].major > major)))
1344 {
1345 return ICLRRuntimeInfo_QueryInterface(&runtimes[i].ICLRRuntimeInfo_iface,
1346 &IID_ICLRRuntimeInfo, (void **)result);
1347 }
1348 }
1349 }
1350
1351 if (legacy)
1353 else
1355
1356 return CLR_E_SHIM_RUNTIME;
1357 }
1358
1359 return CLR_E_SHIM_RUNTIME;
1360}
#define WARN(fmt,...)
Definition: debug.h:115
HRESULT parse_config_file(LPCWSTR filename, parsed_config_file *result)
Definition: config.c:419
void free_parsed_config_file(parsed_config_file *file)
Definition: config.c:448
HRESULT WINAPI CLRMetaHost_GetVersionFromFile(ICLRMetaHost *iface, LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer)
Definition: metahost.c:1049
HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost *iface, LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime)
Definition: metahost.c:1010
uint32_t entry
Definition: isohybrid.c:63
BOOL legacy
Definition: mkisofs.c:131
@ RUNTIME_INFO_UPGRADE_VERSION
Definition: mscoree.idl:40
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
struct list supported_runtimes

Referenced by _CorExeMain(), ClrCreateManagedInstance(), CorBindToRuntimeEx(), CorBindToRuntimeHost(), create_monodata(), GetCORSystemDirectory(), GetCORVersion(), GetRequestedRuntimeInfo(), and ReallyFixupVTable().

◆ ICLRRuntimeInfo_GetRuntimeHost()

HRESULT ICLRRuntimeInfo_GetRuntimeHost ( ICLRRuntimeInfo iface,
RuntimeHost **  result 
)

Definition at line 544 of file metahost.c.

545{
547
548 assert(This->ICLRRuntimeInfo_iface.lpVtbl == &CLRRuntimeInfoVtbl);
549
551}
static const struct ICLRRuntimeInfoVtbl CLRRuntimeInfoVtbl
Definition: metahost.c:34

Referenced by _CorExeMain(), ClrCreateManagedInstance(), create_monodata(), and ReallyFixupVTable().

◆ impl_from_ICLRRuntimeInfo()

static CLRRuntimeInfo * impl_from_ICLRRuntimeInfo ( ICLRRuntimeInfo iface)
inlinestatic

Definition at line 304 of file metahost.c.

305{
306 return CONTAINING_RECORD(iface, CLRRuntimeInfo, ICLRRuntimeInfo_iface);
307}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by CLRRuntimeInfo_GetInterface(), CLRRuntimeInfo_GetVersionString(), and ICLRRuntimeInfo_GetRuntimeHost().

◆ impl_from_IEnumUnknown()

static struct InstalledRuntimeEnum * impl_from_IEnumUnknown ( IEnumUnknown iface)
inlinestatic

◆ InstalledRuntimeEnum_AddRef()

static ULONG WINAPI InstalledRuntimeEnum_AddRef ( IEnumUnknown iface)
static

Definition at line 808 of file metahost.c.

809{
812
813 TRACE("(%p) refcount=%u\n", iface, ref);
814
815 return ref;
816}
#define InterlockedIncrement
Definition: armddk.h:53
static struct InstalledRuntimeEnum * impl_from_IEnumUnknown(IEnumUnknown *iface)
Definition: metahost.c:782
Definition: send.c:48

◆ InstalledRuntimeEnum_Clone()

static HRESULT WINAPI InstalledRuntimeEnum_Clone ( IEnumUnknown iface,
IEnumUnknown **  ppenum 
)
static

Definition at line 902 of file metahost.c.

903{
905 struct InstalledRuntimeEnum *new_enum;
906
907 TRACE("(%p)\n", iface);
908
909 new_enum = HeapAlloc(GetProcessHeap(), 0, sizeof(*new_enum));
910 if (!new_enum)
911 return E_OUTOFMEMORY;
912
914 new_enum->ref = 1;
915 new_enum->pos = This->pos;
916
917 *ppenum = &new_enum->IEnumUnknown_iface;
918
919 return S_OK;
920}

◆ InstalledRuntimeEnum_Next()

static HRESULT WINAPI InstalledRuntimeEnum_Next ( IEnumUnknown iface,
ULONG  celt,
IUnknown **  rgelt,
ULONG pceltFetched 
)
static

Definition at line 833 of file metahost.c.

835{
837 int num_fetched = 0;
839 IUnknown *item;
840
841 TRACE("(%p,%u,%p,%p)\n", iface, celt, rgelt, pceltFetched);
842
843 while (num_fetched < celt)
844 {
845 if (This->pos >= NUM_RUNTIMES)
846 {
847 hr = S_FALSE;
848 break;
849 }
850 if (runtimes[This->pos].mono_abi_version)
851 {
852 item = (IUnknown*)&runtimes[This->pos].ICLRRuntimeInfo_iface;
853 IUnknown_AddRef(item);
854 rgelt[num_fetched] = item;
855 num_fetched++;
856 }
857 This->pos++;
858 }
859
860 if (pceltFetched)
861 *pceltFetched = num_fetched;
862
863 return hr;
864}
static ATOM item
Definition: dde.c:856
#define S_FALSE
Definition: winerror.h:2357

◆ InstalledRuntimeEnum_QueryInterface()

static HRESULT WINAPI InstalledRuntimeEnum_QueryInterface ( IEnumUnknown iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 787 of file metahost.c.

789{
790 TRACE("%p %s %p\n", iface, debugstr_guid(riid), ppvObject);
791
794 {
795 *ppvObject = iface;
796 }
797 else
798 {
799 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
800 return E_NOINTERFACE;
801 }
802
803 IEnumUnknown_AddRef( iface );
804
805 return S_OK;
806}
const GUID IID_IEnumUnknown

◆ InstalledRuntimeEnum_Release()

static ULONG WINAPI InstalledRuntimeEnum_Release ( IEnumUnknown iface)
static

Definition at line 818 of file metahost.c.

819{
822
823 TRACE("(%p) refcount=%u\n", iface, ref);
824
825 if (ref == 0)
826 {
828 }
829
830 return ref;
831}
#define InterlockedDecrement
Definition: armddk.h:52

◆ InstalledRuntimeEnum_Reset()

static HRESULT WINAPI InstalledRuntimeEnum_Reset ( IEnumUnknown iface)
static

Definition at line 891 of file metahost.c.

892{
894
895 TRACE("(%p)\n", iface);
896
897 This->pos = 0;
898
899 return S_OK;
900}

◆ InstalledRuntimeEnum_Skip()

static HRESULT WINAPI InstalledRuntimeEnum_Skip ( IEnumUnknown iface,
ULONG  celt 
)
static

Definition at line 866 of file metahost.c.

867{
869 int num_fetched = 0;
871
872 TRACE("(%p,%u)\n", iface, celt);
873
874 while (num_fetched < celt)
875 {
876 if (This->pos >= NUM_RUNTIMES)
877 {
878 hr = S_FALSE;
879 break;
880 }
881 if (runtimes[This->pos].mono_abi_version)
882 {
883 num_fetched++;
884 }
885 This->pos++;
886 }
887
888 return hr;
889}

◆ load_mono()

static HRESULT load_mono ( CLRRuntimeInfo This,
loaded_mono **  result 
)
static

Definition at line 95 of file metahost.c.

96{
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};
101 WCHAR mono_dll_path[MAX_PATH+16], mono_bin_path[MAX_PATH+4];
102 WCHAR mono_lib_path[MAX_PATH+4], mono_etc_path[MAX_PATH+4];
103 char mono_lib_path_a[MAX_PATH], mono_etc_path_a[MAX_PATH];
104 int trace_size;
105 char trace_setting[256];
106
107 if (This->mono_abi_version <= 0 || This->mono_abi_version > NUM_ABI_VERSIONS)
108 {
110 return E_FAIL;
111 }
112
113 *result = &loaded_monos[This->mono_abi_version-1];
114
115 if ((*result)->is_shutdown)
116 {
117 ERR("Cannot load Mono after it has been shut down.\n");
118 *result = NULL;
119 return E_FAIL;
120 }
121
122 if (!(*result)->mono_handle)
123 {
124 strcpyW(mono_bin_path, This->mono_path);
125 strcatW(mono_bin_path, bin);
126 set_environment(mono_bin_path);
127
128 strcpyW(mono_lib_path, This->mono_path);
129 strcatW(mono_lib_path, lib);
130 WideCharToMultiByte(CP_UTF8, 0, mono_lib_path, -1, mono_lib_path_a, MAX_PATH, NULL, NULL);
131
132 strcpyW(mono_etc_path, This->mono_path);
133 strcatW(mono_etc_path, etc);
134 WideCharToMultiByte(CP_UTF8, 0, mono_etc_path, -1, mono_etc_path_a, MAX_PATH, NULL, NULL);
135
136 if (!find_mono_dll(This->mono_path, mono_dll_path, This->mono_abi_version)) goto fail;
137
138 (*result)->mono_handle = LoadLibraryW(mono_dll_path);
139
140 if (!(*result)->mono_handle) goto fail;
141
142#define LOAD_MONO_FUNCTION(x) do { \
143 (*result)->x = (void*)GetProcAddress((*result)->mono_handle, #x); \
144 if (!(*result)->x) { \
145 goto fail; \
146 } \
147} while (0);
148
149 LOAD_MONO_FUNCTION(mono_assembly_get_image);
150 LOAD_MONO_FUNCTION(mono_assembly_load_from);
151 LOAD_MONO_FUNCTION(mono_assembly_open);
152 LOAD_MONO_FUNCTION(mono_config_parse);
153 LOAD_MONO_FUNCTION(mono_class_from_mono_type);
154 LOAD_MONO_FUNCTION(mono_class_from_name);
155 LOAD_MONO_FUNCTION(mono_class_get_method_from_name);
156 LOAD_MONO_FUNCTION(mono_domain_assembly_open);
157 LOAD_MONO_FUNCTION(mono_image_open_from_module_handle);
158 LOAD_MONO_FUNCTION(mono_install_assembly_preload_hook);
159 LOAD_MONO_FUNCTION(mono_jit_exec);
160 LOAD_MONO_FUNCTION(mono_jit_init);
161 LOAD_MONO_FUNCTION(mono_jit_set_trace_options);
162 LOAD_MONO_FUNCTION(mono_marshal_get_vtfixup_ftnptr);
163 LOAD_MONO_FUNCTION(mono_object_get_domain);
164 LOAD_MONO_FUNCTION(mono_object_new);
165 LOAD_MONO_FUNCTION(mono_object_unbox);
166 LOAD_MONO_FUNCTION(mono_profiler_install);
167 LOAD_MONO_FUNCTION(mono_reflection_type_from_name);
168 LOAD_MONO_FUNCTION(mono_runtime_invoke);
169 LOAD_MONO_FUNCTION(mono_runtime_object_init);
170 LOAD_MONO_FUNCTION(mono_runtime_quit);
171 LOAD_MONO_FUNCTION(mono_set_dirs);
172 LOAD_MONO_FUNCTION(mono_stringify_assembly_name);
173 LOAD_MONO_FUNCTION(mono_string_new);
174 LOAD_MONO_FUNCTION(mono_thread_attach);
175
176 /* GLib imports obsoleted by the 2.0 ABI */
177 if (This->mono_abi_version == 1)
178 {
179 (*result)->glib_handle = LoadLibraryW(glibdll);
180 if (!(*result)->glib_handle) goto fail;
181
182 (*result)->mono_free = (void*)GetProcAddress((*result)->glib_handle, "g_free");
183 if (!(*result)->mono_free) goto fail;
184 }
185 else
186 {
187 LOAD_MONO_FUNCTION(mono_free);
188 }
189
190#undef LOAD_MONO_FUNCTION
191
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; \
196 } \
197} while (0);
198
199 LOAD_OPT_VOID_MONO_FUNCTION(mono_runtime_set_shutting_down);
200 LOAD_OPT_VOID_MONO_FUNCTION(mono_thread_pool_cleanup);
201 LOAD_OPT_VOID_MONO_FUNCTION(mono_thread_suspend_all_other_threads);
202 LOAD_OPT_VOID_MONO_FUNCTION(mono_threads_set_shutting_down);
203
204#undef LOAD_OPT_VOID_MONO_FUNCTION
205
206 (*result)->mono_profiler_install((MonoProfiler*)*result, mono_shutdown_callback_fn);
207
208 (*result)->mono_set_dirs(mono_lib_path_a, mono_etc_path_a);
209
210 (*result)->mono_config_parse(NULL);
211
212 (*result)->mono_install_assembly_preload_hook(mono_assembly_search_hook_fn, *result);
213
214 trace_size = GetEnvironmentVariableA("WINE_MONO_TRACE", trace_setting, sizeof(trace_setting));
215
216 if (trace_size)
217 {
218 (*result)->mono_jit_set_trace_options(trace_setting);
219 }
220 }
221
222 return S_OK;
223
224fail:
225 ERR("Could not load Mono into this process\n");
226 FreeLibrary((*result)->mono_handle);
227 FreeLibrary((*result)->glib_handle);
228 (*result)->mono_handle = NULL;
229 (*result)->glib_handle = NULL;
230 return E_FAIL;
231}
#define FreeLibrary(x)
Definition: compat.h:748
#define WideCharToMultiByte
Definition: compat.h:111
#define GetEnvironmentVariableA(x, y, z)
Definition: compat.h:754
#define LoadLibraryW(x)
Definition: compat.h:747
static void mono_shutdown_callback_fn(MonoProfiler *prof)
Definition: metahost.c:233
#define LOAD_OPT_VOID_MONO_FUNCTION(x)
static MonoAssembly * mono_assembly_search_hook_fn(MonoAssemblyName *aname, char **assemblies_path, void *user_data)
Definition: metahost.c:1160
#define LOAD_MONO_FUNCTION(x)
static void set_environment(LPCWSTR bin_path)
Definition: metahost.c:66
static struct _PeImage bin
struct _MonoProfiler MonoProfiler

Referenced by CLRRuntimeInfo_GetRuntimeHost().

◆ missing_runtime_message()

static void missing_runtime_message ( const CLRRuntimeInfo This)
static

Definition at line 85 of file metahost.c.

86{
87 if (This->major == 1)
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");
93}
#define MESSAGE
Definition: options.h:86

Referenced by CLRMetaHost_GetRuntime(), get_runtime_info(), and load_mono().

◆ mono_assembly_search_hook_fn()

static MonoAssembly * mono_assembly_search_hook_fn ( MonoAssemblyName aname,
char **  assemblies_path,
void user_data 
)
static

Definition at line 1160 of file metahost.c.

1161{
1162 loaded_mono *mono = user_data;
1163 HRESULT hr=S_OK;
1165 char *stringname=NULL;
1166 LPWSTR stringnameW;
1167 int stringnameW_size;
1168 IAssemblyCache *asmcache;
1171 char *pathA;
1173 static WCHAR fusiondll[] = {'f','u','s','i','o','n',0};
1174 HMODULE hfusion=NULL;
1175 static HRESULT (WINAPI *pCreateAssemblyCache)(IAssemblyCache**,DWORD);
1176
1177 stringname = mono->mono_stringify_assembly_name(aname);
1178
1179 TRACE("%s\n", debugstr_a(stringname));
1180
1181 if (!stringname) return NULL;
1182
1183 /* FIXME: We should search the given paths before the GAC. */
1184
1185 if (!pCreateAssemblyCache)
1186 {
1187 hr = LoadLibraryShim(fusiondll, NULL, NULL, &hfusion);
1188
1189 if (SUCCEEDED(hr))
1190 {
1191 pCreateAssemblyCache = (void*)GetProcAddress(hfusion, "CreateAssemblyCache");
1192 if (!pCreateAssemblyCache)
1193 hr = E_FAIL;
1194 }
1195 }
1196
1197 if (SUCCEEDED(hr))
1198 hr = pCreateAssemblyCache(&asmcache, 0);
1199
1200 if (SUCCEEDED(hr))
1201 {
1202 stringnameW_size = MultiByteToWideChar(CP_UTF8, 0, stringname, -1, NULL, 0);
1203
1204 stringnameW = HeapAlloc(GetProcessHeap(), 0, stringnameW_size * sizeof(WCHAR));
1205 if (stringnameW)
1206 MultiByteToWideChar(CP_UTF8, 0, stringname, -1, stringnameW, stringnameW_size);
1207 else
1208 hr = E_OUTOFMEMORY;
1209
1210 if (SUCCEEDED(hr))
1211 {
1212 info.cbAssemblyInfo = sizeof(info);
1213 info.pszCurrentAssemblyPathBuf = path;
1214 info.cchBuf = MAX_PATH;
1215 path[0] = 0;
1216
1217 hr = IAssemblyCache_QueryAssemblyInfo(asmcache, 0, stringnameW, &info);
1218 }
1219
1220 HeapFree(GetProcessHeap(), 0, stringnameW);
1221
1222 IAssemblyCache_Release(asmcache);
1223 }
1224
1225 if (SUCCEEDED(hr))
1226 {
1227 TRACE("found: %s\n", debugstr_w(path));
1228
1229 pathA = WtoA(path);
1230
1231 if (pathA)
1232 {
1234
1235 if (!result)
1236 ERR("Failed to load %s, status=%u\n", debugstr_w(path), stat);
1237
1239 }
1240 }
1241
1242 mono->mono_free(stringname);
1243
1244 return result;
1245}
#define stat
Definition: acwin.h:99
GLuint pathA
Definition: glext.h:11719
char * WtoA(LPCWSTR wstr)
Definition: mscoree_main.c:30
struct _MonoAssembly MonoAssembly
MonoImageOpenStatus
#define DWORD
Definition: nt_native.h:44
char *CDECL * mono_stringify_assembly_name(MonoAssemblyName *aname)
MonoAssembly *CDECL * mono_assembly_open(const char *filename, MonoImageOpenStatus *status)
Definition: stat.h:55
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by load_mono().

◆ mono_shutdown_callback_fn()

static void mono_shutdown_callback_fn ( MonoProfiler prof)
static

Definition at line 233 of file metahost.c.

234{
235 loaded_mono *mono = (loaded_mono*)prof;
236
237 mono->is_shutdown = TRUE;
238}

Referenced by load_mono().

◆ parse_runtime_version()

static BOOL parse_runtime_version ( LPCWSTR  version,
DWORD major,
DWORD minor,
DWORD build 
)
static

Definition at line 971 of file metahost.c.

972{
973 *major = 0;
974 *minor = 0;
975 *build = 0;
976
977 if (version[0] == 'v' || version[0] == 'V')
978 {
979 version++;
980 if (!isdigit(*version))
981 return FALSE;
982
983 while (isdigit(*version))
984 *major = *major * 10 + (*version++ - '0');
985
986 if (*version == 0)
987 return TRUE;
988
989 if (*version++ != '.' || !isdigit(*version))
990 return FALSE;
991
992 while (isdigit(*version))
993 *minor = *minor * 10 + (*version++ - '0');
994
995 if (*version == 0)
996 return TRUE;
997
998 if (*version++ != '.' || !isdigit(*version))
999 return FALSE;
1000
1001 while (isdigit(*version))
1002 *build = *build * 10 + (*version++ - '0');
1003
1004 return *version == 0;
1005 }
1006 else
1007 return FALSE;
1008}
#define isdigit(c)
Definition: acclib.h:68

Referenced by CLRMetaHost_GetRuntime(), and get_runtime_info().

◆ set_environment()

static void set_environment ( LPCWSTR  bin_path)
static

Definition at line 66 of file metahost.c.

67{
68 WCHAR path_env[MAX_PATH];
69 int len;
70
71 static const WCHAR pathW[] = {'P','A','T','H',0};
72
73 /* We have to modify PATH as Mono loads other DLLs from this directory. */
74 GetEnvironmentVariableW(pathW, path_env, sizeof(path_env)/sizeof(WCHAR));
75 len = strlenW(path_env);
76 path_env[len++] = ';';
77 strcpyW(path_env+len, bin_path);
78 SetEnvironmentVariableW(pathW, path_env);
79}
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableW(IN LPCWSTR lpName, IN LPCWSTR lpValue)
Definition: environ.c:259
#define strlenW(s)
Definition: unicode.h:34

Referenced by load_mono().

◆ unload_all_runtimes()

void unload_all_runtimes ( void  )

Definition at line 266 of file metahost.c.

267{
268 int i;
269
270 for (i=0; i<NUM_ABI_VERSIONS; i++)
271 {
272 loaded_mono *mono = &loaded_monos[i];
273 if (mono->mono_handle && mono->is_started && !mono->is_shutdown)
274 {
275 /* Copied from Mono's ves_icall_System_Environment_Exit */
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();
281 }
282 }
283
284 for (i=0; i<NUM_RUNTIMES; i++)
285 if (runtimes[i].loaded_runtime)
286 RuntimeHost_Destroy(runtimes[i].loaded_runtime);
287}
HRESULT RuntimeHost_Destroy(RuntimeHost *This)

Referenced by _CorExeMain(), and CorExitProcess().

Variable Documentation

◆ CLRMetaHost_vtbl

const struct ICLRMetaHostVtbl CLRMetaHost_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI CLRMetaHost_EnumerateInstalledRuntimes(ICLRMetaHost *iface, IEnumUnknown **ppEnumerator)
Definition: metahost.c:1084
static HRESULT WINAPI CLRMetaHost_QueryInterface(ICLRMetaHost *iface, REFIID riid, void **ppvObject)
Definition: metahost.c:939
static HRESULT WINAPI CLRMetaHost_QueryLegacyV2RuntimeBinding(ICLRMetaHost *iface, REFIID riid, LPVOID *ppUnk)
Definition: metahost.c:1122
static ULONG WINAPI CLRMetaHost_Release(ICLRMetaHost *iface)
Definition: metahost.c:966
static HRESULT WINAPI CLRMetaHost_RequestRuntimeLoadedNotification(ICLRMetaHost *iface, RuntimeLoadedCallbackFnPtr pCallbackFunction)
Definition: metahost.c:1114
static HRESULT WINAPI CLRMetaHost_EnumerateLoadedRuntimes(ICLRMetaHost *iface, HANDLE hndProcess, IEnumUnknown **ppEnumerator)
Definition: metahost.c:1106
static HRESULT WINAPI CLRMetaHost_ExitProcess(ICLRMetaHost *iface, INT32 iExitCode)
Definition: metahost.c:1130
static ULONG WINAPI CLRMetaHost_AddRef(ICLRMetaHost *iface)
Definition: metahost.c:961

Definition at line 1137 of file metahost.c.

◆ CLRRuntimeInfoVtbl

static const struct ICLRRuntimeInfoVtbl CLRRuntimeInfoVtbl
static
Initial value:
= {
}
static HRESULT WINAPI CLRRuntimeInfo_LoadLibrary(ICLRRuntimeInfo *iface, LPCWSTR pwzDllName, HMODULE *phndModule)
Definition: metahost.c:446
static HRESULT WINAPI CLRRuntimeInfo_IsStarted(ICLRRuntimeInfo *iface, BOOL *pbStarted, DWORD *pdwStartupFlags)
Definition: metahost.c:518
static HRESULT WINAPI CLRRuntimeInfo_GetInterface(ICLRRuntimeInfo *iface, REFCLSID rclsid, REFIID riid, LPVOID *ppUnk)
Definition: metahost.c:470
static HRESULT WINAPI CLRRuntimeInfo_GetRuntimeDirectory(ICLRRuntimeInfo *iface, LPWSTR pwzBuffer, DWORD *pcchBuffer)
Definition: metahost.c:391
static ULONG WINAPI CLRRuntimeInfo_AddRef(ICLRRuntimeInfo *iface)
Definition: metahost.c:331
static HRESULT WINAPI CLRRuntimeInfo_LoadErrorString(ICLRRuntimeInfo *iface, UINT iResourceID, LPWSTR pwzBuffer, DWORD *pcchBuffer, LONG iLocaleid)
Definition: metahost.c:438
static HRESULT WINAPI CLRRuntimeInfo_IsLoadable(ICLRRuntimeInfo *iface, BOOL *pbLoadable)
Definition: metahost.c:487
static HRESULT WINAPI CLRRuntimeInfo_GetProcAddress(ICLRRuntimeInfo *iface, LPCSTR pszProcName, LPVOID *ppProc)
Definition: metahost.c:462
static HRESULT WINAPI CLRRuntimeInfo_BindAsLegacyV2Runtime(ICLRRuntimeInfo *iface)
Definition: metahost.c:511
static HRESULT WINAPI CLRRuntimeInfo_GetVersionString(ICLRRuntimeInfo *iface, LPWSTR pwzBuffer, DWORD *pcchBuffer)
Definition: metahost.c:341
static ULONG WINAPI CLRRuntimeInfo_Release(ICLRRuntimeInfo *iface)
Definition: metahost.c:336
static HRESULT WINAPI CLRRuntimeInfo_IsLoaded(ICLRRuntimeInfo *iface, HANDLE hndProcess, BOOL *pbLoaded)
Definition: metahost.c:430
static HRESULT WINAPI CLRRuntimeInfo_SetDefaultStartupFlags(ICLRRuntimeInfo *iface, DWORD dwStartupFlags, LPCWSTR pwzHostConfigFile)
Definition: metahost.c:495
static HRESULT WINAPI CLRRuntimeInfo_QueryInterface(ICLRRuntimeInfo *iface, REFIID riid, void **ppvObject)
Definition: metahost.c:309
static HRESULT WINAPI CLRRuntimeInfo_GetDefaultStartupFlags(ICLRRuntimeInfo *iface, DWORD *pdwStartupFlags, LPWSTR pwzHostConfigFile, DWORD *pcchHostConfigFile)
Definition: metahost.c:503

Definition at line 34 of file metahost.c.

Referenced by ICLRRuntimeInfo_GetRuntimeHost().

◆ GlobalCLRMetaHost

static struct CLRMetaHost GlobalCLRMetaHost
static
Initial value:
= {
}
static const struct ICLRMetaHostVtbl CLRMetaHost_vtbl
Definition: metahost.c:1137

Definition at line 937 of file metahost.c.

Referenced by CLRMetaHost_CreateInstance().

◆ InstalledRuntimeEnum_Vtbl

static const struct IEnumUnknownVtbl InstalledRuntimeEnum_Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI InstalledRuntimeEnum_Skip(IEnumUnknown *iface, ULONG celt)
Definition: metahost.c:866
static ULONG WINAPI InstalledRuntimeEnum_Release(IEnumUnknown *iface)
Definition: metahost.c:818
static HRESULT WINAPI InstalledRuntimeEnum_Reset(IEnumUnknown *iface)
Definition: metahost.c:891
static HRESULT WINAPI InstalledRuntimeEnum_Clone(IEnumUnknown *iface, IEnumUnknown **ppenum)
Definition: metahost.c:902
static ULONG WINAPI InstalledRuntimeEnum_AddRef(IEnumUnknown *iface)
Definition: metahost.c:808
static HRESULT WINAPI InstalledRuntimeEnum_QueryInterface(IEnumUnknown *iface, REFIID riid, void **ppvObject)
Definition: metahost.c:787
static HRESULT WINAPI InstalledRuntimeEnum_Next(IEnumUnknown *iface, ULONG celt, IUnknown **rgelt, ULONG *pceltFetched)
Definition: metahost.c:833

Definition at line 780 of file metahost.c.

Referenced by CLRMetaHost_EnumerateInstalledRuntimes(), and InstalledRuntimeEnum_Clone().

◆ libmono2_arch_dll

const WCHAR libmono2_arch_dll[] = {'\\','b','i','n','\\','l','i','b','m','o','n','o','-','2','.','0','.','d','l','l',0}
static

Definition at line 558 of file metahost.c.

Referenced by find_mono_dll().

◆ loaded_monos

loaded_mono loaded_monos[NUM_ABI_VERSIONS]
static

Definition at line 58 of file metahost.c.

Referenced by expect_no_runtimes(), load_mono(), and unload_all_runtimes().

◆ net_11_subdir

const WCHAR net_11_subdir[] = {'1','.','0',0}
static

Definition at line 30 of file metahost.c.

◆ net_20_subdir

const WCHAR net_20_subdir[] = {'2','.','0',0}
static

Definition at line 31 of file metahost.c.

◆ net_40_subdir

const WCHAR net_40_subdir[] = {'4','.','0',0}
static

Definition at line 32 of file metahost.c.

◆ runtime_list_cs

static CRITICAL_SECTION runtime_list_cs = { &runtime_list_cs_debug, -1, 0, 0, 0, 0 }
static

Definition at line 46 of file metahost.c.

Referenced by CLRRuntimeInfo_GetRuntimeHost(), and find_runtimes().

◆ runtime_list_cs_debug

CRITICAL_SECTION_DEBUG runtime_list_cs_debug
static
Initial value:
=
{
0, 0, { (DWORD_PTR)(__FILE__ ": runtime_list_cs") }
}
static CRITICAL_SECTION_DEBUG runtime_list_cs_debug
Definition: metahost.c:47
LIST_ENTRY ProcessLocksList
Definition: winbase.h:883
#define DWORD_PTR
Definition: treelist.c:76

Definition at line 47 of file metahost.c.

◆ runtimes

Initial value:
= {
{{&CLRRuntimeInfoVtbl}, net_11_subdir, 1, 1, 4322, 0},
{{&CLRRuntimeInfoVtbl}, net_20_subdir, 2, 0, 50727, 0},
{{&CLRRuntimeInfoVtbl}, net_40_subdir, 4, 0, 30319, 0}
}
static const WCHAR net_11_subdir[]
Definition: metahost.c:30
static const WCHAR net_20_subdir[]
Definition: metahost.c:31
static const WCHAR net_40_subdir[]
Definition: metahost.c:32

Definition at line 38 of file metahost.c.

Referenced by CLRMetaHost_GetRuntime(), find_runtimes(), get_runtime_info(), InstalledRuntimeEnum_Next(), InstalledRuntimeEnum_Skip(), and unload_all_runtimes().

◆ runtimes_initialized

int runtimes_initialized
static

Definition at line 44 of file metahost.c.

Referenced by find_runtimes().