mscoree: Add stub implementation of ICLRMetaHost.

This commit is contained in:
Vincent Povirk 2010-09-22 14:09:04 -05:00 committed by Alexandre Julliard
parent 1b978eadde
commit fce6f93b48
5 changed files with 166 additions and 4 deletions

View File

@ -3,6 +3,7 @@ IMPORTS = uuid shell32 advapi32
C_SRCS = \
corruntimehost.c \
metahost.c \
mscoree_main.c
@MAKE_DLL_RULES@

154
dlls/mscoree/metahost.c Normal file
View File

@ -0,0 +1,154 @@
/*
* ICLRMetaHost - discovery and management of available .NET runtimes
*
* Copyright 2010 Vincent Povirk for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "wine/unicode.h"
#include "wine/library.h"
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "mscoree.h"
#include "metahost.h"
#include "mscoree_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL( mscoree );
struct CLRMetaHost
{
const struct ICLRMetaHostVtbl *CLRMetaHost_vtbl;
};
static const struct CLRMetaHost GlobalCLRMetaHost;
static HRESULT WINAPI CLRMetaHost_QueryInterface(ICLRMetaHost* iface,
REFIID riid,
void **ppvObject)
{
TRACE("%s %p\n", debugstr_guid(riid), ppvObject);
if ( IsEqualGUID( riid, &IID_ICLRMetaHost ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = iface;
}
else
{
FIXME("Unsupported interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
ICLRMetaHost_AddRef( iface );
return S_OK;
}
static ULONG WINAPI CLRMetaHost_AddRef(ICLRMetaHost* iface)
{
return 2;
}
static ULONG WINAPI CLRMetaHost_Release(ICLRMetaHost* iface)
{
return 1;
}
static HRESULT WINAPI CLRMetaHost_GetRuntime(ICLRMetaHost* iface,
LPCWSTR pwzVersion, REFIID iid, LPVOID *ppRuntime)
{
FIXME("%s %s %p\n", debugstr_w(pwzVersion), debugstr_guid(iid), ppRuntime);
return E_NOTIMPL;
}
static HRESULT WINAPI CLRMetaHost_GetVersionFromFile(ICLRMetaHost* iface,
LPCWSTR pwzFilePath, LPWSTR pwzBuffer, DWORD *pcchBuffer)
{
FIXME("%s %p %p\n", debugstr_w(pwzFilePath), pwzBuffer, pcchBuffer);
return E_NOTIMPL;
}
static HRESULT WINAPI CLRMetaHost_EnumerateInstalledRuntimes(ICLRMetaHost* iface,
IEnumUnknown **ppEnumerator)
{
FIXME("%p\n", ppEnumerator);
return E_NOTIMPL;
}
static HRESULT WINAPI CLRMetaHost_EnumerateLoadedRuntimes(ICLRMetaHost* iface,
HANDLE hndProcess, IEnumUnknown **ppEnumerator)
{
FIXME("%p %p\n", hndProcess, ppEnumerator);
return E_NOTIMPL;
}
static HRESULT WINAPI CLRMetaHost_RequestRuntimeLoadedNotification(ICLRMetaHost* iface,
RuntimeLoadedCallbackFnPtr pCallbackFunction)
{
FIXME("%p\n", pCallbackFunction);
return E_NOTIMPL;
}
static HRESULT WINAPI CLRMetaHost_QueryLegacyV2RuntimeBinding(ICLRMetaHost* iface,
REFIID riid, LPVOID *ppUnk)
{
FIXME("%s %p\n", debugstr_guid(riid), ppUnk);
return E_NOTIMPL;
}
static HRESULT WINAPI CLRMetaHost_ExitProcess(ICLRMetaHost* iface, INT32 iExitCode)
{
FIXME("%i: stub\n", iExitCode);
ExitProcess(iExitCode);
}
static const struct ICLRMetaHostVtbl CLRMetaHost_vtbl =
{
CLRMetaHost_QueryInterface,
CLRMetaHost_AddRef,
CLRMetaHost_Release,
CLRMetaHost_GetRuntime,
CLRMetaHost_GetVersionFromFile,
CLRMetaHost_EnumerateInstalledRuntimes,
CLRMetaHost_EnumerateLoadedRuntimes,
CLRMetaHost_RequestRuntimeLoadedNotification,
CLRMetaHost_QueryLegacyV2RuntimeBinding,
CLRMetaHost_ExitProcess
};
static const struct CLRMetaHost GlobalCLRMetaHost = {
&CLRMetaHost_vtbl
};
extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj)
{
return ICLRMetaHost_QueryInterface((ICLRMetaHost*)&GlobalCLRMetaHost, riid, ppobj);
}

View File

@ -642,9 +642,14 @@ BOOL WINAPI StrongNameSignatureVerificationEx(LPCWSTR filename, BOOL forceVerifi
HRESULT WINAPI CLRCreateInstance(REFCLSID clsid, REFIID riid, LPVOID *ppInterface)
{
FIXME("(%s,%s,%p): stub\n", debugstr_guid(clsid), debugstr_guid(riid), ppInterface);
TRACE("(%s,%s,%p)\n", debugstr_guid(clsid), debugstr_guid(riid), ppInterface);
return E_NOTIMPL;
if (IsEqualGUID(clsid, &CLSID_CLRMetaHost))
return CLRMetaHost_CreateInstance(riid, ppInterface);
FIXME("not implemented for class %s\n", debugstr_guid(clsid));
return CLASS_E_CLASSNOTAVAILABLE;
}
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)

View File

@ -22,6 +22,8 @@
extern IUnknown* create_corruntimehost(void);
extern HRESULT CLRMetaHost_CreateInstance(REFIID riid, void **ppobj);
/* Mono 2.6 embedding */
typedef struct _MonoDomain MonoDomain;
typedef struct _MonoAssembly MonoAssembly;

View File

@ -47,7 +47,7 @@ BOOL init_pointers(void)
if (FAILED(hr))
{
todo_wine win_skip(".NET 4 is not installed\n");
win_skip(".NET 4 is not installed\n");
FreeLibrary(hmscoree);
return FALSE;
}
@ -72,7 +72,7 @@ void test_enumruntimes(void)
WCHAR buf[MAX_PATH];
hr = ICLRMetaHost_EnumerateInstalledRuntimes(metahost, &runtime_enum);
ok(hr == S_OK, "EnumerateInstalledRuntimes returned %x\n", hr);
todo_wine ok(hr == S_OK, "EnumerateInstalledRuntimes returned %x\n", hr);
if (FAILED(hr)) return;
while ((hr = IEnumUnknown_Next(runtime_enum, 1, &unk, &count)) == S_OK)