public CCorRuntimeHost(NativeMethods.IClrRuntimeInfo RuntimeInfo) { StringBuilder buffer = new StringBuilder(260); int bufferLength = buffer.Capacity; RuntimeInfo.GetVersionString(buffer, out bufferLength); this.ClrRuntimeInfoVersion = buffer.ToString(); Logger.AddMethodCall("CCorRuntimeHost.ctor called with IClrRuntimeInfo version " + this.ClrRuntimeInfoVersion, DateTime.Now); this.RuntimeHostInstance = (NativeMethods.ICorRuntimeHost)RuntimeInfo.GetInterface(NativeMethods._corRuntimeHostClsIdGuid, NativeMethods._corRuntimeHostInterfaceIdGuid); }
public void Dispose() { this.fDelegatesBound = false; this.InvokeMemberFnPtr = (NativeMethods.CCorRuntimeHost.Type_InvokeMember)null; if (IntPtr.Zero != this.DomainTypePtr) { Marshal.Release(this.DomainTypePtr); this.DomainTypePtr = IntPtr.Zero; } this.GetTypeFnPtr = (NativeMethods.CCorRuntimeHost.AppDomain_GetType)null; if (IntPtr.Zero != this.DomainObjectPtr) { Marshal.Release(this.DomainObjectPtr); this.DomainObjectPtr = IntPtr.Zero; } this.CurrentDomainFnPtr = (NativeMethods.CCorRuntimeHost.Host_CurrentDomain)null; if (IntPtr.Zero != this.RuntimeHostPtr) { Marshal.Release(this.RuntimeHostPtr); this.RuntimeHostPtr = IntPtr.Zero; } this.RuntimeHostInstance = (NativeMethods.ICorRuntimeHost)null; }