279 references to DangerousGetHandle
aspire (2)
Processes\DetachedProcessLauncher.Windows.cs (2)
60var handles = new[] { nulHandle.DangerousGetHandle() }; 76var nulRawHandle = nulHandle.DangerousGetHandle();
ILCompiler.Compiler (1)
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (1)
168var peReader = new PEReader((byte*)safeBuffer.DangerousGetHandle(), (int)safeBuffer.ByteLength);
ILCompiler.ReadyToRun (1)
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (1)
168var peReader = new PEReader((byte*)safeBuffer.DangerousGetHandle(), (int)safeBuffer.ByteLength);
ILCompiler.TypeSystem (1)
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\SymbolReader\PortablePdbSymbolReader.cs (1)
48var metadataReader = new MetadataReader((byte*)safeBuffer.DangerousGetHandle(), (int)safeBuffer.ByteLength, MetadataReaderOptions.Default, stringDecoder);
Infrastructure.Common (2)
CertificateManager.cs (2)
140using (X509Store store = new X509Store(keychain.DangerousGetHandle())) 196using (X509Store store = new X509Store(handle.DangerousGetHandle()))
Microsoft.AspNetCore.Cryptography.Internal (8)
SafeHandles\NCryptDescriptorHandle.cs (1)
32return new String((char*)ruleStringHandle.DangerousGetHandle());
SafeHandles\SafeLibraryHandle.cs (1)
75return new string((char*)messageHandle.DangerousGetHandle(), 0, numCharsOutput).Trim();
UnsafeBufferUtil.cs (6)
44BlockCopy((void*)from.DangerousGetHandle(), to, byteCount); 64BlockCopy(from, (void*)to.DangerousGetHandle(), byteCount); 93BlockCopyCore(from: (byte*)from.DangerousGetHandle(), to: (byte*)to.DangerousGetHandle(), byteCount: (uint)length.ToInt32()); 97BlockCopyCore(from: (byte*)from.DangerousGetHandle(), to: (byte*)to.DangerousGetHandle(), byteCount: (ulong)length.ToInt64());
Microsoft.AspNetCore.DataProtection (3)
Cng\DpapiSecretSerializerHelper.cs (3)
181UnsafeBufferUtil.BlockCopy(from: (void*)protectedData.DangerousGetHandle(), to: pbRetVal, byteCount: cbProtectedData); 307return new Secret((byte*)unencryptedPayloadHandle.DangerousGetHandle(), checked((int)cbUnencryptedPayload)); 313UnsafeBufferUtil.SecureZeroMemory((byte*)unencryptedPayloadHandle.DangerousGetHandle(), cbUnencryptedPayload);
Microsoft.CodeAnalysis.Workspaces (1)
TemporaryStorage\TemporaryStorageService.MemoryMappedInfo.cs (1)
145(byte*)accessor.Target.SafeMemoryMappedViewHandle.DangerousGetHandle() + accessor.Target.PointerOffset,
Microsoft.ML.TensorFlow (1)
TensorflowUtils.cs (1)
563_inputValues[index] = value.Handle.DangerousGetHandle();
Microsoft.NET.HostModel (1)
AppHost\BinaryUtils.cs (1)
80return KMPSearch(searchPattern, (byte*)safeBuffer.DangerousGetHandle(), (int)safeBuffer.ByteLength);
Microsoft.TestPlatform.PlatformAbstractions (1)
netcore\System\ProcessHelper.cs (1)
29return Process.GetProcessById(processId).SafeHandle.DangerousGetHandle();
NuGet.Packaging (6)
Signing\Cms\HeapBlockRetainer.cs (1)
26return hBlock.DangerousGetHandle();
Signing\Cms\NativeUtility.cs (5)
52Marshal.StructureToPtr(signerInfo, signerInfoHandle.DangerousGetHandle(), fDeleteOld: false); 54signedInfo.rgSigners = signerInfoHandle.DangerousGetHandle(); 61Marshal.StructureToPtr(certificateBlobs[i], new IntPtr(certificatesHandle.DangerousGetHandle().ToInt64() + Marshal.SizeOf(certificateBlobs[i]) * i), fDeleteOld: false); 64signedInfo.rgCertEncoded = certificatesHandle.DangerousGetHandle(); 119signerInfo.hCryptProvOrhNCryptKey = privateKey.Handle.DangerousGetHandle();
PresentationCore (10)
MS\Internal\DpiUtil\DpiUtil+ProcessDpiAwarenessHelper.cs (1)
105return SafeNativeMethods.GetProcessDpiAwareness(new HandleRef(null, hProcess.DangerousGetHandle()));
System\Windows\InterOp\D3DImage.cs (2)
781data.pInteropDeviceBitmap = (ulong)_pInteropDeviceBitmap.DangerousGetHandle().ToPointer(); 798data.pSoftwareBitmap = (ulong)_softwareCopy.WicSourceHandle.DangerousGetHandle().ToPointer();
System\Windows\Media\ColorContext.cs (1)
371colorContextPtrs[i] = colorContextHandles[i].DangerousGetHandle();
System\Windows\Media\ColorTransformHelper.cs (2)
77handles[0] = sourceProfile.DangerousGetHandle(); 78handles[1] = destinationProfile.DangerousGetHandle();
System\Windows\Media\Imaging\BitmapEncoder.cs (2)
638IntPtr[] colorContextPtrs = new IntPtr[1] { colorContext.ColorContextHandle.DangerousGetHandle() }; 666colorContextPtrs[i] = colorContexts[i].ColorContextHandle.DangerousGetHandle();
System\Windows\Media\Imaging\BitmapSource.cs (1)
877_convertedDUCEPtr = new BitmapSourceSafeMILHandle(pCWICWrapperBitmap.DangerousGetHandle(), pIWICSource);
System\Windows\Media\Imaging\WriteableBitmap.cs (1)
1215command.SwDoubleBufferedBitmap = (UInt64) _pDoubleBufferedBitmap.DangerousGetHandle().ToPointer();
ReachFramework (7)
MS\Internal\Printing\Configuration\WinSpoolPrinterCapabilities.cs (5)
443IntPtr baseAddr = buffer.Handle.DangerousGetHandle(); 469IntPtr baseAddr = buffer.Handle.DangerousGetHandle(); 495IntPtr baseAddr = buffer.Handle.DangerousGetHandle(); 523IntPtr baseAddr = buffer.Handle.DangerousGetHandle(); 551IntPtr baseAddr = buffer.Handle.DangerousGetHandle();
PrintConfig\FallbackPTProvider.cs (2)
745IntPtr ptr = pPrinterBuffer.Handle.DangerousGetHandle(); 814IntPtr pDevMode = Marshal.ReadIntPtr(pPrinterBuffer.Handle.DangerousGetHandle());
Security.TransportSecurity.IntegrationTests (1)
Tcp\ClientCredentialTypeTests.OSX.cs (1)
143using (store = new X509Store(keychain.DangerousGetHandle()))
System.Console (1)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Poll.cs (1)
40FileDescriptor = fd.DangerousGetHandle().ToInt32(),
System.Data.Odbc (25)
Common\System\Data\ProviderBase\DbBuffer.cs (22)
70IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 98IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 124IntPtr ptr = DangerousGetHandle(); 157IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 190IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 222IntPtr ptr = DangerousGetHandle(); 249IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 274IntPtr ptr = DangerousGetHandle(); 301IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 326IntPtr ptr = DangerousGetHandle(); 352IntPtr ptr = DangerousGetHandle(); 396IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 420IntPtr ptr = DangerousGetHandle(); 446IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 472IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 501IntPtr ptr = DangerousGetHandle(); 527IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 551IntPtr ptr = DangerousGetHandle(); 577IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 601IntPtr ptr = DangerousGetHandle(); 625IntPtr ptr = DangerousGetHandle(); 650IntPtr ptr = DangerousGetHandle();
System\Data\Odbc\OdbcDataReader.cs (2)
2394buffer.DangerousGetHandle()); // SQLLEN * StrLen_or_Ind 2444buffer.DangerousGetHandle());
System\Data\Odbc\OdbcUtils.cs (1)
329IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset);
System.Data.OleDb (45)
DbPropSet.cs (2)
189IntPtr propertySetPtr = ADP.IntPtrOffset(DangerousGetHandle(), index * ODB.SizeOf_tagDBPROPSET); 238IntPtr propsetPtr = ADP.IntPtrOffset(DangerousGetHandle(), index * ODB.SizeOf_tagDBPROPSET);
OleDbCommand.cs (2)
984tableID.ulPropid = sptr.DangerousGetHandle(); 997hr = iopenRowset.Value.OpenRowset(IntPtr.Zero, tableID, IntPtr.Zero, in ODB.IID_IRowset, propSet.PropertySetCount, propSet.DangerousGetHandle(), out executeResult);
OleDbDataReader.cs (3)
1701IntPtr rowHandlesPtr = rowHandleBuffer.DangerousGetHandle(); 1706Debug.Assert(rowHandleBuffer.DangerousGetHandle() == rowHandlesPtr, "rowhandlebuffer changed"); 1863IntPtr ulPropid = ((null != sptr[i]) ? sptr[i]!.DangerousGetHandle() : info.propid);
OleDbParameter.cs (1)
434bindings.DataSourceType = dbtype.dbString.DangerousGetHandle(); // NOTE: This is a constant and isn't exposed publicly, so there really isn't a potential for Handle Recycling.
OleDbTransaction.cs (2)
62hr = (OleDbHResult)NativeOledbWrapper.ITransactionAbort(DangerousGetHandle()); 90hr = (OleDbHResult)NativeOledbWrapper.ITransactionCommit(DangerousGetHandle());
OleDbWrapper.cs (3)
68IntPtr originalHandle = datasrcWrapper.DangerousGetHandle(); 207IntPtr originalHandle = sessionWrapper.DangerousGetHandle(); 240IntPtr originalHandle = sessionWrapper.DangerousGetHandle();
RowBinding.cs (7)
81return ADP.IntPtrOffset(DangerousGetHandle(), _headerLength); 91return ADP.IntPtrOffset(DangerousGetHandle(), valueOffset); 134IntPtr buffer = DangerousGetHandle(); 182IntPtr buffer = ADP.IntPtrOffset(DangerousGetHandle(), offset); 211IntPtr buffer = ADP.IntPtrOffset(DangerousGetHandle(), offset); 354ResetValues(DangerousGetHandle(), _iaccessor); 577IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset);
System\Data\ProviderBase\DbBuffer.cs (20)
71IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 97IntPtr ptr = DangerousGetHandle(); 130IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 163IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 195IntPtr ptr = DangerousGetHandle(); 222IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 247IntPtr ptr = DangerousGetHandle(); 274IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 299IntPtr ptr = DangerousGetHandle(); 325IntPtr ptr = DangerousGetHandle(); 369IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 393IntPtr ptr = DangerousGetHandle(); 419IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 445IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 474IntPtr ptr = DangerousGetHandle(); 500IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 524IntPtr ptr = DangerousGetHandle(); 550IntPtr ptr = ADP.IntPtrOffset(DangerousGetHandle(), offset); 574IntPtr ptr = DangerousGetHandle(); 598IntPtr ptr = DangerousGetHandle();
System\Data\ProviderBase\DbConnectionPool.cs (4)
257WriteIntPtr(SEMAPHORE_HANDLE * IntPtr.Size, _poolHandle.DangerousGetHandle()); 258WriteIntPtr(ERROR_HANDLE * IntPtr.Size, _errorHandle.DangerousGetHandle()); 259WriteIntPtr(CREATION_HANDLE * IntPtr.Size, _creationHandle.DangerousGetHandle()); 1126nint* handle = (nint*)_waitHandles.DangerousGetHandle();
System\Data\ProviderBase\WrappedIUnknown.cs (1)
54IntPtr handle = DangerousGetHandle();
System.Diagnostics.EventLog (1)
System\Diagnostics\Reader\UnsafeNativeMethods.cs (1)
396_value.Password = _originalHandleValue = _passwordHandle.DangerousGetHandle();
System.Diagnostics.PerformanceCounter (2)
System\Diagnostics\SharedPerformanceCounter.cs (2)
1664return _fileViewAddress.DangerousGetHandle(); 1767Interlocked.CompareExchange(ref *(int*)_fileViewAddress.DangerousGetHandle().ToPointer(), initialOffset, 0);
System.Diagnostics.Process (18)
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (1)
38SetHandle(_handle.DangerousGetHandle());
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (4)
34stdinRawFd = stdinFd.DangerousGetHandle().ToInt32(); 40stdoutRawFd = stdoutFd.DangerousGetHandle().ToInt32(); 46stderrRawFd = stderrFd.DangerousGetHandle().ToInt32(); 66inheritedFds[i] = (int)handle.DangerousGetHandle();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Poll.cs (1)
40FileDescriptor = fd.DangerousGetHandle().ToInt32(),
System\Diagnostics\Process.cs (1)
131public IntPtr Handle => SafeHandle.DangerousGetHandle();
System\Diagnostics\Process.Multiplexing.Unix.cs (4)
42int outputFd = outputHandle.DangerousGetHandle().ToInt32(); 43int errorFd = errorHandle.DangerousGetHandle().ToInt32(); 273int outputFd = outputHandle.DangerousGetHandle().ToInt32(); 274int errorFd = errorHandle.DangerousGetHandle().ToInt32();
System\Diagnostics\Process.Unix.cs (1)
405SafePipeHandle safePipeHandle = new(handle.DangerousGetHandle(), ownsHandle: true);
System\Diagnostics\ProcessStartInfo.cs (6)
491nint rawValue = handle.DangerousGetHandle(); 494if (snapshot[j].DangerousGetHandle() == rawValue) 556nint input = stdinHandle.DangerousGetHandle(); 557nint output = stdoutHandle.DangerousGetHandle(); 558nint error = stderrHandle.DangerousGetHandle(); 562nint handle = inheritedHandles[i].DangerousGetHandle();
System.DirectoryServices (4)
System\DirectoryServices\ActiveDirectory\TrustHelper.cs (1)
1002uint result = global::Interop.Advapi32.LsaQueryInformationPolicy(policyHandle.DangerousGetHandle(), policyDnsDomainInformation, ref buffer);
System\DirectoryServices\ActiveDirectory\Utils.cs (3)
2078tokenHandle.DangerousGetHandle(), 2097tokenHandle.DangerousGetHandle(), 2159policyHandle.DangerousGetHandle(),
System.DirectoryServices.AccountManagement (7)
System\DirectoryServices\AccountManagement\AuthZSet.cs (4)
81_psUserSid.DangerousGetHandle(), 282bool success = Interop.Advapi32.EqualDomainSid(_psUserSid.DangerousGetHandle(), pSid, ref sameDomain); 329if (Interop.Advapi32.EqualDomainSid(_psMachineSid.DangerousGetHandle(), pSid, ref inMachineDomain)) 422if (Utils.ClassifySID(pSid) == SidType.RealObject && Interop.Advapi32.EqualDomainSid(_psUserSid.DangerousGetHandle(), pSid, ref sameDomain))
System\DirectoryServices\AccountManagement\Utils.cs (3)
394tokenHandle.DangerousGetHandle(), 415tokenHandle.DangerousGetHandle(), 490policyHandle.DangerousGetHandle(),
System.DirectoryServices.Protocols (5)
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (4)
178if (s_handleTable[_ldapHandle.DangerousGetHandle()] != null) 180s_handleTable.Remove(_ldapHandle.DangerousGetHandle()); 183s_handleTable.Add(_ldapHandle.DangerousGetHandle(), new WeakReference(this)); 1155s_handleTable.Remove(_ldapHandle.DangerousGetHandle());
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (1)
941*ConnectionToUse = con._ldapHandle.DangerousGetHandle();
System.IO.FileSystem.Watcher (1)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Poll.cs (1)
40FileDescriptor = fd.DangerousGetHandle().ToInt32(),
System.IO.IsolatedStorage (1)
System\IO\IsolatedStorage\IsolatedStorageFileStream.cs (1)
68: base(new SafeFileHandle(initializationData.NestedStream.SafeFileHandle.DangerousGetHandle(), ownsHandle: false), access, bufferSize)
System.IO.MemoryMappedFiles (1)
Microsoft\Win32\SafeMemoryMappedFileHandle.Unix.cs (1)
60handlePtr = fileHandle.DangerousGetHandle();
System.IO.Pipes (2)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (1)
32base.SetHandle(_pipeSocketHandle!.DangerousGetHandle());
System\IO\Pipes\AnonymousPipeServerStream.cs (1)
90return _clientHandle.DangerousGetHandle().ToString();
System.IO.Ports (1)
src\runtime\src\libraries\Common\src\Interop\Unix\System.IO.Ports.Native\Interop.Serial.cs (1)
75FileDescriptor = fd.DangerousGetHandle().ToInt32(),
System.Net.Http (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System.Net.Http.WinHttpHandler (3)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Windows.cs (1)
27&& chain.SafeHandle!.DangerousGetHandle() == IntPtr.Zero) // Build failed to generate a valid handle.
System\Net\Http\WinHttpRequestState.cs (1)
117s_dbg_requestHandle = value.DangerousGetHandle();
System.Net.HttpListener (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System.Net.Mail (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System.Net.NameResolution (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System.Net.Primitives (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System.Net.Quic (3)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System\Net\Quic\Internal\MsQuicSafeHandle.cs (2)
30public QUIC_HANDLE* QuicHandle => (QUIC_HANDLE*)DangerousGetHandle(); 73public override string ToString() => _traceId ??= $"[{s_typeName[(int)_type]}][0x{DangerousGetHandle():X11}]";
System.Net.Requests (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System.Net.Security (3)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (1)
488IntPtr cbtData = (nint)_channelBinding.DangerousGetHandle() + appDataOffset;
System\Net\NegotiateAuthenticationPal.Unix.cs (1)
589IntPtr cbtAppData = channelBinding.DangerousGetHandle() + appDataOffset;
System.Net.Sockets (6)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Poll.cs (1)
40FileDescriptor = fd.DangerousGetHandle().ToInt32(),
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System\Net\Sockets\Socket.cs (1)
392public IntPtr Handle => SafeHandle.DangerousGetHandle();
System\Net\Sockets\SocketAsyncContext.Unix.cs (1)
1299IntPtr handle = _socket.DangerousGetHandle();
System\Net\Sockets\SocketPal.Unix.cs (2)
1910buffer[i] = (int)socket.InternalSafeHandle.DangerousGetHandle(); 2012int fd = (int)socket.InternalSafeHandle.DangerousGetHandle();
System.Net.WebSockets (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
143return $"{handle.GetType().Name}:{handle.GetHashCode()}(0x{handle.DangerousGetHandle():X})";
System.Private.CoreLib (23)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\FileStreamStrategy.cs (1)
18internal IntPtr Handle => SafeFileHandle.DangerousGetHandle();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SafeHandleMarshaller.cs (2)
39public IntPtr ToUnmanaged() => _handle!.DangerousGetHandle(); 87_originalHandleValue = handle.DangerousGetHandle();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (1)
291return new Span<char>((byte*)buffer.DangerousGetHandle(), (int)(buffer.ByteLength / 2));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\EventWaitHandle.Unix.cs (3)
52WaitSubsystem.ResetEvent(waitHandle.DangerousGetHandle()); 66WaitSubsystem.SetEvent(waitHandle.DangerousGetHandle()); 80WaitSubsystem.SetEvent(waitHandle.DangerousGetHandle());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (1)
705return _waitEvent.SafeWaitHandle.DangerousGetHandle();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Mutex.Unix.cs (1)
81WaitSubsystem.ReleaseMutex(waitHandle.DangerousGetHandle());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (2)
111UserUnregisterWaitHandleValue = UserUnregisterWaitHandle?.DangerousGetHandle() ?? IntPtr.Zero; 173Debug.Assert(handleValue == handle!.DangerousGetHandle());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Semaphore.Unix.cs (1)
60return WaitSubsystem.ReleaseSemaphore(waitHandle.DangerousGetHandle(), releaseCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.Unix.cs (2)
68return WaitSubsystem.Wait(waitHandle.DangerousGetHandle(), millisecondsTimeout, interruptible: false) == WaitHandle.WaitSuccess; 84WaitSubsystem.SetEvent(waitHandle.DangerousGetHandle());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (9)
48get => _waitHandle == null ? InvalidHandle : _waitHandle.DangerousGetHandle(); 136waitResult = context.Wait([waitHandle.DangerousGetHandle()], false, millisecondsTimeout); 157waitHandle.DangerousGetHandle(), 182waitHandle.DangerousGetHandle(), 258unsafeWaitHandles[i] = safeWaitHandle.DangerousGetHandle(); 380unsafeWaitHandles[i] = safeWaitHandles[i].DangerousGetHandle(); 390unsafeWaitHandles[i] = safeWaitHandles[i].DangerousGetHandle(); 466safeWaitHandleToSignal.DangerousGetHandle(), 467safeWaitHandleToWaitOn.DangerousGetHandle(),
System.Reflection.Metadata (1)
System\Reflection\Metadata\MetadataReader.netstandard.cs (1)
95peReader = new PEReader((byte*)safeBuffer.DangerousGetHandle(), (int)safeBuffer.ByteLength);
System.Security.Cryptography (22)
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (4)
155holderRawHandle = Holder.DangerousGetHandle(); 246duplicate.SetHandle(Holder.DangerousGetHandle()); 273holder.SetHandle(DangerousGetHandle()); 290duplicate.SetHandle(holder.DangerousGetHandle());
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (1)
253pvBuffer = stringHandle.DangerousGetHandle(),
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.NamedCurve.cs (1)
163buff.pvBuffer = safeCurveName.DangerousGetHandle();
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\CertificateHelpers.Windows.cs (1)
181SafeNCryptKeyHandle newKeyHandle = CreateSafeNCryptKeyHandle(privateKey.DangerousGetHandle(), certificateContext);
System\Security\Cryptography\CngKey.Import.cs (1)
65pvBuffer = passwordHandle.DangerousGetHandle(),
System\Security\Cryptography\X509Certificates\CertificateHelpers.Windows.cs (1)
180return Interop.Crypt32.CertDuplicateCertificateContext(handle.DangerousGetHandle());
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.cs (2)
50get { return _certContext.DangerousGetHandle(); } 542certContext = Interop.Crypt32.CertDuplicateCertificateContextWithKeyContainerDeletion(oldCertContext.DangerousGetHandle());
System\Security\Cryptography\X509Certificates\ChainPal.Windows.BuildChain.cs (4)
48chainPara.RequestedUsage.Usage.rgpszUsageIdentifier = applicationPolicyOids.DangerousGetHandle(); 58chainPara.RequestedIssuancePolicy.Usage.rgpszUsageIdentifier = certificatePolicyOids.DangerousGetHandle(); 68if (!Interop.Crypt32.CertGetCertificateChain(storeHandle.DangerousGetHandle(), certContext, &ft, extraStoreHandle, ref chainPara, flags, IntPtr.Zero, out chain)) 97customChainEngine.hExclusiveRoot = customTrustStoreHandle.DangerousGetHandle();
System\Security\Cryptography\X509Certificates\ChainPal.Windows.cs (2)
69CERT_CHAIN_CONTEXT* pCertChainContext = (CERT_CHAIN_CONTEXT*)(_chain.DangerousGetHandle()); 97CERT_CHAIN_CONTEXT* pCertChainContext = (CERT_CHAIN_CONTEXT*)(_chain.DangerousGetHandle());
System\Security\Cryptography\X509Certificates\FindPal.Windows.cs (1)
442CertificatePal.FromHandle(pCertContext.DangerousGetHandle()),
System\Security\Cryptography\X509Certificates\StorePal.Windows.cs (1)
45X509Certificate2 cert = new X509Certificate2(pCertContext.DangerousGetHandle());
System\Security\Cryptography\X509Certificates\WindowsHelpers.cs (1)
51byte** pOidPointers = (byte**)(safeLocalAllocHandle.DangerousGetHandle());
System\Security\Cryptography\X509Certificates\X509Chain.cs (1)
73return handle.DangerousGetHandle();
System\Security\Cryptography\X509Certificates\X509Store.cs (1)
96return _storePal.SafeHandle.DangerousGetHandle();
System.Security.Cryptography.Pkcs (14)
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.Decode.cs (1)
57CRYPT_ALGORITHM_IDENTIFIER* pCryptAlgorithmIdentifier = (CRYPT_ALGORITHM_IDENTIFIER*)(sh.DangerousGetHandle());
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.DecodeRecipients.cs (1)
44CMSG_CMS_RECIPIENT_INFO* pCMsgCmsRecipientInfo = (CMSG_CMS_RECIPIENT_INFO*)(pCmsgCmsRecipientInfoMemory.DangerousGetHandle());
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.Decrypt.cs (2)
176decryptPara.hKey = hKey.DangerousGetHandle(); 209decryptPara.hProv = hKey.DangerousGetHandle();
Internal\Cryptography\Pal\Windows\HeapBlockRetainer.cs (1)
32return hBlock.DangerousGetHandle();
Internal\Cryptography\Pal\Windows\HelpersWindows.cs (3)
59if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, paramType, index, pvData.DangerousGetHandle(), ref cbData)) 297DATA_BLOB* pDataBlob = (DATA_BLOB*)(sh.DangerousGetHandle()); 352CRYPT_ATTRIBUTES* pCryptAttributes = (CRYPT_ATTRIBUTES*)(sh.DangerousGetHandle());
Internal\Cryptography\Pal\Windows\KeyAgreeRecipientInfoPalWindows.cs (1)
169CMSG_CMS_RECIPIENT_INFO* pRecipientInfo = (CMSG_CMS_RECIPIENT_INFO*)(_pCmsgCmsRecipientInfoMemory.DangerousGetHandle());
Internal\Cryptography\Pal\Windows\KeyTransRecipientInfoPalWindows.cs (1)
94CMSG_CMS_RECIPIENT_INFO* pRecipientInfo = (CMSG_CMS_RECIPIENT_INFO*)(_pCmsgCmsRecipientInfoMemory.DangerousGetHandle());
Internal\Cryptography\Pal\Windows\PkcsPalWindows.cs (1)
134using (SafeNCryptKeyHandle keyHandle = new SafeNCryptKeyHandle(handle.DangerousGetHandle(), handle))
Microsoft\Win32\SafeHandles\SafeCertContextHandle.cs (1)
21return (CERT_CONTEXT*)DangerousGetHandle();
Microsoft\Win32\SafeHandles\SafeHeapAllocHandle.cs (1)
27byte* p = (byte*)(result.DangerousGetHandle());
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CryptEncodeDecodeWrappers.cs (1)
37if (!CryptDecodeObject(MsgEncodingType.All, (IntPtr)lpszStructType, pbEncoded, cbEncoded, 0, (void*)sh.DangerousGetHandle(), ref cbRequired))
System.Security.Principal.Windows (16)
System\Security\Principal\WindowsIdentity.cs (16)
79if (!identity._safeTokenHandle.IsInvalid && identity._safeTokenHandle.DangerousGetHandle() != IntPtr.Zero) 83if (!identity._safeTokenHandle.IsInvalid && identity._safeTokenHandle.DangerousGetHandle() != IntPtr.Zero) 85CreateFromToken(identity._safeTokenHandle.DangerousGetHandle()); 172KERB_S4U_LOGON* pKerbS4uLogin = (KERB_S4U_LOGON*)(authenticationInfo.DangerousGetHandle()); 188sourceName.CopyTo(new Span<byte>((void*)sourceNameBuffer.DangerousGetHandle(), sourceName.Length)); 189LSA_STRING lsaOriginName = new LSA_STRING(sourceNameBuffer.DangerousGetHandle(), sourceNameLength); 196authenticationInfo.DangerousGetHandle(), 305return DuplicateAccessToken(accessToken.DangerousGetHandle()); 684return _safeTokenHandle.DangerousGetHandle(); 1095Interop.TOKEN_PRIMARY_GROUP primaryGroup = *(Interop.TOKEN_PRIMARY_GROUP*)(safeAllocHandlePrimaryGroup!.DangerousGetHandle()); 1103int count = *(int*)safeAllocHandle!.DangerousGetHandle(); 1105((byte*)safeAllocHandle.DangerousGetHandle() + sizeof(IntPtr) /* offsetof(Interop.TOKEN_GROUPS, Groups) */); 1163Interop.SID_AND_ATTRIBUTES user = *(Interop.SID_AND_ATTRIBUTES*)(safeAllocHandle!.DangerousGetHandle()); 1206int count = *(int*)safeAllocHandle.DangerousGetHandle(); 1208((byte*)safeAllocHandle.DangerousGetHandle() + sizeof(IntPtr) /* offsetof(Interop.TOKEN_GROUPS, Groups) */); 1251Interop.CLAIM_SECURITY_ATTRIBUTES_INFORMATION claimAttributes = *(Interop.CLAIM_SECURITY_ATTRIBUTES_INFORMATION*)(safeAllocHandle!.DangerousGetHandle());
System.ServiceProcess.ServiceController (2)
Microsoft\Win32\SafeHandles\SafeServiceHandle.cs (2)
25get { return DangerousGetHandle() == IntPtr.Zero || DangerousGetHandle() == new IntPtr(-1); }
System.Text.Encoding.CodePages (3)
System\Text\BaseCodePageEncoding.cs (2)
375return (byte*)safeNativeMemoryHandle.DangerousGetHandle(); 408if (safeNativeMemoryHandle != null && safeNativeMemoryHandle.DangerousGetHandle() == IntPtr.Zero)
System\Text\GB18030Encoding.cs (1)
133byte* pNativeMemory = (byte*)safeNativeMemoryHandle!.DangerousGetHandle();
System.Windows.Extensions (3)
System\Security\Cryptography\X509Certificates\X509Certificate2UI.cs (3)
64ViewInfo.pCertContext = safeCertContext.DangerousGetHandle(); 143IntPtr hSourceCertStore = safeSourceStoreHandle.DangerousGetHandle(); 149csc.hSelectedCertStore = safeCertStoreHandle.DangerousGetHandle();
System.Windows.Forms.Primitives (1)
Windows\Win32\Pinvoke.RegLoadMUIString.cs (1)
23(System.Registry.HKEY)key.Handle.DangerousGetHandle(),
UIAutomationClient (11)
MS\Internal\Automation\Misc.cs (1)
484IntPtr[] handles = { handle.DangerousGetHandle() };
MS\Internal\Automation\UiaCoreApi.cs (7)
361UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 373UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 385UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 427UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 443UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle()); 444findParams.pFindCondition = findCondition._safeHandle.DangerousGetHandle(); 585UiaMiniCacheRequest miniCR = new UiaMiniCacheRequest(request, request._condition._safeHandle.DangerousGetHandle());
System\Windows\Automation\AndCondition.cs (1)
44SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.And, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
System\Windows\Automation\NotCondition.cs (1)
39SetMarshalData(new UiaCoreApi.UiaNotCondition(_condition._safeHandle.DangerousGetHandle()));
System\Windows\Automation\OrCondition.cs (1)
44SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.Or, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
UIAutomationClientSideProviders (1)
MS\Internal\AutomationProxies\Misc.cs (1)
992IntPtr[] handles = { handle.DangerousGetHandle() };