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