mscoree: Implement IMetahostPolicy GetRequestedRuntime.

This commit is contained in:
Alistair Leslie-Hughes 2013-11-05 15:13:34 +11:00 committed by Alexandre Julliard
parent ace3c315b8
commit d8f54b4d49
1 changed files with 46 additions and 2 deletions

View File

@ -1190,11 +1190,52 @@ static HRESULT WINAPI metahostpolicy_GetRequestedRuntime(ICLRMetaHostPolicy *ifa
LPWSTR pwzImageVersion, DWORD *pcchImageVersion, DWORD *pdwConfigFlags, REFIID riid,
LPVOID *ppRuntime)
{
FIXME("%d %p %p %p %p %p %p %p %s %p\n", dwPolicyFlags, pwzBinary, pCfgStream,
ICLRRuntimeInfo *result;
HRESULT hr;
WCHAR filename[MAX_PATH];
const WCHAR *path = NULL;
int flags = 0;
TRACE("%d %p %p %p %p %p %p %p %s %p\n", dwPolicyFlags, pwzBinary, pCfgStream,
pwzVersion, pcchVersion, pwzImageVersion, pcchImageVersion, pdwConfigFlags,
debugstr_guid(riid), ppRuntime);
return E_NOTIMPL;
if (pCfgStream)
FIXME("ignoring config file stream\n");
if (pdwConfigFlags)
FIXME("ignoring config flags\n");
if(dwPolicyFlags & METAHOST_POLICY_USE_PROCESS_IMAGE_PATH)
{
GetModuleFileNameW(0, filename, MAX_PATH);
path = filename;
}
else if(pwzBinary)
{
path = pwzBinary;
}
if(dwPolicyFlags & METAHOST_POLICY_APPLY_UPGRADE_POLICY)
flags |= RUNTIME_INFO_UPGRADE_VERSION;
hr = get_runtime_info(path, pwzImageVersion, NULL, 0, flags, FALSE, &result);
if (SUCCEEDED(hr))
{
if (pwzImageVersion)
{
/* Ignoring errors on purpose */
ICLRRuntimeInfo_GetVersionString(result, pwzImageVersion, pcchImageVersion);
}
hr = ICLRRuntimeInfo_QueryInterface(result, riid, ppRuntime);
ICLRRuntimeInfo_Release(result);
}
TRACE("<- 0x%08x\n", hr);
return hr;
}
static const struct ICLRMetaHostPolicyVtbl CLRMetaHostPolicy_vtbl =
@ -1327,6 +1368,9 @@ HRESULT get_runtime_info(LPCWSTR exefile, LPCWSTR version, LPCWSTR config_file,
if (runtimeinfo_flags & ~supported_runtime_flags)
FIXME("unsupported runtimeinfo flags %x\n", runtimeinfo_flags & ~supported_runtime_flags);
if (exefile && !exefile[0])
exefile = NULL;
if (exefile && !config_file)
{
strcpyW(local_config_file, exefile);