8 instantiations of WeakGCHandle
System.Net.Security (1)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (1)
568
handle._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);
1458
rcwEntry = new
WeakGCHandle
<NativeObjectWrapper>(wrapper);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\WeakGCHandle.T.cs (1)
83
public static WeakGCHandle<T> FromIntPtr(IntPtr value) => new
WeakGCHandle
<T>(value);
System\Runtime\InteropServices\PInvokeMarshal.cs (1)
136
thunkData->Handle = new
WeakGCHandle
<Delegate>(del, trackResurrection: true);
System.Private.TypeLoader (1)
Internal\Runtime\TypeLoader\TypeSystemContextFactory.cs (1)
19
private 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)
1036
WeakGCHandle
<SslAuthenticationOptions>.FromIntPtr(data)
1219
WeakGCHandle
<SslAuthenticationOptions>.FromIntPtr(sslData)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (2)
479
private
WeakGCHandle
<SslAuthenticationOptions> _authOptionsHandle;
569
Interop.Ssl.SslSetData(handle,
WeakGCHandle
<SslAuthenticationOptions>.ToIntPtr(handle._authOptionsHandle));
System.Private.CoreLib (34)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (1)
18
private
WeakGCHandle
<object> _weakTargetObj;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (9)
551
private
WeakGCHandle
<object> _proxyHandle;
552
private
WeakGCHandle
<object> _proxyHandleTrackingResurrection;
637
internal
WeakGCHandle
<object> ProxyHandle => _proxyHandle;
668
WeakGCHandle
<object> resurrectionHandle = _proxyHandleTrackingResurrection.IsAllocated
1438
private readonly Dictionary<IntPtr,
WeakGCHandle
<NativeObjectWrapper>> _cache;
1453
ref
WeakGCHandle
<NativeObjectWrapper> rcwEntry = ref CollectionsMarshal.GetValueRefOrAddDefault(_cache, comPointer, out bool exists);
1496
if (!_cache.TryGetValue(comPointer, out
WeakGCHandle
<NativeObjectWrapper> existingHandle))
1522
if (_cache.TryGetValue(comPointer, out
WeakGCHandle
<NativeObjectWrapper> existingHandle)
1550
if (_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>
23
public 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
83
public 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
94
public static IntPtr ToIntPtr(
WeakGCHandle
<T> value) => value._handle;
96
/// <summary>Releases this <see cref="
WeakGCHandle
{T}"/>.</summary>
111
public override readonly bool Equals([NotNullWhen(true)] object? obj) => obj is
WeakGCHandle
<T> handle && Equals(handle);
114
public readonly bool Equals(
WeakGCHandle
<T> other) => _handle == other._handle;
System\Runtime\InteropServices\PInvokeMarshal.cs (4)
103
public
WeakGCHandle
<Delegate> Handle; // A weak GCHandle to the delegate
151
WeakGCHandle
<Delegate> handle = ((ThunkContextData*)ContextData)->Handle;
208
WeakGCHandle
<Delegate> handle;
282
WeakGCHandle
<Delegate> handle;
System\Runtime\InteropServices\TrackerObjectManager.NativeAot.cs (2)
209
public
WeakGCHandle
<object> RootObject;
211
public Instance(
WeakGCHandle
<object> handle)
System.Private.TypeLoader (1)
Internal\Runtime\TypeLoader\TypeSystemContextFactory.cs (1)
19
private 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
<>))]