ReactOS 0.4.16-dev-1025-gd3456f5
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 217 of file mscoree_main.c.

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

◆ _CorImageUnloading()

VOID WINAPI _CorImageUnloading ( PVOID  imageBase)

Definition at line 231 of file mscoree_main.c.

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

◆ _CorValidateImage()

HRESULT WINAPI _CorValidateImage ( PVOID imageBase,
LPCWSTR  imageName 
)

Definition at line 236 of file mscoree_main.c.

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

◆ CLRCreateInstance()

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

Definition at line 560 of file mscoree_main.c.

561{
563
564 if (IsEqualGUID(clsid, &CLSID_CLRMetaHost))
566
567 FIXME("not implemented for class %s\n", debugstr_guid(clsid));
568
570}
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 468 of file mscoree_main.c.

469{
470 HRESULT ret;
474 IUnknown *unk;
475
476 TRACE("(%s,%s,%p)\n", debugstr_w(pTypeName), debugstr_guid(riid), ppObject);
477
478 /* FIXME: How to determine which runtime version to use? */
480
481 if (SUCCEEDED(ret))
482 {
484
485 ICLRRuntimeInfo_Release(info);
486 }
487
488 if (SUCCEEDED(ret))
490
491 if (SUCCEEDED(ret))
493
494 if (SUCCEEDED(ret))
495 {
496 ret = IUnknown_QueryInterface(unk, riid, ppObject);
497 IUnknown_Release(unk);
498 }
499
500 return ret;
501}
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
Definition: txthost.c:37
int ret

◆ CoEEShutDownCOM()

void WINAPI CoEEShutDownCOM ( void  )

Definition at line 610 of file mscoree_main.c.

611{
612 FIXME("stub.\n");
613}

◆ CoInitializeCor()

HRESULT WINAPI CoInitializeCor ( DWORD  fFlags)

Definition at line 399 of file mscoree_main.c.

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

◆ CorBindToCurrentRuntime()

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

Definition at line 462 of file mscoree_main.c.

463{
464 FIXME("(%s, %s, %s, %p): stub\n", debugstr_w(filename), debugstr_guid(rclsid), debugstr_guid(riid), ppv);
465 return E_NOTIMPL;
466}
#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 439 of file mscoree_main.c.

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

225{
226 TRACE("(%x)\n", exitCode);
228 ExitProcess(exitCode);
229}
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 515 of file mscoree_main.c.

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

◆ CreateDebuggingInterfaceFromVersion()

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

Definition at line 521 of file mscoree_main.c.

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

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( VOID  )

Definition at line 605 of file mscoree_main.c.

606{
607 return S_FALSE;
608}
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 572 of file mscoree_main.c.

573{
574 mscorecf *This;
575 HRESULT hr;
576
577 TRACE("(%s, %s, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
578
579 if(!ppv)
580 return E_INVALIDARG;
581
582 This = HeapAlloc(GetProcessHeap(), 0, sizeof(mscorecf));
583
584 This->IClassFactory_iface.lpVtbl = &mscorecf_vtbl;
585 This->pfnCreateInstance = &create_monodata;
586 This->ref = 1;
587 This->clsid = *rclsid;
588
589 hr = IClassFactory_QueryInterface( &This->IClassFactory_iface, riid, ppv );
590 IClassFactory_Release(&This->IClassFactory_iface);
591
592 return hr;
593}
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#ifndef __REACTOS__
201 case DLL_WINE_PREATTACH:
202 return FALSE; /* prefer native version */
203#endif
207 break;
210 if (lpvReserved) break; /* process is terminating */
212 break;
213 }
214 return TRUE;
215}
static DWORD const fdwReason
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 595 of file mscoree_main.c.

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

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 600 of file mscoree_main.c.

601{
603}
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 405 of file mscoree_main.c.

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

◆ GetCORSystemDirectory()

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

Definition at line 242 of file mscoree_main.c.

243{
245 HRESULT ret;
246
247 TRACE("(%p, %d, %p)!\n", pbuffer, cchBuffer, dwLength);
248
249 if (!dwLength || !pbuffer)
250 return E_POINTER;
251
253
254 if (SUCCEEDED(ret))
255 {
257 ret = ICLRRuntimeInfo_GetRuntimeDirectory(info, pbuffer, dwLength);
258
259 ICLRRuntimeInfo_Release(info);
260 }
261
262 return ret;
263}
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 265 of file mscoree_main.c.

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

Referenced by LoadLibraryShim().

◆ GetFileVersion()

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

Definition at line 342 of file mscoree_main.c.

343{
344 TRACE("(%s, %p, %d, %p)\n", debugstr_w(szFilename), szBuffer, cchBuffer, dwLength);
345
346 if (!szFilename || !dwLength)
347 return E_POINTER;
348
350 return CLRMetaHost_GetVersionFromFile(0, szFilename, szBuffer, dwLength);
351}
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 336 of file mscoree_main.c.

337{
338 FIXME("(%s, %p)\n", debugstr_a(procname), ppv);
340}
#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 288 of file mscoree_main.c.

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

Referenced by GetRequestedRuntimeVersion().

◆ GetRequestedRuntimeVersion()

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

Definition at line 326 of file mscoree_main.c.

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

◆ GetVersionFromProcess()

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

Definition at line 411 of file mscoree_main.c.

412{
413 FIXME("(%p, %p, %d, %p): stub\n", hProcess, pVersion, cchBuffer, dwLength);
414 return E_NOTIMPL;
415}
_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 353 of file mscoree_main.c.

354{
356 WCHAR dll_filename[MAX_PATH];
358 static const WCHAR default_version[] = {'v','1','.','1','.','4','3','2','2',0};
359 static const WCHAR slash[] = {'\\',0};
360 DWORD dummy;
361
362 TRACE("(%p %s, %p, %p, %p)\n", szDllName, debugstr_w(szDllName), szVersion, pvReserved, phModDll);
363
364 if (!szDllName || !phModDll)
365 return E_POINTER;
366
367 if (!get_install_root(dll_filename))
368 {
369 ERR("error reading registry key for installroot\n");
370 dll_filename[0] = 0;
371 }
372 else
373 {
374 if (!szVersion)
375 {
377 if (SUCCEEDED(ret))
379 else
380 szVersion = default_version;
381 }
382 strcatW(dll_filename, szVersion);
383 strcatW(dll_filename, slash);
384 }
385
386 strcatW(dll_filename, szDllName);
387
388 *phModDll = LoadLibraryW(dll_filename);
389
390 return *phModDll ? S_OK : E_HANDLE;
391}
#define ERR(fmt,...)
Definition: precomp.h:57
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:265
static BOOL get_install_root(LPWSTR install_dir)
Definition: mscoree_main.c:45
#define strcatW(d, s)
Definition: unicode.h:36
#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 434 of file mscoree_main.c.

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

◆ LoadStringRCEx()

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

Definition at line 417 of file mscoree_main.c.

418{
419 HRESULT res = S_OK;
420 if ((iBufLen <= 0) || !pBuffer)
421 return E_INVALIDARG;
422 pBuffer[0] = 0;
423 if (resId) {
424 FIXME("(%d, %x, %p, %d, %d, %p): semi-stub\n", culture, resId, pBuffer, iBufLen, bQuiet, pBufLen);
425 res = E_NOTIMPL;
426 }
427 else
428 res = E_FAIL;
429 if (pBufLen)
430 *pBufLen = lstrlenW(pBuffer);
431 return res;
432}
#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 393 of file mscoree_main.c.

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

◆ 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: precomp.h:61
#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 655 of file mscoree_main.c.

656{
657 memcpy( (BYTE *)dst + offset, src, size );
658}
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
#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 660 of file mscoree_main.c.

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

◆ ND_RI2()

INT WINAPI ND_RI2 ( const void ptr,
INT  offset 
)

Definition at line 620 of file mscoree_main.c.

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

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

◆ ND_RI8()

INT64 WINAPI ND_RI8 ( const void ptr,
INT  offset 
)

Definition at line 630 of file mscoree_main.c.

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

◆ ND_RU1()

INT WINAPI ND_RU1 ( const void ptr,
INT  offset 
)

Definition at line 615 of file mscoree_main.c.

616{
617 return *((const BYTE *)ptr + offset);
618}

◆ ND_WI2()

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

Definition at line 640 of file mscoree_main.c.

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

◆ ND_WI4()

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

Definition at line 645 of file mscoree_main.c.

646{
647 *(INT *)((BYTE *)ptr + offset) = val;
648}

◆ ND_WI8()

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

Definition at line 650 of file mscoree_main.c.

651{
652 *(INT64 *)((BYTE *)ptr + offset) = val;
653}

◆ ND_WU1()

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

Definition at line 635 of file mscoree_main.c.

636{
637 *((BYTE *)ptr + offset) = val;
638}

◆ StrongNameSignatureVerification()

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

Definition at line 503 of file mscoree_main.c.

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

◆ StrongNameSignatureVerificationEx()

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

Definition at line 509 of file mscoree_main.c.

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

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