555 references to DangerousGetHandle
mscorlib (24)
microsoft\win32\win32native.cs (1)
542this.Buffer = buffer.DangerousGetHandle();
system\io\filestream.cs (1)
1420return _handle.DangerousGetHandle();
system\security\cryptography\cryptoapitransform.cs (1)
163get { return _safeKeyHandle.DangerousGetHandle(); }
system\security\principal\windowsidentity.cs (14)
128internal WindowsIdentity (SafeAccessTokenHandle safeTokenHandle) : this (safeTokenHandle.DangerousGetHandle(), null, -1) { 252info.AddValue("m_userToken", m_safeTokenHandle.DangerousGetHandle()); 604return m_safeTokenHandle.DangerousGetHandle(); 1165if (!identity.m_safeTokenHandle.IsInvalid && identity.m_safeTokenHandle != SafeAccessTokenHandle.InvalidHandle && identity.m_safeTokenHandle.DangerousGetHandle() != IntPtr.Zero) 1169if (!identity.m_safeTokenHandle.IsInvalid && identity.m_safeTokenHandle.DangerousGetHandle() != IntPtr.Zero) 1170CreateFromToken(identity.m_safeTokenHandle.DangerousGetHandle()); 1186return m_safeTokenHandle.DangerousGetHandle(); 1333int count = Marshal.ReadInt32(safeAllocHandle.DangerousGetHandle()); 1334IntPtr pSidAndAttributes = new IntPtr((long)safeAllocHandle.DangerousGetHandle() + (long)Marshal.OffsetOf(typeof(Win32Native.TOKEN_GROUPS), "Groups")); 1383Win32Native.TOKEN_PRIMARY_GROUP primaryGroup = (Win32Native.TOKEN_PRIMARY_GROUP)Marshal.PtrToStructure(safeAllocHandlePrimaryGroup.DangerousGetHandle(), typeof(Win32Native.TOKEN_PRIMARY_GROUP)); 1391int count = Marshal.ReadInt32(safeAllocHandle.DangerousGetHandle()); 1392IntPtr pSidAndAttributes = new IntPtr((long)safeAllocHandle.DangerousGetHandle() + (long)Marshal.OffsetOf(typeof(Win32Native.TOKEN_GROUPS), "Groups")); 1445Win32Native.SID_AND_ATTRIBUTES user = (Win32Native.SID_AND_ATTRIBUTES)Marshal.PtrToStructure(safeAllocHandle.DangerousGetHandle(), typeof(Win32Native.SID_AND_ATTRIBUTES)); 1479Win32Native.CLAIM_SECURITY_ATTRIBUTES_INFORMATION claimAttributes = (Win32Native.CLAIM_SECURITY_ATTRIBUTES_INFORMATION)Marshal.PtrToStructure(safeAllocHandle.DangerousGetHandle(), typeof(Win32Native.CLAIM_SECURITY_ATTRIBUTES_INFORMATION));
system\stubhelpers.cs (1)
1781return (success ? pHandle.DangerousGetHandle() : IntPtr.Zero);
system\text\basecodepageencoding.cs (1)
347if (safeMemorySectionHandle != null && safeMemorySectionHandle.DangerousGetHandle() == IntPtr.Zero)
system\text\gb18030encoding.cs (1)
172byte *pMemorySection = (byte *) safeMemorySectionHandle.DangerousGetHandle();
system\threading\threadpool.cs (1)
1920ret = BindIOCompletionCallbackNative(osHandle.DangerousGetHandle());
system\threading\waithandle.cs (3)
91get { return safeWaitHandle == null ? InvalidHandle : safeWaitHandle.DangerousGetHandle();} 168waitHandle = safeWaitHandle.DangerousGetHandle(); 189waitHandle = handle.DangerousGetHandle();
PresentationCore (9)
Core\CSharp\System\Windows\Interop\D3DImage.cs (2)
876data.pInteropDeviceBitmap = (ulong)_pInteropDeviceBitmap.DangerousGetHandle().ToPointer(); 893data.pSoftwareBitmap = (ulong)_softwareCopy.WicSourceHandle.DangerousGetHandle().ToPointer();
Core\CSharp\System\Windows\Media\ColorContext.cs (1)
461colorContextPtrs[i] = colorContextHandles[i].DangerousGetHandle();
Core\CSharp\System\Windows\Media\ColorTransformHelper.cs (2)
112handles[0] = sourceProfile.DangerousGetHandle(); 113handles[1] = destinationProfile.DangerousGetHandle();
Core\CSharp\System\Windows\Media\Imaging\BitmapEncoder.cs (2)
716IntPtr[] colorContextPtrs = new IntPtr[1] { colorContext.ColorContextHandle.DangerousGetHandle() }; 744colorContextPtrs[i] = colorContexts[i].ColorContextHandle.DangerousGetHandle();
Core\CSharp\System\Windows\Media\Imaging\BitmapSource.cs (1)
1010_convertedDUCEPtr = new BitmapSourceSafeMILHandle(pCWICWrapperBitmap.DangerousGetHandle(), pIWICSource);
Core\CSharp\System\Windows\Media\Imaging\WriteableBitmap.cs (1)
1442command.SwDoubleBufferedBitmap = (UInt64) _pDoubleBufferedBitmap.DangerousGetHandle().ToPointer();
System (176)
compmod\system\codedom\compiler\CompilerParameters.cs (1)
309return userToken.DangerousGetHandle();
net\System\Net\_AutoWebProxyScriptEngine.cs (2)
428GlobalLog.Print("AutoWebProxyScriptEngine#" + ValidationHelper.HashString(this) + "::ListenForRegistry() RegOpenCurrentUser() using hkcu:" + hkcu.DangerousGetHandle().ToString("x")); 432GlobalLog.Print("AutoWebProxyScriptEngine#" + ValidationHelper.HashString(this) + "::ListenForRegistry() RegOpenKeyEx() returned errorCode:" + errorCode + " key:" + key.DangerousGetHandle().ToString("x"));
net\System\Net\_DigestClient.cs (11)
1172int initiatorType = Marshal.ReadInt32(binding.DangerousGetHandle(), InitiatorTypeOffset); 1173int initiatorLength = Marshal.ReadInt32(binding.DangerousGetHandle(), InitiatorLengthOffset); 1174int acceptorType = Marshal.ReadInt32(binding.DangerousGetHandle(), AcceptorTypeOffset); 1175int acceptorLength = Marshal.ReadInt32(binding.DangerousGetHandle(), AcceptorLengthOffset); 1176int applicationDataLength = Marshal.ReadInt32(binding.DangerousGetHandle(), ApplicationDataLengthOffset); 1186int initiatorOffset = Marshal.ReadInt32(binding.DangerousGetHandle(), InitiatorOffsetOffset); 1187Marshal.Copy(IntPtrHelper.Add(binding.DangerousGetHandle(), initiatorOffset), formattedData, offset, initiatorLength); 1197int acceptorOffset = Marshal.ReadInt32(binding.DangerousGetHandle(), AcceptorOffsetOffset); 1198Marshal.Copy(IntPtrHelper.Add(binding.DangerousGetHandle(), acceptorOffset), formattedData, offset, acceptorLength); 1207int applicationDataOffset = Marshal.ReadInt32(binding.DangerousGetHandle(), ApplicationDataOffsetOffset); 1208Marshal.Copy(IntPtrHelper.Add(binding.DangerousGetHandle(), applicationDataOffset), formattedData, offset, applicationDataLength);
net\System\Net\_ListenerResponseStream.cs (1)
169pBufferAsIntPtr = bufferAsIntPtr.DangerousGetHandle();
net\System\Net\_SafeNetHandles.cs (9)
840return "0x" + DangerousGetHandle().ToString("x"); 862return "0x" + DangerousGetHandle().ToString("x"); 984return "0x" + DangerousGetHandle().ToString("x"); 1530inUnmanagedBuffer[index].token = securityBuffer.unmanagedToken.DangerousGetHandle(); 1855inUnmanagedBuffer[index].token = securityBuffer.unmanagedToken.DangerousGetHandle(); 2114inUnmanagedBuffer[index].token = securityBuffer.unmanagedToken.DangerousGetHandle(); 2228inUnmanagedBuffer[index].token = securityBuffer.unmanagedToken.DangerousGetHandle(); 2437SetHandle(socket.DangerousGetHandle()); 2736InnerSafeCloseSocket result = UnsafeNclNativeMethods.SafeNetHandles.accept(socketHandle.DangerousGetHandle(), socketAddress, ref socketAddressSize);
net\System\Net\_SecureChannel.cs (3)
165_CERT_CONTEXT context = (_CERT_CONTEXT)Marshal.PtrToStructure(certContext.DangerousGetHandle(), typeof(_CERT_CONTEXT)); 199result = new X509Certificate2(remoteContext.DangerousGetHandle()); 468_CERT_CHAIN_ELEMENT* pIL = (_CERT_CHAIN_ELEMENT*)issuerList.aIssuers.DangerousGetHandle();
net\System\Net\_SSPIWrapper.cs (7)
31GlobalLog.Print("SSPIWrapper::arrayBase: " + (arrayBaseHandle.DangerousGetHandle().ToString("x"))); 592attribute = Marshal.PtrToStringUni(SspiHandle.DangerousGetHandle()); 608attribute = Marshal.PtrToStringUni(SspiHandle.DangerousGetHandle()); 883GlobalLog.Print("NegotiationInfoClass::.ctor() the handle is invalid:" + (safeHandle.DangerousGetHandle()).ToString("x")); 886IntPtr packageInfo = safeHandle.DangerousGetHandle(); 948GlobalLog.Print("SecurityPackageInfoClass::.ctor() the pointer is invalid: " + (safeHandle.DangerousGetHandle()).ToString("x")); 951IntPtr unmanagedAddress = IntPtrHelper.Add(safeHandle.DangerousGetHandle(), SecurityPackageInfo.Size * index);
net\System\Net\DNS.cs (1)
1122AddressInfo* pAddressInfo = (AddressInfo*)root.DangerousGetHandle();
net\System\Net\HttpListener.cs (1)
2482Marshal.Copy(blob, tokenOffset, token.DangerousGetHandle(), tokenSize);
net\System\Net\HttpListenerRequest.cs (2)
1146UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST* pResultList = (UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST*)handle.DangerousGetHandle(); 1174UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST_V1* pResultList = (UnsafeNclNativeMethods.HttpApi.TOKENBINDING_RESULT_LIST_V1*)handle.DangerousGetHandle();
net\System\Net\Internal.cs (3)
226IntPtr nextAdapter = buffer.DangerousGetHandle(); 579ipv4Socket.DangerousGetHandle(), 602ipv6Socket.DangerousGetHandle(),
net\System\Net\NetWebProxyFinder.cs (1)
515url = new string((char*)autoProxyUrl.DangerousGetHandle());
net\System\Net\NetworkInformation\NetworkAddressChange.cs (2)
295s_ipv4Socket.DangerousGetHandle(), 323s_ipv6Socket.DangerousGetHandle(),
net\System\Net\NetworkInformation\ping.cs (7)
230Icmp6EchoReply icmp6Reply = (Icmp6EchoReply)Marshal.PtrToStructure (buffer.DangerousGetHandle (), typeof(Icmp6EchoReply)); 231reply = new PingReply (icmp6Reply,buffer.DangerousGetHandle(),ping.sendSize); 234IcmpEchoReply icmpReply = (IcmpEchoReply)Marshal.PtrToStructure (buffer.DangerousGetHandle (), typeof(IcmpEchoReply)); 728Icmp6EchoReply icmp6Reply = (Icmp6EchoReply)Marshal.PtrToStructure(replyBuffer.DangerousGetHandle(), typeof(Icmp6EchoReply)); 729reply = new PingReply(icmp6Reply, replyBuffer.DangerousGetHandle(), sendSize); 732IcmpEchoReply icmpReply = (IcmpEchoReply)Marshal.PtrToStructure(replyBuffer.DangerousGetHandle(), typeof(IcmpEchoReply)); 756byte* dst = (byte*)requestBuffer.DangerousGetHandle();
net\System\Net\NetworkInformation\SystemIPGlobalProperties.cs (5)
39fixedInfo = new FixedInfo( (FIXED_INFO)Marshal.PtrToStructure(buffer.DangerousGetHandle(),typeof(FIXED_INFO))); 171IntPtr newPtr = buffer.DangerousGetHandle(); 218IntPtr newPtr = buffer.DangerousGetHandle(); 276IntPtr newPtr = buffer.DangerousGetHandle(); 322IntPtr newPtr = buffer.DangerousGetHandle();
net\System\Net\NetworkInformation\SystemIPv4InterfaceProperties.cs (1)
90IpPerAdapterInfo ipPerAdapterInfo = (IpPerAdapterInfo)Marshal.PtrToStructure(buffer.DangerousGetHandle(),typeof(IpPerAdapterInfo));
net\System\Net\NetworkInformation\SystemNetworkInterface.cs (1)
102IntPtr ptr = buffer.DangerousGetHandle();
net\System\Net\Sockets\_AcceptOverlappedAsyncResult.cs (2)
80IntPtr handle = m_ListenSocket.SafeHandle.DangerousGetHandle(); 90GlobalLog.Print("AcceptOverlappedAsyncResult#" + ValidationHelper.HashString(this) + "::PostCallback() setsockopt handle:" + handle.ToString() + " AcceptSocket:" + ValidationHelper.HashString(m_AcceptSocket) + " itsHandle:" + m_AcceptSocket.SafeHandle.DangerousGetHandle().ToString() + " returns:" + errorCode.ToString());
net\System\Net\Sockets\_BaseOverlappedAsyncResult.cs (6)
179Marshal.WriteIntPtr( m_UnmanagedBlob.DangerousGetHandle(), Win32.OverlappedhEventOffset, m_OverlappedEvent.SafeWaitHandle.DangerousGetHandle() ); 211GlobalLog.Print("BaseOverlappedAsyncResult#" + ValidationHelper.HashString(this) + "::EnableCompletionPort() overlapped:" + ValidationHelper.HashString(m_Cache.Overlapped) + " NativeOverlapped = " + m_Cache.NativeOverlapped.DangerousGetHandle().ToString("x")); 317Debug.Assert((IntPtr)nativeOverlapped == asyncResult.m_Cache.NativeOverlapped.DangerousGetHandle(), "Handle mismatch"); 419uint errorCode = (uint)Marshal.ReadInt32(IntPtrHelper.Add(asyncResult.m_UnmanagedBlob.DangerousGetHandle(), 421uint numBytes = errorCode!=0 ? unchecked((uint)-1) : (uint)Marshal.ReadInt32(IntPtrHelper.Add(asyncResult.m_UnmanagedBlob.DangerousGetHandle(),
net\System\Net\Sockets\Socket.cs (33)
490return m_Handle.DangerousGetHandle(); 1344m_Handle.DangerousGetHandle(), 1458!UnsafeNclNativeMethods.OSSOCK.TransmitFile_Blocking(m_Handle.DangerousGetHandle(), fileHandle, 0, 0, SafeNativeOverlapped.Zero, asyncResult.TransmitFileBuffers, flags) : 1459!UnsafeNclNativeMethods.OSSOCK.TransmitFile_Blocking2(m_Handle.DangerousGetHandle(), IntPtr.Zero, 0, 0, SafeNativeOverlapped.Zero, asyncResult.TransmitFileBuffers, flags)) 1546bytesTransferred = UnsafeNclNativeMethods.OSSOCK.send(m_Handle.DangerousGetHandle(), null, 0, socketFlags); 1550m_Handle.DangerousGetHandle(), 1633m_Handle.DangerousGetHandle(), 1645m_Handle.DangerousGetHandle(), 1777bytesTransferred = UnsafeNclNativeMethods.OSSOCK.recv(m_Handle.DangerousGetHandle(), null, 0, socketFlags); 1780bytesTransferred = UnsafeNclNativeMethods.OSSOCK.recv(m_Handle.DangerousGetHandle(), pinnedBuffer+offset, size, socketFlags); 1880m_Handle.DangerousGetHandle(), 2005m_Handle.DangerousGetHandle(), 2102bytesTransferred = UnsafeNclNativeMethods.OSSOCK.recvfrom(m_Handle.DangerousGetHandle(), null, 0, socketFlags, socketAddress.m_Buffer, ref socketAddress.m_Size ); 2104bytesTransferred = UnsafeNclNativeMethods.OSSOCK.recvfrom(m_Handle.DangerousGetHandle(), pinnedBuffer+offset, size, socketFlags, socketAddress.m_Buffer, ref socketAddress.m_Size ); 2198m_Handle.DangerousGetHandle(), 2251m_Handle.DangerousGetHandle(), 2548IntPtr handle = m_Handle.DangerousGetHandle(); 2877IntPtr handle = m_Handle.DangerousGetHandle(); 3284if (!DisconnectEx_Blocking(m_Handle.DangerousGetHandle(), IntPtr.Zero, (int) (reuseSocket ? TransmitFileOptions.ReuseSocket : 0), 0)) 6185m_Handle.DangerousGetHandle(), 6316GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") ioctlsocket(FIONBIO):" + (errorCode == SocketError.SocketError ? (SocketError) Marshal.GetLastWin32Error() : errorCode).ToString()); 6329GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") shutdown():" + (errorCode == SocketError.SocketError ? (SocketError) Marshal.GetLastWin32Error() : errorCode).ToString()); 6338GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") setsockopt():" + (errorCode == SocketError.SocketError ? (SocketError) Marshal.GetLastWin32Error() : errorCode).ToString()); 6348errorCode = (SocketError) UnsafeNclNativeMethods.OSSOCK.recv(m_Handle.DangerousGetHandle(), null, 0, SocketFlags.None); 6350GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") recv():" + errorCode.ToString()); 6365GlobalLog.Print("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ") ioctlsocket(FIONREAD):" + (errorCode == SocketError.SocketError ? (SocketError) Marshal.GetLastWin32Error() : errorCode).ToString()); 6386GlobalLog.Assert("SafeCloseSocket::Dispose(handle:" + m_Handle.DangerousGetHandle().ToString("x") + ")", "Closing the handle threw ObjectDisposedException."); 6827fileDescriptorSet[current + 1] = ((Socket)socketList[current]).m_Handle.DangerousGetHandle(); 6855if (fileDescriptorSet[currentFileDescriptor + 1]==socket.m_Handle.DangerousGetHandle()) { 7006m_Handle.DangerousGetHandle(), 9661m_SendPacketsDescriptor[descriptorIndex].fileHandle = m_SendPacketsFileHandles[fileIndex].DangerousGetHandle(); 9828IntPtr handle = m_CurrentSocket.SafeHandle.DangerousGetHandle(); 10050Debug.Assert((IntPtr)nativeOverlapped == m_PtrNativeOverlapped.DangerousGetHandle(), "Handle mismatch");
net\System\Net\UnsafeNativeMethods.cs (2)
1729Marshal.ReadIntPtr(chainList.DangerousGetHandle() 1735X509Chain chain = new X509Chain(chainRef.DangerousGetHandle());
security\system\security\Authentication\ExtendedProtection\ExtendedProtectionPolicy.cs (2)
96Marshal.Copy(channelBindingData, 0, customChannelBinding.DangerousGetHandle(), channelBindingData.Length); 186Marshal.Copy(customChannelBinding.DangerousGetHandle(), channelBindingData, 0, customChannelBinding.Size);
security\system\security\cryptography\cryptoapi.cs (7)
2895Marshal.Copy(pbEncoded.DangerousGetHandle(), encodedData, 0, (int) cbEncoded); 2932Marshal.Copy(pbEncoded.DangerousGetHandle(), encodedData, 0, (int) cbEncoded); 2962(dwDisplayType == CAPI.CERT_NAME_ATTR_TYPE ? pszCommonName.DangerousGetHandle() : new IntPtr(&dwStrType)), 2972(dwDisplayType == CAPI.CERT_NAME_ATTR_TYPE ? pszCommonName.DangerousGetHandle() : new IntPtr(&dwStrType)), 2977string name = Marshal.PtrToStringUni(ptr.DangerousGetHandle()); 3161string s = Marshal.PtrToStringUni(pbFormat.DangerousGetHandle()); 3211string s = Marshal.PtrToStringUni(pbFormat.DangerousGetHandle());
security\system\security\cryptography\x509\x500Name.cs (1)
101return Marshal.PtrToStringUni(pwszDecodeName.DangerousGetHandle());
security\system\security\cryptography\x509\x509certificate2.cs (18)
173Marshal.Copy(decodedKeyValue.DangerousGetHandle(), decodedData, 0, decodedData.Length); 206CAPI.CRYPTOAPI_BLOB pDssPubKey = (CAPI.CRYPTOAPI_BLOB) Marshal.PtrToStructure(decodedKeyValue.DangerousGetHandle(), typeof(CAPI.CRYPTOAPI_BLOB)); 207CAPI.CERT_DSS_PARAMETERS pDssParameters = (CAPI.CERT_DSS_PARAMETERS) Marshal.PtrToStructure(decodedParameters.DangerousGetHandle(), typeof(CAPI.CERT_DSS_PARAMETERS)); 666string friendlyName = Marshal.PtrToStringUni(ptr.DangerousGetHandle()); 694CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) m_safeCertContext.DangerousGetHandle()); 714CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) m_safeCertContext.DangerousGetHandle()); 735CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) m_safeCertContext.DangerousGetHandle()); 903CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) m_safeCertContext.DangerousGetHandle()); 966CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) m_safeCertContext.DangerousGetHandle()); 986bool result = CAPI.DecodeObject(ptr.DangerousGetHandle(), 992CAPI.CERT_ALT_NAME_INFO altNameInfo = (CAPI.CERT_ALT_NAME_INFO) Marshal.PtrToStructure(decoded.DangerousGetHandle(), typeof(CAPI.CERT_ALT_NAME_INFO)); 1010CAPI.CERT_NAME_VALUE nameValue = (CAPI.CERT_NAME_VALUE) Marshal.PtrToStructure(pUpnName.DangerousGetHandle(), typeof(CAPI.CERT_NAME_VALUE)); 1219CAPI.CRYPT_KEY_PROV_INFO pKeyProvInfo = (CAPI.CRYPT_KEY_PROV_INFO) Marshal.PtrToStructure(ptr.DangerousGetHandle(), typeof(CAPI.CRYPT_KEY_PROV_INFO)); 1304CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 1313CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 1376DataBlob.pbData = ptr.DangerousGetHandle(); 1402Marshal.StructureToPtr(keyProvInfo, ptr.DangerousGetHandle(), false); 1413Marshal.DestroyStructure(ptr.DangerousGetHandle(), typeof(CAPI.CRYPT_KEY_PROV_INFO));
security\system\security\cryptography\x509\x509certificate2collection.cs (21)
308CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 331Marshal.Copy(pbEncoded.DangerousGetHandle(), pbBlob, 0, pbBlob.Length); 343DataBlob.pbData = pbEncoded.DangerousGetHandle(); 370DataBlob.pbData = pbEncoded.DangerousGetHandle(); 424HashBlob.pbData = pb.DangerousGetHandle(); 436pvFindPara = pb.DangerousGetHandle(); 453pvFindPara = pb.DangerousGetHandle(); 741CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 770CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 787CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 804CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 825CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 851CAPI.CERT_NAME_VALUE pNameValue = (CAPI.CERT_NAME_VALUE) Marshal.PtrToStructure(decoded.DangerousGetHandle(), typeof(CAPI.CERT_NAME_VALUE)); 871CAPI.CERT_TEMPLATE_EXT pTemplate = (CAPI.CERT_TEMPLATE_EXT) Marshal.PtrToStructure(decoded.DangerousGetHandle(), typeof(CAPI.CERT_TEMPLATE_EXT)); 896IntPtr pCertContext = safeCertContextHandle.DangerousGetHandle(); 912IntPtr pszOid = Marshal.ReadIntPtr(new IntPtr((long) rghOIDs.DangerousGetHandle() + index * Marshal.SizeOf(typeof(IntPtr)))); 933CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 954CAPI.CERT_POLICIES_INFO pInfo = (CAPI.CERT_POLICIES_INFO) Marshal.PtrToStructure(decoded.DangerousGetHandle(), typeof(CAPI.CERT_POLICIES_INFO)); 975CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 998CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 1045Marshal.Copy(ptr.DangerousGetHandle(), hex, 0, hex.Length);
security\system\security\cryptography\x509\x509chain.cs (5)
126return m_safeCertChainHandle.DangerousGetHandle(); 278uint cbSize = (uint) Marshal.ReadInt32(safeCertChainHandle.DangerousGetHandle()); 282X509Utils.memcpy(m_safeCertChainHandle.DangerousGetHandle(), new IntPtr(&pChain), cbSize); 372ChainPara.RequestedUsage.Usage.rgpszUsageIdentifier = applicationPolicyHandle.DangerousGetHandle(); 380ChainPara.RequestedIssuancePolicy.Usage.rgpszUsageIdentifier = certificatePolicyHandle.DangerousGetHandle();
security\system\security\cryptography\x509\x509extension.cs (10)
135CAPI.CRYPTOAPI_BLOB pKeyUsage = (CAPI.CRYPTOAPI_BLOB) Marshal.PtrToStructure(decoded.DangerousGetHandle(), typeof(CAPI.CRYPTOAPI_BLOB)); 224CAPI.CERT_BASIC_CONSTRAINTS_INFO pBasicConstraints = (CAPI.CERT_BASIC_CONSTRAINTS_INFO) Marshal.PtrToStructure(decoded.DangerousGetHandle(), 242CAPI.CERT_BASIC_CONSTRAINTS2_INFO pBasicConstraints2 = (CAPI.CERT_BASIC_CONSTRAINTS2_INFO) Marshal.PtrToStructure(decoded.DangerousGetHandle(), 324CAPI.CERT_ENHKEY_USAGE pEnhKeyUsage = (CAPI.CERT_ENHKEY_USAGE) Marshal.PtrToStructure(decoded.DangerousGetHandle(), typeof(CAPI.CERT_ENHKEY_USAGE)); 350pEnhKeyUsage.rgpszUsageIdentifier = safeLocalAllocHandle.DangerousGetHandle(); 428bool result = CAPI.DecodeObject(pb.DangerousGetHandle(), 435CAPI.CRYPTOAPI_BLOB pSubjectKeyIdentifier = (CAPI.CRYPTOAPI_BLOB) Marshal.PtrToStructure(decoded.DangerousGetHandle(), typeof(CAPI.CRYPTOAPI_BLOB)); 490pPublicKeyInfo = (CAPI.CERT_PUBLIC_KEY_INFO2 *) publicKeyInfo.DangerousGetHandle(); 519CAPI.CERT_PUBLIC_KEY_INFO2 * pPublicKeyInfo = (CAPI.CERT_PUBLIC_KEY_INFO2 *) publicKeyInfo.DangerousGetHandle(); 605CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) certContext.DangerousGetHandle());
security\system\security\cryptography\x509\x509store.cs (2)
128return m_safeCertStoreHandle.DangerousGetHandle(); 281safeCertContext.DangerousGetHandle(),
security\system\security\cryptography\x509\x509utils.cs (5)
272Marshal.Copy(managed, 0, pb.DangerousGetHandle(), managed.Length); 319Marshal.Copy(arr, 0, pb.DangerousGetHandle(), arr.Length); 330Marshal.Copy(arr, 0, pb.DangerousGetHandle(), arr.Length); 508pOid = new IntPtr((long)safeLocalAllocHandle.DangerousGetHandle() + ptrSize); 511Marshal.WriteIntPtr(new IntPtr((long) safeLocalAllocHandle.DangerousGetHandle() + index * Marshal.SizeOf(typeof(IntPtr))), pOid);
services\monitoring\system\diagnosticts\Process.cs (1)
355return OpenProcessHandle(this.m_processAccess).DangerousGetHandle();
services\monitoring\system\diagnosticts\SharedPerformanceCounter.cs (2)
1541return fileViewAddress.DangerousGetHandle(); 1633SafeNativeMethods.InterlockedCompareExchange(fileViewAddress.DangerousGetHandle(), initialOffset, 0);
sys\system\io\ports\SerialStream.cs (1)
1732Overlapped overlapped = new Overlapped(0, 0, waitCommEventWaitHandle.SafeWaitHandle.DangerousGetHandle(), asyncResult);
System.Core (13)
Microsoft\Win32\SafeHandles\CapiSafeHandles.cs (2)
147IntPtr rawParentHandle = parentCsp.DangerousGetHandle(); 381IntPtr originalHandle = DangerousGetHandle();
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (3)
271duplicate.SetHandle(Holder.DangerousGetHandle()); 310holder.SetHandle(DangerousGetHandle()); 325duplicate.SetHandle(holder.DangerousGetHandle());
System\IO\Pipes\Pipe.cs (1)
151return m_clientHandle.DangerousGetHandle().ToString();
System\Security\Cryptography\CapiNative.cs (1)
1028Marshal.Copy(arr, 0, pb.DangerousGetHandle(), arr.Length);
System\Security\Cryptography\X509Certificates\ECDsaCertificateExtensions.cs (2)
41IntPtr certHandle = certContext.DangerousGetHandle(); 116IntPtr certHandle = safeCertContext.DangerousGetHandle();
System\Security\Cryptography\X509Certificates\RSACertificateExtensions.cs (1)
48Marshal.Copy(cngBlobHandle.DangerousGetHandle(), cngBlob, 0, cngBlob.Length);
System\Security\Cryptography\X509Certificates\X509Native.cs (1)
102var newKeyHandle = new SafeNCryptKeyHandle(privateKey.DangerousGetHandle(), certificateContext);
System\Security\Cryptography\Xml\ManifestSignedXml.cs (2)
173return HexStringToBytes(Marshal.PtrToStringUni(tokenBuffer.DangerousGetHandle())); 438actualKeyHash = Marshal.PtrToStringUni(issuerKeyBuffer.DangerousGetHandle());
System.Data (53)
fx\src\data\System\Data\Odbc\OdbcDataReader.cs (2)
2112buffer.DangerousGetHandle()); // SQLLEN * StrLen_or_Ind 2158buffer.DangerousGetHandle());
fx\src\data\System\Data\Odbc\OdbcUtils.cs (1)
323IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset);
fx\src\data\System\Data\OleDb\DBPropSet.cs (2)
170IntPtr propertySetPtr = ADP.IntPtrOffset(DangerousGetHandle(), index * ODB.SizeOf_tagDBPROPSET); 211IntPtr propsetPtr = ADP.IntPtrOffset(DangerousGetHandle(), index * ODB.SizeOf_tagDBPROPSET);
fx\src\data\System\Data\OleDb\OleDbCommand.cs (2)
908tableID.ulPropid = sptr.DangerousGetHandle(); 920hr = iopenRowset.Value.OpenRowset(ADP.PtrZero, tableID, ADP.PtrZero, ref ODB.IID_IRowset, propSet.PropertySetCount, propSet.DangerousGetHandle(), out executeResult);
fx\src\data\System\Data\OleDb\OleDbDataReader.cs (3)
1544IntPtr rowHandlesPtr = rowHandleBuffer.DangerousGetHandle(); 1550Debug.Assert(rowHandleBuffer.DangerousGetHandle() == rowHandlesPtr, "rowhandlebuffer changed"); 1700IntPtr ulPropid = ((null != sptr[i]) ? sptr[i].DangerousGetHandle() : info.propid);
fx\src\data\System\Data\OleDb\OleDbParameter.cs (1)
374bindings.DataSourceType = dbtype.dbString.DangerousGetHandle(); // NOTE: This is a constant and isn't exposed publicly, so there really isn't a potential for Handle Recycling.
fx\src\data\System\Data\OleDb\OleDbTransaction.cs (2)
65hr = (OleDbHResult)NativeOledbWrapper.ITransactionAbort(DangerousGetHandle()); 89hr = (OleDbHResult)NativeOledbWrapper.ITransactionCommit(DangerousGetHandle());
fx\src\data\System\Data\OleDb\RowBinding.cs (7)
86return ADP.IntPtrOffset(DangerousGetHandle(), _headerLength); 95return ADP.IntPtrOffset(DangerousGetHandle(), valueOffset); 134IntPtr buffer = DangerousGetHandle(); 175IntPtr buffer = ADP.IntPtrOffset(DangerousGetHandle(), offset); 201buffer = ADP.IntPtrOffset(DangerousGetHandle(), offset); 317ResetValues(DangerousGetHandle(), _iaccessor); 549IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset);
fx\src\data\System\Data\ProviderBase\DbBuffer.cs (22)
76IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 101IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 123IntPtr ptr = DangerousGetHandle(); 151IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 179IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 206IntPtr ptr = DangerousGetHandle(); 229IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 250IntPtr ptr = DangerousGetHandle(); 273IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 294IntPtr ptr = DangerousGetHandle(); 316IntPtr ptr = DangerousGetHandle(); 353IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 373IntPtr ptr = DangerousGetHandle(); 395IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 417IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 441IntPtr ptr = DangerousGetHandle(); 463IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 483IntPtr ptr = DangerousGetHandle(); 505IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 525IntPtr ptr = DangerousGetHandle(); 545IntPtr ptr = DangerousGetHandle(); 565IntPtr ptr = DangerousGetHandle();
fx\src\data\System\Data\ProviderBase\DbConnectionPool.cs (7)
351WriteIntPtr(SEMAPHORE_HANDLE*IntPtr.Size, _poolHandle.DangerousGetHandle()); 352WriteIntPtr(ERROR_HANDLE*IntPtr.Size, _errorHandle.DangerousGetHandle()); 353WriteIntPtr(CREATION_HANDLE*IntPtr.Size, _creationHandle.DangerousGetHandle()); 1258waitResult = SafeNativeMethods.WaitForMultipleObjectsEx(waitHandleCount, _waitHandles.DangerousGetHandle(), false, waitForMultipleObjectsTimeout, false); 1382int result = SafeNativeMethods.ReleaseSemaphore(_waitHandles.CreationHandle.DangerousGetHandle(), 1, IntPtr.Zero); 1554waitResult = SafeNativeMethods.WaitForSingleObjectEx(_waitHandles.CreationHandle.DangerousGetHandle(), timeout, false); 1600waitResult = SafeNativeMethods.ReleaseSemaphore(_waitHandles.CreationHandle.DangerousGetHandle(), 1, IntPtr.Zero);
fx\src\data\System\Data\ProviderBase\WrappedIUnknown.cs (1)
55IntPtr handle = DangerousGetHandle();
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (1)
3148IntPtr pointer = packet.DangerousGetHandle();
fx\src\data\System\Data\SQLTypes\SQLFileStream.cs (2)
905IntPtr ptr = DangerousGetHandle(); 1072IntPtr ptr = DangerousGetHandle();
System.IdentityModel (31)
System\IdentityModel\Claims\WindowsClaimSet.cs (3)
283int count = Marshal.ReadInt32(safeAllocHandle.DangerousGetHandle()); 284IntPtr pSidAndAttributes = new IntPtr((long)safeAllocHandle.DangerousGetHandle() + (long)Marshal.OffsetOf(typeof(TOKEN_GROUPS), "Groups")); 358SID_AND_ATTRIBUTES user = (SID_AND_ATTRIBUTES)Marshal.PtrToStructure(safeAllocHandle.DangerousGetHandle(), typeof(SID_AND_ATTRIBUTES));
System\IdentityModel\Selectors\WindowsUserNameSecurityTokenAuthenticator.cs (1)
58WindowsIdentity windowsIdentity = new WindowsIdentity(tokenHandle.DangerousGetHandle(), SecurityUtils.AuthTypeBasic);
System\IdentityModel\Selectors\X509CertificateChain.cs (5)
166ChainPara.RequestedUsage.Usage.rgpszUsageIdentifier = applicationPolicyHandle.DangerousGetHandle(); 175ChainPara.RequestedIssuancePolicy.Usage.rgpszUsageIdentifier = certificatePolicyHandle.DangerousGetHandle(); 273X509Certificate2 intermediatesCert = new X509Certificate2( safeCertContext.DangerousGetHandle() ); 341pOid = new IntPtr((long)safeAllocHandle.DangerousGetHandle() + ptrSize); 345Marshal.WriteIntPtr(new IntPtr((long) safeAllocHandle.DangerousGetHandle() + index * Marshal.SizeOf(typeof(IntPtr))), pOid);
System\IdentityModel\Selectors\X509CertificateStore.cs (4)
145blob.pbData = pvTemp.DangerousGetHandle(); 149Marshal.StructureToPtr(blob, pvFindPara.DangerousGetHandle(), false); 215X509Store store = new X509Store(this.certStoreHandle.DangerousGetHandle()); 237if (TryGetMatchingX509Certificate(pCertContext.DangerousGetHandle(), findType,
System\IdentityModel\Selectors\X509SecurityTokenAuthenticator.cs (8)
146Marshal.Copy(NativeMethods.LsaSourceName, 0, pSourceName.DangerousGetHandle(), NativeMethods.LsaSourceName.Length); 147UNICODE_INTPTR_STRING sourceName = new UNICODE_INTPTR_STRING(NativeMethods.LsaSourceName.Length, NativeMethods.LsaSourceName.Length + 1, pSourceName.DangerousGetHandle()); 202Marshal.Copy(NativeMethods.LsaKerberosName, 0, pPackageName.DangerousGetHandle(), NativeMethods.LsaKerberosName.Length); 203UNICODE_INTPTR_STRING packageName = new UNICODE_INTPTR_STRING(NativeMethods.LsaKerberosName.Length, NativeMethods.LsaKerberosName.Length + 1, pPackageName.DangerousGetHandle()); 230KERB_CERTIFICATE_S4U_LOGON* pInfo = (KERB_CERTIFICATE_S4U_LOGON*)pLogonInfo.DangerousGetHandle().ToPointer(); 236pInfo->Certificate = new IntPtr(pLogonInfo.DangerousGetHandle().ToInt64() + KERB_CERTIFICATE_S4U_LOGON.Size); 251pLogonInfo.DangerousGetHandle(), 277return new WindowsIdentity(tokenHandle.DangerousGetHandle(), SecurityUtils.AuthTypeCertMap);
System\IdentityModel\SspiSafeHandles.cs (3)
237inUnmanagedBuffer[index].token = securityBuffer.unmanagedToken.DangerousGetHandle(); 517inUnmanagedBuffer[index].token = securityBuffer.unmanagedToken.DangerousGetHandle(); 1422Marshal.Copy(bytes, 0, result.DangerousGetHandle(), bytes.Length);
System\IdentityModel\SspiWrapper.cs (5)
174IntPtr unmanagedAddress = IntPtrHelper.Add(safeHandle.DangerousGetHandle(), SecurityPackageInfo.Size * index); 212IntPtr packageInfo = safeHandle.DangerousGetHandle(); 252Marshal.Copy(safeHandle.DangerousGetHandle(), sessionKey, 0, sessionKeyLength); 603attribute = Marshal.PtrToStringUni(sspiHandle.DangerousGetHandle()); 676specifiedTarget = Marshal.PtrToStringUni(sspiHandle.DangerousGetHandle()) as string;
System\IdentityModel\Tokens\KerberosReceiverSecurityToken.cs (1)
268WindowsIdentity windowsIdentity = new WindowsIdentity( tokenHandle.DangerousGetHandle(), SecurityUtils.AuthTypeKerberos);
System\IdentityModel\Tokens\WindowsUserNameSecurityTokenHandler.cs (1)
101WindowsIdentity windowsIdentity = new WindowsIdentity(tokenHandle.DangerousGetHandle(), AuthenticationTypes.Password, WindowsAccountType.Normal, true);
System.IdentityModel.Selectors (22)
infocard\client\System\IdentityModel\Selectors\CardSpaceSelector.cs (1)
201nativeToken.DangerousGetHandle(),
infocard\client\System\IdentityModel\Selectors\CryptoHandle.cs (1)
140(RpcInfoCardCryptoHandle)Marshal.PtrToStructure(nativeHandle.DangerousGetHandle(),
infocard\client\System\IdentityModel\Selectors\InfoCardKeyedHashAlgorithm.cs (3)
135Marshal.Copy(m_cachedBlock, 0, pInData.DangerousGetHandle(), m_cachedBlock.Length); 192Marshal.Copy(m_cachedBlock, 0, pInData.DangerousGetHandle(), m_cachedBlock.Length); 209Marshal.Copy(pOutData.DangerousGetHandle(), outData, 0, pOutData.Length);
infocard\client\System\IdentityModel\Selectors\InfoCardRSACryptoProvider.cs (8)
88Marshal.Copy(inData, 0, pInData.DangerousGetHandle(), inData.Length); 105Marshal.Copy(pOutData.DangerousGetHandle(), outData, 0, pOutData.Length); 120Marshal.Copy(inData, 0, pInData.DangerousGetHandle(), inData.Length); 136Marshal.Copy(pOutData.DangerousGetHandle(), outData, 0, pOutData.Length); 154Marshal.Copy(hash, 0, pHash.DangerousGetHandle(), hash.Length); 173Marshal.Copy(pSig.DangerousGetHandle(), sig, 0, pSig.Length); 194Marshal.Copy(hash, 0, pHash.DangerousGetHandle(), hash.Length); 198Marshal.Copy(sig, 0, pSig.DangerousGetHandle(), sig.Length);
infocard\client\System\IdentityModel\Selectors\InfoCardSymmetricAlgorithm.cs (5)
167Marshal.Copy(iv, 0, pIV.DangerousGetHandle(), iv.Length); 238Marshal.Copy(inputBuffer, inputOffset, pInData.DangerousGetHandle(), inputCount); 253Marshal.Copy(pOutData.DangerousGetHandle(), outputBuffer, outputOffset, pOutData.Length); 285Marshal.Copy(inputBuffer, inputOffset, pInData.DangerousGetHandle(), inputCount); 302Marshal.Copy(pOutData.DangerousGetHandle(), outData, 0, pOutData.Length);
infocard\client\System\IdentityModel\Selectors\InfoCardSymmetricCrypto.cs (3)
125Marshal.Copy(label, 0, pLabel.DangerousGetHandle(), label.Length); 126Marshal.Copy(nonce, 0, pNonce.DangerousGetHandle(), nonce.Length); 147Marshal.Copy(pDerivedKey.DangerousGetHandle(), derivedKey, 0, pDerivedKey.Length);
infocard\client\System\IdentityModel\Selectors\PolicyChain.cs (1)
56IntPtr pos = m_nativeChain.DangerousGetHandle();
System.IO.Log (1)
System\IO\Log\SimpleFileLog.cs (1)
230Marshal.Copy(pData.DangerousGetHandle(),
System.Messaging (5)
System\Messaging\Message.cs (1)
1494int handle = value.Handle.DangerousGetHandle().ToInt32(); // this is safe because MSMQ always returns 32-bit handle
System\Messaging\MessageEnumerator.cs (1)
74get { return this.Handle.DangerousGetHandle(); }
System\Messaging\MessageQueue.cs (2)
1221return MQInfo.ReadHandle.DangerousGetHandle(); 1341return MQInfo.WriteHandle.DangerousGetHandle();
System\Messaging\MessageQueueEnumerator.cs (1)
127get { return this.Handle.DangerousGetHandle(); }
System.Net (53)
net\PeerToPeer\Cloud.cs (1)
224IntPtr pPEER_PNRP_CLOUD_INFO = ArrayOfCloudInfoStructures.DangerousGetHandle();
net\PeerToPeer\Collaboration\CollaborationHelperFunctions.cs (3)
161X509Store certStore = new X509Store(certHandle.DangerousGetHandle()); 211X509Store certStore = new X509Store(certHandle.DangerousGetHandle()); 222pd.pbData = safeCredentials.DangerousGetHandle();
net\PeerToPeer\Collaboration\ContactManager.cs (10)
145pc = (PEER_CONTACT)Marshal.PtrToStructure(contact.DangerousGetHandle(), typeof(PEER_CONTACT)); 337PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 537PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 744PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 963PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 1175PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 1289IntPtr pPEER_CONTACT = contactArray.DangerousGetHandle(); 1354if (!safeContact.DangerousGetHandle().Equals(IntPtr.Zero)){ 1356PEER_CONTACT pc = (PEER_CONTACT)Marshal.PtrToStructure(safeContact.DangerousGetHandle(), typeof(PEER_CONTACT)); 1441PEER_CONTACT pc = (PEER_CONTACT)Marshal.PtrToStructure(contact.DangerousGetHandle(), typeof(PEER_CONTACT));
net\PeerToPeer\Collaboration\MyContact.cs (3)
181PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 347PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 515PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(),
net\PeerToPeer\Collaboration\Peer.cs (6)
401IntPtr ptrPeerPresenceInfo = presenceInfo.DangerousGetHandle(); 588IntPtr pPEER_OBJECT = objectArray.DangerousGetHandle(); 684pi.applicationData.pbData = data.DangerousGetHandle(); 749PEER_INVITATION_RESPONSE pir = (PEER_INVITATION_RESPONSE)Marshal.PtrToStructure(safeResponse.DangerousGetHandle(), 1107pi.applicationData.pbData = data.DangerousGetHandle(); 1259pir = (PEER_INVITATION_RESPONSE)Marshal.PtrToStructure(response.DangerousGetHandle(),
net\PeerToPeer\Collaboration\PeerApplication.cs (1)
379PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(),
net\PeerToPeer\Collaboration\PeerCollaboration.cs (12)
49IntPtr ptrPeerPresenceInfo = safePresenceInfo.DangerousGetHandle(); 256PEER_APP_LAUNCH_INFO pali = (PEER_APP_LAUNCH_INFO)Marshal.PtrToStructure(appLaunchInfoData.DangerousGetHandle(), 428IntPtr pPEER_PEOPLE_NEAR_ME = appArray.DangerousGetHandle(); 523appRegInfo.application.data.pbData = data.DangerousGetHandle(); 714IntPtr pPEER_APLICATION = appArray.DangerousGetHandle(); 762Marshal.PtrToStructure(safeAppRegInfo.DangerousGetHandle(), 821po.data.pbData = data.DangerousGetHandle(); 944IntPtr pPEER_OBJECT = objectArray.DangerousGetHandle(); 1133PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 1292PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 1463PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 1625PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(),
net\PeerToPeer\Collaboration\PeerContact.cs (6)
282IntPtr pPEER_ENDPOINT = epArray.DangerousGetHandle(); 404PEER_CONTACT pc = (PEER_CONTACT)Marshal.PtrToStructure(contact.DangerousGetHandle(), typeof(PEER_CONTACT)); 1075IntPtr pPEER_APLICATION = appArray.DangerousGetHandle(); 1354PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 1605PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 1856PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(),
net\PeerToPeer\Collaboration\PeerEndPoint.cs (1)
315PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(),
net\PeerToPeer\Collaboration\PeerNearMe.cs (2)
299PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), 650PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(),
net\PeerToPeer\Collaboration\PeerObject.cs (1)
324PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(),
net\PeerToPeer\PeerNameRegistration.cs (2)
439Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Registration is successful. The handle is {0}", m_RegistrationHandle.DangerousGetHandle()); 609Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Update of existing registration is successful. The handle is {0}", m_RegistrationHandle.DangerousGetHandle());
net\PeerToPeer\PeerNameResolver.cs (4)
243"Successfully started the async resolve. The native handle is {0}", m_SafePeerNameEndResolve.DangerousGetHandle()); 288result = UnsafeP2PNativeMethods.PeerPnrpGetEndpoint(m_SafePeerNameEndResolve.DangerousGetHandle(), out shEndPointInfo); 307PEER_PNRP_ENDPOINT_INFO* pEndPointInfo = (PEER_PNRP_ENDPOINT_INFO*)shEndPointInfo.DangerousGetHandle(); 669IntPtr pEndPointInfoArray = shEndPointInfoArray.DangerousGetHandle();
net\PeerToPeer\UnsafePeerToPeerMethods.cs (1)
345return s_P2PLibrary.DangerousGetHandle();
System.Security (118)
system\security\cryptography\cryptoapi.cs (2)
2421Marshal.Copy(pbEncoded.DangerousGetHandle(), encodedData, 0, (int) cbEncoded); 2455Marshal.Copy(pbEncoded.DangerousGetHandle(), encodedData, 0, (int) cbEncoded);
system\security\cryptography\cryptographicattribute.cs (1)
91internal CryptographicAttributeObjectCollection (SafeLocalAllocHandle pCryptAttributes) : this(pCryptAttributes.DangerousGetHandle()) {}
system\security\cryptography\pkcs\envelopedpkcs7.cs (42)
285ctrlDecryptPara.hCryptProv = cmsgDecryptParam.safeCryptProvHandle.DangerousGetHandle(); 301CAPI.CMSG_CMS_RECIPIENT_INFO cmsRecipientInfo = (CAPI.CMSG_CMS_RECIPIENT_INFO) Marshal.PtrToStructure(keyAgree.pCmsgRecipientInfo.DangerousGetHandle(), typeof(CAPI.CMSG_CMS_RECIPIENT_INFO)); 304keyAgreeDecryptPara.hCryptProv = cmsgDecryptParam.safeCryptProvHandle.DangerousGetHandle(); 325CAPI.CERT_CONTEXT pCertContext = (CAPI.CERT_CONTEXT) Marshal.PtrToStructure(pOriginatorCert.DangerousGetHandle(), typeof(CAPI.CERT_CONTEXT)); 362Marshal.Copy(pbContent.DangerousGetHandle(), content, 0, (int) cbContent); 417encodeInfo.pvEncryptionAuxInfo = encryptParam.pvEncryptionAuxInfo.DangerousGetHandle(); 425encodeInfo.rgCmsRecipients = encryptParam.rgpRecipients.DangerousGetHandle(); 428encodeInfo.rgCertEncoded = encryptParam.rgCertEncoded.DangerousGetHandle(); 432encodeInfo.rgUnprotectedAttr = encryptParam.rgUnprotectedAttr.DangerousGetHandle(); 437encodeInfo.rgpRecipients = encryptParam.rgpRecipients.DangerousGetHandle(); 440Marshal.StructureToPtr(encodeInfo, ceei.DangerousGetHandle(), false); 446ceei.DangerousGetHandle(), 459Marshal.DestroyStructure(ceei.DangerousGetHandle(), typeof(CAPI.CMSG_ENVELOPED_ENCODE_INFO)); 534recipientInfo.pCmsgRecipientInfo.DangerousGetHandle(), 611Marshal.StructureToPtr(auxInfo, pvAuxInfo.DangerousGetHandle(), false); 669CAPI.CERT_CONTEXT pCertContext = (CAPI.CERT_CONTEXT) Marshal.PtrToStructure(X509Utils.GetCertContext(certificates[index]).DangerousGetHandle(), typeof(CAPI.CERT_CONTEXT)); 670CAPI.CRYPTOAPI_BLOB * pBlob = (CAPI.CRYPTOAPI_BLOB *) new IntPtr((long) encryptParam.rgCertEncoded.DangerousGetHandle() + 684IntPtr pKeyInfo = new IntPtr((long) encryptParam.rgpRecipients.DangerousGetHandle() + reiSize); 688CAPI.CERT_CONTEXT pCertContext = (CAPI.CERT_CONTEXT) Marshal.PtrToStructure(X509Utils.GetCertContext(certificate).DangerousGetHandle(), typeof(CAPI.CERT_CONTEXT)); 691CAPI.CMSG_RECIPIENT_ENCODE_INFO * pEncodeInfo = (CAPI.CMSG_RECIPIENT_ENCODE_INFO *) new IntPtr((long) encryptParam.rgpRecipients.DangerousGetHandle() + 711Marshal.Copy(objId, 0, encryptParam.rgszObjId[index].DangerousGetHandle(), objId.Length); 715Marshal.WriteIntPtr(pszObjId, encryptParam.rgszObjId[index].DangerousGetHandle()); 780Marshal.WriteIntPtr(ppbData, pbData.DangerousGetHandle()); 826Marshal.Copy(objId, 0, encryptParam.rgszObjId[index].DangerousGetHandle(), objId.Length); 830Marshal.WriteIntPtr(pszObjId, encryptParam.rgszObjId[index].DangerousGetHandle()); 846Marshal.Copy(objId, 0, encryptParam.rgszKeyWrapObjId[cKeyAgree].DangerousGetHandle(), objId.Length); 850Marshal.WriteIntPtr(pszObjId, encryptParam.rgszKeyWrapObjId[cKeyAgree].DangerousGetHandle()); 857Marshal.WriteIntPtr(pKeyWrapAuxInfo, encryptParam.pvEncryptionAuxInfo.DangerousGetHandle()); 870Marshal.WriteIntPtr(pEphemeralAlgorithm, encryptParam.rgEphemeralIdentifier[cKeyAgree].DangerousGetHandle()); 875Marshal.Copy(objId, 0, encryptParam.rgszEphemeralObjId[cKeyAgree].DangerousGetHandle(), objId.Length); 877pszObjId = new IntPtr((long) encryptParam.rgEphemeralIdentifier[cKeyAgree].DangerousGetHandle() + (long) Marshal.OffsetOf(typeof(CAPI.CRYPT_ALGORITHM_IDENTIFIER), "pszObjId")); 878Marshal.WriteIntPtr(pszObjId, encryptParam.rgszEphemeralObjId[cKeyAgree].DangerousGetHandle()); 881IntPtr pParameters = new IntPtr((long) encryptParam.rgEphemeralIdentifier[cKeyAgree].DangerousGetHandle() + (long) Marshal.OffsetOf(typeof(CAPI.CRYPT_ALGORITHM_IDENTIFIER), "Parameters")); 900Marshal.WriteIntPtr(prgpRecipientEncryptedKeys, encryptParam.prgpEncryptedKey[cKeyAgree].DangerousGetHandle()); 902Marshal.WriteIntPtr(encryptParam.prgpEncryptedKey[cKeyAgree].DangerousGetHandle(), encryptParam.rgpEncryptedKey[cKeyAgree].DangerousGetHandle()); 905pcbSize = new IntPtr((long) encryptParam.rgpEncryptedKey[cKeyAgree].DangerousGetHandle() + (long) Marshal.OffsetOf(typeof(CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO), "cbSize")); 909IntPtr pRecipientPublicKey = new IntPtr((long) encryptParam.rgpEncryptedKey[cKeyAgree].DangerousGetHandle() + (long) Marshal.OffsetOf(typeof(CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO), "RecipientPublicKey")); 924IntPtr pRecipientId = new IntPtr((long) encryptParam.rgpEncryptedKey[cKeyAgree].DangerousGetHandle() + (long) Marshal.OffsetOf(typeof(CAPI.CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO), "RecipientId")); 958Marshal.WriteIntPtr(ppbData, pbKeyId.DangerousGetHandle()); 1025IntPtr pCertInfo = encryptParam.rgpRecipients.DangerousGetHandle(); 1030IntPtr dangerousCertContextHandle = certContext.DangerousGetHandle();
system\security\cryptography\pkcs\pkcs9attribute.cs (3)
117long signingTime = Marshal.ReadInt64(pbDecoded.DangerousGetHandle()); 128Marshal.WriteInt64(pbSigningTime.DangerousGetHandle(), ft); 131if (!CAPI.EncodeObject(CAPI.szOID_RSA_signingTime, pbSigningTime.DangerousGetHandle(), out encodedSigningTime))
system\security\cryptography\pkcs\pkcsmisc.cs (7)
89CAPI.CERT_NAME_INFO certNameInfo = (CAPI.CERT_NAME_INFO) Marshal.PtrToStructure(pbCertNameInfo.DangerousGetHandle(), typeof(CAPI.CERT_NAME_INFO)); 322Marshal.StructureToPtr(keyInfo, pKeyInfo.DangerousGetHandle(), false); 323int keyLength = (int) CAPI.CAPISafe.CertGetPublicKeyLength(CAPI.X509_ASN_ENCODING | CAPI.PKCS_7_ASN_ENCODING, pKeyInfo.DangerousGetHandle()); 328Marshal.DestroyStructure(pKeyInfo.DangerousGetHandle(), typeof(CAPI.CERT_PUBLIC_KEY_INFO)); 351CAPI.CRYPT_RC2_CBC_PARAMETERS rc2Parameters = (CAPI.CRYPT_RC2_CBC_PARAMETERS) Marshal.PtrToStructure(pbParameters.DangerousGetHandle(), typeof(CAPI.CRYPT_RC2_CBC_PARAMETERS)); 382CAPI.CRYPTOAPI_BLOB blob = (CAPI.CRYPTOAPI_BLOB)Marshal.PtrToStructure(pbParameters.DangerousGetHandle(), typeof(CAPI.CRYPTOAPI_BLOB)); 400Marshal.Copy(pbParameters.DangerousGetHandle(), parameters, 0, parameters.Length);
system\security\cryptography\pkcs\pkcsutils.cs (30)
58CAPI.CERT_CONTEXT pCertContext = (CAPI.CERT_CONTEXT) Marshal.PtrToStructure(X509Utils.GetCertContext(certificate).DangerousGetHandle(), typeof(CAPI.CERT_CONTEXT)); 80while (CAPI.CAPISafe.CryptGetProvParam(safeCryptProvHandle, CAPI.PP_ENUMALGS_EX, pPeex.DangerousGetHandle(), new IntPtr(&cbPeex), enumFlag)) { 81CAPI.PROV_ENUMALGS_EX peex = (CAPI.PROV_ENUMALGS_EX) Marshal.PtrToStructure(pPeex.DangerousGetHandle(), typeof(CAPI.PROV_ENUMALGS_EX)); 142CAPI.CRYPT_ALGORITHM_IDENTIFIER cryptAlgorithmIdentifier = (CAPI.CRYPT_ALGORITHM_IDENTIFIER) Marshal.PtrToStructure(pbAlgorithm.DangerousGetHandle(), typeof(CAPI.CRYPT_ALGORITHM_IDENTIFIER)); 237certificates.Add(new X509Certificate2(safeCertContextHandle.DangerousGetHandle())); 311CAPI.CMSG_SIGNER_INFO cmsgSignerInfo2 = (CAPI.CMSG_SIGNER_INFO) Marshal.PtrToStructure(pbCmsgSignerInfo.DangerousGetHandle(), typeof(CAPI.CMSG_SIGNER_INFO)); 383issuerSerial.IssuerName = Marshal.PtrToStringUni(ptr.DangerousGetHandle()); 406CAPI.CRYPTOAPI_BLOB decodedBlob = (CAPI.CRYPTOAPI_BLOB) Marshal.PtrToStructure(pbDecoded.DangerousGetHandle(), typeof(CAPI.CRYPTOAPI_BLOB)); 430return CAPI.BlobToByteArray(pbDecoded.DangerousGetHandle()); 649I_CRYPT_ATTRIBUTE * pCryptAttribute = (I_CRYPT_ATTRIBUTE *) pCryptAttributes.DangerousGetHandle(); 650IntPtr pAttrData = new IntPtr((long) pCryptAttributes.DangerousGetHandle() + (cryptAttrSize * attributes.Count)); 701return pCryptAttributes.DangerousGetHandle(); 752cmsSignerEncodeInfo.hCryptProv = safeCryptProvHandle.DangerousGetHandle(); 766Marshal.Copy(dummyName.RawData, 0, pbDataIssuer.DangerousGetHandle(), dummyName.RawData.Length); 767cmsSignerEncodeInfo.SignerId.Value.IssuerSerialNumber.Issuer.pbData = pbDataIssuer.DangerousGetHandle(); 775byte * pSerialNumber = (byte *)pbDataSerialNumber.DangerousGetHandle(); 778pbDataSerialNumber.DangerousGetHandle(); 791cmsSignerEncodeInfo.hCryptProv = safeCryptProvHandle.DangerousGetHandle(); 794CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 818cmsSignerEncodeInfo.SignerId.Value.KeyId.pbData = pbData.DangerousGetHandle(); 960CAPI.CRYPTOAPI_BLOB * pCertBlob = (CAPI.CRYPTOAPI_BLOB * ) certBlob.DangerousGetHandle(); 964CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 985CAPI.CERT_CONTEXT pCertContext = *((CAPI.CERT_CONTEXT*) safeCertContextHandle.DangerousGetHandle()); 1074Marshal.StructureToPtr(KeyProvInfo, pKeyProvInfo.DangerousGetHandle(), false); 1082Marshal.StructureToPtr(SignatureAlgorithm, pSignatureAlgorithm.DangerousGetHandle(), false); 1094pKeyProvInfo.DangerousGetHandle(), 1095pSignatureAlgorithm.DangerousGetHandle(), 1101Marshal.DestroyStructure(pKeyProvInfo.DangerousGetHandle(), typeof(CAPI.CRYPT_KEY_PROV_INFO)); 1103Marshal.DestroyStructure(pSignatureAlgorithm.DangerousGetHandle(), typeof(CAPI.CRYPT_ALGORITHM_IDENTIFIER)); 1109X509Certificate2 certificate = new X509Certificate2(handle.DangerousGetHandle());
system\security\cryptography\pkcs\recipientinfo.cs (2)
422CAPI.CMSG_CMS_RECIPIENT_INFO cmsRecipientInfo = (CAPI.CMSG_CMS_RECIPIENT_INFO) Marshal.PtrToStructure(pbCmsRecipientInfo.DangerousGetHandle(), typeof(CAPI.CMSG_CMS_RECIPIENT_INFO)); 457CAPI.CERT_INFO certInfo = (CAPI.CERT_INFO) Marshal.PtrToStructure(pbCertInfo.DangerousGetHandle(), typeof(CAPI.CERT_INFO));
system\security\cryptography\pkcs\signedpkcs7.cs (7)
306Marshal.StructureToPtr(signerEncodeInfo, pSignerEncodeInfo.DangerousGetHandle(), false); 311signedEncodeInfo.rgSigners = pSignerEncodeInfo.DangerousGetHandle(); 314signedEncodeInfo.rgCertEncoded = pEncodedBagOfCerts.DangerousGetHandle(); 351Marshal.DestroyStructure(pSignerEncodeInfo.DangerousGetHandle(), typeof(CAPI.CMSG_SIGNER_ENCODE_INFO)); 380Marshal.StructureToPtr(signerEncodeInfo, pSignerEncodeInfo.DangerousGetHandle(), false); 386pSignerEncodeInfo.DangerousGetHandle())) 390Marshal.DestroyStructure(pSignerEncodeInfo.DangerousGetHandle(), typeof(CAPI.CMSG_SIGNER_ENCODE_INFO));
system\security\cryptography\pkcs\signerinfo.cs (15)
53m_cmsgSignerInfo = (CAPI.CMSG_SIGNER_INFO) Marshal.PtrToStructure(pbCmsgSignerInfo.DangerousGetHandle(), typeof(CAPI.CMSG_SIGNER_INFO)); 79m_cmsgSignerInfo = (CAPI.CMSG_SIGNER_INFO) Marshal.PtrToStructure(pbCmsgSignerInfo.DangerousGetHandle(), typeof(CAPI.CMSG_SIGNER_INFO)); 309Marshal.StructureToPtr(signerEncodeInfo, pSignerEncodeInfo.DangerousGetHandle(), false); 315pSignerEncodeInfo.DangerousGetHandle())) 324Marshal.DestroyStructure(pSignerEncodeInfo.DangerousGetHandle(), typeof(CAPI.CMSG_SIGNER_ENCODE_INFO)); 349CAPI.CERT_CONTEXT pCertContext = (CAPI.CERT_CONTEXT) Marshal.PtrToStructure(X509Utils.GetCertContext(certificate).DangerousGetHandle(), typeof(CAPI.CERT_CONTEXT)); 425Marshal.WriteIntPtr(ppbData, pbParameters.DangerousGetHandle()); 483pbParentEncodedSignerInfo.DangerousGetHandle(), 540CAPI.CMSG_CMS_SIGNER_INFO cmsgCmsSignerInfo = (CAPI.CMSG_CMS_SIGNER_INFO) Marshal.PtrToStructure(pbCmsgCmsSignerInfo.DangerousGetHandle(), typeof(CAPI.CMSG_CMS_SIGNER_INFO)); 551CAPI.CMSG_SIGNER_INFO cmsgSignerInfo = (CAPI.CMSG_SIGNER_INFO) Marshal.PtrToStructure(pbCmsgSignerInfo.DangerousGetHandle(), typeof(CAPI.CMSG_SIGNER_INFO)); 593CAPI.CRYPTOAPI_BLOB * pNewValue = (CAPI.CRYPTOAPI_BLOB *) pbCounterSignatureValue.DangerousGetHandle(); 606newAttr.rgValue = pbCounterSignatureValue.DangerousGetHandle(); 609Marshal.StructureToPtr(newAttr, pNewAttr.DangerousGetHandle(), false); 613pNewAttr.DangerousGetHandle(), 618Marshal.DestroyStructure(pNewAttr.DangerousGetHandle(), typeof(CAPI.CRYPT_ATTRIBUTE));
system\security\cryptography\x509\x509ui.cs (3)
63ViewInfo.pCertContext = safeCertContext.DangerousGetHandle(); 137IntPtr hSourceCertStore = safeSourceStoreHandle.DangerousGetHandle(); 143csc.hSelectedCertStore = safeCertStoreHandle.DangerousGetHandle();
system\security\cryptography\x509\x509utils.cs (6)
131Marshal.Copy(arr, 0, pb.DangerousGetHandle(), arr.Length); 169CAPI.CRYPT_KEY_PROV_INFO pKeyProvInfo = (CAPI.CRYPT_KEY_PROV_INFO) Marshal.PtrToStructure(ptr.DangerousGetHandle(), typeof(CAPI.CRYPT_KEY_PROV_INFO)); 265IntPtr pOid = new IntPtr((long)safeLocalAllocHandle.DangerousGetHandle() + ptrSize); 267Marshal.WriteIntPtr(new IntPtr((long) safeLocalAllocHandle.DangerousGetHandle() + index * Marshal.SizeOf(typeof(IntPtr))), pOid); 320ChainPara.RequestedUsage.Usage.rgpszUsageIdentifier = applicationPolicyHandle.DangerousGetHandle(); 329ChainPara.RequestedIssuancePolicy.Usage.rgpszUsageIdentifier = certificatePolicyHandle.DangerousGetHandle();
System.ServiceModel (28)
System\ServiceModel\Activation\SharedMemory.cs (2)
58SharedMemoryContents* contents = (SharedMemoryContents*)view.DangerousGetHandle(); 144SharedMemoryContents* contents = (SharedMemoryContents*)view.DangerousGetHandle();
System\ServiceModel\Channels\ChannelBindingUtility.cs (1)
243byte* sourceBuffer = (byte*)source.DangerousGetHandle().ToPointer();
System\ServiceModel\Channels\MsmqDefaultLockingQueue.cs (1)
107retCode = UnsafeNativeMethods.MQReceiveMessage(handle.DangerousGetHandle(), timeoutIntervalInMilliseconds,
System\ServiceModel\Channels\MsmqQueue.cs (3)
557return UnsafeNativeMethods.MQReceiveMessage(handle.DangerousGetHandle(), timeoutInMilliseconds, 567return UnsafeNativeMethods.MQReceiveMessage(handle.DangerousGetHandle(), timeoutInMilliseconds, 590return UnsafeNativeMethods.MQReceiveMessage(handle.DangerousGetHandle(), timeoutInMilliseconds,
System\ServiceModel\Channels\OverlappedContext.cs (1)
365this.eventHandle = (IntPtr)(1 | (long)this.completionEvent.SafeWaitHandle.DangerousGetHandle());
System\ServiceModel\Channels\PipeConnection.cs (10)
279if (UnsafeNativeMethods.ReadFile(this.pipe.DangerousGetHandle(), this.readOverlapped.BufferPtr + offset, size, IntPtr.Zero, this.readOverlapped.NativeOverlapped) == 0) 373if (UnsafeNativeMethods.WriteFile(this.pipe.DangerousGetHandle(), this.writeOverlapped.BufferPtr + offset, size, IntPtr.Zero, this.writeOverlapped.NativeOverlapped) == 0) 867if (UnsafeNativeMethods.GetOverlappedResult(this.pipe.DangerousGetHandle(), this.readOverlapped.NativeOverlapped, out numBytes, 0) == 0) 935if (UnsafeNativeMethods.GetOverlappedResult(this.pipe.DangerousGetHandle(), this.writeOverlapped.NativeOverlapped, out numBytes, 0) == 0) 1376if (UnsafeNativeMethods.ReadFile(this.pipe.DangerousGetHandle(), this.readOverlapped.BufferPtr + offset, size, IntPtr.Zero, this.readOverlapped.NativeOverlapped) == 0) 1474if (UnsafeNativeMethods.WriteFile(this.pipe.DangerousGetHandle(), this.writeOverlapped.BufferPtr + offset, size, IntPtr.Zero, this.writeOverlapped.NativeOverlapped) == 0) 1595if (UnsafeNativeMethods.GetOverlappedResult(pipe.DangerousGetHandle(), nativeOverlapped, out bytesWritten, 0) == 0) 1611if (UnsafeNativeMethods.GetOverlappedResult(pipe.DangerousGetHandle(), nativeOverlapped, out bytesRead, 0) == 0) 2656SharedMemoryContents* contents = (SharedMemoryContents*)view.DangerousGetHandle(); 2700SharedMemoryContents* contents = (SharedMemoryContents*)view.DangerousGetHandle();
System\ServiceModel\ComIntegration\ComPlusAuthorization.cs (5)
63int level = Marshal.ReadInt32(buffer.DangerousGetHandle()); 76int level = Marshal.ReadInt32(buffer.DangerousGetHandle()); 87Marshal.PtrToStructure(buffer.DangerousGetHandle(), typeof(TOKEN_STATISTICS)); 143anonymousIdentity = new WindowsIdentity(tokenHandle.DangerousGetHandle()); 187processIdentity = new WindowsIdentity(tokenHandle.DangerousGetHandle());
System\ServiceModel\ComIntegration\PersistStreamTypeWrapper.cs (1)
80if (null == hGlobal || IntPtr.Zero == hGlobal.DangerousGetHandle())
System\ServiceModel\Security\SpnegoTokenAuthenticator.cs (1)
136WindowsIdentity windowsIdentity = new WindowsIdentity(contextToken.DangerousGetHandle(), windowsNegotiation.ProtocolName);
System\ServiceModel\Security\TlsSspiNegotiation.cs (3)
660this.remoteCertificate = new X509Certificate2(remoteContext.DangerousGetHandle()); 688mappedIdentity = new WindowsIdentity(token.DangerousGetHandle(), SecurityUtils.AuthTypeCertMap); 736_CERT_CONTEXT context = (_CERT_CONTEXT)Marshal.PtrToStructure(certContext.DangerousGetHandle(), typeof(_CERT_CONTEXT));
System.ServiceModel.Activation (4)
System\ServiceModel\Activation\HostedImpersonationContext.cs (1)
95context = HostedInnerImpersonationContext.UnsafeCreate(tokenHandle.DangerousGetHandle());
System\ServiceModel\Activation\Interop\SafeHGlobalHandleCritical.cs (1)
54Marshal.Copy(bytes, 0, result.DangerousGetHandle(), bytes.Length);
System\ServiceModel\Activation\MetabaseReader.cs (2)
109record.pbMDData = bufferHandle.DangerousGetHandle(); 121record.pbMDData = bufferHandle.DangerousGetHandle();
System.Transactions (5)
System\Transactions\Oletx\DTCTransactionManager.cs (1)
67Marshal.Copy( whereaboutsBuffer.DangerousGetHandle(), this.whereabouts, 0, Convert.ToInt32(this.whereaboutsSize) );
System\Transactions\Oletx\OletxTransactionManager.cs (1)
324Marshal.Copy( prepareInfoBuffer.DangerousGetHandle(), prepareInfo, 0, Convert.ToInt32(prepareInfoSize) );
System\Transactions\Transaction.cs (1)
175if (defaultContext.DangerousGetHandle() == contextToken)
System\Transactions\TransactionInterop.cs (2)
133Marshal.Copy( cookieBuffer.DangerousGetHandle(), cookie, 0, Convert.ToInt32(cookieSize) ); 349Marshal.Copy( propagationTokenBuffer.DangerousGetHandle(), propagationToken, 0, Convert.ToInt32(tokenSize) );
System.Windows.Forms (1)
winforms\Managed\System\WinForms\Control.cs (1)
17755return cp.Advise(punkEventsSink.DangerousGetHandle(), out cookie);
UIAutomationClient (11)
MS\Internal\Automation\Misc.cs (1)
524IntPtr[] handles = { handle.DangerousGetHandle() };
MS\Internal\Automation\UiaCoreAPI.cs (7)
375UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 387UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 399UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 441UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 457UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 458findParams.pFindCondition = findCondition._safeHandle.DangerousGetHandle(); 611UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle());
System\Windows\Automation\AndCondition.cs (1)
61SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.And, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
System\Windows\Automation\NotCondition.cs (1)
51SetMarshalData(new UiaCoreApi.UiaNotCondition(_condition._safeHandle.DangerousGetHandle()));
System\Windows\Automation\OrCondition.cs (1)
61SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.Or, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
UIAutomationClientsideProviders (1)
MS\Internal\AutomationProxies\Misc.cs (1)
1014IntPtr[] handles = { handle.DangerousGetHandle() };