122 references to SetHandle
Infrastructure.Common (1)
SafeKeychainHandle.cs (1)
42SetHandle(IntPtr.Zero);
Microsoft.Win32.Registry (1)
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs (1)
32SetHandle(preexistingHandle);
Microsoft.Win32.SystemEvents (1)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs (1)
14SetHandle(value);
PresentationCore (6)
System\Windows\Media\ColorContextHelper.cs (1)
31SetHandle(profile);
System\Windows\Media\ColorTransformHelper.cs (1)
30SetHandle(profile);
System\Windows\Media\Imaging\BitmapSourceSafeMILHandle.cs (1)
40SetHandle(handle);
System\Windows\Media\safemediahandle.cs (1)
25SetHandle(handle);
System\Windows\Media\SafeMILHandle.cs (1)
33SetHandle(handle);
System\Windows\Media\SafeReversePInvokeHandle.cs (1)
38SetHandle(reversePInvokeWrapper);
System.Diagnostics.EventLog (5)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs (1)
14SetHandle(value);
System\Diagnostics\Reader\CoTaskMemSafeHandle.cs (1)
20SetHandle(handle);
System\Diagnostics\Reader\CoTaskMemUnicodeSafeHandle.cs (2)
21SetHandle(handle); 26SetHandle(handle);
System\Diagnostics\Reader\EventLogHandle.cs (1)
22SetHandle(handle);
System.Diagnostics.PerformanceCounter (1)
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs (1)
32SetHandle(preexistingHandle);
System.Diagnostics.Process (2)
Microsoft\Win32\SafeHandles\SafeProcessHandle.cs (1)
56SetHandle(existingHandle);
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (1)
38SetHandle(_handle.DangerousGetHandle());
System.DirectoryServices (4)
src\runtime\src\libraries\Common\src\Interop\Windows\Secur32\Interop.LsaLogonProcessSafeHandle.cs (1)
17SetHandle(value);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs (1)
14SetHandle(value);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaPolicyHandle.cs (1)
15SetHandle(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeTokenHandle.cs (1)
19SetHandle(handle);
System.DirectoryServices.AccountManagement (4)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaMemoryHandle.cs (1)
16SetHandle(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaPolicyHandle.cs (1)
15SetHandle(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeTokenHandle.cs (1)
19SetHandle(handle);
System\DirectoryServices\AccountManagement\AuthZSet.cs (1)
528SetHandle(handle);
System.DirectoryServices.Protocols (4)
System\DirectoryServices\Protocols\Interop\SafeHandles.cs (1)
15SetHandle(value);
System\DirectoryServices\Protocols\Interop\SafeHandles.Linux.cs (3)
35SetHandle(value); 56SetHandle(Interop.Ldap.ber_alloc(1)); 72SetHandle(Interop.Ldap.ber_init(value));
System.Drawing.Common (1)
System\Drawing\Printing\PrintController.SafeDeviceModeHandle.cs (1)
27SetHandle(handle);
System.IO.Compression (1)
src\runtime\src\libraries\Common\src\System\IO\Compression\ZLibNative.cs (1)
209SetHandle(IntPtr.Zero);
System.IO.MemoryMappedFiles (3)
Microsoft\Win32\SafeMemoryMappedFileHandle.Unix.cs (2)
67SetHandle(handlePtr); 74SetHandle((IntPtr)(-1));
Microsoft\Win32\SafeMemoryMappedViewHandle.Unix.cs (1)
13base.SetHandle(handle);
System.IO.Pipes (3)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (3)
32base.SetHandle(_pipeSocketHandle!.DangerousGetHandle()); 56base.SetHandle((IntPtr)DefaultInvalidHandle); 135base.SetHandle(descriptor);
System.Management (1)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs (1)
14SetHandle(value);
System.Net.Http (1)
src\runtime\src\libraries\Common\src\System\Net\DebugSafeHandle.cs (1)
24SetHandle(invalidValue);
System.Net.Http.WinHttpHandler (2)
System\Net\Http\WinHttpChannelBinding.cs (2)
29SetHandle(data); 71SetHandle(IntPtr.Zero);
System.Net.Quic (11)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs (1)
74SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs (1)
87SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs (2)
19SetHandle(IntPtr.Zero); 39SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (1)
23SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
28SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (3)
38SetHandle(IntPtr.Zero); 58SetHandle(IntPtr.Zero); 78SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs (1)
20SetHandle(IntPtr.Zero);
System\Net\Quic\Internal\MsQuicSafeHandle.cs (1)
62SetHandle(IntPtr.Zero);
System.Net.Security (17)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (1)
515SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (1)
162SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs (1)
74SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs (1)
87SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs (2)
19SetHandle(IntPtr.Zero); 39SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (3)
58SetHandle(IntPtr.Zero); 146SetHandle(IntPtr.Zero); 171SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (1)
23SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
28SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (3)
38SetHandle(IntPtr.Zero); 58SetHandle(IntPtr.Zero); 78SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs (1)
20SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\System\Net\DebugSafeHandle.cs (1)
24SetHandle(invalidValue);
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (1)
64SetHandle(IntPtr.Zero);
System.Net.Sockets (1)
System\Net\Sockets\SafeSocketHandle.cs (1)
175base.SetHandle(handle);
System.Net.WebSockets (1)
src\runtime\src\libraries\Common\src\System\IO\Compression\ZLibNative.cs (1)
209SetHandle(IntPtr.Zero);
System.Private.CoreLib (7)
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.cs (1)
38SetHandle(preexistingHandle);
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (3)
54SetHandle(new IntPtr(-1)); 216tempReadHandle.SetHandle(readFd); 219tempWriteHandle.SetHandle(writeFd);
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeWaitHandle.cs (1)
24SetHandle(existingHandle);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (1)
1359safeHandle.SetHandle(handle);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (1)
430buffer.SetHandle(Marshal.AllocHGlobal(byteLength));
System.Security.AccessControl (1)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeTokenHandle.cs (1)
19SetHandle(handle);
System.Security.Cryptography (16)
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (4)
89SetHandle(handle); 246duplicate.SetHandle(Holder.DangerousGetHandle()); 273holder.SetHandle(DangerousGetHandle()); 290duplicate.SetHandle(holder.DangerousGetHandle());
Microsoft\Win32\SafeHandles\SafePasswordHandle.cs (1)
78SetHandle((IntPtr)(-1));
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeHashHandle.cs (1)
18SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeKeyHandle.cs (1)
27SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeProvHandle.cs (2)
22SetHandle(IntPtr.Zero); 121SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCertContextHandle.cs (3)
32SetHandle(_parent.handle); 47SetHandle(IntPtr.Zero); 60SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeChainEngineHandle.cs (2)
18SetHandle(handle); 30SetHandle(IntPtr.Zero);
System\Security\Cryptography\FixedMemoryKeyBox.cs (1)
16SetHandle((IntPtr)memory);
System\Security\Cryptography\X509Certificates\SafeLocalAllocHandle.cs (1)
17h.SetHandle(Marshal.AllocHGlobal(cb));
System.Security.Cryptography.Pkcs (7)
Microsoft\Win32\SafeHandles\SafeCertContextHandle.cs (1)
32SetHandle(IntPtr.Zero);
Microsoft\Win32\SafeHandles\SafeCryptMsgHandle.cs (1)
25SetHandle(IntPtr.Zero);
Microsoft\Win32\SafeHandles\SafeProvOrNCryptKeyHandleUwp.cs (1)
43SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeHashHandle.cs (1)
18SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeKeyHandle.cs (1)
27SetHandle(IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeProvHandle.cs (2)
22SetHandle(IntPtr.Zero); 121SetHandle(IntPtr.Zero);
System.Security.Principal.Windows (5)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLocalAllocHandle.cs (2)
18h.SetHandle(Marshal.AllocHGlobal(cb)); 26SetHandle(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaMemoryHandle.cs (1)
16SetHandle(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaPolicyHandle.cs (1)
15SetHandle(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaReturnBufferHandle.cs (1)
17SetHandle(handle);
System.ServiceProcess.ServiceController (1)
Microsoft\Win32\SafeHandles\SafeServiceHandle.cs (1)
20SetHandle(handle);
System.Speech (2)
Internal\HGlobalSafeHandle.cs (2)
42SetHandle(Marshal.AllocHGlobal(size)); 46SetHandle(Marshal.ReAllocHGlobal(handle, (IntPtr)size));
System.Text.Encoding.CodePages (1)
Microsoft\Win32\SafeHandles\SafeAllocHHandle.cs (1)
16SetHandle(handle);
System.Windows.Extensions (3)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCertContextHandle.cs (3)
32SetHandle(_parent.handle); 47SetHandle(IntPtr.Zero); 60SetHandle(IntPtr.Zero);
UIAutomationClient (3)
MS\Internal\Automation\SafeProcessHandle.cs (1)
28SetHandle(Misc.OpenProcess(UnsafeNativeMethods.PROCESS_QUERY_INFORMATION | UnsafeNativeMethods.PROCESS_VM_READ, false, processId, hwnd));
System\Windows\Automation\Condition.cs (2)
44sh.SetHandle(mem); 61sh.SetHandle(mem);
UIAutomationClientSideProviders (4)
MS\Internal\AutomationProxies\CommonRemoteMemoryBlock.cs (1)
42SetHandle(Misc.VirtualAllocEx(_processHandle, IntPtr.Zero, new UIntPtr((uint)cbSize), UnsafeNativeMethods.MEM_COMMIT, UnsafeNativeMethods.PAGE_READWRITE));
MS\Internal\AutomationProxies\SafeCoTaskMem.cs (1)
18SetHandle(Marshal.AllocCoTaskMem(length * sizeof (char)));
MS\Internal\AutomationProxies\SafeProcessHandle.cs (1)
32SetHandle(Misc.OpenProcess(NativeMethods.PROCESS_QUERY_INFORMATION | NativeMethods.PROCESS_VM_OPERATION | NativeMethods.PROCESS_VM_READ | NativeMethods.PROCESS_VM_WRITE, false, processId, hwnd));
MS\Internal\AutomationProxies\SafeThemeHandle.cs (1)
23SetHandle(preexistingHandle);
UIAutomationTypes (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsOther.cs (1)
556 base.SetHandle(existingHandle);