8 instantiations of WeakGCHandle
System.Net.Security (1)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (1)
568handle._authOptionsHandle = new WeakGCHandle<SslAuthenticationOptions>(options);
System.Private.CoreLib (6)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (1)
28_weakTargetObj = new WeakGCHandle<object>(targetObj);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (3)
616_proxyHandle = new WeakGCHandle<object>(comProxy, trackResurrection: !proxyHasFinalizer); 620_proxyHandleTrackingResurrection = new WeakGCHandle<object>(comProxy, trackResurrection: true); 1458rcwEntry = new WeakGCHandle<NativeObjectWrapper>(wrapper);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\WeakGCHandle.T.cs (1)
83public static WeakGCHandle<T> FromIntPtr(IntPtr value) => new WeakGCHandle<T>(value);
System\Runtime\InteropServices\PInvokeMarshal.cs (1)
136thunkData->Handle = new WeakGCHandle<Delegate>(del, trackResurrection: true);
System.Private.TypeLoader (1)
Internal\Runtime\TypeLoader\TypeSystemContextFactory.cs (1)
19private static WeakGCHandle<TypeSystemContext?> s_cachedContext = new WeakGCHandle<TypeSystemContext?>(null);
40 references to WeakGCHandle
System.Net.Security (4)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (2)
1036WeakGCHandle<SslAuthenticationOptions>.FromIntPtr(data) 1219WeakGCHandle<SslAuthenticationOptions>.FromIntPtr(sslData)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (2)
479private WeakGCHandle<SslAuthenticationOptions> _authOptionsHandle; 569Interop.Ssl.SslSetData(handle, WeakGCHandle<SslAuthenticationOptions>.ToIntPtr(handle._authOptionsHandle));
System.Private.CoreLib (34)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (1)
18private WeakGCHandle<object> _weakTargetObj;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (9)
551private WeakGCHandle<object> _proxyHandle; 552private WeakGCHandle<object> _proxyHandleTrackingResurrection; 637internal WeakGCHandle<object> ProxyHandle => _proxyHandle; 668WeakGCHandle<object> resurrectionHandle = _proxyHandleTrackingResurrection.IsAllocated 1438private readonly Dictionary<IntPtr, WeakGCHandle<NativeObjectWrapper>> _cache; 1453ref WeakGCHandle<NativeObjectWrapper> rcwEntry = ref CollectionsMarshal.GetValueRefOrAddDefault(_cache, comPointer, out bool exists); 1496if (!_cache.TryGetValue(comPointer, out WeakGCHandle<NativeObjectWrapper> existingHandle)) 1522if (_cache.TryGetValue(comPointer, out WeakGCHandle<NativeObjectWrapper> existingHandle) 1550if (_cache.TryGetValue(comPointer, out WeakGCHandle<NativeObjectWrapper> cachedRef)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (1)
26/// <seealso cref="WeakGCHandle{T}"/>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\WeakGCHandle.T.cs (17)
22/// <typeparam name="T">The type of the object this <see cref="WeakGCHandle{T}"/> tracks to.</typeparam> 23public struct WeakGCHandle<T> : IEquatable<WeakGCHandle<T>>, IDisposable 32/// <param name="target">The object that uses the <see cref="WeakGCHandle{T}"/>.</param> 45/// Tries to retrieve the target object that is referenced by the current <see cref="WeakGCHandle{T}"/> object. 72/// Returns a new <see cref="WeakGCHandle{T}"/> object created from a handle to a managed object. 74/// <param name="value">An <see cref="IntPtr"/> handle to a managed object to create a <see cref="WeakGCHandle{T}"/> object from.</param> 75/// <returns>A new <see cref="WeakGCHandle{T}"/> object that corresponds to the value parameter.</returns> 79/// The <see cref="IntPtr"/> representation of <see cref="WeakGCHandle{T}"/> is not 83public static WeakGCHandle<T> FromIntPtr(IntPtr value) => new WeakGCHandle<T>(value); 86/// Returns the internal integer representation of a <see cref="WeakGCHandle{T}"/> object. 88/// <param name="value">A <see cref="WeakGCHandle{T}"/> object to retrieve an internal integer representation from.</param> 89/// <returns>An <see cref="IntPtr"/> object that represents a <see cref="WeakGCHandle{T}"/> object.</returns> 91/// The <see cref="IntPtr"/> representation of <see cref="WeakGCHandle{T}"/> is not 94public static IntPtr ToIntPtr(WeakGCHandle<T> value) => value._handle; 96/// <summary>Releases this <see cref="WeakGCHandle{T}"/>.</summary> 111public override readonly bool Equals([NotNullWhen(true)] object? obj) => obj is WeakGCHandle<T> handle && Equals(handle); 114public readonly bool Equals(WeakGCHandle<T> other) => _handle == other._handle;
System\Runtime\InteropServices\PInvokeMarshal.cs (4)
103public WeakGCHandle<Delegate> Handle; // A weak GCHandle to the delegate 151WeakGCHandle<Delegate> handle = ((ThunkContextData*)ContextData)->Handle; 208WeakGCHandle<Delegate> handle; 282WeakGCHandle<Delegate> handle;
System\Runtime\InteropServices\TrackerObjectManager.NativeAot.cs (2)
209public WeakGCHandle<object> RootObject; 211public Instance(WeakGCHandle<object> handle)
System.Private.TypeLoader (1)
Internal\Runtime\TypeLoader\TypeSystemContextFactory.cs (1)
19private static WeakGCHandle<TypeSystemContext?> s_cachedContext = new WeakGCHandle<TypeSystemContext?>(null);
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
714[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.WeakGCHandle<>))]