ReactOS 0.4.16-dev-2357-g35d0dfe
mscoree_main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "winreg.h"
#include "ole2.h"
#include "ocidl.h"
#include "shellapi.h"
#include "strongname.h"
#include "initguid.h"
#include "msxml2.h"
#include "corerror.h"
#include "cor.h"
#include "mscoree.h"
#include "corhdr.h"
#include "cordebug.h"
#include "metahost.h"
#include "fusion.h"
#include "wine/list.h"
#include "mscoree_private.h"
#include "rpcproxy.h"
#include "wine/debug.h"
Include dependency graph for mscoree_main.c:

Go to the source code of this file.

Classes

struct  print_handler_tls
 
struct  mscorecf
 

Macros

#define COBJMACROS
 

Typedefs

typedef HRESULT(* fnCreateInstance) (REFIID riid, LPVOID *ppObj)
 
typedef struct mscorecf mscorecf
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mscoree)
 
 WINE_DECLARE_DEBUG_CHANNEL (winediag)
 
charWtoA (LPCWSTR wstr)
 
static BOOL get_install_root (LPWSTR install_dir)
 
static mscorecfimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI mscorecf_QueryInterface (IClassFactory *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI mscorecf_AddRef (IClassFactory *iface)
 
static ULONG WINAPI mscorecf_Release (IClassFactory *iface)
 
static HRESULT WINAPI mscorecf_CreateInstance (IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI mscorecf_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI CorBindToRuntimeHost (LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, LPCWSTR pwszHostConfigFile, VOID *pReserved, DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
void CDECL mono_print_handler_fn (const char *string, INT is_stdout)
 
void CDECL mono_log_handler_fn (const char *log_domain, const char *log_level, const char *message, INT fatal, void *user_data)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
__int32 WINAPI _CorExeMain2 (PBYTE ptrMemory, DWORD cntMemory, LPWSTR imageName, LPWSTR loaderName, LPWSTR cmdLine)
 
void WINAPI CorExitProcess (int exitCode)
 
VOID WINAPI _CorImageUnloading (PVOID imageBase)
 
HRESULT WINAPI _CorValidateImage (PVOID *imageBase, LPCWSTR imageName)
 
HRESULT WINAPI GetCORSystemDirectory (LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
 
HRESULT WINAPI GetCORVersion (LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
 
HRESULT WINAPI CorIsLatestSvc (int *unk1, int *unk2)
 
HRESULT WINAPI CorGetSvc (void *unk)
 
HRESULT WINAPI GetRequestedRuntimeInfo (LPCWSTR pExe, LPCWSTR pwszVersion, LPCWSTR pConfigurationFile, DWORD startupFlags, DWORD runtimeInfoFlags, LPWSTR pDirectory, DWORD dwDirectory, DWORD *dwDirectoryLength, LPWSTR pVersion, DWORD cchBuffer, DWORD *dwlength)
 
HRESULT WINAPI GetRequestedRuntimeVersion (LPWSTR pExe, LPWSTR pVersion, DWORD cchBuffer, DWORD *dwlength)
 
HRESULT WINAPI GetRealProcAddress (LPCSTR procname, void **ppv)
 
HRESULT WINAPI GetFileVersion (LPCWSTR szFilename, LPWSTR szBuffer, DWORD cchBuffer, DWORD *dwLength)
 
HRESULT WINAPI LoadLibraryShim (LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll)
 
HRESULT WINAPI LockClrVersion (FLockClrVersionCallback hostCallback, FLockClrVersionCallback *pBeginHostSetup, FLockClrVersionCallback *pEndHostSetup)
 
HRESULT WINAPI CoInitializeCor (DWORD fFlags)
 
HRESULT WINAPI GetAssemblyMDImport (LPCWSTR szFileName, REFIID riid, IUnknown **ppIUnk)
 
HRESULT WINAPI GetVersionFromProcess (HANDLE hProcess, LPWSTR pVersion, DWORD cchBuffer, DWORD *dwLength)
 
HRESULT WINAPI LoadStringRCEx (LCID culture, UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet, int *pBufLen)
 
HRESULT WINAPI LoadStringRC (UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet)
 
HRESULT WINAPI CorBindToRuntimeEx (LPWSTR szVersion, LPWSTR szBuildFlavor, DWORD nflags, REFCLSID rslsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CorBindToCurrentRuntime (LPCWSTR filename, REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
STDAPI ClrCreateManagedInstance (LPCWSTR pTypeName, REFIID riid, void **ppObject)
 
BOOLEAN WINAPI StrongNameSignatureVerification (LPCWSTR filename, DWORD inFlags, DWORD *pOutFlags)
 
BOOLEAN WINAPI StrongNameSignatureVerificationEx (LPCWSTR filename, BOOLEAN forceVerification, BOOLEAN *pVerified)
 
BOOLEAN WINAPI StrongNameTokenFromAssembly (LPCWSTR path, BYTE **token, ULONG *size)
 
HRESULT WINAPI CreateDebuggingInterfaceFromVersion (int nDebugVersion, LPCWSTR version, IUnknown **ppv)
 
HRESULT WINAPI CLRCreateInstance (REFCLSID clsid, REFIID riid, LPVOID *ppInterface)
 
HRESULT WINAPI CreateInterface (REFCLSID clsid, REFIID riid, LPVOID *ppInterface)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
static void parse_msi_version_string (const char *version, int *parts)
 
static int compare_versions (const char *a, const char *b)
 
static BOOL invoke_appwiz (void)
 
static BOOL get_support_msi (LPCWSTR mono_path, LPWSTR msi_path)
 
static BOOL install_wine_mono (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 
void WINAPI CoEEShutDownCOM (void)
 
INT WINAPI ND_RU1 (const void *ptr, INT offset)
 
INT WINAPI ND_RI2 (const void *ptr, INT offset)
 
INT WINAPI ND_RI4 (const void *ptr, INT offset)
 
INT64 WINAPI ND_RI8 (const void *ptr, INT offset)
 
void WINAPI ND_WU1 (void *ptr, INT offset, BYTE val)
 
void WINAPI ND_WI2 (void *ptr, INT offset, SHORT val)
 
void WINAPI ND_WI4 (void *ptr, INT offset, INT val)
 
void WINAPI ND_WI8 (void *ptr, INT offset, INT64 val)
 
void WINAPI ND_CopyObjDst (const void *src, void *dst, INT offset, INT size)
 
void WINAPI ND_CopyObjSrc (const void *src, INT offset, void *dst, INT size)
 

Variables

static DWORD print_tls_index = TLS_OUT_OF_INDEXES
 
static const struct IClassFactoryVtbl mscorecf_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file mscoree_main.c.

Typedef Documentation

◆ fnCreateInstance

typedef HRESULT(* fnCreateInstance) (REFIID riid, LPVOID *ppObj)

Definition at line 61 of file mscoree_main.c.

◆ mscorecf

Function Documentation

◆ _CorExeMain2()

__int32 WINAPI _CorExeMain2 ( PBYTE  ptrMemory,
DWORD  cntMemory,
LPWSTR  imageName,
LPWSTR  loaderName,
LPWSTR  cmdLine 
)

Definition at line 312 of file mscoree_main.c.

313{
314 TRACE("(%p, %lu, %s, %s, %s)\n", ptrMemory, cntMemory, debugstr_w(imageName), debugstr_w(loaderName), debugstr_w(cmdLine));
315 FIXME("Directly running .NET applications not supported.\n");
316 return -1;
317}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define debugstr_w
Definition: kernel32.h:32
UNICODE_STRING imageName
Definition: library.c:551
#define TRACE(s)
Definition: solgame.cpp:4

◆ _CorImageUnloading()

VOID WINAPI _CorImageUnloading ( PVOID  imageBase)

Definition at line 325 of file mscoree_main.c.

326{
327 TRACE("(%p): stub\n", imageBase);
328}

◆ _CorValidateImage()

HRESULT WINAPI _CorValidateImage ( PVOID imageBase,
LPCWSTR  imageName 
)

Definition at line 330 of file mscoree_main.c.

331{
332 TRACE("(%p, %s): stub\n", imageBase, debugstr_w(imageName));
333 return E_FAIL;
334}
#define E_FAIL
Definition: ddrawi.h:102

◆ CLRCreateInstance()

HRESULT WINAPI CLRCreateInstance ( REFCLSID  clsid,
REFIID  riid,
LPVOID ppInterface 
)

Definition at line 687 of file mscoree_main.c.

688{
690
691 if (IsEqualGUID(clsid, &CLSID_CLRMetaHost))
693 if (IsEqualGUID(clsid, &CLSID_CLRMetaHostPolicy))
695
696 FIXME("not implemented for class %s\n", debugstr_guid(clsid));
697
699}
HRESULT CLRMetaHostPolicy_CreateInstance(REFIID riid, void **ppobj)
Definition: metahost.c:1385
HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj)
Definition: metahost.c:1281
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
static REFIID LPVOID * ppInterface
Definition: metahost.c:40
const CLSID * clsid
Definition: msctf.cpp:50
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772

Referenced by CreateInterface().

◆ ClrCreateManagedInstance()

STDAPI ClrCreateManagedInstance ( LPCWSTR  pTypeName,
REFIID  riid,
void **  ppObject 
)

Definition at line 594 of file mscoree_main.c.

595{
596 HRESULT ret;
597 ICLRRuntimeInfo *info;
600 IUnknown *unk;
601
602 TRACE("(%s,%s,%p)\n", debugstr_w(pTypeName), debugstr_guid(riid), ppObject);
603
604 /* FIXME: How to determine which runtime version to use? */
606
607 if (SUCCEEDED(ret))
608 {
610
611 ICLRRuntimeInfo_Release(info);
612 }
613
614 if (SUCCEEDED(ret))
616
617 if (SUCCEEDED(ret))
619
620 if (SUCCEEDED(ret))
621 {
622 ret = IUnknown_QueryInterface(unk, riid, ppObject);
623 IUnknown_Release(unk);
624 }
625
626 return ret;
627}
HRESULT RuntimeHost_CreateManagedInstance(RuntimeHost *This, LPCWSTR name, MonoDomain *domain, MonoObject **result)
HRESULT RuntimeHost_GetIUnknownForObject(RuntimeHost *This, MonoObject *obj, IUnknown **ppUnk)
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file, IStream *config_stream, DWORD startup_flags, DWORD runtimeinfo_flags, BOOL legacy, ICLRRuntimeInfo **result)
Definition: metahost.c:1904
HRESULT ICLRRuntimeInfo_GetRuntimeHost(ICLRRuntimeInfo *iface, RuntimeHost **result)
Definition: metahost.c:703
return ret
Definition: mutex.c:146
#define SUCCEEDED(hr)
Definition: intsafe.h:50
@ RUNTIME_INFO_UPGRADE_VERSION
Definition: mscoree.idl:40
struct _MonoObject MonoObject
Definition: txthost.c:37

◆ CoEEShutDownCOM()

void WINAPI CoEEShutDownCOM ( void  )

Definition at line 972 of file mscoree_main.c.

973{
974 FIXME("stub.\n");
975}

◆ CoInitializeCor()

HRESULT WINAPI CoInitializeCor ( DWORD  fFlags)

Definition at line 510 of file mscoree_main.c.

511{
512 FIXME("(0x%08lx): stub\n", fFlags);
513 return S_OK;
514}
#define S_OK
Definition: intsafe.h:52

◆ compare_versions()

static int compare_versions ( const char a,
const char b 
)
static

Definition at line 751 of file mscoree_main.c.

752{
753 int a_parts[3], b_parts[3], i;
754
755 parse_msi_version_string(a, a_parts);
756 parse_msi_version_string(b, b_parts);
757
758 for (i=0; i<3; i++)
759 if (a_parts[i] != b_parts[i])
760 return a_parts[i] - b_parts[i];
761
762 return 0;
763}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
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
static void parse_msi_version_string(const char *version, int *parts)
Definition: mscoree_main.c:731

Referenced by get_support_msi(), and install_wine_mono().

◆ CorBindToCurrentRuntime()

HRESULT WINAPI CorBindToCurrentRuntime ( LPCWSTR  filename,
REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 573 of file mscoree_main.c.

574{
575 HRESULT ret;
576 ICLRRuntimeInfo *info;
577
578 TRACE("(%s, %s, %s, %p)\n", debugstr_w(filename), debugstr_guid(rclsid), debugstr_guid(riid), ppv);
579
580 *ppv = NULL;
581
583
584 if (SUCCEEDED(ret))
585 {
586 ret = ICLRRuntimeInfo_GetInterface(info, rclsid, riid, ppv);
587
588 ICLRRuntimeInfo_Release(info);
589 }
590
591 return ret;
592}
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * filename
Definition: ioapi.h:137

◆ CorBindToRuntimeEx()

HRESULT WINAPI CorBindToRuntimeEx ( LPWSTR  szVersion,
LPWSTR  szBuildFlavor,
DWORD  nflags,
REFCLSID  rslsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 550 of file mscoree_main.c.

552{
553 HRESULT ret;
554 ICLRRuntimeInfo *info;
555
556 TRACE("%s %s %ld %s %s %p\n", debugstr_w(szVersion), debugstr_w(szBuildFlavor), nflags, debugstr_guid( rslsid ),
558
559 *ppv = NULL;
560
562
563 if (SUCCEEDED(ret))
564 {
565 ret = ICLRRuntimeInfo_GetInterface(info, rslsid, riid, ppv);
566
567 ICLRRuntimeInfo_Release(info);
568 }
569
570 return ret;
571}
static LPCWSTR szVersion
Definition: asmcache.c:748

◆ CorBindToRuntimeHost()

HRESULT WINAPI CorBindToRuntimeHost ( LPCWSTR  pwszVersion,
LPCWSTR  pwszBuildFlavor,
LPCWSTR  pwszHostConfigFile,
VOID pReserved,
DWORD  startupFlags,
REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 199 of file mscoree_main.c.

203{
204 HRESULT ret;
205 ICLRRuntimeInfo *info;
206
207 TRACE("(%s, %s, %s, %p, %ld, %s, %s, %p)\n", debugstr_w(pwszVersion),
208 debugstr_w(pwszBuildFlavor), debugstr_w(pwszHostConfigFile), pReserved,
209 startupFlags, debugstr_guid(rclsid), debugstr_guid(riid), ppv);
210
211 *ppv = NULL;
212
213 ret = get_runtime_info(NULL, pwszVersion, pwszHostConfigFile, NULL, startupFlags, 0, TRUE, &info);
214
215 if (SUCCEEDED(ret))
216 {
217 ret = ICLRRuntimeInfo_GetInterface(info, rclsid, riid, ppv);
218
219 ICLRRuntimeInfo_Release(info);
220 }
221
222 return ret;
223}
_Out_ PVOID pReserved
Definition: netsh.h:77

◆ CorExitProcess()

void WINAPI CorExitProcess ( int  exitCode)

Definition at line 319 of file mscoree_main.c.

320{
321 TRACE("(%x)\n", exitCode);
322 CLRMetaHost_ExitProcess(0, exitCode);
323}
HRESULT WINAPI CLRMetaHost_ExitProcess(ICLRMetaHost *iface, INT32 iExitCode)
Definition: metahost.c:1244

◆ CorGetSvc()

HRESULT WINAPI CorGetSvc ( void unk)

Definition at line 392 of file mscoree_main.c.

393{
394 ERR_(winediag)("If this function is called, it is likely the result of a broken .NET installation\n");
395
396 return E_NOTIMPL;
397}
#define E_NOTIMPL
Definition: ddrawi.h:99
#define ERR_(ch,...)
Definition: debug.h:156

◆ CorIsLatestSvc()

HRESULT WINAPI CorIsLatestSvc ( int unk1,
int unk2 
)

Definition at line 382 of file mscoree_main.c.

383{
384 ERR_(winediag)("If this function is called, it is likely the result of a broken .NET installation\n");
385
386 if (!unk1 || !unk2)
387 return E_POINTER;
388
389 return S_OK;
390}
static DWORD unk1
Definition: cursoricon.c:1638
#define E_POINTER
Definition: winerror.h:3480

◆ CreateDebuggingInterfaceFromVersion()

HRESULT WINAPI CreateDebuggingInterfaceFromVersion ( int  nDebugVersion,
LPCWSTR  version,
IUnknown **  ppv 
)

Definition at line 648 of file mscoree_main.c.

649{
650 static const WCHAR v2_0[] = {'v','2','.','0','.','5','0','7','2','7',0};
651 HRESULT hr = E_FAIL;
652 ICLRRuntimeInfo *runtimeinfo;
653
654 if(nDebugVersion < 1 || nDebugVersion > 4)
655 return E_INVALIDARG;
656
657 TRACE("(%d %s, %p): stub\n", nDebugVersion, debugstr_w(version), ppv);
658
659 if(!ppv)
660 return E_INVALIDARG;
661
662 *ppv = NULL;
663
664 if(wcscmp(version, v2_0) != 0)
665 {
666 FIXME("Currently .NET Version '%s' not support.\n", debugstr_w(version));
667 return E_INVALIDARG;
668 }
669
670 if(nDebugVersion != 3)
671 return E_INVALIDARG;
672
673 hr = CLRMetaHost_GetRuntime(0, version, &IID_ICLRRuntimeInfo, (void**)&runtimeinfo);
674 if(hr == S_OK)
675 {
676 hr = ICLRRuntimeInfo_GetInterface(runtimeinfo, &CLSID_CLRDebuggingLegacy, &IID_ICorDebug, (void**)ppv);
677
678 ICLRRuntimeInfo_Release(runtimeinfo);
679 }
680
681 if(!*ppv)
682 return E_FAIL;
683
684 return hr;
685}
#define E_INVALIDARG
Definition: ddrawi.h:101
static IUnknown **const WCHAR v2_0[]
Definition: debugging.c:37
static const WCHAR version[]
Definition: asmname.c:66
HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost *iface, LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime)
Definition: metahost.c:1149
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
HRESULT hr
Definition: shlfolder.c:183
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ CreateInterface()

HRESULT WINAPI CreateInterface ( REFCLSID  clsid,
REFIID  riid,
LPVOID ppInterface 
)

Definition at line 701 of file mscoree_main.c.

702{
704
706}
HRESULT WINAPI CLRCreateInstance(REFCLSID clsid, REFIID riid, LPVOID *ppInterface)
Definition: mscoree_main.c:687

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 708 of file mscoree_main.c.

709{
710 mscorecf *This;
711 HRESULT hr;
712
713 TRACE("(%s, %s, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
714
715 if(!ppv)
716 return E_INVALIDARG;
717
718 This = malloc(sizeof(mscorecf));
719
720 This->IClassFactory_iface.lpVtbl = &mscorecf_vtbl;
721 This->pfnCreateInstance = create_monodata;
722 This->ref = 1;
723 This->clsid = *rclsid;
724
725 hr = IClassFactory_QueryInterface( &This->IClassFactory_iface, riid, ppv );
726 IClassFactory_Release(&This->IClassFactory_iface);
727
728 return hr;
729}
HRESULT create_monodata(REFCLSID clsid, LPVOID *ppObj)
#define malloc
Definition: debug_ros.c:4
static const struct IClassFactoryVtbl mscorecf_vtbl
Definition: mscoree_main.c:190

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 279 of file mscoree_main.c.

280{
281 TRACE("(%p, %ld, %p)\n", hinstDLL, fdwReason, lpvReserved);
282
283 switch (fdwReason)
284 {
287
289
291 return FALSE;
292
293 break;
297 break;
300 if (lpvReserved) break; /* process is terminating */
303 {
306 }
307 break;
308 }
309 return TRUE;
310}
static DWORD const fdwReason
void runtimehost_uninit(void)
void runtimehost_init(void)
#define free
Definition: debug_ros.c:5
#define FALSE
Definition: types.h:117
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1240
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1166
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
void expect_no_runtimes(void)
Definition: metahost.c:454
static IN DWORD IN LPVOID lpvReserved
static DWORD print_tls_index
Definition: mscoree_main.c:59
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:529

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 960 of file mscoree_main.c.

961{
963
965}
HRESULT __wine_register_resources(HMODULE module)
Definition: register.c:112
static BOOL install_wine_mono(void)
Definition: mscoree_main.c:850

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 967 of file mscoree_main.c.

968{
970}
HRESULT __wine_unregister_resources(HMODULE module)
Definition: register.c:124

◆ get_install_root()

static BOOL get_install_root ( LPWSTR  install_dir)
static

Definition at line 78 of file mscoree_main.c.

79{
80 static 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};
81 static const WCHAR install_root[] = {'I','n','s','t','a','l','l','R','o','o','t',0};
82
83 DWORD len;
84 HKEY key;
85
86 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key))
87 return FALSE;
88
89 len = MAX_PATH * sizeof(WCHAR);
90 if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len))
91 {
93 return FALSE;
94 }
96
97 return TRUE;
98}
#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
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define KEY_READ
Definition: nt_native.h:1026
Definition: copy.c:22
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by LoadLibraryShim().

◆ get_support_msi()

static BOOL get_support_msi ( LPCWSTR  mono_path,
LPWSTR  msi_path 
)
static

Definition at line 803 of file mscoree_main.c.

804{
805 static const WCHAR support_msi_relative[] = {'\\','s','u','p','p','o','r','t','\\','w','i','n','e','m','o','n','o','-','s','u','p','p','o','r','t','.','m','s','i',0};
806 UINT (WINAPI *pMsiOpenPackageW)(LPCWSTR,ULONG*);
807 UINT (WINAPI *pMsiGetProductPropertyA)(ULONG,LPCSTR,LPSTR,LPDWORD);
808 UINT (WINAPI *pMsiCloseHandle)(ULONG);
809 HMODULE hmsi = NULL;
810 char versionstringbuf[15];
811 UINT res;
813 ULONG msiproduct;
814 BOOL ret=FALSE;
815
816 hmsi = GetModuleHandleA("msi");
817
818 lstrcpyW(msi_path, mono_path);
819 lstrcatW(msi_path, support_msi_relative);
820
821 pMsiOpenPackageW = (void*)GetProcAddress(hmsi, "MsiOpenPackageW");
822
823 res = pMsiOpenPackageW(msi_path, &msiproduct);
824
825 if (res == ERROR_SUCCESS)
826 {
827 buffer_size = sizeof(versionstringbuf);
828
829 pMsiGetProductPropertyA = (void*)GetProcAddress(hmsi, "MsiGetProductPropertyA");
830
831 res = pMsiGetProductPropertyA(msiproduct, "ProductVersion", versionstringbuf, &buffer_size);
832
833 pMsiCloseHandle = (void*)GetProcAddress(hmsi, "MsiCloseHandle");
834
835 pMsiCloseHandle(msiproduct);
836 }
837
838 if (res == ERROR_SUCCESS) {
839 TRACE("found support msi version %s at %s\n", versionstringbuf, debugstr_w(msi_path));
840
841 if (compare_versions(WINE_MONO_VERSION, versionstringbuf) <= 0)
842 {
843 ret = TRUE;
844 }
845 }
846
847 return ret;
848}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define GetProcAddress(x, y)
Definition: compat.h:753
#define lstrcpyW
Definition: compat.h:749
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint res
Definition: glext.h:9613
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static int compare_versions(const char *a, const char *b)
Definition: mscoree_main.c:751
#define WINE_MONO_VERSION
unsigned int UINT
Definition: ndis.h:50
#define LPDWORD
Definition: nt_native.h:46
wchar_t const *const size_t const buffer_size
Definition: stat.cpp:95
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
const char * LPCSTR
Definition: xmlstorage.h:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char * LPSTR
Definition: xmlstorage.h:182

Referenced by install_wine_mono().

◆ GetAssemblyMDImport()

HRESULT WINAPI GetAssemblyMDImport ( LPCWSTR  szFileName,
REFIID  riid,
IUnknown **  ppIUnk 
)

Definition at line 516 of file mscoree_main.c.

517{
518 FIXME("(%p %s, %s, %p): stub\n", szFileName, debugstr_w(szFileName), debugstr_guid(riid), *ppIUnk);
520}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ GetCORSystemDirectory()

HRESULT WINAPI GetCORSystemDirectory ( LPWSTR  pbuffer,
DWORD  cchBuffer,
DWORD dwLength 
)

Definition at line 336 of file mscoree_main.c.

337{
338 ICLRRuntimeInfo *info;
339 HRESULT ret;
340
341 TRACE("(%p, %ld, %p)!\n", pbuffer, cchBuffer, dwLength);
342
343 if (!dwLength || !pbuffer)
344 return E_POINTER;
345
347
348 if (SUCCEEDED(ret))
349 {
351 ret = ICLRRuntimeInfo_GetRuntimeDirectory(info, pbuffer, dwLength);
352
353 ICLRRuntimeInfo_Release(info);
354 }
355
356 return ret;
357}
static DWORD DWORD * dwLength
Definition: fusion.c:86
static DWORD cchBuffer
Definition: fusion.c:85

◆ GetCORVersion()

HRESULT WINAPI GetCORVersion ( LPWSTR  pbuffer,
DWORD  cchBuffer,
DWORD dwLength 
)

Definition at line 359 of file mscoree_main.c.

360{
361 ICLRRuntimeInfo *info;
362 HRESULT ret;
363
364 TRACE("(%p, %ld, %p)!\n", pbuffer, cchBuffer, dwLength);
365
366 if (!dwLength || !pbuffer)
367 return E_POINTER;
368
370
371 if (SUCCEEDED(ret))
372 {
374 ret = ICLRRuntimeInfo_GetVersionString(info, pbuffer, dwLength);
375
376 ICLRRuntimeInfo_Release(info);
377 }
378
379 return ret;
380}

Referenced by LoadLibraryShim().

◆ GetFileVersion()

HRESULT WINAPI GetFileVersion ( LPCWSTR  szFilename,
LPWSTR  szBuffer,
DWORD  cchBuffer,
DWORD dwLength 
)

Definition at line 453 of file mscoree_main.c.

454{
455 TRACE("(%s, %p, %ld, %p)\n", debugstr_w(szFilename), szBuffer, cchBuffer, dwLength);
456
457 if (!szFilename || !dwLength)
458 return E_POINTER;
459
461 return CLRMetaHost_GetVersionFromFile(0, szFilename, szBuffer, dwLength);
462}
HRESULT WINAPI CLRMetaHost_GetVersionFromFile(ICLRMetaHost *iface, LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer)
Definition: metahost.c:1157

◆ GetRealProcAddress()

HRESULT WINAPI GetRealProcAddress ( LPCSTR  procname,
void **  ppv 
)

Definition at line 447 of file mscoree_main.c.

448{
449 FIXME("(%s, %p)\n", debugstr_a(procname), ppv);
451}
#define CLR_E_SHIM_RUNTIMEEXPORT
Definition: corerror.h:228
#define debugstr_a
Definition: kernel32.h:31

◆ GetRequestedRuntimeInfo()

HRESULT WINAPI GetRequestedRuntimeInfo ( LPCWSTR  pExe,
LPCWSTR  pwszVersion,
LPCWSTR  pConfigurationFile,
DWORD  startupFlags,
DWORD  runtimeInfoFlags,
LPWSTR  pDirectory,
DWORD  dwDirectory,
DWORD dwDirectoryLength,
LPWSTR  pVersion,
DWORD  cchBuffer,
DWORD dwlength 
)

Definition at line 399 of file mscoree_main.c.

402{
403 HRESULT ret;
404 ICLRRuntimeInfo *info;
405 DWORD length_dummy;
406
407 TRACE("(%s, %s, %s, 0x%08lx, 0x%08lx, %p, 0x%08lx, %p, %p, 0x%08lx, %p)\n", debugstr_w(pExe),
408 debugstr_w(pwszVersion), debugstr_w(pConfigurationFile), startupFlags, runtimeInfoFlags, pDirectory,
409 dwDirectory, dwDirectoryLength, pVersion, cchBuffer, dwlength);
410
411 if (!dwDirectoryLength) dwDirectoryLength = &length_dummy;
412
413 if (!dwlength) dwlength = &length_dummy;
414
415 ret = get_runtime_info(pExe, pwszVersion, pConfigurationFile, NULL, startupFlags, runtimeInfoFlags, TRUE, &info);
416
417 if (SUCCEEDED(ret))
418 {
419 *dwlength = cchBuffer;
420 ret = ICLRRuntimeInfo_GetVersionString(info, pVersion, dwlength);
421
422 if (SUCCEEDED(ret))
423 {
424 if(pwszVersion)
425 pVersion[0] = pwszVersion[0];
426
427 *dwDirectoryLength = dwDirectory;
428 ret = ICLRRuntimeInfo_GetRuntimeDirectory(info, pDirectory, dwDirectoryLength);
429 }
430
431 ICLRRuntimeInfo_Release(info);
432 }
433
434 return ret;
435}

Referenced by GetRequestedRuntimeVersion().

◆ GetRequestedRuntimeVersion()

HRESULT WINAPI GetRequestedRuntimeVersion ( LPWSTR  pExe,
LPWSTR  pVersion,
DWORD  cchBuffer,
DWORD dwlength 
)

Definition at line 437 of file mscoree_main.c.

438{
439 TRACE("(%s, %p, %ld, %p)\n", debugstr_w(pExe), pVersion, cchBuffer, dwlength);
440
441 if(!dwlength)
442 return E_POINTER;
443
444 return GetRequestedRuntimeInfo(pExe, NULL, NULL, 0, 0, NULL, 0, NULL, pVersion, cchBuffer, dwlength);
445}
HRESULT WINAPI GetRequestedRuntimeInfo(LPCWSTR pExe, LPCWSTR pwszVersion, LPCWSTR pConfigurationFile, DWORD startupFlags, DWORD runtimeInfoFlags, LPWSTR pDirectory, DWORD dwDirectory, DWORD *dwDirectoryLength, LPWSTR pVersion, DWORD cchBuffer, DWORD *dwlength)
Definition: mscoree_main.c:399

◆ GetVersionFromProcess()

HRESULT WINAPI GetVersionFromProcess ( HANDLE  hProcess,
LPWSTR  pVersion,
DWORD  cchBuffer,
DWORD dwLength 
)

Definition at line 522 of file mscoree_main.c.

523{
524 FIXME("(%p, %p, %ld, %p): stub\n", hProcess, pVersion, cchBuffer, dwLength);
525 return E_NOTIMPL;
526}
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71

◆ impl_from_IClassFactory()

static mscorecf * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 110 of file mscoree_main.c.

111{
112 return CONTAINING_RECORD(iface, mscorecf, IClassFactory_iface);
113}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by mscorecf_AddRef(), mscorecf_CreateInstance(), and mscorecf_Release().

◆ install_wine_mono()

static BOOL install_wine_mono ( void  )
static

Definition at line 850 of file mscoree_main.c.

851{
853 HMODULE hmsi = NULL;
854 HRESULT initresult = E_FAIL;
855 UINT (WINAPI *pMsiEnumRelatedProductsA)(LPCSTR,DWORD,DWORD,LPSTR);
856 UINT (WINAPI *pMsiGetProductInfoA)(LPCSTR,LPCSTR,LPSTR,DWORD*);
857 UINT (WINAPI *pMsiInstallProductW)(LPCWSTR,LPCWSTR);
858 char versionstringbuf[15];
859 char productcodebuf[39];
860 UINT res;
862 BOOL ret;
863 WCHAR mono_path[MAX_PATH];
864 WCHAR support_msi_path[MAX_PATH];
865
866 static const char* mono_upgrade_code = "{DE624609-C6B5-486A-9274-EF0B854F6BC5}";
867
869
870 if (is_wow64)
871 {
872 TRACE("not installing mono in wow64 process\n");
873 return TRUE;
874 }
875
876 TRACE("searching for mono runtime\n");
877
878 if (!get_mono_path(mono_path, FALSE))
879 {
880 TRACE("mono runtime not found\n");
881 return invoke_appwiz();
882 }
883
884 TRACE("mono runtime is at %s\n", debugstr_w(mono_path));
885
886 hmsi = LoadLibraryA("msi");
887
888 if (!hmsi)
889 {
890 ERR("couldn't load msi.dll\n");
891 return FALSE;
892 }
893
894 pMsiEnumRelatedProductsA = (void*)GetProcAddress(hmsi, "MsiEnumRelatedProductsA");
895
896 res = pMsiEnumRelatedProductsA(mono_upgrade_code, 0, 0, productcodebuf);
897
898 if (res == ERROR_SUCCESS)
899 {
900 pMsiGetProductInfoA = (void*)GetProcAddress(hmsi, "MsiGetProductInfoA");
901
902 buffer_size = sizeof(versionstringbuf);
903
904 res = pMsiGetProductInfoA(productcodebuf, "VersionString", versionstringbuf, &buffer_size);
905 }
906 else if (res != ERROR_NO_MORE_ITEMS)
907 {
908 ERR("MsiEnumRelatedProducts failed, err=%u\n", res);
909 }
910
911 if (res == ERROR_SUCCESS)
912 {
913 TRACE("found installed support package %s\n", versionstringbuf);
914
915 if (compare_versions(WINE_MONO_VERSION, versionstringbuf) <= 0)
916 {
917 TRACE("support package is at least %s, quitting\n", WINE_MONO_VERSION);
918 ret = TRUE;
919 goto end;
920 }
921 }
922
923 initresult = CoInitialize(NULL);
924
925 ret = get_support_msi(mono_path, support_msi_path);
926 if (!ret)
927 {
928 /* Try looking outside c:\windows\mono */
929 ret = (get_mono_path(mono_path, TRUE) &&
930 get_support_msi(mono_path, support_msi_path));
931 }
932
933 if (ret)
934 {
935 TRACE("installing support msi\n");
936
937 pMsiInstallProductW = (void*)GetProcAddress(hmsi, "MsiInstallProductW");
938
939 res = pMsiInstallProductW(support_msi_path, NULL);
940
941 if (res == ERROR_SUCCESS)
942 {
943 ret = TRUE;
944 goto end;
945 }
946 else
947 ERR("MsiInstallProduct failed, err=%i\n", res);
948 }
949
950 ret = invoke_appwiz();
951
952end:
953 if (hmsi)
954 FreeLibrary(hmsi);
955 if (SUCCEEDED(initresult))
957 return ret;
958}
#define ERR(fmt,...)
Definition: precomp.h:57
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
#define FreeLibrary(x)
Definition: compat.h:748
#define GetCurrentProcess()
Definition: compat.h:759
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define IsWow64Process
Definition: compat.h:760
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
BOOL get_mono_path(LPWSTR path, BOOL skip_local)
Definition: metahost.c:874
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
GLuint GLuint end
Definition: gl.h:1545
BOOL is_wow64
Definition: main.c:38
static BOOL get_support_msi(LPCWSTR mono_path, LPWSTR msi_path)
Definition: mscoree_main.c:803
static BOOL invoke_appwiz(void)
Definition: mscoree_main.c:765
#define DWORD
Definition: nt_native.h:44

Referenced by DllRegisterServer().

◆ invoke_appwiz()

static BOOL invoke_appwiz ( void  )
static

Definition at line 765 of file mscoree_main.c.

766{
769 WCHAR app[MAX_PATH];
770 WCHAR *args;
771 LONG len;
772 BOOL ret;
773
774 static const WCHAR controlW[] = {'\\','c','o','n','t','r','o','l','.','e','x','e',0};
775 static const WCHAR argsW[] =
776 {' ','a','p','p','w','i','z','.','c','p','l',' ','i','n','s','t','a','l','l','_','m','o','n','o',0};
777
778 len = GetSystemDirectoryW(app, MAX_PATH - ARRAY_SIZE(controlW));
779 memcpy(app+len, controlW, sizeof(controlW));
780
781 args = malloc(len * sizeof(WCHAR) + sizeof(controlW) + sizeof(argsW));
782 if(!args)
783 return FALSE;
784
785 memcpy(args, app, len*sizeof(WCHAR) + sizeof(controlW));
786 memcpy(args + len + ARRAY_SIZE(controlW) - 1, argsW, sizeof(argsW));
787
788 TRACE("starting %s\n", debugstr_w(args));
789
790 memset(&si, 0, sizeof(si));
791 si.cb = sizeof(si);
792 ret = CreateProcessW(app, args, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
793 free(args);
794 if (ret) {
798 }
799
800 return ret;
801}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define CloseHandle
Definition: compat.h:739
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2232
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4442
#define INFINITE
Definition: serial.h:102
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
static SYSTEM_INFO si
Definition: virtual.c:39
long LONG
Definition: pedump.c:60
#define memset(x, y, z)
Definition: compat.h:39
#define args
Definition: format.c:66
Definition: match.c:390
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82

Referenced by install_wine_mono().

◆ LoadLibraryShim()

HRESULT WINAPI LoadLibraryShim ( LPCWSTR  szDllName,
LPCWSTR  szVersion,
LPVOID  pvReserved,
HMODULE phModDll 
)

Definition at line 464 of file mscoree_main.c.

465{
467 WCHAR dll_filename[MAX_PATH];
469 static const WCHAR default_version[] = {'v','1','.','1','.','4','3','2','2',0};
470 static const WCHAR slash[] = {'\\',0};
471 DWORD dummy;
472
473 TRACE("(%p %s, %p, %p, %p)\n", szDllName, debugstr_w(szDllName), szVersion, pvReserved, phModDll);
474
475 if (!szDllName || !phModDll)
476 return E_POINTER;
477
478 if (!get_install_root(dll_filename))
479 {
480 ERR("error reading registry key for installroot\n");
481 dll_filename[0] = 0;
482 }
483 else
484 {
485 if (!szVersion)
486 {
488 if (SUCCEEDED(ret))
490 else
491 szVersion = default_version;
492 }
493 lstrcatW(dll_filename, szVersion);
494 lstrcatW(dll_filename, slash);
495 }
496
497 lstrcatW(dll_filename, szDllName);
498
499 *phModDll = LoadLibraryW(dll_filename);
500
501 return *phModDll ? S_OK : E_HANDLE;
502}
static const WCHAR szDllName[]
Definition: sip.c:61
#define LoadLibraryW(x)
Definition: compat.h:747
static LPCWSTR LPVOID pvReserved
Definition: asmcache.c:749
static LPCWSTR LPVOID HMODULE * phModDll
Definition: asmcache.c:749
HRESULT WINAPI GetCORVersion(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
Definition: mscoree_main.c:359
static BOOL get_install_root(LPWSTR install_dir)
Definition: mscoree_main.c:78
#define E_HANDLE
Definition: winerror.h:4117

Referenced by CLRRuntimeInfo_LoadLibrary(), create_monodata(), and get_file_from_strongname().

◆ LoadStringRC()

HRESULT WINAPI LoadStringRC ( UINT  resId,
LPWSTR  pBuffer,
int  iBufLen,
int  bQuiet 
)

Definition at line 545 of file mscoree_main.c.

546{
547 return LoadStringRCEx(-1, resId, pBuffer, iBufLen, bQuiet, NULL);
548}
HRESULT WINAPI LoadStringRCEx(LCID culture, UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet, int *pBufLen)
Definition: mscoree_main.c:528
PVOID pBuffer

◆ LoadStringRCEx()

HRESULT WINAPI LoadStringRCEx ( LCID  culture,
UINT  resId,
LPWSTR  pBuffer,
int  iBufLen,
int  bQuiet,
int pBufLen 
)

Definition at line 528 of file mscoree_main.c.

529{
530 HRESULT res = S_OK;
531 if ((iBufLen <= 0) || !pBuffer)
532 return E_INVALIDARG;
533 pBuffer[0] = 0;
534 if (resId) {
535 FIXME("(%ld, %x, %p, %d, %d, %p): semi-stub\n", culture, resId, pBuffer, iBufLen, bQuiet, pBufLen);
536 res = E_NOTIMPL;
537 }
538 else
539 res = E_FAIL;
540 if (pBufLen)
541 *pBufLen = lstrlenW(pBuffer);
542 return res;
543}
#define lstrlenW
Definition: compat.h:750
static const WCHAR culture[]
Definition: asmname.c:67

Referenced by LoadStringRC().

◆ LockClrVersion()

HRESULT WINAPI LockClrVersion ( FLockClrVersionCallback  hostCallback,
FLockClrVersionCallback pBeginHostSetup,
FLockClrVersionCallback pEndHostSetup 
)

Definition at line 504 of file mscoree_main.c.

505{
506 FIXME("(%p %p %p): stub\n", hostCallback, pBeginHostSetup, pEndHostSetup);
507 return S_OK;
508}

◆ mono_log_handler_fn()

void CDECL mono_log_handler_fn ( const char log_domain,
const char log_level,
const char message,
INT  fatal,
void user_data 
)

Definition at line 265 of file mscoree_main.c.

266{
267 SIZE_T len = (log_domain ? strlen(log_domain) + 2 : 0) + strlen(message) + strlen("\n") + 1;
268 char *msg = calloc(len, sizeof(char));
269
270 if (msg)
271 {
272 sprintf(msg, "%s%s%s\n", log_domain ? log_domain : "", log_domain ? ": " : "", message);
274 }
275
276 free(msg);
277}
#define msg(x)
Definition: auth_time.c:54
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
#define sprintf
Definition: sprintf.c:45
void CDECL mono_print_handler_fn(const char *string, INT is_stdout)
Definition: mscoree_main.c:225
#define calloc
Definition: rosglue.h:14
Definition: tftpd.h:60
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by load_mono().

◆ mono_print_handler_fn()

void CDECL mono_print_handler_fn ( const char string,
INT  is_stdout 
)

Definition at line 225 of file mscoree_main.c.

226{
228
229 if (!tls)
230 {
231 tls = malloc(sizeof(*tls));
232 tls->length = 0;
234 }
235
236 while (*string)
237 {
238 int remaining_buffer = sizeof(tls->buffer) - tls->length;
239 int length = strlen(string);
240 const char *newline = memchr(string, '\n', min(length, remaining_buffer));
241
242 if (newline)
243 {
244 length = newline - string + 1;
245 wine_dbg_printf("%.*s%.*s", tls->length, tls->buffer, length, string);
246 tls->length = 0;
247 string += length;
248 }
249 else if (length > remaining_buffer)
250 {
251 /* this would overflow Wine's debug buffer */
252 wine_dbg_printf("%.*s%.*s\n", tls->length, tls->buffer, remaining_buffer, string);
253 tls->length = 0;
254 string += remaining_buffer;
255 }
256 else
257 {
258 memcpy(tls->buffer + tls->length, string, length);
259 tls->length += length;
260 break;
261 }
262 }
263}
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1276
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define memchr(s, c, n)
Definition: mkisofs.h:875
#define min(a, b)
Definition: monoChain.cc:55
const char int wine_dbg_printf(const char *format,...) __WINE_PRINTF_ATTR(1
static DWORD tls
Definition: sock.c:229

Referenced by load_mono(), and mono_log_handler_fn().

◆ mscorecf_AddRef()

static ULONG WINAPI mscorecf_AddRef ( IClassFactory iface)
static

Definition at line 131 of file mscoree_main.c.

132{
135
136 TRACE("%p ref=%lu\n", This, ref);
137
138 return ref;
139}
#define InterlockedIncrement
Definition: armddk.h:53
static mscorecf * impl_from_IClassFactory(IClassFactory *iface)
Definition: mscoree_main.c:110
Definition: send.c:48

◆ mscorecf_CreateInstance()

static HRESULT WINAPI mscorecf_CreateInstance ( IClassFactory iface,
LPUNKNOWN  pOuter,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 156 of file mscoree_main.c.

158{
160 HRESULT hr;
161 IUnknown *punk;
162
163 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj );
164
165 *ppobj = NULL;
166
167 if (pOuter)
169
170 hr = This->pfnCreateInstance( &This->clsid, (LPVOID*) &punk );
171 if (SUCCEEDED(hr))
172 {
173 hr = IUnknown_QueryInterface( punk, riid, ppobj );
174
175 IUnknown_Release( punk );
176 }
177 else
178 {
179 WARN("Cannot create an instance object. 0x%08lx\n", hr);
180 }
181 return hr;
182}
#define WARN(fmt,...)
Definition: precomp.h:61
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

◆ mscorecf_LockServer()

static HRESULT WINAPI mscorecf_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 184 of file mscoree_main.c.

185{
186 FIXME("(%p)->(%d),stub!\n",iface,dolock);
187 return S_OK;
188}

◆ mscorecf_QueryInterface()

static HRESULT WINAPI mscorecf_QueryInterface ( IClassFactory iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 115 of file mscoree_main.c.

116{
117 TRACE("%s %p\n", debugstr_guid(riid), ppobj);
118
121 {
122 IClassFactory_AddRef( iface );
123 *ppobj = iface;
124 return S_OK;
125 }
126
127 ERR("interface %s not implemented\n", debugstr_guid(riid));
128 return E_NOINTERFACE;
129}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ mscorecf_Release()

static ULONG WINAPI mscorecf_Release ( IClassFactory iface)
static

Definition at line 141 of file mscoree_main.c.

142{
145
146 TRACE("%p ref=%lu\n", This, ref);
147
148 if (ref == 0)
149 {
150 free(This);
151 }
152
153 return ref;
154}
#define InterlockedDecrement
Definition: armddk.h:52

◆ ND_CopyObjDst()

void WINAPI ND_CopyObjDst ( const void src,
void dst,
INT  offset,
INT  size 
)

Definition at line 1017 of file mscoree_main.c.

1018{
1019 memcpy( (BYTE *)dst + offset, src, size );
1020}
GLenum src
Definition: glext.h:6340
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLenum GLenum dst
Definition: glext.h:6340
unsigned char BYTE
Definition: xxhash.c:193

◆ ND_CopyObjSrc()

void WINAPI ND_CopyObjSrc ( const void src,
INT  offset,
void dst,
INT  size 
)

Definition at line 1022 of file mscoree_main.c.

1023{
1024 memcpy( dst, (const BYTE *)src + offset, size );
1025}

◆ ND_RI2()

INT WINAPI ND_RI2 ( const void ptr,
INT  offset 
)

Definition at line 982 of file mscoree_main.c.

983{
984 return *(const SHORT *)((const BYTE *)ptr + offset);
985}
static PVOID ptr
Definition: dispmode.c:27
short SHORT
Definition: pedump.c:59

◆ ND_RI4()

INT WINAPI ND_RI4 ( const void ptr,
INT  offset 
)

Definition at line 987 of file mscoree_main.c.

988{
989 return *(const INT *)((const BYTE *)ptr + offset);
990}
int32_t INT
Definition: typedefs.h:58

◆ ND_RI8()

INT64 WINAPI ND_RI8 ( const void ptr,
INT  offset 
)

Definition at line 992 of file mscoree_main.c.

993{
994 return *(const INT64 *)((const BYTE *)ptr + offset);
995}
COMPILER_DEPENDENT_INT64 INT64
Definition: actypes.h:132

◆ ND_RU1()

INT WINAPI ND_RU1 ( const void ptr,
INT  offset 
)

Definition at line 977 of file mscoree_main.c.

978{
979 return *((const BYTE *)ptr + offset);
980}

◆ ND_WI2()

void WINAPI ND_WI2 ( void ptr,
INT  offset,
SHORT  val 
)

Definition at line 1002 of file mscoree_main.c.

1003{
1004 *(SHORT *)((BYTE *)ptr + offset) = val;
1005}
GLuint GLfloat * val
Definition: glext.h:7180

◆ ND_WI4()

void WINAPI ND_WI4 ( void ptr,
INT  offset,
INT  val 
)

Definition at line 1007 of file mscoree_main.c.

1008{
1009 *(INT *)((BYTE *)ptr + offset) = val;
1010}

◆ ND_WI8()

void WINAPI ND_WI8 ( void ptr,
INT  offset,
INT64  val 
)

Definition at line 1012 of file mscoree_main.c.

1013{
1014 *(INT64 *)((BYTE *)ptr + offset) = val;
1015}

◆ ND_WU1()

void WINAPI ND_WU1 ( void ptr,
INT  offset,
BYTE  val 
)

Definition at line 997 of file mscoree_main.c.

998{
999 *((BYTE *)ptr + offset) = val;
1000}

◆ parse_msi_version_string()

static void parse_msi_version_string ( const char version,
int parts 
)
static

Definition at line 731 of file mscoree_main.c.

732{
733 const char *minor_start, *build_start;
734
735 parts[0] = atoi(version);
736
737 parts[1] = parts[2] = 0;
738
739 minor_start = strchr(version, '.');
740 if (minor_start)
741 {
742 minor_start++;
743 parts[1] = atoi(minor_start);
744
745 build_start = strchr(minor_start, '.');
746 if (build_start)
747 parts[2] = atoi(build_start+1);
748 }
749}
std::map< E_STRING, PART_TEST > parts
Definition: LocaleTests.cpp:67
_ACRTIMP int __cdecl atoi(const char *)
Definition: string.c:1715
_ACRTIMP char *__cdecl strchr(const char *, int)
Definition: string.c:3286

Referenced by compare_versions().

◆ StrongNameSignatureVerification()

BOOLEAN WINAPI StrongNameSignatureVerification ( LPCWSTR  filename,
DWORD  inFlags,
DWORD pOutFlags 
)

Definition at line 629 of file mscoree_main.c.

630{
631 FIXME("(%s, 0x%lX, %p): stub\n", debugstr_w(filename), inFlags, pOutFlags);
632 return FALSE;
633}

◆ StrongNameSignatureVerificationEx()

BOOLEAN WINAPI StrongNameSignatureVerificationEx ( LPCWSTR  filename,
BOOLEAN  forceVerification,
BOOLEAN pVerified 
)

Definition at line 635 of file mscoree_main.c.

636{
637 FIXME("(%s, %u, %p): stub\n", debugstr_w(filename), forceVerification, pVerified);
638 *pVerified = TRUE;
639 return TRUE;
640}

◆ StrongNameTokenFromAssembly()

BOOLEAN WINAPI StrongNameTokenFromAssembly ( LPCWSTR  path,
BYTE **  token,
ULONG size 
)

Definition at line 642 of file mscoree_main.c.

643{
644 FIXME("(%s, %p, %p): stub\n", debugstr_w(path), token, size);
645 return FALSE;
646}
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 token
Definition: glfuncs.h:210

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( winediag  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mscoree  )

◆ WtoA()

Variable Documentation

◆ mscorecf_vtbl

const struct IClassFactoryVtbl mscorecf_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI mscorecf_AddRef(IClassFactory *iface)
Definition: mscoree_main.c:131
static HRESULT WINAPI mscorecf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: mscoree_main.c:115
static ULONG WINAPI mscorecf_Release(IClassFactory *iface)
Definition: mscoree_main.c:141
static HRESULT WINAPI mscorecf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: mscoree_main.c:184
static HRESULT WINAPI mscorecf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: mscoree_main.c:156

Definition at line 190 of file mscoree_main.c.

Referenced by DllGetClassObject().

◆ print_tls_index

DWORD print_tls_index = TLS_OUT_OF_INDEXES
static

Definition at line 59 of file mscoree_main.c.

Referenced by DllMain(), and mono_print_handler_fn().