ReactOS 0.4.15-dev-7934-g1dc8d80
mscoree_main.c File Reference
#include "mscoree_private.h"
#include <rpcproxy.h>
Include dependency graph for mscoree_main.c:

Go to the source code of this file.

Classes

struct  mscorecf
 

Typedefs

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

Functions

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)
 
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 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)
 
BOOL WINAPI StrongNameSignatureVerification (LPCWSTR filename, DWORD inFlags, DWORD *pOutFlags)
 
BOOL WINAPI StrongNameSignatureVerificationEx (LPCWSTR filename, BOOL forceVerification, BOOL *pVerified)
 
HRESULT WINAPI CreateConfigStream (LPCWSTR filename, IStream **stream)
 
HRESULT WINAPI CreateDebuggingInterfaceFromVersion (int nDebugVersion, LPCWSTR version, IUnknown **ppv)
 
HRESULT WINAPI CLRCreateInstance (REFCLSID clsid, REFIID riid, LPVOID *ppInterface)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 
HRESULT WINAPI DllCanUnloadNow (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 HINSTANCE MSCOREE_hInstance
 
static const struct IClassFactoryVtbl mscorecf_vtbl
 

Typedef Documentation

◆ fnCreateInstance

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

Definition at line 28 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 215 of file mscoree_main.c.

216{
217 TRACE("(%p, %u, %s, %s, %s)\n", ptrMemory, cntMemory, debugstr_w(imageName), debugstr_w(loaderName), debugstr_w(cmdLine));
218 FIXME("Directly running .NET applications not supported.\n");
219 return -1;
220}
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4

◆ _CorImageUnloading()

VOID WINAPI _CorImageUnloading ( PVOID  imageBase)

Definition at line 229 of file mscoree_main.c.

230{
231 TRACE("(%p): stub\n", imageBase);
232}

◆ _CorValidateImage()

HRESULT WINAPI _CorValidateImage ( PVOID imageBase,
LPCWSTR  imageName 
)

Definition at line 234 of file mscoree_main.c.

235{
236 TRACE("(%p, %s): stub\n", imageBase, debugstr_w(imageName));
237 return E_FAIL;
238}
#define E_FAIL
Definition: ddrawi.h:102

◆ CLRCreateInstance()

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

Definition at line 558 of file mscoree_main.c.

559{
561
562 if (IsEqualGUID(clsid, &CLSID_CLRMetaHost))
564
565 FIXME("not implemented for class %s\n", debugstr_guid(clsid));
566
568}
HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj)
Definition: metahost.c:1155
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
static REFIID LPVOID * ppInterface
Definition: metahost.c:34
REFCLSID clsid
Definition: msctf.c:82
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ ClrCreateManagedInstance()

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

Definition at line 466 of file mscoree_main.c.

467{
468 HRESULT ret;
472 IUnknown *unk;
473
474 TRACE("(%s,%s,%p)\n", debugstr_w(pTypeName), debugstr_guid(riid), ppObject);
475
476 /* FIXME: How to determine which runtime version to use? */
478
479 if (SUCCEEDED(ret))
480 {
482
483 ICLRRuntimeInfo_Release(info);
484 }
485
486 if (SUCCEEDED(ret))
488
489 if (SUCCEEDED(ret))
491
492 if (SUCCEEDED(ret))
493 {
494 ret = IUnknown_QueryInterface(unk, riid, ppObject);
495 IUnknown_Release(unk);
496 }
497
498 return ret;
499}
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, 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
#define SUCCEEDED(hr)
Definition: intsafe.h:50
@ RUNTIME_INFO_UPGRADE_VERSION
Definition: mscoree.idl:40
struct _MonoObject MonoObject
int ret
char * host
Definition: whois.c:55

◆ CoEEShutDownCOM()

void WINAPI CoEEShutDownCOM ( void  )

Definition at line 608 of file mscoree_main.c.

609{
610 FIXME("stub.\n");
611}

◆ CoInitializeCor()

HRESULT WINAPI CoInitializeCor ( DWORD  fFlags)

Definition at line 397 of file mscoree_main.c.

398{
399 FIXME("(0x%08x): stub\n", fFlags);
400 return S_OK;
401}
#define S_OK
Definition: intsafe.h:52

◆ CorBindToCurrentRuntime()

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

Definition at line 460 of file mscoree_main.c.

461{
462 FIXME("(%s, %s, %s, %p): stub\n", debugstr_w(filename), debugstr_guid(rclsid), debugstr_guid(riid), ppv);
463 return E_NOTIMPL;
464}
#define E_NOTIMPL
Definition: ddrawi.h:99
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 437 of file mscoree_main.c.

439{
440 HRESULT ret;
442
443 TRACE("%s %s %d %s %s %p\n", debugstr_w(szVersion), debugstr_w(szBuildFlavor), nflags, debugstr_guid( rslsid ),
445
446 *ppv = NULL;
447
449
450 if (SUCCEEDED(ret))
451 {
452 ret = ICLRRuntimeInfo_GetInterface(info, rslsid, riid, ppv);
453
454 ICLRRuntimeInfo_Release(info);
455 }
456
457 return ret;
458}
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 166 of file mscoree_main.c.

170{
171 HRESULT ret;
173
174 TRACE("(%s, %s, %s, %p, %d, %s, %s, %p)\n", debugstr_w(pwszVersion),
175 debugstr_w(pwszBuildFlavor), debugstr_w(pwszHostConfigFile), pReserved,
176 startupFlags, debugstr_guid(rclsid), debugstr_guid(riid), ppv);
177
178 *ppv = NULL;
179
180 ret = get_runtime_info(NULL, pwszVersion, pwszHostConfigFile, startupFlags, 0, TRUE, &info);
181
182 if (SUCCEEDED(ret))
183 {
184 ret = ICLRRuntimeInfo_GetInterface(info, rclsid, riid, ppv);
185
186 ICLRRuntimeInfo_Release(info);
187 }
188
189 return ret;
190}

◆ CorExitProcess()

void WINAPI CorExitProcess ( int  exitCode)

Definition at line 222 of file mscoree_main.c.

223{
224 TRACE("(%x)\n", exitCode);
226 ExitProcess(exitCode);
227}
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487
void unload_all_runtimes(void)
Definition: metahost.c:266

◆ CreateConfigStream()

HRESULT WINAPI CreateConfigStream ( LPCWSTR  filename,
IStream **  stream 
)

Definition at line 513 of file mscoree_main.c.

514{
515 FIXME("(%s, %p): stub\n", debugstr_w(filename), stream);
516 return E_NOTIMPL;
517}
Definition: parse.h:23

◆ CreateDebuggingInterfaceFromVersion()

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

Definition at line 519 of file mscoree_main.c.

520{
521 const WCHAR v2_0[] = {'v','2','.','0','.','5','0','7','2','7',0};
522 HRESULT hr = E_FAIL;
523 ICLRRuntimeInfo *runtimeinfo;
524
525 if(nDebugVersion < 1 || nDebugVersion > 4)
526 return E_INVALIDARG;
527
528 TRACE("(%d %s, %p): stub\n", nDebugVersion, debugstr_w(version), ppv);
529
530 if(!ppv)
531 return E_INVALIDARG;
532
533 *ppv = NULL;
534
535 if(strcmpW(version, v2_0) != 0)
536 {
537 FIXME("Currently .NET Version '%s' not support.\n", debugstr_w(version));
538 return E_INVALIDARG;
539 }
540
541 if(nDebugVersion != 3)
542 return E_INVALIDARG;
543
544 hr = CLRMetaHost_GetRuntime(0, version, &IID_ICLRRuntimeInfo, (void**)&runtimeinfo);
545 if(hr == S_OK)
546 {
547 hr = ICLRRuntimeInfo_GetInterface(runtimeinfo, &CLSID_CLRDebuggingLegacy, &IID_ICorDebug, (void**)ppv);
548
549 ICLRRuntimeInfo_Release(runtimeinfo);
550 }
551
552 if(!*ppv)
553 return E_FAIL;
554
555 return hr;
556}
#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:1010
#define strcmpW(s1, s2)
Definition: unicode.h:38
HRESULT hr
Definition: shlfolder.c:183
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( VOID  )

Definition at line 603 of file mscoree_main.c.

604{
605 return S_FALSE;
606}
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 570 of file mscoree_main.c.

571{
572 mscorecf *This;
573 HRESULT hr;
574
575 TRACE("(%s, %s, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
576
577 if(!ppv)
578 return E_INVALIDARG;
579
580 This = HeapAlloc(GetProcessHeap(), 0, sizeof(mscorecf));
581
582 This->IClassFactory_iface.lpVtbl = &mscorecf_vtbl;
583 This->pfnCreateInstance = &create_monodata;
584 This->ref = 1;
585 This->clsid = *rclsid;
586
587 hr = IClassFactory_QueryInterface( &This->IClassFactory_iface, riid, ppv );
588 IClassFactory_Release(&This->IClassFactory_iface);
589
590 return hr;
591}
HRESULT create_monodata(REFIID riid, LPVOID *ppObj)
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
static const struct IClassFactoryVtbl mscorecf_vtbl
Definition: mscoree_main.c:157

◆ DllMain()

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

Definition at line 192 of file mscoree_main.c.

193{
194 TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
195
196 MSCOREE_hInstance = hinstDLL;
197
198 switch (fdwReason)
199 {
200 case DLL_WINE_PREATTACH:
201 return FALSE; /* prefer native version */
205 break;
208 if (lpvReserved) break; /* process is terminating */
210 break;
211 }
212 return TRUE;
213}
void runtimehost_uninit(void)
void runtimehost_init(void)
#define FALSE
Definition: types.h:117
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
void expect_no_runtimes(void)
Definition: metahost.c:289
static IN DWORD IN LPVOID lpvReserved
static HINSTANCE MSCOREE_hInstance
Definition: mscoree_main.c:26

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 593 of file mscoree_main.c.

594{
596}
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 598 of file mscoree_main.c.

599{
601}
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ get_install_root()

static BOOL get_install_root ( LPWSTR  install_dir)
static

Definition at line 45 of file mscoree_main.c.

46{
47 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};
48 const WCHAR install_root[] = {'I','n','s','t','a','l','l','R','o','o','t',0};
49
50 DWORD len;
51 HKEY key;
52
53 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key))
54 return FALSE;
55
56 len = MAX_PATH * sizeof(WCHAR);
57 if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len))
58 {
60 return FALSE;
61 }
63
64 return TRUE;
65}
#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:1023
Definition: copy.c:22
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by LoadLibraryShim().

◆ GetAssemblyMDImport()

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

Definition at line 403 of file mscoree_main.c.

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

◆ GetCORSystemDirectory()

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

Definition at line 240 of file mscoree_main.c.

241{
243 HRESULT ret;
244
245 TRACE("(%p, %d, %p)!\n", pbuffer, cchBuffer, dwLength);
246
247 if (!dwLength || !pbuffer)
248 return E_POINTER;
249
251
252 if (SUCCEEDED(ret))
253 {
255 ret = ICLRRuntimeInfo_GetRuntimeDirectory(info, pbuffer, dwLength);
256
257 ICLRRuntimeInfo_Release(info);
258 }
259
260 return ret;
261}
static DWORD DWORD * dwLength
Definition: fusion.c:86
static DWORD cchBuffer
Definition: fusion.c:85
#define E_POINTER
Definition: winerror.h:2365

◆ GetCORVersion()

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

Definition at line 263 of file mscoree_main.c.

264{
266 HRESULT ret;
267
268 TRACE("(%p, %d, %p)!\n", pbuffer, cchBuffer, dwLength);
269
270 if (!dwLength || !pbuffer)
271 return E_POINTER;
272
274
275 if (SUCCEEDED(ret))
276 {
278 ret = ICLRRuntimeInfo_GetVersionString(info, pbuffer, dwLength);
279
280 ICLRRuntimeInfo_Release(info);
281 }
282
283 return ret;
284}

Referenced by LoadLibraryShim().

◆ GetFileVersion()

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

Definition at line 340 of file mscoree_main.c.

341{
342 TRACE("(%s, %p, %d, %p)\n", debugstr_w(szFilename), szBuffer, cchBuffer, dwLength);
343
344 if (!szFilename || !dwLength)
345 return E_POINTER;
346
348 return CLRMetaHost_GetVersionFromFile(0, szFilename, szBuffer, dwLength);
349}
HRESULT WINAPI CLRMetaHost_GetVersionFromFile(ICLRMetaHost *iface, LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer)
Definition: metahost.c:1049

◆ GetRealProcAddress()

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

Definition at line 334 of file mscoree_main.c.

335{
336 FIXME("(%s, %p)\n", debugstr_a(procname), ppv);
338}
#define CLR_E_SHIM_RUNTIMEEXPORT
Definition: corerror.h:128
#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 286 of file mscoree_main.c.

289{
290 HRESULT ret;
292 DWORD length_dummy;
293
294 TRACE("(%s, %s, %s, 0x%08x, 0x%08x, %p, 0x%08x, %p, %p, 0x%08x, %p)\n", debugstr_w(pExe),
295 debugstr_w(pwszVersion), debugstr_w(pConfigurationFile), startupFlags, runtimeInfoFlags, pDirectory,
296 dwDirectory, dwDirectoryLength, pVersion, cchBuffer, dwlength);
297
298 if (!dwDirectoryLength) dwDirectoryLength = &length_dummy;
299
300 if (!dwlength) dwlength = &length_dummy;
301
302 ret = get_runtime_info(pExe, pwszVersion, pConfigurationFile, startupFlags, runtimeInfoFlags, TRUE, &info);
303
304 if (SUCCEEDED(ret))
305 {
306 *dwlength = cchBuffer;
307 ret = ICLRRuntimeInfo_GetVersionString(info, pVersion, dwlength);
308
309 if (SUCCEEDED(ret))
310 {
311 if(pwszVersion)
312 pVersion[0] = pwszVersion[0];
313
314 *dwDirectoryLength = dwDirectory;
315 ret = ICLRRuntimeInfo_GetRuntimeDirectory(info, pDirectory, dwDirectoryLength);
316 }
317
318 ICLRRuntimeInfo_Release(info);
319 }
320
321 return ret;
322}

Referenced by GetRequestedRuntimeVersion().

◆ GetRequestedRuntimeVersion()

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

Definition at line 324 of file mscoree_main.c.

325{
326 TRACE("(%s, %p, %d, %p)\n", debugstr_w(pExe), pVersion, cchBuffer, dwlength);
327
328 if(!dwlength)
329 return E_POINTER;
330
331 return GetRequestedRuntimeInfo(pExe, NULL, NULL, 0, 0, NULL, 0, NULL, pVersion, cchBuffer, dwlength);
332}
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:286

◆ GetVersionFromProcess()

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

Definition at line 409 of file mscoree_main.c.

410{
411 FIXME("(%p, %p, %d, %p): stub\n", hProcess, pVersion, cchBuffer, dwLength);
412 return E_NOTIMPL;
413}
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71

◆ impl_from_IClassFactory()

static mscorecf * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 77 of file mscoree_main.c.

78{
79 return CONTAINING_RECORD(iface, mscorecf, IClassFactory_iface);
80}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

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

◆ LoadLibraryShim()

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

Definition at line 351 of file mscoree_main.c.

352{
354 WCHAR dll_filename[MAX_PATH];
356 static const WCHAR default_version[] = {'v','1','.','1','.','4','3','2','2',0};
357 static const WCHAR slash[] = {'\\',0};
358 DWORD dummy;
359
360 TRACE("(%p %s, %p, %p, %p)\n", szDllName, debugstr_w(szDllName), szVersion, pvReserved, phModDll);
361
362 if (!szDllName || !phModDll)
363 return E_POINTER;
364
365 if (!get_install_root(dll_filename))
366 {
367 ERR("error reading registry key for installroot\n");
368 dll_filename[0] = 0;
369 }
370 else
371 {
372 if (!szVersion)
373 {
375 if (SUCCEEDED(ret))
377 else
378 szVersion = default_version;
379 }
380 strcatW(dll_filename, szVersion);
381 strcatW(dll_filename, slash);
382 }
383
384 strcatW(dll_filename, szDllName);
385
386 *phModDll = LoadLibraryW(dll_filename);
387
388 return *phModDll ? S_OK : E_HANDLE;
389}
#define ERR(fmt,...)
Definition: debug.h:110
static const WCHAR szDllName[]
Definition: sip.c:61
#define LoadLibraryW(x)
Definition: compat.h:747
static LPCSTR DWORD void * pvReserved
Definition: str.c:196
static LPCWSTR LPVOID HMODULE * phModDll
Definition: asmcache.c:749
HRESULT WINAPI GetCORVersion(LPWSTR pbuffer, DWORD cchBuffer, DWORD *dwLength)
Definition: mscoree_main.c:263
static BOOL get_install_root(LPWSTR install_dir)
Definition: mscoree_main.c:45
#define strcatW(d, s)
Definition: unicode.h:30
#define E_HANDLE
Definition: winerror.h:2850

Referenced by CLRRuntimeInfo_LoadLibrary(), and mono_assembly_search_hook_fn().

◆ LoadStringRC()

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

Definition at line 432 of file mscoree_main.c.

433{
434 return LoadStringRCEx(-1, resId, pBuffer, iBufLen, bQuiet, NULL);
435}
HRESULT WINAPI LoadStringRCEx(LCID culture, UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet, int *pBufLen)
Definition: mscoree_main.c:415
PVOID pBuffer

◆ LoadStringRCEx()

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

Definition at line 415 of file mscoree_main.c.

416{
417 HRESULT res = S_OK;
418 if ((iBufLen <= 0) || !pBuffer)
419 return E_INVALIDARG;
420 pBuffer[0] = 0;
421 if (resId) {
422 FIXME("(%d, %x, %p, %d, %d, %p): semi-stub\n", culture, resId, pBuffer, iBufLen, bQuiet, pBufLen);
423 res = E_NOTIMPL;
424 }
425 else
426 res = E_FAIL;
427 if (pBufLen)
428 *pBufLen = lstrlenW(pBuffer);
429 return res;
430}
#define lstrlenW
Definition: compat.h:750
static const WCHAR culture[]
Definition: asmname.c:67
GLuint res
Definition: glext.h:9613

Referenced by LoadStringRC().

◆ LockClrVersion()

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

Definition at line 391 of file mscoree_main.c.

392{
393 FIXME("(%p %p %p): stub\n", hostCallback, pBeginHostSetup, pEndHostSetup);
394 return S_OK;
395}

◆ mscorecf_AddRef()

static ULONG WINAPI mscorecf_AddRef ( IClassFactory iface)
static

Definition at line 98 of file mscoree_main.c.

99{
102
103 TRACE("%p ref=%u\n", This, ref);
104
105 return ref;
106}
#define InterlockedIncrement
Definition: armddk.h:53
static mscorecf * impl_from_IClassFactory(IClassFactory *iface)
Definition: mscoree_main.c:77
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ mscorecf_CreateInstance()

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

Definition at line 123 of file mscoree_main.c.

125{
127 HRESULT hr;
128 IUnknown *punk;
129
130 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj );
131
132 *ppobj = NULL;
133
134 if (pOuter)
136
137 hr = This->pfnCreateInstance( &This->clsid, (LPVOID*) &punk );
138 if (SUCCEEDED(hr))
139 {
140 hr = IUnknown_QueryInterface( punk, riid, ppobj );
141
142 IUnknown_Release( punk );
143 }
144 else
145 {
146 WARN("Cannot create an instance object. 0x%08x\n", hr);
147 }
148 return hr;
149}
#define WARN(fmt,...)
Definition: debug.h:112
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ mscorecf_LockServer()

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

Definition at line 151 of file mscoree_main.c.

152{
153 FIXME("(%p)->(%d),stub!\n",iface,dolock);
154 return S_OK;
155}

◆ mscorecf_QueryInterface()

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

Definition at line 82 of file mscoree_main.c.

83{
84 TRACE("%s %p\n", debugstr_guid(riid), ppobj);
85
88 {
89 IClassFactory_AddRef( iface );
90 *ppobj = iface;
91 return S_OK;
92 }
93
94 ERR("interface %s not implemented\n", debugstr_guid(riid));
95 return E_NOINTERFACE;
96}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ mscorecf_Release()

static ULONG WINAPI mscorecf_Release ( IClassFactory iface)
static

Definition at line 108 of file mscoree_main.c.

109{
112
113 TRACE("%p ref=%u\n", This, ref);
114
115 if (ref == 0)
116 {
118 }
119
120 return ref;
121}
#define InterlockedDecrement
Definition: armddk.h:52
#define HeapFree(x, y, z)
Definition: compat.h:735

◆ ND_CopyObjDst()

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

Definition at line 653 of file mscoree_main.c.

654{
655 memcpy( (BYTE *)dst + offset, src, size );
656}
GLsizeiptr size
Definition: glext.h:5919
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
GLintptr offset
Definition: glext.h:5920
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
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 658 of file mscoree_main.c.

659{
660 memcpy( dst, (const BYTE *)src + offset, size );
661}

◆ ND_RI2()

INT WINAPI ND_RI2 ( const void ptr,
INT  offset 
)

Definition at line 618 of file mscoree_main.c.

619{
620 return *(const SHORT *)((const BYTE *)ptr + offset);
621}
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 623 of file mscoree_main.c.

624{
625 return *(const INT *)((const BYTE *)ptr + offset);
626}
int32_t INT
Definition: typedefs.h:58

◆ ND_RI8()

INT64 WINAPI ND_RI8 ( const void ptr,
INT  offset 
)

Definition at line 628 of file mscoree_main.c.

629{
630 return *(const INT64 *)((const BYTE *)ptr + offset);
631}
signed long long INT64

◆ ND_RU1()

INT WINAPI ND_RU1 ( const void ptr,
INT  offset 
)

Definition at line 613 of file mscoree_main.c.

614{
615 return *((const BYTE *)ptr + offset);
616}

◆ ND_WI2()

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

Definition at line 638 of file mscoree_main.c.

639{
640 *(SHORT *)((BYTE *)ptr + offset) = val;
641}
GLuint GLfloat * val
Definition: glext.h:7180

◆ ND_WI4()

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

Definition at line 643 of file mscoree_main.c.

644{
645 *(INT *)((BYTE *)ptr + offset) = val;
646}

◆ ND_WI8()

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

Definition at line 648 of file mscoree_main.c.

649{
650 *(INT64 *)((BYTE *)ptr + offset) = val;
651}

◆ ND_WU1()

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

Definition at line 633 of file mscoree_main.c.

634{
635 *((BYTE *)ptr + offset) = val;
636}

◆ StrongNameSignatureVerification()

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

Definition at line 501 of file mscoree_main.c.

502{
503 FIXME("(%s, 0x%X, %p): stub\n", debugstr_w(filename), inFlags, pOutFlags);
504 return FALSE;
505}

◆ StrongNameSignatureVerificationEx()

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

Definition at line 507 of file mscoree_main.c.

508{
509 FIXME("(%s, %u, %p): stub\n", debugstr_w(filename), forceVerification, pVerified);
510 return FALSE;
511}

◆ 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
GLuint64EXT * result
Definition: glext.h:11304
#define CP_UTF8
Definition: nls.h:20

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

Variable Documentation

◆ mscorecf_vtbl

const struct IClassFactoryVtbl mscorecf_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI mscorecf_AddRef(IClassFactory *iface)
Definition: mscoree_main.c:98
static HRESULT WINAPI mscorecf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: mscoree_main.c:82
static ULONG WINAPI mscorecf_Release(IClassFactory *iface)
Definition: mscoree_main.c:108
static HRESULT WINAPI mscorecf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: mscoree_main.c:151
static HRESULT WINAPI mscorecf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: mscoree_main.c:123

Definition at line 157 of file mscoree_main.c.

Referenced by DllGetClassObject().

◆ MSCOREE_hInstance

HINSTANCE MSCOREE_hInstance
static

Definition at line 26 of file mscoree_main.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().