private static IntPtr GetRuntimeInterfaceImpl( [In, MarshalAs(UnmanagedType.LPStruct)] Guid clsid, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid) { IntPtr result; if (clsid == Guid.Empty) { Guid CLSID_CLRMetaHost = new Guid("9280188d-0e8e-4867-b30c-7fa83884e8de"); ICLRMetaHost metahost = (ICLRMetaHost)GetRuntimeInterfaceAsObject(CLSID_CLRMetaHost, typeof(ICLRMetaHost).GUID); result = metahost.GetRuntime(GetSystemVersion(), riid); } else { Marshal.ThrowExceptionForHR(CLRCreateInstance(clsid, riid, out result)); } return(result); }
public ClrRuntimeInfo GetRuntime(string version) { Guid ifaceId = typeof(ICLRRuntimeInfo).GUID; return(new ClrRuntimeInfo(_metaHost.GetRuntime(version, ref ifaceId))); }