Provides an interface to a preferred version of the common language runtime (CLR) based on a hosting policy, managed assembly, version string, and configuration stream. This method does not actually load or activate the CLR, but simply returns the ICLRRuntimeInfo interface that represents the policy result. This method supersedes the GetRequestedRuntimeInfo, GetRequestedRuntimeVersion, CorBindToRuntimeHost, CorBindToRuntimeByCfg, and GetCORRequiredVersion methods.
HRESULT GetRequestedRuntime( [in] METAHOST_POLICY_FLAGS dwPolicyFlags, [in] LPCWSTR pwzBinary, [in] IStream *pCfgStream, [in, out, size_is(*pcchVersion)] LPWSTR pwzVersion, [in, out] DWORD *pcchVersion, [out, size_is(*pcchImageVersion)] LPWSTR pwzImageVersion, [in, out] DWORD *pcchImageVersion, [out] DWORD *pdwConfigFlags, [in] REFIID riid [out, iid_is(riid), retval] LPVOID *ppRuntime);
|[in] Required. Specifies a member of the METAHOST_POLICY_FLAGS enumeration, representing a binding policy, and any number of modifiers. The only policy that is currently available is METAHOST_POLICY_HIGHCOMPAT.|
Modifiers include METAHOST_POLICY_EMULATE_EXE_LAUNCH, METAHOST_POLICY_APPLY_UPGRADE_POLICY, METAHOST_POLICY_SHOW_ERROR_DIALOG, METAHOST_POLICY_USE_PROCESS_IMAGE_PATH, and METAHOST_POLICY_ENSURE_SKU_SUPPORTED.
|[in] Optional. Specifies the assembly file path.|
|[in] Optional. Specifies the configuration file as a System.Runtime.InteropServices.ComTypes.IStream.|
|[in, out] Optional. Specifies or returns the preferred CLR version to be loaded.|
|[in, out] Required. Specifies the expected size of |
|[out] Optional. When |
|[in, out] Optional. Specifies the size of |
|[out] Optional. If |
|[in] Specifies the interface identifier IID_ICLRRuntimeInfo for the requested ICLRRuntimeInfo interface.|
|[out] When |
When this method succeeds, it has the side effect of combining additional flags with the current default startup flags of the returned runtime interface, if and only if one or more of the following elements exist in the configuration stream within the
STARTUP_SERVER_GCto be set.
STARTUP_ETWto be set.
STARTUP_ARMto be set.
The resulting default
STARTUP_FLAGS value is the bitwise OR combination of the values that are set from the preceding list with the default startup flags.
This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure.
|S_OK||The method completed successfully.|
|ERROR_INSUFFICIENT_BUFFER||The memory allocated to |
The memory allocated to
Platforms: See System Requirements.
Library: Included as a resource in MSCorEE.dll
.NET Framework Versions: Available since 4