85 references to GCHandleType
Microsoft.AspNetCore.Server.HttpSys (1)
RequestProcessing\ResponseBody.cs (1)
281handle = GCHandle.Alloc(buffer.Array, GCHandleType.Pinned);
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Compilation\CompilationAPITests.vb (1)
2473Dim pinnedPEImage = GCHandle.Alloc(moduleBytes.ToArray(), GCHandleType.Pinned)
Microsoft.ML.LightGbm (2)
WrappedLightGbmDataset.cs (2)
60gcValues[i] = GCHandle.Alloc(sampleValuePerColumn[i], GCHandleType.Pinned); 62gcIndices[i] = GCHandle.Alloc(sampleIndicesPerColumn[i], GCHandleType.Pinned);
Microsoft.ML.Mkl.Components (2)
SymSgdClassificationTrainer.cs (2)
346GcHandle = GCHandle.Alloc(Buffer, GCHandleType.Pinned); 739stateGCHandle = GCHandle.Alloc(state, GCHandleType.Pinned);
Microsoft.ML.Vision (2)
ImageClassificationTrainer.cs (2)
991var featureBufferHandle = GCHandle.Alloc(featuresBuffer, GCHandleType.Pinned); 993var labelBufferHandle = GCHandle.Alloc(labelBuffer, GCHandleType.Pinned);
Microsoft.NET.StringTools (1)
WeakStringCache.cs (1)
93WeakHandle = GCHandle.Alloc(str, GCHandleType.Weak);
Microsoft.NET.StringTools.net35 (1)
WeakStringCache.cs (1)
93WeakHandle = GCHandle.Alloc(str, GCHandleType.Weak);
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
CodeModel\CodeModelTestHelpers.vb (1)
110Dim handle = GCHandle.Alloc(managedObject, GCHandleType.Normal)
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
692[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.GCHandleType))]
netstandard (1)
netstandard.cs (1)
1697[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.GCHandleType))]
PresentationCore (5)
MS\Internal\FontCache\FontSource.cs (1)
397_memoryHandle = GCHandle.Alloc(bits, GCHandleType.Pinned);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (2)
220gcHandle = GCHandle.Alloc(_characterArray, GCHandleType.Pinned); 319gcHandle = GCHandle.Alloc(_string, GCHandleType.Pinned);
System\Windows\Media\EventProxy.cs (1)
138m_handle = System.Runtime.InteropServices.GCHandle.Alloc(epw, System.Runtime.InteropServices.GCHandleType.Normal)
System\Windows\Media\StreamAsIStream.cs (1)
657sd.m_handle = System.Runtime.InteropServices.GCHandle.Alloc(sais, System.Runtime.InteropServices.GCHandleType.Normal);
PresentationFramework (2)
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (2)
51m._gchandle = GCHandle.Alloc(value, GCHandleType.Pinned); 276public MarshalerArray(Array array) => _gchandle = GCHandle.Alloc(array, GCHandleType.Pinned);
Roslyn.Test.PdbUtilities (1)
Shared\DummyMetadataImport.cs (1)
66GCHandle pinnedBuffer = GCHandle.Alloc(signature, GCHandleType.Pinned);
System.Drawing.Common (1)
System\Drawing\Font.cs (1)
293GCHandle handle = GCHandle.Alloc(logFont, GCHandleType.Pinned);
System.Net.Quic (5)
System\Net\Quic\QuicConnection.cs (2)
318GCHandle context = GCHandle.Alloc(this, GCHandleType.Weak); 352GCHandle context = GCHandle.Alloc(this, GCHandleType.Weak);
System\Net\Quic\QuicListener.cs (1)
121GCHandle context = GCHandle.Alloc(this, GCHandleType.Weak);
System\Net\Quic\QuicStream.cs (2)
168GCHandle context = GCHandle.Alloc(this, GCHandleType.Weak); 210GCHandle context = GCHandle.Alloc(this, GCHandleType.Weak);
System.Net.Sockets (3)
System\Net\Sockets\SocketPal.Unix.cs (3)
311handles[i] = GCHandle.Alloc(buffer.Array, GCHandleType.Pinned); 425handles[i] = GCHandle.Alloc(buffer.Array, GCHandleType.Pinned); 564handles[i] = GCHandle.Alloc(buffer.Array, GCHandleType.Pinned);
System.Numerics.Tensors (1)
System\Numerics\Tensors\netcore\Tensor_1.cs (1)
241GCHandle handle = GCHandle.Alloc(_values, GCHandleType.Pinned);
System.Private.CoreLib (41)
src\libraries\System.Private.CoreLib\src\System\ComAwareWeakReference.cs (2)
133nint newHandle = GCHandle.InternalAlloc(newRef, GCHandleType.Normal); 177nint newHandle = GCHandle.InternalAlloc(comAwareRef, GCHandleType.Normal);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
620rgGCHandle[i] = GCHandle.Alloc(dataRefObj[i], GCHandleType.Pinned);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (1)
326*pinsTemp = GCHandle.Alloc(value, GCHandleType.Pinned);
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
22_pinningHandle = GCHandle.Alloc(array, GCHandleType.Pinned);
src\libraries\System.Private.CoreLib\src\System\Memory.cs (2)
401GCHandle handle = GCHandle.Alloc(tmpObject, GCHandleType.Pinned); 420GCHandle handle = GCHandle.Alloc(tmpObject, GCHandleType.Pinned);
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (2)
316GCHandle handle = GCHandle.Alloc(tmpObject, GCHandleType.Pinned); 335GCHandle handle = GCHandle.Alloc(tmpObject, GCHandleType.Pinned);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (6)
34private GCHandle(object? value, GCHandleType type) 37if ((uint)type > (uint)GCHandleType.Pinned) // IMPORTANT: This must be kept in sync with the GCHandleType enum. 42if (type == GCHandleType.Pinned && !Marshal.IsPinnable(value)) 49if (type == GCHandleType.Pinned) 65public static GCHandle Alloc(object? value) => new GCHandle(value, GCHandleType.Normal); 72public static GCHandle Alloc(object? value, GCHandleType type) => new GCHandle(value, type);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.T.cs (2)
14/// <para>This type corresponds to <see cref="GCHandleType.Normal"/>.</para> 35_handle = GCHandle.InternalAlloc(target, GCHandleType.Normal);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PinnedGCHandle.T.cs (2)
15/// <para>This type corresponds to <see cref="GCHandleType.Pinned"/>.</para> 37_handle = GCHandle.InternalAlloc(target, GCHandleType.Pinned);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\WeakGCHandle.T.cs (4)
14/// <para>This type corresponds to <see cref="GCHandleType.Weak"/> or <see cref="GCHandleType.WeakTrackResurrection"/>.</para> 36_handle = GCHandle.InternalAlloc(target, trackResurrection ? GCHandleType.WeakTrackResurrection : GCHandleType.Weak);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (3)
101var thisHandle = GCHandle.Alloc(this, IsCollectible ? GCHandleType.WeakTrackResurrection : GCHandleType.Normal); 147var thisStrongHandle = GCHandle.Alloc(this, GCHandleType.Normal);
src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (2)
170GCHandleRef(pNativeOverlapped, (nuint)(i + 1)) = GCHandle.Alloc(objArray[i], GCHandleType.Pinned); 176GCHandleRef(pNativeOverlapped, 1) = GCHandle.Alloc(userData, GCHandleType.Pinned);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (2)
140data._pinnedData[i] = GCHandle.Alloc(objArray[i], GCHandleType.Pinned); 150data._pinnedData[0] = GCHandle.Alloc(pinData, GCHandleType.Pinned);
src\libraries\System.Private.CoreLib\src\System\WeakReference.cs (2)
83nint h = GCHandle.InternalAlloc(target, trackResurrection ? GCHandleType.WeakTrackResurrection : GCHandleType.Weak);
src\libraries\System.Private.CoreLib\src\System\WeakReference.T.cs (2)
83nint h = GCHandle.InternalAlloc(target, trackResurrection ? GCHandleType.WeakTrackResurrection : GCHandleType.Weak);
src\System\Runtime\InteropServices\GCHandle.CoreCLR.cs (4)
10internal static IntPtr InternalAlloc(object? value, GCHandleType type) 19private static extern IntPtr _InternalAlloc(object? value, GCHandleType type); 22private static IntPtr InternalAllocWithGCTransition(object? value, GCHandleType type) 26private static partial IntPtr _InternalAllocWithGCTransition(ObjectHandleOnStack value, GCHandleType type);
src\System\RuntimeHandles.cs (2)
592private static partial IntPtr GetGCHandle(QCallTypeHandle handle, GCHandleType type); 594internal IntPtr GetGCHandle(GCHandleType type)
src\System\RuntimeType.CoreCLR.cs (1)
2454IntPtr newgcHandle = th.GetGCHandle(GCHandleType.WeakTrackResurrection);
System.Private.Windows.Core (1)
Windows\Win32\System\Variant\VARIANT.cs (1)
268pin = GCHandle.Alloc(array, GCHandleType.Pinned);
System.Reflection.Metadata (2)
System\Reflection\Internal\Utilities\PinnedObject.cs (1)
28_handle = GCHandle.Alloc(obj, GCHandleType.Pinned);
System\Reflection\Metadata\Internal\VirtualHeap.cs (1)
103var blob = new PinnedBlob(GCHandle.Alloc(value, GCHandleType.Pinned), value.Length);
System.Resources.Extensions (1)
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
22_pinningHandle = GCHandle.Alloc(array, GCHandleType.Pinned);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
669[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.GCHandleType))]
System.Runtime.InteropServices (1)
artifacts\obj\System.Runtime.InteropServices\Debug\net10.0\System.Runtime.InteropServices.Forwards.cs (1)
91[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.GCHandleType))]
System.Security.Cryptography (1)
System\Security\Cryptography\CryptoStream.cs (1)
724GCHandle pinHandle = GCHandle.Alloc(rentedBuffer, GCHandleType.Pinned);
System.Windows.Forms (4)
System\Windows\Forms\Control.ControlNativeWindow.cs (1)
43_rootRef = GCHandle.Alloc(GetControl(), GCHandleType.Normal);
System\Windows\Forms\NativeWindow.cs (2)
245GCHandle root = GCHandle.Alloc(window, GCHandleType.Weak); 735s_windowHandles[hwnd] = GCHandle.Alloc(window.PreviousWindow, GCHandleType.Weak);
System\Windows\Forms\NotifyIcon.NotifyIconNativeWindow.cs (1)
43_rootRef = GCHandle.Alloc(_reference, GCHandleType.Normal);
TlsFeaturesObserve (2)
HttpSys\HttpSysConfigurator.cs (2)
34var handleHash = GCHandle.Alloc(hash, GCHandleType.Pinned); 92var sockAddrHandle = GCHandle.Alloc(sockAddrStructureBytes, GCHandleType.Pinned);