26DEFINE_GUID(IID__AppDomain, 0x05f696dc,0x2b29,0x3663,0xad,0x8b,0xc4,0x38,0x9c,0xf2,0xa7,0x13);
64 mscorlib_path =
WtoA(
This->version->mscorlib_path);
72 entry->domain =
This->mono->mono_jit_init(mscorlib_path);
101 if (
This->default_domain)
goto end;
150 ERR(
"Cannot load mscorlib\n");
157 ERR(
"Couldn't get assembly image\n");
161 klass =
This->mono->mono_class_from_name(
image,
"System",
"AppDomain");
164 ERR(
"Couldn't get class from image\n");
168 method =
This->mono->mono_class_get_method_from_name(klass,
"get_CurrentDomain", 0);
171 ERR(
"Couldn't get method from class\n");
177 if (!appdomain_object)
179 ERR(
"Couldn't get result pointer\n");
187 hr = IUnknown_QueryInterface(unk, &IID__AppDomain, (
void**)punk);
189 IUnknown_Release(unk);
224 ICorRuntimeHost_AddRef( iface );
250 FIXME(
"stub %p\n", iface);
257 FIXME(
"stub %p\n", iface);
265 FIXME(
"stub %p\n", iface);
273 FIXME(
"stub %p\n", iface);
281 FIXME(
"stub %p\n", iface);
290 FIXME(
"stub %p\n", iface);
298 FIXME(
"stub %p\n", iface);
305 FIXME(
"stub %p\n", iface);
312 FIXME(
"stub %p\n", iface);
322 FIXME(
"stub %p\n", iface);
334 TRACE(
"(%p)\n", iface);
350 FIXME(
"stub %p\n", iface);
359 FIXME(
"stub %p\n", iface);
367 FIXME(
"stub %p\n", iface);
378 FIXME(
"stub %p\n", iface);
386 FIXME(
"stub %p\n", iface);
394 FIXME(
"stub %p\n", iface);
402 FIXME(
"stub %p\n", iface);
410 FIXME(
"stub %p\n", iface);
458 ICLRRuntimeHost_AddRef( iface );
466 return ICorRuntimeHost_AddRef(&
This->ICorRuntimeHost_iface);
472 return ICorRuntimeHost_Release(&
This->ICorRuntimeHost_iface);
477 FIXME(
"(%p)\n", iface);
483 FIXME(
"(%p)\n", iface);
490 FIXME(
"(%p,%p)\n", iface, pHostControl);
497 FIXME(
"(%p,%p)\n", iface, pCLRControl);
502 DWORD dwAppDomainId,
BOOL fWaitUntilDone)
504 FIXME(
"(%p,%u,%i)\n", iface, dwAppDomainId, fWaitUntilDone);
516 DWORD *pdwAppDomainId)
518 FIXME(
"(%p,%p)\n", iface, pdwAppDomainId);
524 DWORD dwActivationData,
LPCWSTR *ppwzActivationData,
int *pReturnValue)
526 FIXME(
"(%p,%s,%u,%u)\n", iface,
debugstr_w(pwzAppFullName), dwManifestPaths, dwActivationData);
553 ERR(
"Couldn't get Default Domain\n");
572 ERR(
"Couldn't get assembly image\n");
576 classA =
WtoA(pwzTypeName);
579 klass =
This->mono->mono_class_from_name(
image, classA,
ns+1);
582 ERR(
"Couldn't get class from image\n");
586 methodA =
WtoA(pwzMethodName);
587 method =
This->mono->mono_class_get_method_from_name(klass, methodA, 1);
590 ERR(
"Couldn't get method from class\n");
597 argsA =
WtoA(pwzArgument);
603 ERR(
"Couldn't get result pointer\n");
661 type =
This->mono->mono_reflection_type_from_name(nameA,
NULL);
671 klass =
This->mono->mono_class_from_mono_type(
type);
692 This->mono->mono_runtime_object_init(
obj);
727 ERR(
"Cannot load mscorlib\n");
734 ERR(
"Couldn't get assembly image\n");
738 klass =
This->mono->mono_class_from_name(
image,
"System.Runtime.InteropServices",
"Marshal");
741 ERR(
"Couldn't get class from image\n");
745 method =
This->mono->mono_class_get_method_from_name(klass,
"GetIUnknownForObject", 1);
748 ERR(
"Couldn't get method from class\n");
757 ERR(
"Couldn't get result pointer\n");
764 ERR(
"GetIUnknownForObject returned 0\n");
781 size +=
sizeof(
char*);
784 size +=
sizeof(
char*);
787 current_arg = (
char*)(*
argv + *
argc + 1);
791 (*argv)[
i] = current_arg;
802# define CAN_FIXUP_VTABLE 1
841# define CAN_FIXUP_VTABLE 0
866 if (
fixup->done)
return;
892 image =
host->mono->mono_image_open_from_module_handle(
fixup->dll,
910 for (
i=0;
i<
fixup->fixup->count;
i++)
922 ICLRRuntimeInfo_Release(
info);
928 ERR(
"unable to fixup vtable, hr=%x, status=%d\n",
hr,
status);
949 fixup->fixup = vtable_fixup;
960 if (
sizeof(
void*) > 4)
961 ERR(
"32-bit fixup in 64-bit mode; broken image?\n");
965 for (
i=0;
i<vtable_fixup->
count;
i++)
976 ERR(
"unsupported vtable fixup flags %x\n", vtable_fixup->
type);
990 ULONG vtable_fixup_count,
i;
997 for (
i=0;
i<vtable_fixup_count;
i++)
999 else if (vtable_fixup_count)
1000 FIXME(
"cannot fixup vtable; expect a crash\n");
1005 ERR(
"failed to read CLR headers, hr=%x\n",
hr);
1071 ICLRRuntimeInfo_Release(
info);
1133 This->version = runtime_version;
1138 This->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": RuntimeHost.lock");
1153 IUnknown_AddRef(unk);
1158 IUnknown_AddRef(unk);
1178 hr = IUnknown_QueryInterface(unk,
riid,
ppv);
1180 IUnknown_Release(unk);
1194 This->lock.DebugInfo->Spare[0] = 0;
1207#define CHARS_IN_GUID 39
1209#define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
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};
1246 WARN(
"Class value cannot be found.\n");
1257 WARN(
"CodeBase value cannot be found.\n");
1306 ERR(
"Couldn't get assembly image\n");
1314 klass =
host->mono->mono_class_from_name(
image, classA,
ns+1);
1318 ERR(
"Couldn't get class from image\n");
1326 host->mono->mono_runtime_object_init(
result);
1333 IUnknown_Release(unk);
1346 ICLRRuntimeInfo_Release(
info);
#define InterlockedIncrement
#define InterlockedDecrement
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
#define RegCloseKey(hKey)
HRESULT CorDebug_Create(ICLRRuntimeHost *runtimehost, IUnknown **ppUnk)
static RuntimeHost * impl_from_ICorRuntimeHost(ICorRuntimeHost *iface)
static ULONG WINAPI corruntimehost_AddRef(ICorRuntimeHost *iface)
static HRESULT WINAPI CLRRuntimeHost_ExecuteInAppDomain(ICLRRuntimeHost *iface, DWORD dwAppDomainId, FExecuteInAppDomainCallback pCallback, void *cookie)
static HRESULT WINAPI corruntimehost_Start(ICorRuntimeHost *iface)
static HRESULT WINAPI CLRRuntimeHost_UnloadAppDomain(ICLRRuntimeHost *iface, DWORD dwAppDomainId, BOOL fWaitUntilDone)
static HRESULT WINAPI corruntimehost_SwitchOutLogicalThreadState(ICorRuntimeHost *iface, DWORD **fiberCookie)
static HRESULT WINAPI corruntimehost_QueryInterface(ICorRuntimeHost *iface, REFIID riid, void **ppvObject)
static HRESULT WINAPI corruntimehost_CurrentDomain(ICorRuntimeHost *iface, IUnknown **appDomain)
HRESULT RuntimeHost_GetInterface(RuntimeHost *This, REFCLSID clsid, REFIID riid, void **ppv)
void runtimehost_uninit(void)
static HRESULT WINAPI CLRRuntimeHost_SetHostControl(ICLRRuntimeHost *iface, IHostControl *pHostControl)
static void FixupVTable(HMODULE hmodule)
static HANDLE dll_fixup_heap
static HRESULT RuntimeHost_AddDomain(RuntimeHost *This, MonoDomain **result)
static HRESULT RuntimeHost_GetIUnknownForDomain(RuntimeHost *This, MonoDomain *domain, IUnknown **punk)
static HRESULT WINAPI CLRRuntimeHost_Start(ICLRRuntimeHost *iface)
static HRESULT WINAPI corruntimehost_GetConfiguration(ICorRuntimeHost *iface, ICorConfiguration **pConfiguration)
static ULONG WINAPI CLRRuntimeHost_Release(ICLRRuntimeHost *iface)
static ULONG WINAPI CLRRuntimeHost_AddRef(ICLRRuntimeHost *iface)
static HRESULT WINAPI corruntimehost_UnloadDomain(ICorRuntimeHost *iface, IUnknown *appDomain)
static HRESULT WINAPI CLRRuntimeHost_ExecuteInDefaultAppDomain(ICLRRuntimeHost *iface, LPCWSTR pwzAssemblyPath, LPCWSTR pwzTypeName, LPCWSTR pwzMethodName, LPCWSTR pwzArgument, DWORD *pReturnValue)
static HRESULT WINAPI corruntimehost_CreateLogicalThreadState(ICorRuntimeHost *iface)
static HRESULT WINAPI CLRRuntimeHost_GetCLRControl(ICLRRuntimeHost *iface, ICLRControl **pCLRControl)
static HRESULT WINAPI corruntimehost_GetDefaultDomain(ICorRuntimeHost *iface, IUnknown **pAppDomain)
HRESULT RuntimeHost_Destroy(RuntimeHost *This)
void runtimehost_init(void)
static HRESULT WINAPI corruntimehost_Stop(ICorRuntimeHost *iface)
HRESULT RuntimeHost_Construct(const CLRRuntimeInfo *runtime_version, loaded_mono *loaded_mono, RuntimeHost **result)
static HRESULT WINAPI corruntimehost_CreateDomainEx(ICorRuntimeHost *iface, LPCWSTR friendlyName, IUnknown *setup, IUnknown *evidence, IUnknown **appDomain)
static HRESULT WINAPI CLRRuntimeHost_GetCurrentAppDomainId(ICLRRuntimeHost *iface, DWORD *pdwAppDomainId)
static HRESULT WINAPI CLRRuntimeHost_QueryInterface(ICLRRuntimeHost *iface, REFIID riid, void **ppvObject)
static const struct ICorRuntimeHostVtbl corruntimehost_vtbl
static HRESULT WINAPI corruntimehost_SwitchInLogicalThreadState(ICorRuntimeHost *iface, DWORD *fiberCookie)
static struct list dll_fixups
static HRESULT WINAPI corruntimehost_EnumDomains(ICorRuntimeHost *iface, HDOMAINENUM *hEnum)
static void RuntimeHost_DeleteDomain(RuntimeHost *This, MonoDomain *domain)
static HRESULT WINAPI corruntimehost_CreateDomain(ICorRuntimeHost *iface, LPCWSTR friendlyName, IUnknown *identityArray, IUnknown **appDomain)
static const struct ICLRRuntimeHostVtbl CLRHostVtbl
static HRESULT WINAPI corruntimehost_MapFile(ICorRuntimeHost *iface, HANDLE hFile, HMODULE *mapAddress)
HRESULT RuntimeHost_CreateManagedInstance(RuntimeHost *This, LPCWSTR name, MonoDomain *domain, MonoObject **result)
BOOL WINAPI _CorDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
static HRESULT WINAPI corruntimehost_DeleteLogicalThreadState(ICorRuntimeHost *iface)
static HRESULT WINAPI CLRRuntimeHost_Stop(ICLRRuntimeHost *iface)
static HRESULT WINAPI corruntimehost_CloseEnum(ICorRuntimeHost *iface, HDOMAINENUM hEnum)
static ULONG WINAPI corruntimehost_Release(ICorRuntimeHost *iface)
static HRESULT WINAPI corruntimehost_CreateDomainSetup(ICorRuntimeHost *iface, IUnknown **appDomainSetup)
static HRESULT WINAPI CLRRuntimeHost_ExecuteApplication(ICLRRuntimeHost *iface, LPCWSTR pwzAppFullName, DWORD dwManifestPaths, LPCWSTR *ppwzManifestPaths, DWORD dwActivationData, LPCWSTR *ppwzActivationData, int *pReturnValue)
static void get_utf8_args(int *argc, char ***argv)
HRESULT RuntimeHost_GetIUnknownForObject(RuntimeHost *This, MonoObject *obj, IUnknown **ppUnk)
static HRESULT WINAPI corruntimehost_NextDomain(ICorRuntimeHost *iface, HDOMAINENUM hEnum, IUnknown **appDomain)
static RuntimeHost * impl_from_ICLRRuntimeHost(ICLRRuntimeHost *iface)
static void CDECL ReallyFixupVTable(struct dll_fixup *fixup)
static const struct vtable_fixup_thunk thunk_template
static HRESULT WINAPI corruntimehost_CreateEvidence(ICorRuntimeHost *iface, IUnknown **evidence)
__int32 WINAPI _CorExeMain(void)
static HRESULT WINAPI corruntimehost_LocksHeldByLogicalThread(ICorRuntimeHost *iface, DWORD *pCount)
static void FixupVTableEntry(HMODULE hmodule, VTableFixup *vtable_fixup)
HRESULT create_monodata(REFIID riid, LPVOID *ppObj)
static HRESULT RuntimeHost_GetDefaultDomain(RuntimeHost *This, MonoDomain **result)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define HeapFree(x, y, z)
#define WideCharToMultiByte
static void cleanup(void)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
LPWSTR WINAPI GetCommandLineW(VOID)
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
HRESULT assembly_release(ASSEMBLY *assembly)
FxPnpStateCallbackInfo * pCallback
GLuint GLuint GLsizei GLenum type
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
HANDLE WINAPI HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
BOOL WINAPI HeapDestroy(HANDLE hHeap)
static IN DWORD IN LPVOID lpvReserved
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
static CHAR filenameA[MAX_PATH]
HRESULT assembly_from_hmodule(ASSEMBLY **out, HMODULE hmodule)
HRESULT assembly_get_vtable_fixups(ASSEMBLY *assembly, VTableFixup **fixups, DWORD *count)
HRESULT(__stdcall * FExecuteInAppDomainCallback)([in] void *cookie)
char * WtoA(LPCWSTR wstr)
struct _MonoObject MonoObject
struct _MonoString MonoString
struct _MonoMethod MonoMethod
struct _MonoAssembly MonoAssembly
struct _MonoImage MonoImage
struct _MonoType MonoType
struct _MonoDomain MonoDomain
struct _MonoClass MonoClass
#define HEAP_CREATE_ENABLE_EXECUTE
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
#define strncmpW(s1, s2, n)
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
void(CDECL *function)(struct dll_fixup *fixup)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define CONTAINING_RECORD(address, type, field)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define CLASS_E_CLASSNOTAVAILABLE
#define HKEY_CLASSES_ROOT