ReactOS 0.4.15-dev-8093-g3285f69
mscoree_private.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <objbase.h>
#include <cor.h>
#include <cordebug.h>
#include <metahost.h>
#include <wine/list.h>
#include <wine/unicode.h>
#include <wine/debug.h>
Include dependency graph for mscoree_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _VTableFixup
 
struct  CLRRuntimeInfo
 
struct  RuntimeHost
 
struct  CorProcess
 
struct  CorDebug
 
struct  parsed_config_file
 
struct  supported_runtime
 
struct  loaded_mono
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define COBJMACROS
 

Typedefs

typedef struct _VTableFixup VTableFixup
 
typedef struct tagASSEMBLY ASSEMBLY
 
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
 
typedef struct _MonoString MonoString
 
typedef struct _MonoMethod MonoMethod
 
typedef struct _MonoProfiler MonoProfiler
 
typedef struct _MonoThread MonoThread
 
typedef struct loaded_mono loaded_mono
 
typedef struct RuntimeHost RuntimeHost
 
typedef struct CLRRuntimeInfo CLRRuntimeInfo
 
typedef struct CorProcess CorProcess
 
typedef struct CorDebug CorDebug
 
typedef struct parsed_config_file parsed_config_file
 
typedef struct supported_runtime supported_runtime
 
typedef MonoAssembly *(* MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname, char **assemblies_path, void *user_data)
 
typedef void(* MonoProfileFunc) (MonoProfiler *prof)
 

Enumerations

enum  MonoImageOpenStatus { MONO_IMAGE_OK , MONO_IMAGE_ERROR_ERRNO , MONO_IMAGE_MISSING_ASSEMBLYREF , MONO_IMAGE_IMAGE_INVALID }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mscoree)
 
charWtoA (LPCWSTR wstr) DECLSPEC_HIDDEN
 
HRESULT CLRMetaHost_CreateInstance (REFIID riid, void **ppobj) DECLSPEC_HIDDEN
 
HRESULT WINAPI CLRMetaHost_GetVersionFromFile (ICLRMetaHost *iface, LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer) DECLSPEC_HIDDEN
 
HRESULT assembly_create (ASSEMBLY **out, LPCWSTR file) DECLSPEC_HIDDEN
 
HRESULT assembly_from_hmodule (ASSEMBLY **out, HMODULE hmodule) DECLSPEC_HIDDEN
 
HRESULT assembly_release (ASSEMBLY *assembly) DECLSPEC_HIDDEN
 
HRESULT assembly_get_runtime_version (ASSEMBLY *assembly, LPSTR *version) DECLSPEC_HIDDEN
 
HRESULT assembly_get_vtable_fixups (ASSEMBLY *assembly, VTableFixup **fixups, DWORD *count) DECLSPEC_HIDDEN
 
HRESULT get_runtime_info (LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file, DWORD startup_flags, DWORD runtimeinfo_flags, BOOL legacy, ICLRRuntimeInfo **result) DECLSPEC_HIDDEN
 
HRESULT ICLRRuntimeInfo_GetRuntimeHost (ICLRRuntimeInfo *iface, RuntimeHost **result) DECLSPEC_HIDDEN
 
HRESULT MetaDataDispenser_CreateInstance (IUnknown **ppUnk) DECLSPEC_HIDDEN
 
HRESULT parse_config_file (LPCWSTR filename, parsed_config_file *result) DECLSPEC_HIDDEN
 
void free_parsed_config_file (parsed_config_file *file) DECLSPEC_HIDDEN
 
void unload_all_runtimes (void) DECLSPEC_HIDDEN
 
void expect_no_runtimes (void) DECLSPEC_HIDDEN
 
HRESULT RuntimeHost_Construct (const CLRRuntimeInfo *runtime_version, loaded_mono *loaded_mono, RuntimeHost **result) DECLSPEC_HIDDEN
 
HRESULT RuntimeHost_GetInterface (RuntimeHost *This, REFCLSID clsid, REFIID riid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT RuntimeHost_GetIUnknownForObject (RuntimeHost *This, MonoObject *obj, IUnknown **ppUnk) DECLSPEC_HIDDEN
 
HRESULT RuntimeHost_CreateManagedInstance (RuntimeHost *This, LPCWSTR name, MonoDomain *domain, MonoObject **result) DECLSPEC_HIDDEN
 
HRESULT RuntimeHost_Destroy (RuntimeHost *This) DECLSPEC_HIDDEN
 
HRESULT WINAPI CLRMetaHost_GetRuntime (ICLRMetaHost *iface, LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime) DECLSPEC_HIDDEN
 
HRESULT CorDebug_Create (ICLRRuntimeHost *runtimehost, IUnknown **ppUnk) DECLSPEC_HIDDEN
 
HRESULT create_monodata (REFIID riid, LPVOID *ppObj) DECLSPEC_HIDDEN
 
void runtimehost_init (void)
 
void runtimehost_uninit (void)
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 26 of file mscoree_private.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 29 of file mscoree_private.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 27 of file mscoree_private.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 25 of file mscoree_private.h.

Typedef Documentation

◆ ASSEMBLY

Definition at line 58 of file mscoree_private.h.

◆ CLRRuntimeInfo

◆ CorDebug

◆ CorProcess

◆ loaded_mono

Definition at line 79 of file mscoree_private.h.

◆ MonoAssembly

typedef struct _MonoAssembly MonoAssembly

Definition at line 68 of file mscoree_private.h.

◆ MonoAssemblyName

typedef struct _MonoAssemblyName MonoAssemblyName

Definition at line 69 of file mscoree_private.h.

◆ MonoAssemblyPreLoadFunc

typedef MonoAssembly *(* MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname, char **assemblies_path, void *user_data)

Definition at line 158 of file mscoree_private.h.

◆ MonoClass

typedef struct _MonoClass MonoClass

Definition at line 72 of file mscoree_private.h.

◆ MonoDomain

typedef struct _MonoDomain MonoDomain

Definition at line 67 of file mscoree_private.h.

◆ MonoImage

typedef struct _MonoImage MonoImage

Definition at line 71 of file mscoree_private.h.

◆ MonoMethod

typedef struct _MonoMethod MonoMethod

Definition at line 75 of file mscoree_private.h.

◆ MonoObject

typedef struct _MonoObject MonoObject

Definition at line 73 of file mscoree_private.h.

◆ MonoProfileFunc

typedef void(* MonoProfileFunc) (MonoProfiler *prof)

Definition at line 160 of file mscoree_private.h.

◆ MonoProfiler

typedef struct _MonoProfiler MonoProfiler

Definition at line 76 of file mscoree_private.h.

◆ MonoString

typedef struct _MonoString MonoString

Definition at line 74 of file mscoree_private.h.

◆ MonoThread

typedef struct _MonoThread MonoThread

Definition at line 77 of file mscoree_private.h.

◆ MonoType

typedef struct _MonoType MonoType

Definition at line 70 of file mscoree_private.h.

◆ parsed_config_file

◆ RuntimeHost

Definition at line 80 of file mscoree_private.h.

◆ supported_runtime

◆ VTableFixup

Enumeration Type Documentation

◆ MonoImageOpenStatus

Enumerator
MONO_IMAGE_OK 
MONO_IMAGE_ERROR_ERRNO 
MONO_IMAGE_MISSING_ASSEMBLYREF 
MONO_IMAGE_IMAGE_INVALID 

Definition at line 151 of file mscoree_private.h.

151 {
MonoImageOpenStatus
@ MONO_IMAGE_OK
@ MONO_IMAGE_MISSING_ASSEMBLYREF
@ MONO_IMAGE_ERROR_ERRNO
@ MONO_IMAGE_IMAGE_INVALID

Function Documentation

◆ assembly_create()

HRESULT assembly_create ( ASSEMBLY **  out,
LPCWSTR  file 
)

Definition at line 641 of file assembly.c.

642{
644 HRESULT hr;
645
646 *out = NULL;
647
648 if (!(assembly = heap_alloc_zero(sizeof(*assembly)))) return E_OUTOFMEMORY;
649
650 assembly->path = strdupW(file);
651 if (!assembly->path)
652 {
654 goto failed;
655 }
656
659 if (assembly->hfile == INVALID_HANDLE_VALUE)
660 {
662 goto failed;
663 }
664
666 0, 0, NULL);
667 if (!assembly->hmap)
668 {
670 goto failed;
671 }
672
673 assembly->data = MapViewOfFile(assembly->hmap, FILE_MAP_READ, 0, 0, 0);
674 if (!assembly->data)
675 {
677 goto failed;
678 }
679
681 if (FAILED(hr)) goto failed;
682
684 if (FAILED(hr)) goto failed;
685
686 *out = assembly;
687 return S_OK;
688
689failed:
691 return hr;
692}
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define PAGE_READONLY
Definition: compat.h:138
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define FILE_MAP_READ
Definition: compat.h:776
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define MapViewOfFile
Definition: compat.h:745
#define FILE_SHARE_READ
Definition: compat.h:136
HRESULT assembly_release(ASSEMBLY *assembly)
Definition: assembly.c:694
static HRESULT parse_pe_header(ASSEMBLY *assembly)
Definition: assembly.c:603
static HRESULT parse_clr_metadata(ASSEMBLY *assembly)
Definition: assembly.c:560
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
static FILE * out
Definition: regtests2xml.c:44
HRESULT hr
Definition: shlfolder.c:183
Definition: fci.c:127
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

Referenced by CLRMetaHost_GetVersionFromFile(), and IAssemblyCacheImpl_InstallAssembly().

◆ assembly_from_hmodule()

HRESULT assembly_from_hmodule ( ASSEMBLY **  out,
HMODULE  hmodule 
)

Definition at line 245 of file assembly.c.

246{
248 HRESULT hr;
249
250 *out = NULL;
251
253 if (!assembly)
254 return E_OUTOFMEMORY;
255
256 assembly->is_mapped_file = 0;
257
258 assembly->data = (BYTE*)hmodule;
259
261 if (SUCCEEDED(hr))
262 *out = assembly;
263 else
265
266 return hr;
267}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static HMODULE hmodule
Definition: rasapi.c:29
static HRESULT parse_headers(ASSEMBLY *assembly)
Definition: assembly.c:179
unsigned char BYTE
Definition: xxhash.c:193

Referenced by FixupVTable().

◆ assembly_get_runtime_version()

HRESULT assembly_get_runtime_version ( ASSEMBLY assembly,
LPSTR version 
)

Definition at line 865 of file assembly.c.

866{
867 *version = assembly->metadatahdr->Version;
868 return S_OK;
869}
static const WCHAR version[]
Definition: asmname.c:66

Referenced by CLRMetaHost_GetVersionFromFile(), and IAssemblyCacheImpl_InstallAssembly().

◆ assembly_get_vtable_fixups()

HRESULT assembly_get_vtable_fixups ( ASSEMBLY assembly,
VTableFixup **  fixups,
DWORD count 
)

Definition at line 294 of file assembly.c.

295{
296 ULONG size;
297
298 size = assembly_datadir_get_data(assembly, &assembly->corhdr->VTableFixups, (void**)fixups);
299 *count = size / sizeof(VTableFixup);
300
301 return S_OK;
302}
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
static ULONG assembly_datadir_get_data(ASSEMBLY *assembly, IMAGE_DATA_DIRECTORY *datadir, void **data)
Definition: assembly.c:89
struct _VTableFixup VTableFixup
uint32_t ULONG
Definition: typedefs.h:59

Referenced by FixupVTable().

◆ assembly_release()

HRESULT assembly_release ( ASSEMBLY assembly)

Definition at line 694 of file assembly.c.

695{
696 if (!assembly)
697 return S_OK;
698
699 heap_free(assembly->metadatahdr);
700 heap_free(assembly->path);
702 CloseHandle(assembly->hmap);
703 CloseHandle(assembly->hfile);
705
706 return S_OK;
707}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define CloseHandle
Definition: compat.h:739
#define UnmapViewOfFile
Definition: compat.h:746

Referenced by assembly_create(), assembly_from_hmodule(), CLRMetaHost_GetVersionFromFile(), FixupVTable(), and IAssemblyCacheImpl_InstallAssembly().

◆ 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_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 FIXME(fmt,...)
Definition: debug.h:114
#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
static void find_runtimes(void)
Definition: metahost.c:718
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 TRACE(s)
Definition: solgame.cpp:4
#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 MultiByteToWideChar
Definition: compat.h:110
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 CP_UTF8
Definition: nls.h:20
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
Definition: swimpl.c:888
char * LPSTR
Definition: xmlstorage.h:182

Referenced by get_runtime_info(), and GetFileVersion().

◆ CorDebug_Create()

HRESULT CorDebug_Create ( ICLRRuntimeHost runtimehost,
IUnknown **  ppUnk 
)

Definition at line 742 of file cordebug.c.

743{
744 CorDebug *This;
745
746 This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
747 if ( !This )
748 return E_OUTOFMEMORY;
749
750 This->ICorDebug_iface.lpVtbl = &cordebug_vtbl;
751 This->ICorDebugProcessEnum_iface.lpVtbl = &processenum_vtbl;
752 This->ref = 1;
753 This->pCallback = NULL;
754 This->pCallback2 = NULL;
755 This->runtimehost = runtimehost;
756
757 list_init(&This->processes);
758
759 if(This->runtimehost)
760 ICLRRuntimeHost_AddRef(This->runtimehost);
761
762 *ppUnk = (IUnknown*)&This->ICorDebug_iface;
763
764 return S_OK;
765}
static void list_init(struct list_entry *head)
Definition: list.h:51
static const struct ICorDebugProcessEnumVtbl processenum_vtbl
Definition: cordebug.c:503
static const struct ICorDebugVtbl cordebug_vtbl
Definition: cordebug.c:726

Referenced by RuntimeHost_GetInterface().

◆ create_monodata()

HRESULT create_monodata ( REFIID  riid,
LPVOID ppObj 
)

Definition at line 1211 of file corruntimehost.c.

1212{
1213 static const WCHAR wszCodebase[] = {'C','o','d','e','B','a','s','e',0};
1214 static const WCHAR wszClass[] = {'C','l','a','s','s',0};
1215 static const WCHAR wszFileSlash[] = {'f','i','l','e',':','/','/','/',0};
1216 static const WCHAR wszCLSIDSlash[] = {'C','L','S','I','D','\\',0};
1217 static const WCHAR wszInprocServer32[] = {'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2',0};
1218 WCHAR path[CHARS_IN_GUID + ARRAYSIZE(wszCLSIDSlash) + ARRAYSIZE(wszInprocServer32) - 1];
1223 HRESULT hr;
1224 HKEY key;
1225 LONG res;
1226 int offset = 0;
1227 WCHAR codebase[MAX_PATH + 8];
1228 WCHAR classname[350];
1230
1231 DWORD dwBufLen = 350;
1232
1233 lstrcpyW(path, wszCLSIDSlash);
1234 StringFromGUID2(riid, path + lstrlenW(wszCLSIDSlash), CHARS_IN_GUID);
1235 lstrcatW(path, wszInprocServer32);
1236
1237 TRACE("Registry key: %s\n", debugstr_w(path));
1238
1242
1244 if(res != ERROR_SUCCESS)
1245 {
1246 WARN("Class value cannot be found.\n");
1248 goto cleanup;
1249 }
1250
1251 TRACE("classname (%s)\n", debugstr_w(classname));
1252
1253 dwBufLen = MAX_PATH + 8;
1254 res = RegGetValueW( key, NULL, wszCodebase, RRF_RT_REG_SZ, NULL, codebase, &dwBufLen);
1255 if(res != ERROR_SUCCESS)
1256 {
1257 WARN("CodeBase value cannot be found.\n");
1259 goto cleanup;
1260 }
1261
1262 /* Strip file:/// */
1263 if(strncmpW(codebase, wszFileSlash, strlenW(wszFileSlash)) == 0)
1264 offset = strlenW(wszFileSlash);
1265
1266 strcpyW(filename, codebase + offset);
1267
1268 TRACE("codebase (%s)\n", debugstr_w(filename));
1269
1270 *ppObj = NULL;
1271
1272
1274 if (SUCCEEDED(hr))
1275 {
1277
1278 if (SUCCEEDED(hr))
1280
1281 if (SUCCEEDED(hr))
1282 {
1284 MonoClass *klass;
1286 IUnknown *unk = NULL;
1287 char *filenameA, *ns;
1288 char *classA;
1289
1291
1292 host->mono->mono_thread_attach(domain);
1293
1295 assembly = host->mono->mono_domain_assembly_open(domain, filenameA);
1297 if (!assembly)
1298 {
1299 ERR("Cannot open assembly %s\n", filenameA);
1300 goto cleanup;
1301 }
1302
1303 image = host->mono->mono_assembly_get_image(assembly);
1304 if (!image)
1305 {
1306 ERR("Couldn't get assembly image\n");
1307 goto cleanup;
1308 }
1309
1310 classA = WtoA(classname);
1311 ns = strrchr(classA, '.');
1312 *ns = '\0';
1313
1314 klass = host->mono->mono_class_from_name(image, classA, ns+1);
1315 HeapFree(GetProcessHeap(), 0, classA);
1316 if (!klass)
1317 {
1318 ERR("Couldn't get class from image\n");
1319 goto cleanup;
1320 }
1321
1322 /*
1323 * Use the default constructor for the .NET class.
1324 */
1325 result = host->mono->mono_object_new(domain, klass);
1326 host->mono->mono_runtime_object_init(result);
1327
1329 if (SUCCEEDED(hr))
1330 {
1331 hr = IUnknown_QueryInterface(unk, &IID_IUnknown, ppObj);
1332
1333 IUnknown_Release(unk);
1334 }
1335 else
1337 }
1338 else
1340 }
1341 else
1343
1344cleanup:
1345 if(info)
1346 ICLRRuntimeInfo_Release(info);
1347
1349
1350 return hr;
1351}
const GUID IID_IUnknown
#define WARN(fmt,...)
Definition: debug.h:115
#define RegCloseKey(hKey)
Definition: registry.h:49
#define CHARS_IN_GUID
#define ARRAYSIZE(array)
HRESULT RuntimeHost_GetIUnknownForObject(RuntimeHost *This, MonoObject *obj, IUnknown **ppUnk)
static HRESULT RuntimeHost_GetDefaultDomain(RuntimeHost *This, MonoDomain **result)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
static void cleanup(void)
Definition: main.c:1335
HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file, DWORD startup_flags, DWORD runtimeinfo_flags, BOOL legacy, ICLRRuntimeInfo **result)
Definition: metahost.c:1247
HRESULT ICLRRuntimeInfo_GetRuntimeHost(ICLRRuntimeInfo *iface, RuntimeHost **result)
Definition: metahost.c:544
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
#define RRF_RT_REG_SZ
Definition: driver.c:575
GLeglImageOES image
Definition: gl.h:2204
GLuint res
Definition: glext.h:9613
GLuint64EXT * result
Definition: glext.h:11304
GLintptr offset
Definition: glext.h:5920
const char * filename
Definition: ioapi.h:137
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static CHAR filenameA[MAX_PATH]
Definition: storage32.c:42
char * WtoA(LPCWSTR wstr)
Definition: mscoree_main.c:30
struct _MonoObject MonoObject
struct _MonoAssembly MonoAssembly
struct _MonoImage MonoImage
struct _MonoDomain MonoDomain
struct _MonoClass MonoClass
#define KEY_READ
Definition: nt_native.h:1023
long LONG
Definition: pedump.c:60
#define strlenW(s)
Definition: unicode.h:34
#define strncmpW(s1, s2, n)
Definition: unicode.h:42
#define strcpyW(d, s)
Definition: unicode.h:35
WCHAR classname[128]
Definition: startup.c:15
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
Definition: cookie.c:42
Definition: copy.c:22
Definition: mxnamespace.c:45
char * host
Definition: whois.c:55
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
Definition: wincrypt.h:4246
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DllGetClassObject().

◆ 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().

◆ free_parsed_config_file()

void free_parsed_config_file ( parsed_config_file file)

Definition at line 448 of file config.c.

449{
450 supported_runtime *cursor, *cursor2;
451
452 LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, &file->supported_runtimes, supported_runtime, entry)
453 {
454 HeapFree(GetProcessHeap(), 0, cursor->version);
455 list_remove(&cursor->entry);
457 }
458}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
const char cursor[]
Definition: icontest.c:13
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204

Referenced by get_runtime_info().

◆ 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}
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
BOOL legacy
Definition: mkisofs.c:131
@ RUNTIME_INFO_UPGRADE_VERSION
Definition: mscoree.idl:40
#define strcatW(d, s)
Definition: unicode.h:36
#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
static HRESULT CLRRuntimeInfo_GetRuntimeHost(CLRRuntimeInfo *This, RuntimeHost **result)
Definition: metahost.c:240
static CLRRuntimeInfo * impl_from_ICLRRuntimeInfo(ICLRRuntimeInfo *iface)
Definition: metahost.c:304
#define assert(x)
Definition: debug.h:53

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

◆ MetaDataDispenser_CreateInstance()

HRESULT MetaDataDispenser_CreateInstance ( IUnknown **  ppUnk)

Definition at line 169 of file metadata.c.

170{
172
174
175 if (!This)
176 return E_OUTOFMEMORY;
177
178 This->IMetaDataDispenserEx_iface.lpVtbl = &MetaDataDispenserVtbl;
179 This->ref = 1;
180
181 *ppUnk = (IUnknown*)This;
182
183 return S_OK;
184}
static const struct IMetaDataDispenserExVtbl MetaDataDispenserVtbl
Definition: metadata.c:153

Referenced by RuntimeHost_GetInterface().

◆ parse_config_file()

HRESULT parse_config_file ( LPCWSTR  filename,
parsed_config_file result 
)

Definition at line 419 of file config.c.

420{
422 VARIANT var;
423 HRESULT hr;
424 HRESULT initresult;
425
427
429
431
432 if (SUCCEEDED(hr))
433 {
434 V_VT(&var) = VT_UNKNOWN;
436
438
439 IStream_Release(stream);
440 }
441
442 if (SUCCEEDED(initresult))
444
445 return hr;
446}
@ VT_UNKNOWN
Definition: compat.h:2308
static void init_config(parsed_config_file *config)
Definition: config.c:376
static HRESULT parse_config(VARIANT input, parsed_config_file *result)
Definition: config.c:381
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode, IStream **lppStream)
Definition: istream.c:484
const char * var
Definition: shader.c:5666
#define STGM_FAILIFTHERE
Definition: objbase.h:928
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:922
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278
#define STGM_READ
Definition: objbase.h:917
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_VT(A)
Definition: oleauto.h:211
Definition: parse.h:23

Referenced by get_runtime_info().

◆ RuntimeHost_Construct()

HRESULT RuntimeHost_Construct ( const CLRRuntimeInfo runtime_version,
loaded_mono loaded_mono,
RuntimeHost **  result 
)

Definition at line 1120 of file corruntimehost.c.

1122{
1124
1125 This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
1126 if ( !This )
1127 return E_OUTOFMEMORY;
1128
1129 This->ICorRuntimeHost_iface.lpVtbl = &corruntimehost_vtbl;
1130 This->ICLRRuntimeHost_iface.lpVtbl = &CLRHostVtbl;
1131
1132 This->ref = 1;
1133 This->version = runtime_version;
1134 This->mono = loaded_mono;
1135 list_init(&This->domains);
1136 This->default_domain = NULL;
1138 This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RuntimeHost.lock");
1139
1140 *result = This;
1141
1142 return S_OK;
1143}
static const struct ICorRuntimeHostVtbl corruntimehost_vtbl
static const struct ICLRRuntimeHostVtbl CLRHostVtbl
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define DWORD_PTR
Definition: treelist.c:76

Referenced by CLRRuntimeInfo_GetRuntimeHost().

◆ RuntimeHost_CreateManagedInstance()

HRESULT RuntimeHost_CreateManagedInstance ( RuntimeHost This,
LPCWSTR  name,
MonoDomain domain,
MonoObject **  result 
)

Definition at line 638 of file corruntimehost.c.

640{
642 char *nameA=NULL;
643 MonoType *type;
644 MonoClass *klass;
646
647 if (!domain)
649
650 if (SUCCEEDED(hr))
651 {
652 nameA = WtoA(name);
653 if (!nameA)
655 }
656
657 if (SUCCEEDED(hr))
658 {
659 This->mono->mono_thread_attach(domain);
660
661 type = This->mono->mono_reflection_type_from_name(nameA, NULL);
662 if (!type)
663 {
664 ERR("Cannot find type %s\n", debugstr_w(name));
665 hr = E_FAIL;
666 }
667 }
668
669 if (SUCCEEDED(hr))
670 {
671 klass = This->mono->mono_class_from_mono_type(type);
672 if (!klass)
673 {
674 ERR("Cannot convert type %s to a class\n", debugstr_w(name));
675 hr = E_FAIL;
676 }
677 }
678
679 if (SUCCEEDED(hr))
680 {
681 obj = This->mono->mono_object_new(domain, klass);
682 if (!obj)
683 {
684 ERR("Cannot allocate object of type %s\n", debugstr_w(name));
685 hr = E_FAIL;
686 }
687 }
688
689 if (SUCCEEDED(hr))
690 {
691 /* FIXME: Detect exceptions from the constructor? */
692 This->mono->mono_runtime_object_init(obj);
693 *result = obj;
694 }
695
696 HeapFree(GetProcessHeap(), 0, nameA);
697
698 return hr;
699}
#define E_FAIL
Definition: ddrawi.h:102
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
struct _MonoType MonoType
Definition: name.c:39

Referenced by ClrCreateManagedInstance().

◆ RuntimeHost_Destroy()

HRESULT RuntimeHost_Destroy ( RuntimeHost This)

Definition at line 1190 of file corruntimehost.c.

1191{
1192 struct DomainEntry *cursor, *cursor2;
1193
1194 This->lock.DebugInfo->Spare[0] = 0;
1196
1197 LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, &This->domains, struct DomainEntry, entry)
1198 {
1199 list_remove(&cursor->entry);
1201 }
1202
1203 HeapFree( GetProcessHeap(), 0, This );
1204 return S_OK;
1205}
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by unload_all_runtimes().

◆ RuntimeHost_GetInterface()

HRESULT RuntimeHost_GetInterface ( RuntimeHost This,
REFCLSID  clsid,
REFIID  riid,
void **  ppv 
)

Definition at line 1145 of file corruntimehost.c.

1146{
1147 IUnknown *unk;
1148 HRESULT hr;
1149
1150 if (IsEqualGUID(clsid, &CLSID_CorRuntimeHost))
1151 {
1152 unk = (IUnknown*)&This->ICorRuntimeHost_iface;
1153 IUnknown_AddRef(unk);
1154 }
1155 else if (IsEqualGUID(clsid, &CLSID_CLRRuntimeHost))
1156 {
1157 unk = (IUnknown*)&This->ICLRRuntimeHost_iface;
1158 IUnknown_AddRef(unk);
1159 }
1160 else if (IsEqualGUID(clsid, &CLSID_CorMetaDataDispenser) ||
1161 IsEqualGUID(clsid, &CLSID_CorMetaDataDispenserRuntime))
1162 {
1164 if (FAILED(hr))
1165 return hr;
1166 }
1167 else if (IsEqualGUID(clsid, &CLSID_CLRDebuggingLegacy))
1168 {
1169 hr = CorDebug_Create(&This->ICLRRuntimeHost_iface, &unk);
1170 if (FAILED(hr))
1171 return hr;
1172 }
1173 else
1174 unk = NULL;
1175
1176 if (unk)
1177 {
1178 hr = IUnknown_QueryInterface(unk, riid, ppv);
1179
1180 IUnknown_Release(unk);
1181
1182 return hr;
1183 }
1184 else
1185 FIXME("not implemented for class %s\n", debugstr_guid(clsid));
1186
1188}
HRESULT CorDebug_Create(ICLRRuntimeHost *runtimehost, IUnknown **ppUnk)
Definition: cordebug.c:742
HRESULT MetaDataDispenser_CreateInstance(IUnknown **ppUnk)
Definition: metadata.c:169
REFIID LPVOID * ppv
Definition: atlbase.h:39
REFCLSID clsid
Definition: msctf.c:82
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

Referenced by CLRRuntimeInfo_GetInterface().

◆ RuntimeHost_GetIUnknownForObject()

HRESULT RuntimeHost_GetIUnknownForObject ( RuntimeHost This,
MonoObject obj,
IUnknown **  ppUnk 
)

Definition at line 711 of file corruntimehost.c.

713{
717 MonoClass *klass;
720 void *args[2];
721
722 domain = This->mono->mono_object_get_domain(obj);
723
724 assembly = This->mono->mono_domain_assembly_open(domain, "mscorlib");
725 if (!assembly)
726 {
727 ERR("Cannot load mscorlib\n");
728 return E_FAIL;
729 }
730
731 image = This->mono->mono_assembly_get_image(assembly);
732 if (!image)
733 {
734 ERR("Couldn't get assembly image\n");
735 return E_FAIL;
736 }
737
738 klass = This->mono->mono_class_from_name(image, "System.Runtime.InteropServices", "Marshal");
739 if (!klass)
740 {
741 ERR("Couldn't get class from image\n");
742 return E_FAIL;
743 }
744
745 method = This->mono->mono_class_get_method_from_name(klass, "GetIUnknownForObject", 1);
746 if (!method)
747 {
748 ERR("Couldn't get method from class\n");
749 return E_FAIL;
750 }
751
752 args[0] = obj;
753 args[1] = NULL;
754 result = This->mono->mono_runtime_invoke(method, NULL, args, NULL);
755 if (!result)
756 {
757 ERR("Couldn't get result pointer\n");
758 return E_FAIL;
759 }
760
761 *ppUnk = *(IUnknown**)This->mono->mono_object_unbox(result);
762 if (!*ppUnk)
763 {
764 ERR("GetIUnknownForObject returned 0\n");
765 return E_FAIL;
766 }
767
768 return S_OK;
769}
method
Definition: dragdrop.c:54
struct _MonoMethod MonoMethod
Definition: match.c:390

Referenced by ClrCreateManagedInstance(), create_monodata(), and RuntimeHost_GetIUnknownForDomain().

◆ runtimehost_init()

void runtimehost_init ( void  )

Definition at line 1101 of file corruntimehost.c.

1102{
1105}
static HANDLE dll_fixup_heap
static struct list dll_fixups
HANDLE WINAPI HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
Definition: heapmem.c:45
#define HEAP_CREATE_ENABLE_EXECUTE
Definition: rtltypes.h:135

Referenced by DllMain().

◆ runtimehost_uninit()

void runtimehost_uninit ( void  )

Definition at line 1108 of file corruntimehost.c.

1109{
1110 struct dll_fixup *fixup, *fixup2;
1111
1114 {
1115 HeapFree(GetProcessHeap(), 0, fixup->tokens);
1117 }
1118}
BOOL WINAPI HeapDestroy(HANDLE hHeap)
Definition: heapmem.c:85
VTableFixup * fixup

Referenced by DllMain().

◆ 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().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mscoree  )

◆ WtoA()

char * WtoA ( LPCWSTR  wstr)

Definition at line 30 of file mscoree_main.c.

31{
32 int length;
33 char *result;
34
35 length = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
36
38
39 if (result)
41
42 return result;
43}
#define WideCharToMultiByte
Definition: compat.h:111
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

Referenced by _CorExeMain(), CLRRuntimeHost_ExecuteInDefaultAppDomain(), create_monodata(), mono_assembly_search_hook_fn(), ReallyFixupVTable(), RuntimeHost_AddDomain(), and RuntimeHost_CreateManagedInstance().