41 instantiations of GCHandle
mscorlib (6)
system\io\pinnedbuffermemorystream.cs (1)
45_pinningHandle = new GCHandle(array, GCHandleType.Pinned);
system\runtime\interopservices\gchandle.cs (4)
93return new GCHandle(value, GCHandleType.Normal); 99return new GCHandle(value, type); 214return new GCHandle(IntPtr.Zero); 219return new GCHandle(handle);
system\runtime\remoting\serveridentity.cs (1)
90_srvIdentityHandle = new GCHandle(this, GCHandleType.Normal);
PresentationCore (3)
Core\CSharp\System\Windows\Media\Geometry.cs (1)
754GCHandle handle = new GCHandle();
Core\CSharp\System\Windows\Media\Imaging\PropVariant.cs (1)
173GCHandle handle = new GCHandle();
Shared\MS\Internal\CharacterBuffer.cs (1)
504gcHandle = new GCHandle();
System (10)
net\System\Net\_SafeNetHandles.cs (2)
1503GCHandle pinnedOutBytes = new GCHandle(); 1828GCHandle pinnedOutBytes = new GCHandle();
net\System\Net\HttpListener.cs (2)
2349GCHandle headersArrayHandle = new GCHandle(); 2350GCHandle wwwAuthenticateHandle = new GCHandle();
services\monitoring\system\diagnosticts\Process.cs (1)
2005GCHandle environmentHandle = new GCHandle();
services\monitoring\system\diagnosticts\ProcessManager.cs (5)
351GCHandle bufferHandle = new GCHandle(); 422GCHandle bufferHandle = new GCHandle(); 582GCHandle moduleHandlesArrayHandle = new GCHandle(); 795GCHandle dataHandle = new GCHandle(); 1069GCHandle bufferHandle = new GCHandle();
System.IdentityModel (2)
System\IdentityModel\SspiSafeHandles.cs (2)
208GCHandle pinnedOutBytes = new GCHandle(); 489GCHandle pinnedOutBytes = new GCHandle();
System.IdentityModel.Selectors (2)
infocard\Diagnostics\Managed\Microsoft\InfoCards\Diagnostics\InfocardTrace.cs (2)
481GCHandle stringParamHandle = new GCHandle(); 486GCHandle stringsRootHandle = new GCHandle();
System.Net (9)
net\PeerToPeer\Collaboration\ContactManager.cs (1)
1407GCHandle pepName = new GCHandle();
net\PeerToPeer\Collaboration\Peer.cs (5)
379GCHandle pepName = new GCHandle(); 532GCHandle guidHandle = new GCHandle(); 548GCHandle pepName = new GCHandle(); 697GCHandle pepName = new GCHandle(); 1165GCHandle pepName = new GCHandle();
net\PeerToPeer\Collaboration\PeerCollaboration.cs (1)
513GCHandle descHandle = new GCHandle();
net\PeerToPeer\Collaboration\PeerContact.cs (1)
1020GCHandle guidHandle = new GCHandle();
net\PeerToPeer\PeerNameRegistration.cs (1)
344handle = new GCHandle();
System.Security (4)
system\security\cryptography\dataprotection.cs (4)
46GCHandle pbDataIn = new GCHandle(); 47GCHandle pOptionalEntropy = new GCHandle(); 121GCHandle pbDataIn = new GCHandle(); 122GCHandle pOptionalEntropy = new GCHandle();
System.ServiceModel.Internals (1)
System\Runtime\Diagnostics\EventLogger.cs (1)
138GCHandle stringsRootHandle = new GCHandle();
WindowsBase (4)
Base\MS\Internal\IO\Packaging\CompoundFile\CompoundFileDeflateTransform.cs (4)
105GCHandle gcSourceBuf = new GCHandle(); // Preallocate these so we can safely access them 106GCHandle gcSinkBuf = new GCHandle(); // in the next finally block. 254GCHandle gcSourceBuf = new GCHandle(); 255GCHandle gcSinkBuf = new GCHandle();
438 references to GCHandle
mscorlib (50)
parent\parent\parent\parent\InternalApis\NDP_Common\inc\PinnableBufferCache.cs (2)
509private GCHandle m_weakTargetObj; 515m_weakTargetObj = GCHandle.Alloc(targetObj, GCHandleType.Weak);
system\diagnostics\eventing\eventprovider.cs (3)
1047GCHandle[] rgGCHandle = new GCHandle[refObjIndex]; 1052rgGCHandle[i] = GCHandle.Alloc(dataRefObj[i], GCHandleType.Pinned);
System\Diagnostics\Eventing\TraceLogging\DataCollector.cs (4)
29private GCHandle* pinsEnd; 33private GCHandle* pins; 44GCHandle* pins, 284*pinsTemp = GCHandle.Alloc(value, GCHandleType.Pinned);
System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventSource.cs (3)
433var pins = stackalloc GCHandle[pinCount]; 603var pins = stackalloc GCHandle[pinCount]; 722private unsafe void WriteCleanup(GCHandle* pPins, int cPins)
system\internal.cs (1)
128new List<GCHandle>(); // NCL team needs this
system\io\filestream.cs (3)
573GCHandle pinHandle = (GCHandle) pinningHandle; 1110pinningHandle = GCHandle.Alloc(sd, GCHandleType.Pinned);
system\io\pinnedbuffermemorystream.cs (1)
26private GCHandle _pinningHandle;
system\multicastdelegate.cs (3)
726this._methodBase = System.Runtime.InteropServices.GCHandle.InternalGet(gchandle); 736this._methodBase = System.Runtime.InteropServices.GCHandle.InternalGet(gchandle); 746this._methodBase = System.Runtime.InteropServices.GCHandle.InternalGet(gchandle);
system\rttype.cs (3)
2752GCHandle.InternalFree(newgcHandle); 2755RuntimeTypeCache cache = GCHandle.InternalGet(m_cache) as RuntimeTypeCache; 2759RuntimeTypeCache existingCache = GCHandle.InternalCompareExchange(m_cache, cache, null, false) as RuntimeTypeCache;
system\runtime\interopservices\gchandle.cs (13)
91public static GCHandle Alloc(Object value) 97public static GCHandle Alloc(Object value, GCHandleType type) 191public static explicit operator GCHandle(IntPtr value) 197public static GCHandle FromIntPtr(IntPtr value) 223public static explicit operator IntPtr(GCHandle value) 228public static IntPtr ToIntPtr(GCHandle value) 248GCHandle hnd; 251if(o == null || !(o is GCHandle)) 254hnd = (GCHandle) o; 259public static bool operator ==(GCHandle a, GCHandle b) 264public static bool operator !=(GCHandle a, GCHandle b)
system\runtime\remoting\objref.cs (4)
406internal GCHandle srvIdentity; 409internal void SetServerIdentity(GCHandle hndSrvIdentity) 414internal GCHandle GetServerIdentity() 520SetServerIdentity((GCHandle)e.Value);
system\runtime\remoting\realproxy.cs (2)
88internal GCHandle _srvIdentity; 366internal void SetSrvInfo(GCHandle srvIdentity, int domainID)
system\runtime\remoting\remotingservices.cs (3)
1804internal static GCHandle CreateDelegateInvocation(WaitCallback waitDelegate, Object state) 1809return System.Runtime.InteropServices.GCHandle.Alloc(delegateCallToken); 1813internal static void DisposeDelegateInvocation(GCHandle delegateCallToken)
system\runtime\remoting\serveridentity.cs (2)
52internal GCHandle _srvIdentityHandle; 122internal GCHandle GetHandle()
system\security\principal\sid.cs (3)
935GCHandle[] HandleArray = new GCHandle[ sourceSids.Count ]; 956HandleArray[currentSid] = GCHandle.Alloc(sid.BinaryForm, GCHandleType.Pinned);
PresentationCore (31)
Core\CSharp\MS\Internal\FontCache\FontSource.cs (2)
437_memoryHandle = GCHandle.Alloc(bits, GCHandleType.Pinned); 480private GCHandle _memoryHandle;
Core\CSharp\MS\Internal\Shaping\TypefaceMap.cs (1)
107GCHandle gcHandle;
Core\CSharp\System\Windows\Media\EventProxy.cs (5)
50((System.Runtime.InteropServices.GCHandle)(pEPD.m_handle)).Free(); 53internal System.Runtime.InteropServices.GCHandle m_handle; 149System.Runtime.InteropServices.GCHandle handle = (System.Runtime.InteropServices.GCHandle)(epd.m_handle); 190epd.m_handle = System.Runtime.InteropServices.GCHandle.Alloc(epw, System.Runtime.InteropServices.GCHandleType.Normal);
Core\CSharp\System\Windows\Media\Geometry.cs (2)
754GCHandle handle = new GCHandle(); 759handle = GCHandle.Alloc(dashArray, GCHandleType.Pinned);
Core\CSharp\System\Windows\Media\Imaging\PropVariant.cs (2)
173GCHandle handle = new GCHandle(); 178handle = GCHandle.Alloc(array, GCHandleType.Pinned);
Core\CSharp\System\Windows\Media\Imaging\WriteableBitmap.cs (4)
461GCHandle arrayHandle = GCHandle.Alloc(sourceBuffer, GCHandleType.Pinned); 621GCHandle arrayHandle = GCHandle.Alloc(pixels, GCHandleType.Pinned);
Core\CSharp\System\Windows\Media\StreamAsIStream.cs (5)
93((System.Runtime.InteropServices.GCHandle)(pSD.m_handle)).Free(); 96internal System.Runtime.InteropServices.GCHandle m_handle; 627System.Runtime.InteropServices.GCHandle handle = (System.Runtime.InteropServices.GCHandle)(sd.m_handle); 795sd.m_handle = System.Runtime.InteropServices.GCHandle.Alloc(sais, System.Runtime.InteropServices.GCHandleType.Normal);
Shared\MS\Internal\CharacterBuffer.cs (10)
48public abstract IntPtr PinAndGetCharacterPointer(int offset, out GCHandle gcHandle); 53public abstract void UnpinCharacterPointer(GCHandle gcHandle); 238public unsafe override IntPtr PinAndGetCharacterPointer(int offset, out GCHandle gcHandle) 240gcHandle = GCHandle.Alloc(_characterArray, GCHandleType.Pinned); 252public override void UnpinCharacterPointer(GCHandle gcHandle) 353public unsafe override IntPtr PinAndGetCharacterPointer(int offset, out GCHandle gcHandle) 355gcHandle = GCHandle.Alloc(_string, GCHandleType.Pinned); 367public override void UnpinCharacterPointer(GCHandle gcHandle) 502public override IntPtr PinAndGetCharacterPointer(int offset, out GCHandle gcHandle) 516public override void UnpinCharacterPointer(GCHandle gcHandle)
PresentationFramework (7)
src\Framework\System\Windows\Documents\WinEventHandler.cs (2)
52_gchThis = GCHandle.Alloc(_winEventProc.Value); 209private GCHandle _gchThis;
src\Framework\System\Windows\Standard\MessageWindow.cs (5)
89GCHandle gcHandle = default(GCHandle); 92gcHandle = GCHandle.Alloc(this); 202GCHandle gcHandle = GCHandle.FromIntPtr(createStruct.lpCreateParams);
System (109)
net\System\IriHelper.cs (3)
142GCHandle destHandle = GCHandle.Alloc(dest, GCHandleType.Pinned); 348destHandle = GCHandle.Alloc(dest, GCHandleType.Pinned);
net\System\Net\_AutoWebProxyScriptHelper.cs (3)
646 GCHandle[] GCHandles = new GCHandle[SockAddrIn6List.Length]; 649 GCHandles[i] = GCHandle.Alloc(SockAddrIn6List[i].m_Buffer, GCHandleType.Pinned);
net\System\Net\_SafeNetHandles.cs (16)
1502GCHandle[] pinnedInBytes = null; 1503GCHandle pinnedOutBytes = new GCHandle(); 1508pinnedOutBytes = GCHandle.Alloc(outSecBuffer.token, GCHandleType.Pinned); 1516pinnedInBytes = new GCHandle[inSecurityBufferDescriptor.Count]; 1538pinnedInBytes[index] = GCHandle.Alloc(securityBuffer.token, GCHandleType.Pinned); 1827GCHandle[] pinnedInBytes = null; 1828GCHandle pinnedOutBytes = new GCHandle(); 1833pinnedOutBytes = GCHandle.Alloc(outSecBuffer.token, GCHandleType.Pinned); 1841pinnedInBytes = new GCHandle[inSecurityBufferDescriptor.Count]; 1863pinnedInBytes[index] = GCHandle.Alloc(securityBuffer.token, GCHandleType.Pinned); 2097GCHandle[] pinnedInBytes = null; 2103pinnedInBytes = new GCHandle[inSecurityBufferDescriptor.Count]; 2120pinnedInBytes[index] = GCHandle.Alloc(securityBuffer.token, GCHandleType.Pinned); 2208GCHandle[] pinnedInBytes = null; 2215pinnedInBytes = new GCHandle[inSecurityBufferDescriptor.Count]; 2236pinnedInBytes[index] = GCHandle.Alloc(securityBuffer.token, GCHandleType.Pinned);
net\System\Net\_SSPIWrapper.cs (3)
387GCHandle[] pinnedBuffers = new GCHandle[input.Length]; 402pinnedBuffers[i] = GCHandle.Alloc(iBuffer.token, GCHandleType.Pinned);
net\System\Net\_TimerThread.cs (2)
313m_ThisHandle = (IntPtr) GCHandle.Alloc(this); 352((GCHandle) m_ThisHandle).Free();
net\System\Net\HttpListener.cs (9)
229private GCHandle m_PinnedHandle; 251m_PinnedHandle = GCHandle.Alloc(RequestBuffer, GCHandleType.Pinned); 2347GCHandle[] challengeHandles = null; 2349GCHandle headersArrayHandle = new GCHandle(); 2350GCHandle wwwAuthenticateHandle = new GCHandle(); 2353challengeHandles = new GCHandle[httpResponse.Headers.UnknownHeaderCount]; 2361headersArrayHandle = GCHandle.Alloc(headersArray, GCHandleType.Pinned); 2363wwwAuthenticateHandle = GCHandle.Alloc(s_WwwAuthenticateBytes, GCHandleType.Pinned); 2369challengeHandles[i] = GCHandle.Alloc(byteChallenge, GCHandleType.Pinned);
net\System\Net\HttpListenerResponse.cs (11)
508List<GCHandle> pinnedHeaders = SerializeHeaders(ref m_NativeResponse.Headers, isWebSocketHandshake); 707private List<GCHandle> SerializeHeaders(ref UnsafeNclNativeMethods.HttpApi.HTTP_RESPONSE_HEADERS headers, 710List<GCHandle> pinnedHeaders; 711GCHandle gcHandle; 726pinnedHeaders = new List<GCHandle>(); 806gcHandle = GCHandle.Alloc(unknownHeaders, GCHandleType.Pinned); 822gcHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned); 831gcHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned); 845gcHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned); 862private void FreePinnedHeaders(List<GCHandle> pinnedHeaders) { 864foreach (GCHandle gcHandle in pinnedHeaders) {
net\System\Net\Sockets\_BaseOverlappedAsyncResult.cs (6)
31private GCHandle [] m_GCHandles; 255m_GCHandles = new GCHandle[objectsArray.Length]; 258m_GCHandles[i] = GCHandle.Alloc(objectsArray[i], GCHandleType.Pinned); 264m_GCHandles = new GCHandle[1]; 265m_GCHandles[0] = GCHandle.Alloc(objectsToPin, GCHandleType.Pinned); 634GCHandle[] gcHandles = m_GCHandles;
net\System\Net\Sockets\Socket.cs (18)
1328GCHandle[] objectsToPin = null; 1332objectsToPin = new GCHandle[count]; 1337objectsToPin[i] = GCHandle.Alloc(buffer.Array, GCHandleType.Pinned); 1863GCHandle[] objectsToPin = null; 1868objectsToPin = new GCHandle[count]; 1873objectsToPin[i] = GCHandle.Alloc(buffer.Array, GCHandleType.Pinned); 6991GCHandle[] objectsToPin = null; 6996objectsToPin = new GCHandle[buffers.Length]; 6999objectsToPin[i] = GCHandle.Alloc(buffers[i].Buffer, GCHandleType.Pinned); 8649private GCHandle m_SocketAddressGCHandle; 8656private GCHandle m_WSAMessageBufferGCHandle; 8659private GCHandle m_ControlBufferGCHandle; 8662private GCHandle m_WSARecvMsgWSABufferArrayGCHandle; 9184m_WSAMessageBufferGCHandle = GCHandle.Alloc(m_WSAMessageBuffer, GCHandleType.Pinned); 9207m_ControlBufferGCHandle = GCHandle.Alloc(m_ControlBuffer, GCHandleType.Pinned); 9218m_WSARecvMsgWSABufferArrayGCHandle = GCHandle.Alloc(m_WSARecvMsgWSABufferArray, GCHandleType.Pinned); 9222m_WSARecvMsgWSABufferArrayGCHandle = GCHandle.Alloc(m_WSABufferArray, GCHandleType.Pinned); 9463m_SocketAddressGCHandle = GCHandle.Alloc(m_SocketAddress.m_Buffer, GCHandleType.Pinned);
net\System\Net\WebSockets\WebSocketBuffer.cs (4)
43private readonly GCHandle m_GCHandle; 54private GCHandle m_PinnedSendBufferHandle; 73m_GCHandle = GCHandle.Alloc(internalBuffer.Array, GCHandleType.Pinned); 209m_PinnedSendBufferHandle = GCHandle.Alloc(m_PinnedSendBuffer.Array, GCHandleType.Pinned);
net\System\Net\WebSockets\WebSocketHttpListenerDuplexStream.cs (2)
859private GCHandle m_DataChunksGCHandle; 1122m_DataChunksGCHandle = GCHandle.Alloc(m_DataChunks, GCHandleType.Pinned);
parent\parent\parent\InternalApis\NDP_Common\inc\PinnableBufferCache.cs (2)
509private GCHandle m_weakTargetObj; 515m_weakTargetObj = GCHandle.Alloc(targetObj, GCHandleType.Weak);
security\system\security\cryptography\cryptoapi.cs (6)
3492GCHandle handle = GCHandle.Alloc(pvObject, GCHandleType.Pinned); 3557GCHandle handle = GCHandle.Alloc(pvObject, GCHandleType.Pinned); 3639GCHandle handle = GCHandle.Alloc(pbData, GCHandleType.Pinned);
services\monitoring\system\diagnosticts\EventLog.cs (5)
1289GCHandle[] handles = new GCHandle[insertionStrings.Length]; 1290GCHandle stringsRoot = GCHandle.Alloc(addresses, GCHandleType.Pinned); 1301handles[i] = GCHandle.Alloc(insertionStrings[i], GCHandleType.Pinned);
services\monitoring\system\diagnosticts\EventLogInternal.cs (5)
1708GCHandle[] stringHandles = new GCHandle[strings.Length]; 1709GCHandle stringsRootHandle = GCHandle.Alloc(stringRoots, GCHandleType.Pinned); 1712stringHandles[strIndex] = GCHandle.Alloc(strings[strIndex], GCHandleType.Pinned);
services\monitoring\system\diagnosticts\Process.cs (2)
2005GCHandle environmentHandle = new GCHandle(); 2049environmentHandle = GCHandle.Alloc(environmentBytes, GCHandleType.Pinned);
services\monitoring\system\diagnosticts\ProcessManager.cs (10)
351GCHandle bufferHandle = new GCHandle(); 361bufferHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned); 422GCHandle bufferHandle = new GCHandle(); 431bufferHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned); 582GCHandle moduleHandlesArrayHandle = new GCHandle(); 587moduleHandlesArrayHandle = GCHandle.Alloc(moduleHandles, GCHandleType.Pinned); 795GCHandle dataHandle = new GCHandle(); 797dataHandle = GCHandle.Alloc(data, GCHandleType.Pinned); 1069GCHandle bufferHandle = new GCHandle(); 1090bufferHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
sys\System\IO\compression\DeflaterZLib.cs (2)
27private GCHandle _inputBufferHandle; 146_inputBufferHandle = GCHandle.Alloc(inputBuffer, GCHandleType.Pinned);
System.Core (12)
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (5)
409GCHandle pinHandle = (GCHandle)pinningHandle; 533GCHandle pinHandle = (GCHandle)pinningHandle; 793pinningHandle = GCHandle.Alloc(sd, GCHandleType.Pinned);
System\IO\Pipes\Pipe.cs (4)
99GCHandle pinHandle = (GCHandle)pinningHandle; 523GCHandle pinHandle = (GCHandle)pinningHandle;
System\IO\Pipes\PipeStream.cs (1)
1196pinningHandle = GCHandle.Alloc(sd, GCHandleType.Pinned);
System\Security\Cryptography\X509Certificates\X509Native.cs (2)
459private System.Runtime.InteropServices.GCHandle _gcHandle; 466_gcHandle = System.Runtime.InteropServices.GCHandle.Alloc(
System.Data (14)
fx\src\bid\inc\cs\bidPrivateBase.cs (2)
740private static GCHandle hCookie; 752hCookie = GCHandle.Alloc(cookieObject, GCHandleType.Pinned);
fx\src\data\System\Data\OleDb\ColumnBinding.cs (4)
48private GCHandle _pinnedBuffer; 632_pinnedBuffer = GCHandle.Alloc(value, GCHandleType.Pinned); 672_pinnedBuffer = GCHandle.Alloc(value, GCHandleType.Pinned); 689_pinnedBuffer = GCHandle.Alloc(value, GCHandleType.Pinned);
fx\src\data\System\Data\SqlClient\TdsParserSafeHandles.cs (4)
93GCHandle gcHandle = (GCHandle)key; 111GCHandle gcHandle = (GCHandle)key;
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (2)
101private GCHandle _gcHandle; // keeps this object alive until we're closed. 741_gcHandle = GCHandle.Alloc(this, GCHandleType.Normal);
fx\src\data\System\Data\SQLTypes\SQLFileStream.cs (2)
934private GCHandle m_hQos; 980m_hQos = GCHandle.Alloc(m_qos, GCHandleType.Pinned);
System.Drawing (2)
commonui\System\Drawing\Advanced\GraphicsPath.cs (2)
312GCHandle typesHandle = GCHandle.Alloc(pathData.Types, GCHandleType.Pinned);
System.IdentityModel (15)
System\IdentityModel\SspiSafeHandles.cs (10)
207GCHandle[] pinnedInBytes = null; 208GCHandle pinnedOutBytes = new GCHandle(); 215pinnedOutBytes = GCHandle.Alloc(outSecBuffer.token, GCHandleType.Pinned); 224pinnedInBytes = new GCHandle[inSecurityBufferDescriptor.Count]; 245pinnedInBytes[index] = GCHandle.Alloc(securityBuffer.token, GCHandleType.Pinned); 488GCHandle[] pinnedInBytes = null; 489GCHandle pinnedOutBytes = new GCHandle(); 495pinnedOutBytes = GCHandle.Alloc(outSecBuffer.token, GCHandleType.Pinned); 504pinnedInBytes = new GCHandle[inSecurityBufferDescriptor.Count]; 525pinnedInBytes[index] = GCHandle.Alloc(securityBuffer.token, GCHandleType.Pinned);
System\IdentityModel\SspiWrapper.cs (3)
706GCHandle[] pinnedBuffers = new GCHandle[input.Length]; 720pinnedBuffers[i] = GCHandle.Alloc(iBuffer.token, GCHandleType.Pinned);
System\IdentityModel\Tokens\RsaSecurityToken.cs (2)
22GCHandle rsaHandle; 61this.rsaHandle = GCHandle.Alloc(rsa);
System.IdentityModel.Selectors (4)
infocard\Diagnostics\Managed\Microsoft\InfoCards\Diagnostics\InfocardTrace.cs (4)
481GCHandle stringParamHandle = new GCHandle(); 486GCHandle stringsRootHandle = new GCHandle(); 493stringsRootHandle = GCHandle.Alloc(stringRoots, GCHandleType.Pinned); 498stringParamHandle = GCHandle.Alloc(parameter, GCHandleType.Pinned);
System.IO.Log (17)
System\IO\Log\AppendHelper.cs (4)
17GCHandle[] handles; 33this.handles = new GCHandle[data.Count + 1]; 37this.handles[0] = GCHandle.Alloc(header.Bits, GCHandleType.Pinned); 43handles[i + 1] = GCHandle.Alloc(data[i].Array, GCHandleType.Pinned);
System\IO\Log\LogFlushAsyncResult.cs (2)
19GCHandle pinnedResultLsn; 53this.pinnedResultLsn = GCHandle.Alloc(this.boxedResultLsn,
System\IO\Log\LogReserveAndAppendState.cs (6)
63GCHandle[] handles; 453this.handles = new GCHandle[pinnedObjectCount]; 465this.handles[(int)PinIndex.ReturnLsn] = GCHandle.Alloc(this.boxedResultLsn, GCHandleType.Pinned); 472this.handles[(int)PinIndex.Reservations] = GCHandle.Alloc(this.alignedReservations, GCHandleType.Pinned); 478this.handles[(int)PinIndex.Header] = GCHandle.Alloc(this.headerBits, GCHandleType.Pinned); 490this.handles[(int)PinIndex.FirstData + i] = GCHandle.Alloc(segment.Array, GCHandleType.Pinned);
System\IO\Log\LogStore.cs (3)
158GCHandle pinHandle = (GCHandle)pinningHandle; 518pinningHandle = GCHandle.Alloc(sd, GCHandleType.Pinned);
System\IO\Log\LogWriteRestartAreaState.cs (2)
49GCHandle pinnedResultHandle; 411this.pinnedResultHandle = GCHandle.Alloc(this.boxedResultLsn,
System.Messaging (18)
System\Messaging\AccessControlList.cs (2)
126GCHandle mem = GCHandle.Alloc(entries, GCHandleType.Pinned);
System\Messaging\Interop\MessagePropertyVariants.cs (11)
84private GCHandle handleVectorProperties; 85private GCHandle handleVectorIdentifiers; 86private GCHandle handleVectorStatus; 320GCHandle handle = GCHandle.Alloc(objects[i], GCHandleType.Pinned); 334GCHandle handle = GCHandle.Alloc(objects[i], GCHandleType.Pinned); 347handleVectorIdentifiers = GCHandle.Alloc(newVectorIdentifiers, GCHandleType.Pinned); 348handleVectorProperties = GCHandle.Alloc(newVectorProperties, GCHandleType.Pinned); 349handleVectorStatus = GCHandle.Alloc(newVectorStatus, GCHandleType.Pinned); 415((GCHandle)handles[vectorIdentifiers[i] - basePropertyId]).Free();
System\Messaging\Message.cs (2)
1647GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
System\Messaging\MessageQueue.cs (3)
3465GCHandle sdHandle = GCHandle.Alloc(SecurityDescriptor, GCHandleType.Pinned); 3478sdHandle = GCHandle.Alloc(SecurityDescriptor, GCHandleType.Pinned);
System.Net (48)
net\PeerToPeer\Collaboration\ContactManager.cs (4)
1407GCHandle pepName = new GCHandle(); 1410pepName = GCHandle.Alloc(peerEndPoint.Name, GCHandleType.Pinned); 1414GCHandle peerEP = GCHandle.Alloc(pe, GCHandleType.Pinned);
net\PeerToPeer\Collaboration\Peer.cs (18)
379GCHandle pepName = new GCHandle(); 382pepName = GCHandle.Alloc(peerEndPoint.Name, GCHandleType.Pinned); 386GCHandle peerEP = GCHandle.Alloc(pep, GCHandleType.Pinned); 532GCHandle guidHandle = new GCHandle(); 537guidHandle = GCHandle.Alloc(guid, GCHandleType.Pinned); 548GCHandle pepName = new GCHandle(); 551pepName = GCHandle.Alloc(peerEndPoint.Name, GCHandleType.Pinned); 554GCHandle peerEP = GCHandle.Alloc(pep, GCHandleType.Pinned); 697GCHandle pepName = new GCHandle(); 700pepName = GCHandle.Alloc(peerEndPoint.Name, GCHandleType.Pinned); 703GCHandle peerEP = GCHandle.Alloc(pep, GCHandleType.Pinned); 1165GCHandle pepName = new GCHandle(); 1168pepName = GCHandle.Alloc(peerEndPoint.Name, GCHandleType.Pinned); 1171GCHandle peerEP = GCHandle.Alloc(pep, GCHandleType.Pinned);
net\PeerToPeer\Collaboration\PeerApplication.cs (2)
265GCHandle guidHandle = GCHandle.Alloc(guid, GCHandleType.Pinned);
net\PeerToPeer\Collaboration\PeerCollaboration.cs (2)
513GCHandle descHandle = new GCHandle(); 529descHandle = GCHandle.Alloc(application.Description, GCHandleType.Pinned);
net\PeerToPeer\Collaboration\PeerContact.cs (6)
1020GCHandle guidHandle = new GCHandle(); 1026guidHandle = GCHandle.Alloc(guid, GCHandleType.Pinned); 1037GCHandle pepName = GCHandle.Alloc(peerEndPoint.Name, GCHandleType.Pinned); 1040GCHandle peerEP = GCHandle.Alloc(pep, GCHandleType.Pinned);
net\PeerToPeer\Collaboration\PeerNearMe.cs (4)
388GCHandle pepName = GCHandle.Alloc(peerEndPoint.Name, GCHandleType.Pinned); 391GCHandle peerEP = GCHandle.Alloc(pep, GCHandleType.Pinned);
net\PeerToPeer\Collaboration\PeerObject.cs (2)
217GCHandle guidHandle = GCHandle.Alloc(guid, GCHandleType.Pinned);
net\PeerToPeer\PeerNameRegistration.cs (10)
332GCHandle handle; 339handle = GCHandle.Alloc(m_PeerNameRecord.Data, GCHandleType.Pinned); 392GCHandle[] GCHandles = new GCHandle[numAddresses]; 401GCHandles[i] = GCHandle.Alloc(sockaddr, GCHandleType.Pinned); 531GCHandle handle = GCHandle.Alloc(m_PeerNameRecord.Data, GCHandleType.Pinned); 575GCHandle[] GCHandles = new GCHandle[numAddresses]; 584GCHandles[i] = GCHandle.Alloc(sockaddr, GCHandleType.Pinned);
System.Runtime.Caching (2)
System\Caching\SRef.cs (2)
84GCHandle _handle; 90_handle = GCHandle.Alloc(t);
System.Runtime.Remoting (2)
channels\ipc\ipcport.cs (2)
86GCHandle pinningHandle = GCHandle.Alloc(sd, GCHandleType.Pinned);
System.Security (10)
system\security\cryptography\dataprotection.cs (8)
46GCHandle pbDataIn = new GCHandle(); 47GCHandle pOptionalEntropy = new GCHandle(); 52pbDataIn = GCHandle.Alloc(userData, GCHandleType.Pinned); 58pOptionalEntropy = GCHandle.Alloc(optionalEntropy, GCHandleType.Pinned); 121GCHandle pbDataIn = new GCHandle(); 122GCHandle pOptionalEntropy = new GCHandle(); 127pbDataIn = GCHandle.Alloc(encryptedData, GCHandleType.Pinned); 133pOptionalEntropy = GCHandle.Alloc(optionalEntropy, GCHandleType.Pinned);
system\security\cryptography\pkcs\pkcsmisc.cs (2)
475private GCHandle m_gcHandle; 523m_gcHandle = GCHandle.Alloc(m_content, GCHandleType.Pinned);
System.ServiceModel (21)
System\ServiceModel\Channels\MsmqSubqueueLockingQueue.cs (6)
362GCHandle propsHandle = GCHandle.Alloc(null, GCHandleType.Pinned); 363GCHandle nativePropertyIdsHandle = GCHandle.Alloc(null, GCHandleType.Pinned); 364GCHandle propHandle = GCHandle.Alloc(null, GCHandleType.Pinned);
System\ServiceModel\Channels\NativeMsmqMessage.cs (10)
21GCHandle nativePropertiesHandle; 22GCHandle variantsHandle; 23GCHandle idsHandle; 35this.nativePropertiesHandle = GCHandle.Alloc(null, GCHandleType.Pinned); 36this.idsHandle = GCHandle.Alloc(null, GCHandleType.Pinned); 37this.variantsHandle = GCHandle.Alloc(null, GCHandleType.Pinned); 309GCHandle bufferHandle; 314bufferHandle = GCHandle.Alloc(null, GCHandleType.Pinned); 421GCHandle bufferHandle; 433this.bufferHandle = GCHandle.Alloc(null, GCHandleType.Pinned);
System\ServiceModel\Channels\OverlappedContext.cs (2)
28GCHandle pinnedHandle; 67this.pinnedHandle = GCHandle.FromIntPtr(*((IntPtr*)nativeOverlapped +
System\ServiceModel\Channels\SelfSignedCertificate.cs (3)
128GCHandle pfxHandle = GCHandle.Alloc(blob, GCHandleType.Pinned); 148pfxHandle = GCHandle.Alloc(blob, GCHandleType.Pinned);
System.ServiceModel.Internals (7)
System\Runtime\Diagnostics\EventLogger.cs (7)
138GCHandle stringsRootHandle = new GCHandle(); 139GCHandle[] stringHandles = null; 143stringsRootHandle = GCHandle.Alloc(stringRoots, GCHandleType.Pinned); 144stringHandles = new GCHandle[logValues.Length]; 147stringHandles[strIndex] = GCHandle.Alloc(logValues[strIndex], GCHandleType.Pinned); 160foreach (GCHandle gcHandle in stringHandles) 301void UnsafeWriteEventLog(TraceEventType type, ushort eventLogCategory, uint eventId, string[] logValues, byte[] sidBA, GCHandle stringsRootHandle)
System.Web (26)
FileChangesMonitor.cs (2)
413GCHandle _rootCallback; // roots this callback to prevent collection 444_rootCallback = GCHandle.Alloc(myCallback);
Hosting\ISAPIWorkerRequest.cs (9)
384private GCHandle _pinnedArrayData; 499_pinnedArrayData = GCHandle.Alloc(_arrayData, GCHandleType.Pinned); 533private GCHandle _pinnedCharBufferHandle; 562_pinnedCharBufferHandle = GCHandle.Alloc(_charBuffer, GCHandleType.Pinned); 2308private GCHandle _rootedThis; // for the duration of async 2359_rootedThis = GCHandle.Alloc(this); // root for the duration of IO 2377_rootedThis = GCHandle.Alloc(this); // root for the duration of IO 2623_rootedThis = GCHandle.Alloc(this); // root for duration of async operation 2716_rootedThis = GCHandle.Alloc(this); // root for the duration of ExecuteUrl
RootedObjects.cs (4)
36private GCHandle _handle; 39_handle = GCHandle.Alloc(this); 130GCHandle handle = (GCHandle)pointer;
Util\AspCompat.cs (2)
141private GCHandle _rootedThis; // for the duration of async 349_rootedThis = GCHandle.Alloc(this);
Util\GCUtil.cs (5)
21? (IntPtr)GCHandle.Alloc(obj) 27GCHandle gcHandle = (GCHandle)pointer; 44GCHandle _handle; 48_handle = GCHandle.Alloc(t);
Util\PinnedArraySegment.cs (2)
21private GCHandle _gcHandle; 34_gcHandle = GCHandle.Alloc(segment.Array, GCHandleType.Pinned); // pin the array so that unmanaged code can access it
Util\WorkItem.cs (2)
74private GCHandle _rootedThis; 84_rootedThis = GCHandle.Alloc(this);
System.Windows.Forms (15)
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (2)
1238GCHandle gcHandle = GCHandle.Alloc(namedArgs, GCHandleType.Pinned);
winforms\Managed\System\WinForms\Control.cs (2)
14565private GCHandle rootRef; // We will root the control when we do not want to be elligible for garbage collection. 14589rootRef = GCHandle.Alloc(GetControl(), GCHandleType.Normal);
winforms\Managed\System\WinForms\NativeWindow.cs (5)
366GCHandle root = GCHandle.Alloc(window, GCHandleType.Weak); 399GCHandle prevWindow = hashBuckets[bucketNumber].window; 1228hashBuckets[bn].window = GCHandle.Alloc(prevWindow, GCHandleType.Weak); 1453public GCHandle window; // a weak GC handle to the NativeWindow class
winforms\Managed\System\WinForms\NotifyIcon.cs (2)
990private GCHandle rootRef; // We will root the control when we do not want to be elligible for garbage collection. 1016rootRef = GCHandle.Alloc(reference, GCHandleType.Normal);
winforms\Managed\System\WinForms\PropertyGridInternal\PropertyGridView.cs (2)
7078private GCHandle mouseHookRoot; 7154mouseHookRoot = GCHandle.Alloc(hook);
winforms\Managed\System\WinForms\Timer.cs (2)
51private GCHandle timerRoot; 175timerRoot = GCHandle.Alloc(this);
System.Workflow.Runtime (2)
DebugEngine\ProgramPublisher.cs (2)
26GCHandle gchWdeProgramNode; // This is used to pin the wdeProgramNodeSingleton (VS Debugger is using address to calculate cookies) 70this.gchWdeProgramNode = GCHandle.Alloc(this.wdeProgramNodeSingleton);
UIAutomationClient (8)
MS\Internal\Automation\EventListenerClientSide.cs (2)
43_gch = GCHandle.Alloc(_callbackDelegate); 305private GCHandle _gch; // GCHandle to keep GCs from moving the callback
MS\Internal\Automation\HwndProxyElementProvider.cs (2)
1588GCHandle gch = GCHandle.Alloc(enumWindows);
MS\Internal\Automation\UiaCoreAPI.cs (2)
1551static GCHandle _gchandle; 1556_gchandle = GCHandle.Alloc(onGetProviderDelegate);
MS\Internal\Automation\WinEventWrap.cs (2)
266_gchThis = GCHandle.Alloc(_winEventProc); 306private GCHandle _gchThis; // GCHandle to keep GCs from moving this callback
UIAutomationClientsideProviders (6)
MS\Internal\AutomationProxies\Misc.cs (2)
364GCHandle gch = GCHandle.Alloc(enumToolTipWindows);
MS\Internal\AutomationProxies\MSAAWinEventWrap.cs (2)
183_gchThis = GCHandle.Alloc(_winEventProc); 233private GCHandle _gchThis; // GCHandle to keep GCs from moving this callback
MS\Internal\AutomationProxies\WinEventTracker.cs (2)
138internal GCHandle _procHookHandle; 187hp._procHookHandle = GCHandle.Alloc (proc);
WindowsBase (8)
Base\MS\Internal\IO\Packaging\CompoundFile\CompoundFileDeflateTransform.cs (6)
105GCHandle gcSourceBuf = new GCHandle(); // Preallocate these so we can safely access them 106GCHandle gcSinkBuf = new GCHandle(); // in the next finally block. 254GCHandle gcSourceBuf = new GCHandle(); 255GCHandle gcSinkBuf = new GCHandle(); 353private static void AllocOrRealloc(int size, ref byte[] buffer, ref GCHandle gcHandle) 378gcHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned); // pinned so unmanaged code can read/write it
Shared\MS\Win32\HwndSubclass.cs (2)
98_gcHandle = GCHandle.Alloc(this); 734private GCHandle _gcHandle;
WsatConfig (2)
Configuration\HttpWrapper.cs (2)
131GCHandle pinnedAddress; 199pinnedAddress = GCHandle.Alloc(address, GCHandleType.Pinned);
WsatUI (2)
Configuration\HttpWrapper.cs (2)
131GCHandle pinnedAddress; 199pinnedAddress = GCHandle.Alloc(address, GCHandleType.Pinned);