81 types derived from SafeHandle
Infrastructure.Common (1)
SafeKeychainHandle.cs (1)
13public class SafeKeychainHandle : SafeHandle
Microsoft.AspNetCore.Server.HttpSys (3)
_generated\12\Windows.Win32.HttpCloseRequestQueueSafeHandle.g.cs (1)
26 :SafeHandle {
_generated\72\Windows.Win32.LocalFreeSafeHandle.g.cs (1)
26 :SafeHandle {
NativeInterop\SafeNativeOverlapped.cs (1)
9internal sealed class SafeNativeOverlapped : SafeHandle
Microsoft.AspNetCore.Server.IIS (1)
Core\NativeSafeHandle.cs (1)
9internal sealed class NativeSafeHandle : SafeHandle, IValueTaskSource<object?>
NuGet.Packaging (2)
Signing\Cms\NativeMethods.cs (2)
131internal sealed class SafeCryptMsgHandle : SafeHandle 158internal sealed class SafeLocalAllocHandle : SafeHandle
PresentationCore (2)
MS\Win32\UnsafeNativeMethodsTablet.cs (2)
64internal class RecognizerSafeHandle : SafeHandle 98internal class ContextSafeHandle : SafeHandle
ReachFramework (2)
MS\Internal\Printing\Configuration\SafeWinSpoolPrinterHandle.cs (1)
13internal sealed class SafeWinSpoolPrinterHandle : SafeHandle
PrintConfig\PTProvider.cs (1)
40internal sealed class SafePTProviderHandle : System.Runtime.InteropServices.SafeHandle
System.Data.Odbc (2)
Common\System\Data\ProviderBase\DbBuffer.cs (1)
13internal abstract class DbBuffer : SafeHandle
System\Data\Odbc\OdbcHandle.cs (1)
12internal abstract class OdbcHandle : SafeHandle
System.Data.OleDb (5)
DbPropSet.cs (1)
12internal sealed class DBPropSet : SafeHandle
PropertyInfoSet.cs (1)
27internal sealed class PropertyInfoSet : SafeHandle
SafeHandles.cs (1)
18internal sealed class DualCoTaskMem : SafeHandle
System\Data\ProviderBase\DbBuffer.cs (1)
13internal abstract class DbBuffer : SafeHandle
System\Data\ProviderBase\WrappedIUnknown.cs (1)
15internal class WrappedIUnknown : SafeHandle
System.Diagnostics.EventLog (3)
System\Diagnostics\Reader\CoTaskMemSafeHandle.cs (1)
11internal sealed class CoTaskMemSafeHandle : SafeHandle
System\Diagnostics\Reader\CoTaskMemUnicodeSafeHandle.cs (1)
11internal sealed class CoTaskMemUnicodeSafeHandle : SafeHandle
System\Diagnostics\Reader\EventLogHandle.cs (1)
12internal sealed class EventLogHandle : SafeHandle
System.DirectoryServices (1)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeTokenHandle.cs (1)
12internal sealed class SafeTokenHandle : SafeHandle
System.DirectoryServices.AccountManagement (2)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeTokenHandle.cs (1)
12internal sealed class SafeTokenHandle : SafeHandle
System\DirectoryServices\AccountManagement\AuthZSet.cs (1)
520private sealed class SafeMemoryPtr : SafeHandle
System.Drawing.Common (1)
System\Drawing\Printing\PrintController.SafeDeviceModeHandle.cs (1)
19internal sealed class SafeDeviceModeHandle : SafeHandle
System.IO.Compression (5)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeZstdHandle.cs (4)
12internal sealed class SafeZstdCompressHandle : SafeHandle 87internal sealed class SafeZstdDecompressHandle : SafeHandle 162internal sealed class SafeZstdCDictHandle : SafeHandle 178internal sealed class SafeZstdDDictHandle : SafeHandle
src\runtime\src\libraries\Common\src\System\IO\Compression\ZLibNative.cs (1)
161public sealed class ZLibStreamHandle : SafeHandle
System.IO.Compression.Brotli (2)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBrotliHandle.cs (2)
9internal sealed class SafeBrotliEncoderHandle : SafeHandle 22internal sealed class SafeBrotliDecoderHandle : SafeHandle
System.IO.FileSystem.AccessControl (1)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeFindHandle.Windows.cs (1)
9internal sealed class SafeFindHandle : SafeHandle
System.Net.Quic (11)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs (1)
64internal sealed class SafeX509StackHandle : SafeHandle
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs (1)
72internal sealed class SafeX509StoreCtxHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs (2)
9internal sealed class SafeAsn1ObjectHandle : SafeHandle 29internal sealed class SafeAsn1OctetStringHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (1)
11internal sealed class SafeBioHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
10internal abstract class SafeInteriorHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (3)
10internal sealed class SafeX509Handle : SafeHandle 50internal sealed class SafeX509CrlHandle : SafeHandle 70internal sealed class SafeX509StoreHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs (1)
10internal sealed class SafeX509ExtensionHandle : SafeHandle
System\Net\Quic\Internal\MsQuicSafeHandle.cs (1)
11internal unsafe class MsQuicSafeHandle : SafeHandle
System.Net.Security (14)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (1)
80internal sealed class SafeSslContextHandle : SafeHandle, ISafeHandleCachable
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs (1)
64internal sealed class SafeX509StackHandle : SafeHandle
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs (1)
72internal sealed class SafeX509StoreCtxHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs (2)
9internal sealed class SafeAsn1ObjectHandle : SafeHandle 29internal sealed class SafeAsn1OctetStringHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (3)
14internal sealed class SafeGssNameHandle : SafeHandle 71internal sealed class SafeGssCredHandle : SafeHandle 156internal sealed class SafeGssContextHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (1)
11internal sealed class SafeBioHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
10internal abstract class SafeInteriorHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (3)
10internal sealed class SafeX509Handle : SafeHandle 50internal sealed class SafeX509CrlHandle : SafeHandle 70internal sealed class SafeX509StoreHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs (1)
10internal sealed class SafeX509ExtensionHandle : SafeHandle
System.Net.WebSockets (1)
src\runtime\src\libraries\Common\src\System\IO\Compression\ZLibNative.cs (1)
161public sealed class ZLibStreamHandle : SafeHandle
System.Private.CoreLib (2)
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeHandleMinusOneIsInvalid.cs (1)
10public abstract class SafeHandleMinusOneIsInvalid : SafeHandle
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeHandleZeroOrMinusOneIsInvalid.cs (1)
10public abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle
System.Security.AccessControl (1)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeTokenHandle.cs (1)
12internal sealed class SafeTokenHandle : SafeHandle
System.Security.Cryptography (5)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBCryptHandle.cs (1)
11internal abstract class SafeBCryptHandle : SafeHandle, IDisposable
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCrypt32Handle.cs (1)
12internal abstract class SafeCrypt32Handle<T> : SafeHandle where T : SafeHandle, new()
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeUnicodeStringHandle.cs (1)
13internal sealed class SafeUnicodeStringHandle : SafeHandle
System\Security\Cryptography\FixedMemoryKeyBox.cs (1)
8internal sealed unsafe class FixedMemoryKeyBox : SafeHandle
System\Security\Cryptography\OpenSsl.NotSupported.cs (1)
237public sealed class SafeEvpPKeyHandle : SafeHandle
System.Security.Cryptography.Pkcs (3)
Microsoft\Win32\SafeHandles\SafeCertContextHandle.cs (1)
12internal sealed class SafeCertContextHandle : SafeHandle
Microsoft\Win32\SafeHandles\SafeCryptMsgHandle.cs (1)
10internal sealed class SafeCryptMsgHandle : SafeHandle
Microsoft\Win32\SafeHandles\SafeProvOrNCryptKeyHandle.cs (1)
19internal abstract class SafeProvOrNCryptKeyHandle : SafeHandle
System.Security.Principal.Windows (2)
Microsoft\Win32\SafeHandles\SafeAccessTokenHandle.cs (1)
10public sealed class SafeAccessTokenHandle : SafeHandle
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaHandle.cs (1)
10internal sealed class SafeLsaHandle : SafeHandle
System.ServiceProcess.ServiceController (1)
Microsoft\Win32\SafeHandles\SafeServiceHandle.cs (1)
12internal sealed class SafeServiceHandle : SafeHandle
System.Speech (1)
Internal\HGlobalSafeHandle.cs (1)
11internal sealed class HGlobalSafeHandle : SafeHandle
System.Windows.Extensions (1)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCrypt32Handle.cs (1)
12internal abstract class SafeCrypt32Handle<T> : SafeHandle where T : SafeHandle, new()
System.Windows.Forms.Primitives (1)
Microsoft\Win32\SafeHandles\CoTaskMemSafeHandle.cs (1)
8internal sealed class CoTaskMemSafeHandle : SafeHandle
UIAutomationClient (5)
MS\Internal\Automation\SafeHandles.cs (3)
15internal sealed class SafeNodeHandle : SafeHandle 39internal sealed class SafePatternHandle : SafeHandle 62internal sealed class SafeEventHandle : SafeHandle
System\Windows\Automation\Condition.cs (1)
10internal sealed class SafeConditionMemoryHandle : SafeHandle
System\Windows\Automation\Text\TextRange.cs (1)
17internal sealed class SafeTextRangeHandle : SafeHandle
545 references to SafeHandle
Microsoft.AspNetCore.Cryptography.Internal (7)
_generated\0\LibraryImports.g.cs (4)
844public static partial bool CryptProtectMemory(global::System.Runtime.InteropServices.SafeHandle pData, uint cbData, uint dwFlags) 853global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __pData_native__marshaller = new(); 950public static partial bool CryptUnprotectMemory(global::System.Runtime.InteropServices.SafeHandle pData, uint cbData, uint dwFlags) 959global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __pData_native__marshaller = new();
CryptoUtil.cs (1)
30public static void AssertSafeHandleIsValid(SafeHandle safeHandle)
UnsafeNativeMethods.cs (2)
297SafeHandle pData, 340SafeHandle pData,
Microsoft.AspNetCore.DataProtection (2)
MemoryProtection.cs (2)
17public static void CryptProtectMemory(SafeHandle pBuffer, uint byteCount) 33public static void CryptUnprotectMemory(SafeHandle pBuffer, uint byteCount)
Microsoft.AspNetCore.Server.HttpSys (44)
_generated\76\Windows.Win32.PInvoke.ADVAPI32.dll.g.cs (2)
29 internal static unsafe winmdroot.Foundation.WIN32_ERROR GetSecurityInfo(SafeHandle handle, winmdroot.Security.Authorization.SE_OBJECT_TYPE ObjectType, winmdroot.Security.OBJECT_SECURITY_INFORMATION SecurityInfo, out winmdroot.Security.PSID ppsidOwner, out winmdroot.Security.PSID ppsidGroup, out winmdroot.Security.ACL* ppDacl, out winmdroot.Security.ACL* ppSacl, out winmdroot.Security.PSECURITY_DESCRIPTOR ppSecurityDescriptor) 69 internal static unsafe winmdroot.Foundation.WIN32_ERROR GetSecurityInfo(SafeHandle handle, winmdroot.Security.Authorization.SE_OBJECT_TYPE ObjectType, winmdroot.Security.OBJECT_SECURITY_INFORMATION SecurityInfo)
_generated\78\Windows.Win32.PInvoke.HTTPAPI.dll.g.cs (12)
57 internal static unsafe uint HttpCancelHttpRequest(SafeHandle RequestQueueHandle, ulong RequestId, [Optional] global::System.Threading.NativeOverlapped* Overlapped) 233 internal static unsafe uint HttpDelegateRequestEx(SafeHandle RequestQueueHandle, SafeHandle DelegateQueueHandle, ulong RequestId, ulong DelegateUrlGroupId, uint PropertyInfoSetSize, in winmdroot.Networking.HttpServer.HTTP_DELEGATE_REQUEST_PROPERTY_INFO PropertyInfoSet) 302 internal static unsafe uint HttpFindUrlGroupId(string FullyQualifiedUrl, SafeHandle RequestQueueHandle, out ulong UrlGroupId) 380 internal static unsafe uint HttpReceiveRequestEntityBody(SafeHandle RequestQueueHandle, ulong RequestId, uint Flags, Span<byte> EntityBuffer, out uint BytesReturned, [Optional] global::System.Threading.NativeOverlapped* Overlapped) 411 internal static unsafe uint HttpReceiveRequestEntityBody(SafeHandle RequestQueueHandle, ulong RequestId, uint Flags, Span<byte> EntityBuffer, [Optional] global::System.Threading.NativeOverlapped* Overlapped) 512 internal static unsafe uint HttpSendHttpResponse(SafeHandle RequestQueueHandle, ulong RequestId, uint Flags, in winmdroot.Networking.HttpServer.HTTP_RESPONSE_V2 HttpResponse, [Optional] winmdroot.Networking.HttpServer.HTTP_CACHE_POLICY? CachePolicy, out uint BytesSent, [Optional] global::System.Threading.NativeOverlapped* Overlapped, [Optional] winmdroot.Networking.HttpServer.HTTP_LOG_DATA? LogData) 545 internal static unsafe uint HttpSendHttpResponse(SafeHandle RequestQueueHandle, ulong RequestId, uint Flags, in winmdroot.Networking.HttpServer.HTTP_RESPONSE_V2 HttpResponse, [Optional] winmdroot.Networking.HttpServer.HTTP_CACHE_POLICY? CachePolicy, [Optional] global::System.Threading.NativeOverlapped* Overlapped, [Optional] winmdroot.Networking.HttpServer.HTTP_LOG_DATA? LogData) 623 internal static unsafe uint HttpSendResponseEntityBody(SafeHandle RequestQueueHandle, ulong RequestId, uint Flags, [Optional] ReadOnlySpan<winmdroot.Networking.HttpServer.HTTP_DATA_CHUNK> EntityChunks, out uint BytesSent, [Optional] global::System.Threading.NativeOverlapped* Overlapped, [Optional] winmdroot.Networking.HttpServer.HTTP_LOG_DATA? LogData) 655 internal static unsafe uint HttpSendResponseEntityBody(SafeHandle RequestQueueHandle, ulong RequestId, uint Flags, [Optional] ReadOnlySpan<winmdroot.Networking.HttpServer.HTTP_DATA_CHUNK> EntityChunks, [Optional] global::System.Threading.NativeOverlapped* Overlapped, [Optional] winmdroot.Networking.HttpServer.HTTP_LOG_DATA? LogData) 729 internal static unsafe uint HttpSetRequestQueueProperty(SafeHandle RequestQueueHandle, winmdroot.Networking.HttpServer.HTTP_SERVER_PROPERTY Property, ReadOnlySpan<byte> PropertyInformation) 820 internal static unsafe uint HttpShutdownRequestQueue(SafeHandle RequestQueueHandle)
_generated\79\Windows.Win32.PInvoke.KERNEL32.dll.g.cs (1)
44 internal static unsafe winmdroot.Foundation.BOOL SetFileCompletionNotificationModes(SafeHandle FileHandle, byte Flags)
_generated\93\LibraryImports.g.cs (14)
8internal static partial uint HttpReceiveRequestEntityBody(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong requestId, uint flags, nint pEntityBuffer, uint entityBufferLength, out uint bytesReturned, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped pOverlapped) 19global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new(); 58internal static unsafe partial uint HttpReceiveClientCertificate(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong connectionId, uint flags, Windows.Win32.Networking.HttpServer.HTTP_SSL_CLIENT_CERT_INFO* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped pOverlapped) 68global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new(); 105internal static unsafe partial uint HttpReceiveHttpRequest(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong requestId, uint flags, Windows.Win32.Networking.HttpServer.HTTP_REQUEST_V1* pRequestBuffer, uint requestBufferLength, uint* pBytesReturned, global::System.Threading.NativeOverlapped* pOverlapped) 113global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new(); 147internal static unsafe partial uint HttpSendHttpResponse(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong requestId, uint flags, Windows.Win32.Networking.HttpServer.HTTP_RESPONSE_V2* pHttpResponse, Windows.Win32.Networking.HttpServer.HTTP_CACHE_POLICY* pCachePolicy, uint* pBytesSent, nint pReserved1, uint Reserved2, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped pOverlapped, nint pLogData) 157global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new(); 194internal static unsafe partial uint HttpWaitForDisconnectEx(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong connectionId, uint reserved, global::System.Threading.NativeOverlapped* overlapped) 202global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new(); 236internal static unsafe partial uint HttpSendResponseEntityBody(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong requestId, uint flags, ushort entityChunkCount, Windows.Win32.Networking.HttpServer.HTTP_DATA_CHUNK* pEntityChunks, uint* pBytesSent, nint pReserved1, uint Reserved2, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped pOverlapped, nint pLogData) 246global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new(); 283internal static partial uint CancelIoEx(global::System.Runtime.InteropServices.SafeHandle handle, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped overlapped) 293global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __handle_native__marshaller = new();
NativeInterop\HttpApi.cs (11)
17internal static partial uint HttpReceiveRequestEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, IntPtr pEntityBuffer, uint entityBufferLength, out uint bytesReturned, SafeNativeOverlapped pOverlapped); 20internal static unsafe partial uint HttpReceiveClientCertificate(SafeHandle requestQueueHandle, ulong connectionId, uint flags, Windows.Win32.Networking.HttpServer.HTTP_SSL_CLIENT_CERT_INFO* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, SafeNativeOverlapped pOverlapped); 23internal static unsafe partial uint HttpReceiveHttpRequest(SafeHandle requestQueueHandle, ulong requestId, uint flags, Windows.Win32.Networking.HttpServer.HTTP_REQUEST_V1* pRequestBuffer, uint requestBufferLength, uint* pBytesReturned, NativeOverlapped* pOverlapped); 26internal static unsafe partial uint HttpSendHttpResponse(SafeHandle requestQueueHandle, ulong requestId, uint flags, Windows.Win32.Networking.HttpServer.HTTP_RESPONSE_V2* pHttpResponse, Windows.Win32.Networking.HttpServer.HTTP_CACHE_POLICY* pCachePolicy, uint* pBytesSent, IntPtr pReserved1, uint Reserved2, SafeNativeOverlapped pOverlapped, IntPtr pLogData); 29internal static unsafe partial uint HttpWaitForDisconnectEx(SafeHandle requestQueueHandle, ulong connectionId, uint reserved, NativeOverlapped* overlapped); 32internal static unsafe partial uint HttpSendResponseEntityBody(SafeHandle requestQueueHandle, ulong requestId, uint flags, ushort entityChunkCount, Windows.Win32.Networking.HttpServer.HTTP_DATA_CHUNK* pEntityChunks, uint* pBytesSent, IntPtr pReserved1, uint Reserved2, SafeNativeOverlapped pOverlapped, IntPtr pLogData); 35internal static partial uint CancelIoEx(SafeHandle handle, SafeNativeOverlapped overlapped); 37internal unsafe delegate uint HttpGetRequestPropertyInvoker(SafeHandle requestQueueHandle, ulong requestId, HTTP_REQUEST_PROPERTY propertyId, 40internal unsafe delegate uint HttpSetRequestPropertyInvoker(SafeHandle requestQueueHandle, ulong requestId, HTTP_REQUEST_PROPERTY propertyId, 55internal static unsafe uint HttpGetRequestProperty(SafeHandle requestQueueHandle, ulong requestId, HTTP_REQUEST_PROPERTY propertyId, 61internal static unsafe uint HttpSetRequestProperty(SafeHandle requestQueueHandle, ulong requestId, HTTP_REQUEST_PROPERTY propertyId,
NativeInterop\RequestQueue.cs (1)
139internal SafeHandle Handle { get; }
RequestProcessing\ClientCertLoader.cs (1)
47internal SafeHandle RequestQueueHandle => _requestContext.Server.RequestQueue.Handle;
RequestProcessing\RequestStream.cs (1)
36private SafeHandle RequestQueueHandle => RequestContext.Server.RequestQueue.Handle;
RequestProcessing\ResponseBody.cs (1)
34private SafeHandle RequestQueueHandle => RequestContext.Server.RequestQueue.Handle;
Microsoft.CodeAnalysis.Workspaces (9)
Shared\Extensions\SafeHandleExtensions.cs (5)
15/// Acquires a lease on a safe handle. The lease increments the reference count of the <see cref="SafeHandle"/> 20/// lease will permanently prevent the underlying <see cref="SafeHandle"/> from being released by the garbage 23/// <param name="handle">The <see cref="SafeHandle"/> to lease.</param> 26public static SafeHandleLease Lease(this SafeHandle handle) 34Debug.Assert(success, $"{nameof(SafeHandle.DangerousAddRef)} does not return when {nameof(success)} is false.");
Shared\Extensions\SafeHandleLease.cs (4)
11/// Represents a lease of a <see cref="SafeHandle"/>. 17private readonly SafeHandle? _handle; 19internal SafeHandleLease(SafeHandle handle) 23/// Releases the <see cref="SafeHandle"/> lease. The behavior of this method is unspecified if called more than
Microsoft.Win32.Registry (1)
System\Security\AccessControl\RegistrySecurity.cs (1)
98private static Exception? _HandleErrorCode(int errorCode, string? name, SafeHandle? handle, object? context)
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
721[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.SafeHandle))]
netstandard (1)
netstandard.cs (1)
1728[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.SafeHandle))]
PresentationCore (23)
System\Windows\Input\Cursor.cs (3)
91internal Cursor(SafeHandle cursorHandle ) 139internal SafeHandle Handle 340private SafeHandle _cursorHandle;
System\Windows\InterOp\CursorInteropHelper.cs (2)
40public static Cursor Create(SafeHandle cursorHandle) 61internal static Cursor CriticalCreate(SafeHandle cursorHandle)
System\Windows\Media\Effects\BevelBitmapEffect.cs (2)
27protected override unsafe SafeHandle CreateUnmanagedEffect() 36protected override void UpdateUnmanagedPropertyState(SafeHandle unmanagedEffect)
System\Windows\Media\Effects\BitmapEffect.cs (6)
41protected abstract void UpdateUnmanagedPropertyState(SafeHandle unmanagedEffect); 48protected abstract unsafe SafeHandle CreateUnmanagedEffect(); 58protected static unsafe void SetValue(SafeHandle effect, string propertyName, object value) 67protected static unsafe SafeHandle /* IMILBitmapEffect */ CreateBitmapEffectOuter() 78protected static unsafe void InitializeBitmapEffect(SafeHandle /*IMILBitmapEffect */ outerObject, 79SafeHandle/* IMILBitmapEffectPrimitive */ innerObject)
System\Windows\Media\Effects\BitmapEffectGroup.cs (2)
33protected override void UpdateUnmanagedPropertyState(SafeHandle unmanagedEffect) 42protected override unsafe SafeHandle CreateUnmanagedEffect()
System\Windows\Media\Effects\BlurBitmapEffect.cs (2)
27protected override unsafe SafeHandle CreateUnmanagedEffect() 36protected override void UpdateUnmanagedPropertyState(SafeHandle unmanagedEffect)
System\Windows\Media\Effects\DropShadowBitmapEffect.cs (2)
30protected override unsafe SafeHandle CreateUnmanagedEffect() 39protected override void UpdateUnmanagedPropertyState(SafeHandle unmanagedEffect)
System\Windows\Media\Effects\embossbitmapeffect.cs (2)
30protected override unsafe SafeHandle CreateUnmanagedEffect() 39protected override void UpdateUnmanagedPropertyState(SafeHandle unmanagedEffect)
System\Windows\Media\Effects\OuterGlowBitmapEffect.cs (2)
27protected override unsafe SafeHandle CreateUnmanagedEffect() 36protected override void UpdateUnmanagedPropertyState(SafeHandle unmanagedEffect)
ReachFramework (1)
MS\Internal\Printing\Configuration\HGlobalBuffer.cs (1)
48SafeHandle handle = this.Handle;
System.Console (17)
_generated\0\LibraryImports.g.cs (10)
461internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 470global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 593internal static unsafe partial int Read(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 601global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 634internal static unsafe partial int ReadFromNonblocking(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 642global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 675internal static unsafe partial int Write(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int bufferSize) 683global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 742internal static unsafe partial int WriteToNonblocking(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int bufferSize) 750global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
95where TSafeHandle : SafeHandle
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Poll.cs (1)
31internal static unsafe Error Poll(SafeHandle fd, PollEvents events, int timeout, out PollEvents triggered)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Read.cs (2)
22internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count); 25internal static unsafe partial int ReadFromNonblocking(SafeHandle fd, byte* buffer, int count);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Stat.cs (1)
60internal static partial int FStat(SafeHandle fd, out FileStatus output);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Write.cs (2)
22internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize); 28internal static unsafe partial int WriteToNonblocking(SafeHandle fd, byte* buffer, int bufferSize);
System.Data.OleDb (9)
UnsafeNativeMethods.cs (9)
222[In] /*tagDBBINDING[]*/SafeHandle rgBindings, 302[In] SafeHandle rgOptColumns, 337[In] SafeHandle? rgPropertyIDSets, 349[In] SafeHandle rgPropertySets); 455[In] SafeHandle? rgPropertyIDSets, 462[In] SafeHandle rgPropertyIDSets, 470[In] SafeHandle rgPropertySets); 703[In] SafeHandle rghRows, 724[In] SafeHandle? rgPropertyIDSets,
System.Diagnostics.FileVersionInfo (3)
_generated\0\LibraryImports.g.cs (2)
31internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 40global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Stat.cs (1)
60internal static partial int FStat(SafeHandle fd, out FileStatus output);
System.Diagnostics.PerformanceCounter (6)
_generated\0\LibraryImports.g.cs (4)
360internal static partial bool DuplicateHandle(nint hSourceProcessHandle, global::System.Runtime.InteropServices.SafeHandle hSourceHandle, nint hTargetProcess, out global::Microsoft.Win32.SafeHandles.SafeWaitHandle targetHandle, int dwDesiredAccess, bool bInheritHandle, int dwOptions) 374global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __hSourceHandle_native__marshaller = new(); 759internal static partial nuint VirtualQuery(global::System.Runtime.InteropServices.SafeHandle lpAddress, ref global::Interop.Kernel32.MEMORY_BASIC_INFORMATION lpBuffer, nuint dwLength) 767global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __lpAddress_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.DuplicateHandle_SafeWaitHandle.cs (1)
17SafeHandle hSourceHandle,
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.VirtualQuery.cs (1)
14SafeHandle lpAddress,
System.Diagnostics.Process (36)
_generated\0\LibraryImports.g.cs (12)
70internal static partial int SetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, int isNonBlocking) 78global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 114internal static partial int GetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, out bool isNonBlocking) 124global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 163internal static partial int SetFD(global::System.Runtime.InteropServices.SafeHandle fd, int flags) 171global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 207internal static partial int GetFD(global::System.Runtime.InteropServices.SafeHandle fd) 215global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 278internal static unsafe partial int Read(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 286global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 319internal static unsafe partial int ReadFromNonblocking(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 327global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
Microsoft\Win32\SafeHandles\SafeProcessHandle.cs (1)
169startInfo.ThrowIfInvalid(out bool anyRedirection, out SafeHandle[]? inheritedHandles);
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (3)
205private static SafeProcessHandle StartCore(ProcessStartInfo startInfo, SafeFileHandle? stdinHandle, SafeFileHandle? stdoutHandle, SafeFileHandle? stderrHandle, SafeHandle[]? inheritedHandlesSnapshot = null) 209SafeFileHandle? stderrHandle, SafeHandle[]? inheritedHandles, out ProcessWaitState.Holder? waitStateHolder) 433bool usesTerminal, SafeHandle[]? inheritedHandles, out ProcessWaitState.Holder? waitStateHolder, bool throwOnNoExec = true)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Fcntl.cs (4)
17internal static partial int SetIsNonBlocking(SafeHandle fd, int isNonBlocking); 20internal static partial int GetIsNonBlocking(SafeHandle fd, [MarshalAs(UnmanagedType.Bool)] out bool isNonBlocking); 23internal static partial int SetFD(SafeHandle fd, int flags); 26internal static partial int GetFD(SafeHandle fd);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (2)
19ProcessStartInfo startInfo, SafeHandle[]? inheritedHandles = null) 62SafeHandle handle = inheritedHandles[i];
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Poll.cs (1)
31internal static unsafe Error Poll(SafeHandle fd, PollEvents events, int timeout, out PollEvents triggered)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Read.cs (2)
22internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count); 25internal static unsafe partial int ReadFromNonblocking(SafeHandle fd, byte* buffer, int count);
System\Diagnostics\Process.cs (2)
1273startInfo.ThrowIfInvalid(out bool anyRedirection, out SafeHandle[]? inheritedHandles); 1462startInfo.ThrowIfInvalid(out bool anyRedirection, out SafeHandle[]? inheritedHandles);
System\Diagnostics\Process.Unix.cs (1)
428private bool StartCore(ProcessStartInfo startInfo, SafeFileHandle? stdinHandle, SafeFileHandle? stdoutHandle, SafeFileHandle? stderrHandle, SafeHandle[]? inheritedHandles)
System\Diagnostics\ProcessStartInfo.cs (8)
289/// A list of <see cref="SafeHandle"/> objects to be explicitly inherited by the child process, 292public IList<SafeHandle>? InheritedHandles { get; set; } 430internal void ThrowIfInvalid(out bool anyRedirection, out SafeHandle[]? inheritedHandles) 502IList<SafeHandle> list = InheritedHandles; 503SafeHandle[] snapshot = new SafeHandle[list.Count]; 506SafeHandle? handle = list[i]; 584SafeFileHandle? stderrHandle, SafeHandle[]? inheritedHandles = null)
System.Formats.Tar (4)
_generated\0\LibraryImports.g.cs (2)
299internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 308global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
95where TSafeHandle : SafeHandle
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Stat.cs (1)
60internal static partial int FStat(SafeHandle fd, out FileStatus output);
System.IO.Compression (3)
_generated\0\LibraryImports.g.cs (2)
128internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 137global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Stat.cs (1)
60internal static partial int FStat(SafeHandle fd, out FileStatus output);
System.IO.FileSystem.AccessControl (1)
System\Security\AccessControl\FileSystemSecurity.cs (1)
30private static Exception? _HandleErrorCode(int errorCode, string? name, SafeHandle? handle, object? context)
System.IO.FileSystem.DriveInfo (1)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
95where TSafeHandle : SafeHandle
System.IO.FileSystem.Watcher (11)
_generated\0\LibraryImports.g.cs (6)
7internal static unsafe partial int Read(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 15global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 48internal static unsafe partial int ReadFromNonblocking(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 56global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 296internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 305global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
95where TSafeHandle : SafeHandle
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Poll.cs (1)
31internal static unsafe Error Poll(SafeHandle fd, PollEvents events, int timeout, out PollEvents triggered)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Read.cs (2)
22internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count); 25internal static unsafe partial int ReadFromNonblocking(SafeHandle fd, byte* buffer, int count);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Stat.cs (1)
60internal static partial int FStat(SafeHandle fd, out FileStatus output);
System.IO.MemoryMappedFiles (13)
_generated\0\LibraryImports.g.cs (8)
88internal static partial int SetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, int isNonBlocking) 96global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 132internal static partial int GetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, out bool isNonBlocking) 142global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 181internal static partial int SetFD(global::System.Runtime.InteropServices.SafeHandle fd, int flags) 189global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 225internal static partial int GetFD(global::System.Runtime.InteropServices.SafeHandle fd) 233global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
95where TSafeHandle : SafeHandle
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Fcntl.cs (4)
17internal static partial int SetIsNonBlocking(SafeHandle fd, int isNonBlocking); 20internal static partial int GetIsNonBlocking(SafeHandle fd, [MarshalAs(UnmanagedType.Bool)] out bool isNonBlocking); 23internal static partial int SetFD(SafeHandle fd, int flags); 26internal static partial int GetFD(SafeHandle fd);
System.IO.Pipes (23)
_generated\0\LibraryImports.g.cs (12)
187internal static partial int SetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, int isNonBlocking) 195global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 231internal static partial int GetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, out bool isNonBlocking) 241global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 280internal static partial int SetFD(global::System.Runtime.InteropServices.SafeHandle fd, int flags) 288global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 324internal static partial int GetFD(global::System.Runtime.InteropServices.SafeHandle fd) 332global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 758internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 767global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 934internal static partial int GetPeerID(global::System.Runtime.InteropServices.SafeHandle socket, out uint euid) 943global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new();
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (2)
26private SafeHandle? _pipeSocketHandle; 37internal SafeHandle? PipeSocketHandle => _pipeSocketHandle;
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
95where TSafeHandle : SafeHandle
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Fcntl.cs (4)
17internal static partial int SetIsNonBlocking(SafeHandle fd, int isNonBlocking); 20internal static partial int GetIsNonBlocking(SafeHandle fd, [MarshalAs(UnmanagedType.Bool)] out bool isNonBlocking); 23internal static partial int SetFD(SafeHandle fd, int flags); 26internal static partial int GetFD(SafeHandle fd);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPeerID.cs (1)
12internal static partial int GetPeerID(SafeHandle socket, out uint euid);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Stat.cs (1)
60internal static partial int FStat(SafeHandle fd, out FileStatus output);
System\IO\Pipes\NamedPipeServerStream.Unix.cs (2)
161SafeHandle? handle = InternalHandle?.PipeSocketHandle; 200SafeHandle? handle = InternalHandle?.PipeSocketHandle;
System.IO.Ports (8)
_generated\0\LibraryImports.g.cs (4)
518internal static unsafe partial int Read(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 526global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 560internal static unsafe partial int Write(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int bufferSize) 568global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
95where TSafeHandle : SafeHandle
src\runtime\src\libraries\Common\src\Interop\Unix\System.IO.Ports.Native\Interop.Serial.cs (3)
33internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count); 45internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize); 66internal static unsafe Error Poll(SafeHandle fd, PollEvents events, int timeout, out PollEvents triggered)
System.Net.Http (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
System.Net.Http.WinHttpHandler (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
System.Net.HttpListener (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
System.Net.Mail (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
System.Net.NameResolution (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
System.Net.NetworkInformation (3)
_generated\0\LibraryImports.g.cs (2)
141public static unsafe partial global::Interop.Error ReadEvents(global::System.Runtime.InteropServices.SafeHandle socket, delegate* unmanaged<nint, global::Interop.Sys.NetworkChangeKind, void> onNetworkChange) 148global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.NetworkChange.cs (1)
23public static unsafe partial Error ReadEvents(SafeHandle socket, delegate* unmanaged<IntPtr, NetworkChangeKind, void> onNetworkChange);
System.Net.Ping (3)
_generated\0\LibraryImports.g.cs (2)
31internal static unsafe partial global::System.Net.Sockets.SocketError ReceiveSocketError(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.MessageHeader* messageHeader) 38global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReceiveSocketError.cs (1)
13internal static unsafe partial SocketError ReceiveSocketError(SafeHandle socket, MessageHeader* messageHeader);
System.Net.Primitives (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
System.Net.Quic (16)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
91internal static void CheckValidOpenSslHandle(SafeHandle handle)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (3)
13private SafeHandle? _parent; 27SafeHandle parent = _parent; 48internal void TransferOwnershipToParent(SafeHandle parent)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (4)
13internal static class SafeHandleCache<T> where T : SafeHandle 19/// or it should override <see cref="SafeHandle.Dispose(bool)"/> to prevent disposal when the 20/// instance represents an invalid handle: <see cref="System.Runtime.InteropServices.SafeHandle.IsInvalid"/> returns <see language="true"/>. 49internal static bool IsCachedInvalidHandle(SafeHandle handle)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (5)
12private SafeHandle? _parent; 21SafeHandle? parent = _parent; 42internal void SetParent(SafeHandle parent) 55where TExteriorHandle : SafeHandle 72where TExteriorHandle : SafeHandle
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
src\runtime\src\libraries\Common\src\System\Net\SafeHandleCache.cs (2)
28/// cref="SafeHandle"/>. The purpose of the cache is to allow reuse of 34internal class SafeHandleCache<TKey, THandle> where TKey : IEquatable<TKey> where THandle : SafeHandle, ISafeHandleCachable
System.Net.Requests (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
System.Net.Security (17)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
91internal static void CheckValidOpenSslHandle(SafeHandle handle)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (3)
13private SafeHandle? _parent; 27SafeHandle parent = _parent; 48internal void TransferOwnershipToParent(SafeHandle parent)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (4)
13internal static class SafeHandleCache<T> where T : SafeHandle 19/// or it should override <see cref="SafeHandle.Dispose(bool)"/> to prevent disposal when the 20/// instance represents an invalid handle: <see cref="System.Runtime.InteropServices.SafeHandle.IsInvalid"/> returns <see language="true"/>. 49internal static bool IsCachedInvalidHandle(SafeHandle handle)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (5)
12private SafeHandle? _parent; 21SafeHandle? parent = _parent; 42internal void SetParent(SafeHandle parent) 55where TExteriorHandle : SafeHandle 72where TExteriorHandle : SafeHandle
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
src\runtime\src\libraries\Common\src\System\Net\SafeHandleCache.cs (2)
28/// cref="SafeHandle"/>. The purpose of the cache is to allow reuse of 34internal class SafeHandleCache<TKey, THandle> where TKey : IEquatable<TKey> where THandle : SafeHandle, ISafeHandleCachable
System\Net\Security\SslAuthenticationOptions.OpenSsl.cs (1)
16internal System.Runtime.InteropServices.SafeHandle? SafeSslHandle { get; set; }
System.Net.Sockets (120)
_generated\0\LibraryImports.g.cs (78)
39internal static partial global::Interop.Error TryChangeSocketEventRegistration(nint port, global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.SocketEvents currentEvents, global::Interop.Sys.SocketEvents newEvents, nint data) 46global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 116internal static unsafe partial global::Interop.Error Accept(global::System.Runtime.InteropServices.SafeHandle socket, byte* socketAddress, int* socketAddressLen, nint* acceptedFd) 123global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 153private static partial global::Interop.Error Bind(global::System.Runtime.InteropServices.SafeHandle socket, global::System.Net.Sockets.ProtocolType socketProtocolType, global::System.ReadOnlySpan<byte> socketAddress, int socketAddressLen) 160global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 218internal static unsafe partial global::Interop.Error Connect(global::System.Runtime.InteropServices.SafeHandle socket, byte* socketAddress, int socketAddressLen) 225global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 255internal static unsafe partial global::Interop.Error Connectx(global::System.Runtime.InteropServices.SafeHandle socket, byte* socketAddress, int socketAddressLen, global::System.Span<byte> buffer, int bufferLen, int enableTfo, int* sent) 262global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 325internal static partial int SetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, int isNonBlocking) 333global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 369internal static partial int GetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, out bool isNonBlocking) 379global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 418internal static partial int SetFD(global::System.Runtime.InteropServices.SafeHandle fd, int flags) 426global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 462internal static partial int GetFD(global::System.Runtime.InteropServices.SafeHandle fd) 470global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 541internal static unsafe partial global::Interop.Error GetBytesAvailable(global::System.Runtime.InteropServices.SafeHandle socket, int* available) 548global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 578internal static unsafe partial global::Interop.Error GetAtOutOfBandMark(global::System.Runtime.InteropServices.SafeHandle socket, int* atMark) 585global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 631internal static unsafe partial global::Interop.Error GetPeerName(global::System.Runtime.InteropServices.SafeHandle socket, byte* socketAddress, int* socketAddressLen) 638global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 668internal static unsafe partial global::Interop.Error GetSocketErrorOption(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Error* socketError) 675global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 754internal static unsafe partial global::Interop.Error GetSockName(global::System.Runtime.InteropServices.SafeHandle socket, byte* socketAddress, int* socketAddressLen) 761global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 791internal static unsafe partial global::Interop.Error GetSockOpt(global::System.Runtime.InteropServices.SafeHandle socket, global::System.Net.Sockets.SocketOptionLevel optionLevel, global::System.Net.Sockets.SocketOptionName optionName, byte* optionValue, int* optionLen) 798global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 836internal static unsafe partial global::Interop.Error GetRawSockOpt(global::System.Runtime.InteropServices.SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int* optionLen) 843global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 909internal static unsafe partial global::Interop.Error GetLingerOption(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.LingerOption* option) 916global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 946internal static unsafe partial global::Interop.Error SetLingerOption(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.LingerOption* option) 953global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 991internal static partial global::Interop.Error SendFile(global::System.Runtime.InteropServices.SafeHandle out_fd, global::System.Runtime.InteropServices.SafeHandle in_fd, long offset, long count, out long sent) 1001global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __in_fd_native__marshaller = new(); 1002global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __out_fd_native__marshaller = new(); 1040internal static partial global::Interop.Error SetSendTimeout(global::System.Runtime.InteropServices.SafeHandle socket, int millisecondsTimeout) 1047global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1077internal static partial global::Interop.Error SetReceiveTimeout(global::System.Runtime.InteropServices.SafeHandle socket, int millisecondsTimeout) 1084global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1114internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 1123global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 1246internal static partial global::Interop.Error Listen(global::System.Runtime.InteropServices.SafeHandle socket, int backlog) 1253global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1283internal static unsafe partial global::Interop.Error GetIPv4MulticastOption(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.MulticastOption multicastOption, global::Interop.Sys.IPv4MulticastOption* option) 1290global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1320internal static unsafe partial global::Interop.Error SetIPv4MulticastOption(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.MulticastOption multicastOption, global::Interop.Sys.IPv4MulticastOption* option) 1327global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1357internal static unsafe partial global::Interop.Error GetIPv6MulticastOption(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.MulticastOption multicastOption, global::Interop.Sys.IPv6MulticastOption* option) 1364global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1394internal static unsafe partial global::Interop.Error SetIPv6MulticastOption(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.MulticastOption multicastOption, global::Interop.Sys.IPv6MulticastOption* option) 1401global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1447internal static unsafe partial int Read(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 1455global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 1488internal static unsafe partial int ReadFromNonblocking(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 1496global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 1529internal static unsafe partial global::Interop.Error Receive(global::System.Runtime.InteropServices.SafeHandle socket, byte* buffer, int bufferLen, global::System.Net.Sockets.SocketFlags flags, int* received) 1536global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1566internal static unsafe partial global::Interop.Error ReceiveMessage(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.MessageHeader* messageHeader, global::System.Net.Sockets.SocketFlags flags, long* received) 1573global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1603internal static unsafe partial global::Interop.Error Send(global::System.Runtime.InteropServices.SafeHandle socket, byte* buffer, int bufferLen, global::System.Net.Sockets.SocketFlags flags, int* sent) 1610global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1668internal static unsafe partial global::Interop.Error SendMessage(global::System.Runtime.InteropServices.SafeHandle socket, global::Interop.Sys.MessageHeader* messageHeader, global::System.Net.Sockets.SocketFlags flags, long* sent) 1675global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1705internal static unsafe partial global::Interop.Error SetSockOpt(global::System.Runtime.InteropServices.SafeHandle socket, global::System.Net.Sockets.SocketOptionLevel optionLevel, global::System.Net.Sockets.SocketOptionName optionName, byte* optionValue, int optionLen) 1712global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1750internal static unsafe partial global::Interop.Error SetRawSockOpt(global::System.Runtime.InteropServices.SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int optionLen) 1757global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1787internal static partial global::Interop.Error Shutdown(global::System.Runtime.InteropServices.SafeHandle socket, global::System.Net.Sockets.SocketShutdown how) 1794global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new(); 1938internal static unsafe partial int Write(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int bufferSize) 1946global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 2005internal static unsafe partial int WriteToNonblocking(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int bufferSize) 2013global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Accept.cs (1)
12internal static unsafe partial Error Accept(SafeHandle socket, byte* socketAddress, int* socketAddressLen, IntPtr* acceptedFd);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Bind.cs (2)
13private static partial Error Bind(SafeHandle socket, ProtocolType socketProtocolType, ReadOnlySpan<byte> socketAddress, int socketAddressLen); 16SafeHandle socket, ProtocolType socketProtocolType, ReadOnlySpan<byte> socketAddress)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Connect.cs (2)
12internal static unsafe partial Error Connect(SafeHandle socket, byte* socketAddress, int socketAddressLen); 15internal static unsafe partial Error Connectx(SafeHandle socket, byte* socketAddress, int socketAddressLen, Span<byte> buffer, int bufferLen, int enableTfo, int* sent);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Fcntl.cs (4)
17internal static partial int SetIsNonBlocking(SafeHandle fd, int isNonBlocking); 20internal static partial int GetIsNonBlocking(SafeHandle fd, [MarshalAs(UnmanagedType.Bool)] out bool isNonBlocking); 23internal static partial int SetFD(SafeHandle fd, int flags); 26internal static partial int GetFD(SafeHandle fd);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetBytesAvailable.cs (2)
12internal static unsafe partial Error GetBytesAvailable(SafeHandle socket, int* available); 15internal static unsafe partial Error GetAtOutOfBandMark(SafeHandle socket, int* atMark);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPeerName.cs (1)
12internal static unsafe partial Error GetPeerName(SafeHandle socket, byte* socketAddress, int* socketAddressLen);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetSocketErrorOption.cs (1)
13internal static unsafe partial Error GetSocketErrorOption(SafeHandle socket, Error* socketError);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetSockName.cs (1)
12internal static unsafe partial Error GetSockName(SafeHandle socket, byte* socketAddress, int* socketAddressLen);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetSockOpt.cs (2)
13internal static unsafe partial Error GetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen); 19internal static unsafe partial Error GetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int* optionLen);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.LingerOption.cs (2)
19internal static unsafe partial Error GetLingerOption(SafeHandle socket, LingerOption* option); 22internal static unsafe partial Error SetLingerOption(SafeHandle socket, LingerOption* option);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Listen.cs (1)
12internal static partial Error Listen(SafeHandle socket, int backlog);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.MulticastOption.cs (4)
35internal static unsafe partial Error GetIPv4MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv4MulticastOption* option); 38internal static unsafe partial Error SetIPv4MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv4MulticastOption* option); 41internal static unsafe partial Error GetIPv6MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv6MulticastOption* option); 44internal static unsafe partial Error SetIPv6MulticastOption(SafeHandle socket, MulticastOption multicastOption, IPv6MulticastOption* option);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Poll.cs (1)
31internal static unsafe Error Poll(SafeHandle fd, PollEvents events, int timeout, out PollEvents triggered)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Read.cs (2)
22internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count); 25internal static unsafe partial int ReadFromNonblocking(SafeHandle fd, byte* buffer, int count);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Receive.cs (1)
13internal static unsafe partial Error Receive(SafeHandle socket, byte* buffer, int bufferLen, SocketFlags flags, int* received);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReceiveMessage.cs (1)
13internal static unsafe partial Error ReceiveMessage(SafeHandle socket, MessageHeader* messageHeader, SocketFlags flags, long* received);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Send.cs (1)
13internal static unsafe partial Error Send(SafeHandle socket, byte* buffer, int bufferLen, SocketFlags flags, int* sent);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.SendFile.cs (2)
11internal static partial Error SendFile(SafeHandle out_fd, SafeHandle in_fd, long offset, long count, out long sent);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.SendMessage.cs (1)
13internal static unsafe partial Error SendMessage(SafeHandle socket, MessageHeader* messageHeader, SocketFlags flags, long* sent);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.SetReceiveTimeout.cs (1)
13internal static partial Error SetReceiveTimeout(SafeHandle socket, int millisecondsTimeout);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.SetSendTimeout.cs (1)
13internal static partial Error SetSendTimeout(SafeHandle socket, int millisecondsTimeout);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.SetSockOpt.cs (2)
13internal static unsafe partial Error SetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen); 19internal static unsafe partial Error SetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int optionLen);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Shutdown.cs (1)
13internal static partial Error Shutdown(SafeHandle socket, SocketShutdown how);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.SocketEvent.cs (1)
43internal static partial Error TryChangeSocketEventRegistration(IntPtr port, SafeHandle socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Stat.cs (1)
60internal static partial int FStat(SafeHandle fd, out FileStatus output);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Write.cs (2)
22internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize); 28internal static unsafe partial int WriteToNonblocking(SafeHandle fd, byte* buffer, int bufferSize);
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
System.Net.WebSockets (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (1)
141if (value is SafeHandle handle)
System.Private.CoreLib (70)
_generated\2\LibraryImports.g.cs (36)
2206internal static partial int SetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, int isNonBlocking) 2214global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 2250internal static partial int GetIsNonBlocking(global::System.Runtime.InteropServices.SafeHandle fd, out bool isNonBlocking) 2260global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 2299internal static partial int SetFD(global::System.Runtime.InteropServices.SafeHandle fd, int flags) 2307global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 2343internal static partial int GetFD(global::System.Runtime.InteropServices.SafeHandle fd) 2351global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 3192internal static partial int FChflags(global::System.Runtime.InteropServices.SafeHandle fd, uint flags) 3200global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 3295internal static partial int LockFileRegion(global::System.Runtime.InteropServices.SafeHandle fd, long offset, long length, global::Interop.Sys.LockType lockType) 3303global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 3891internal static unsafe partial int PRead(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int bufferSize, long fileOffset) 3899global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 3932internal static unsafe partial long ReadV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount) 3940global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 3973internal static unsafe partial long PReadV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount, long fileOffset) 3981global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 4014internal static unsafe partial int PWrite(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int bufferSize, long fileOffset) 4022global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 4055internal static unsafe partial long PWriteV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount, long fileOffset) 4063global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 4096internal static unsafe partial int Read(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 4104global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 4137internal static unsafe partial int ReadFromNonblocking(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count) 4145global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 4178internal static unsafe partial long WriteV(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.IOVector* vectors, int vectorCount) 4186global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 4432internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 4441global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 4879internal static unsafe partial int FUTimens(global::System.Runtime.InteropServices.SafeHandle fd, global::Interop.Sys.TimeSpec* times) 4887global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 4920internal static unsafe partial int Write(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int bufferSize) 4928global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new(); 4987internal static unsafe partial int WriteToNonblocking(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int bufferSize) 4995global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
95where TSafeHandle : SafeHandle
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Fcntl.cs (4)
17internal static partial int SetIsNonBlocking(SafeHandle fd, int isNonBlocking); 20internal static partial int GetIsNonBlocking(SafeHandle fd, [MarshalAs(UnmanagedType.Bool)] out bool isNonBlocking); 23internal static partial int SetFD(SafeHandle fd, int flags); 26internal static partial int GetFD(SafeHandle fd);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.LChflags.cs (1)
21internal static partial int FChflags(SafeHandle fd, uint flags);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.LockFileRegion.cs (1)
18internal static partial int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.PRead.cs (1)
11internal static unsafe partial int PRead(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.PReadV.cs (1)
11internal static unsafe partial long PReadV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.PWrite.cs (1)
11internal static unsafe partial int PWrite(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.PWriteV.cs (1)
11internal static unsafe partial long PWriteV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Read.cs (2)
22internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count); 25internal static unsafe partial int ReadFromNonblocking(SafeHandle fd, byte* buffer, int count);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadV.cs (1)
11internal static unsafe partial long ReadV(SafeHandle fd, IOVector* vectors, int vectorCount);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Stat.cs (1)
60internal static partial int FStat(SafeHandle fd, out FileStatus output);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.UTimensat.cs (1)
29internal static unsafe partial int FUTimens(SafeHandle fd, TimeSpec* times);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.Write.cs (2)
22internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize); 28internal static unsafe partial int WriteToNonblocking(SafeHandle fd, byte* buffer, int bufferSize);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.WriteV.cs (1)
11internal static unsafe partial long WriteV(SafeHandle fd, IOVector* vectors, int vectorCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (3)
1352/// Initializes the underlying handle of a newly created <see cref="SafeHandle" /> to the provided value. 1354/// <param name="safeHandle">The <see cref="SafeHandle"/> instance to update.</param> 1356public static void InitHandle(SafeHandle safeHandle, IntPtr handle)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SafeHandleMarshaller.cs (7)
9/// A marshaller for <see cref="SafeHandle"/>-derived types that marshals the handle following the lifetime rules for <see cref="SafeHandle"/>s. 11/// <typeparam name="T">The <see cref="SafeHandle"/>-derived type.</typeparam> 15public static class SafeHandleMarshaller<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] T> where T : SafeHandle 18/// Custom marshaller to marshal a <see cref="SafeHandle"/> as its underlying handle value. 54/// Custom marshaller to marshal a <see cref="SafeHandle"/> as its underlying handle value. 148/// Custom marshaller to marshal a <see cref="SafeHandle"/> as its underlying handle value.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPool.Unix.cs (1)
108public static bool BindHandle(SafeHandle osHandle) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolBoundHandle.PlatformNotSupported.cs (2)
11public SafeHandle Handle => null!; 18public static ThreadPoolBoundHandle BindHandle(SafeHandle handle)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandleExtensions.cs (2)
14/// <returns>A <see cref="Runtime.InteropServices.SafeHandle"/> representing the native operating system handle.</returns> 26/// <param name="value">A <see cref="Runtime.InteropServices.SafeHandle"/> representing the native operating system handle.</param>
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
706[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.SafeHandle))]
System.Runtime.Handles (1)
System.Runtime.Handles.cs (1)
7[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.SafeHandle))]
System.Runtime.InteropServices (1)
src\runtime\artifacts\obj\System.Runtime.InteropServices\Release\net11.0\System.Runtime.InteropServices.Forwards.cs (1)
135[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.SafeHandle))]
System.Security.AccessControl (19)
_generated\0\LibraryImports.g.cs (4)
142internal static unsafe partial uint GetSecurityInfoByHandle(global::System.Runtime.InteropServices.SafeHandle handle, uint objectType, uint securityInformation, nint* sidOwner, nint* sidGroup, nint* dacl, nint* sacl, nint* securityDescriptor) 149global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __handle_native__marshaller = new(); 180internal static partial uint SetSecurityInfoByHandle(global::System.Runtime.InteropServices.SafeHandle handle, uint objectType, uint securityInformation, byte[] owner, byte[] group, byte[] dacl, byte[] sacl) 188global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __handle_native__marshaller = new();
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetSecurityInfoByHandle.cs (1)
14SafeHandle handle,
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.SetSecurityInfoByHandle.cs (1)
14SafeHandle handle,
System\Security\AccessControl\NativeObjectSecurity.cs (7)
27protected internal delegate System.Exception? ExceptionFromErrorCode(int errorCode, string? name, SafeHandle? handle, object? context); 64protected NativeObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle? handle, AccessControlSections includeSections, ExceptionFromErrorCode? exceptionFromErrorCode, object? exceptionContext) 69protected NativeObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle? handle, AccessControlSections includeSections) 74private static CommonSecurityDescriptor CreateInternal(ResourceType resourceType, bool isContainer, string? name, SafeHandle? handle, AccessControlSections includeSections, bool createByName, ExceptionFromErrorCode? exceptionFromErrorCode, object? exceptionContext) 155private void Persist(string? name, SafeHandle? handle, AccessControlSections includeSections, object? exceptionContext) 318protected sealed override void Persist(SafeHandle handle, AccessControlSections includeSections) 323protected void Persist(SafeHandle handle, AccessControlSections includeSections, object? exceptionContext)
System\Security\AccessControl\ObjectSecurity.cs (1)
291protected virtual void Persist(SafeHandle handle, AccessControlSections includeSections)
System\Security\AccessControl\ObjectSecurityT.cs (3)
193protected ObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle? safeHandle, AccessControlSections includeSections) 197protected ObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle? safeHandle, AccessControlSections includeSections, ExceptionFromErrorCode? exceptionFromErrorCode, object? exceptionContext) 259protected internal void Persist(SafeHandle handle)
System\Security\AccessControl\Win32.cs (2)
60SafeHandle? handle, 192SafeHandle? handle,
System.Security.Cryptography (22)
_generated\0\LibraryImports.g.cs (4)
690public static partial bool CryptSetProvParam(global::System.Runtime.InteropServices.SafeHandle safeProvHandle, global::Interop.Advapi32.CryptProvParam dwParam, nint pbData, int dwFlags) 699global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __safeProvHandle_native__marshaller = new(); 784public static partial bool CryptGetProvParam(global::System.Runtime.InteropServices.SafeHandle safeProvHandle, global::Interop.Advapi32.CryptProvParam dwParam, nint pbData, ref int dwDataLen, int dwFlags) 793global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __safeProvHandle_native__marshaller = new();
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (3)
69private SafeHandle? _parentHandle; 77protected SafeNCryptHandle(IntPtr handle, SafeHandle parentHandle) 368public SafeNCryptKeyHandle(IntPtr handle, SafeHandle parentHandle)
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.CryptGetProvParam.cs (3)
29SafeHandle safeProvHandle, 47SafeHandle safeProvHandle, 54SafeHandle safeProvHandle,
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCrypt32Handle.cs (1)
12internal abstract class SafeCrypt32Handle<T> : SafeHandle where T : SafeHandle, new()
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (4)
13internal static class SafeHandleCache<T> where T : SafeHandle 19/// or it should override <see cref="SafeHandle.Dispose(bool)"/> to prevent disposal when the 20/// instance represents an invalid handle: <see cref="System.Runtime.InteropServices.SafeHandle.IsInvalid"/> returns <see language="true"/>. 49internal static bool IsCachedInvalidHandle(SafeHandle handle)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\CertificateHelpers.Windows.cs (1)
22private static partial SafeNCryptKeyHandle CreateSafeNCryptKeyHandle(IntPtr handle, SafeHandle parentHandle);
System\Security\Cryptography\X509Certificates\CertificateHelpers.Windows.cs (1)
19private static partial SafeNCryptKeyHandle CreateSafeNCryptKeyHandle(IntPtr handle, SafeHandle parentHandle) =>
System\Security\Cryptography\X509Certificates\ChainPal.Windows.BuildChain.cs (2)
42using (SafeHandle applicationPolicyOids = applicationPolicy!.ToLpstrArray(out applicationPolicyCount)) 52using (SafeHandle certificatePolicyOids = certificatePolicy!.ToLpstrArray(out certificatePolicyCount))
System\Security\Cryptography\X509Certificates\IStorePal.cs (1)
13SafeHandle? SafeHandle { get; }
System\Security\Cryptography\X509Certificates\StorePal.Windows.cs (1)
93SafeHandle IStorePal.SafeHandle
System\Security\Cryptography\X509Certificates\WindowsHelpers.cs (1)
21public static SafeHandle ToLpstrArray(this OidCollection? oids, out int numOids)
System.Security.Cryptography.Pkcs (27)
_generated\0\LibraryImports.g.cs (4)
125public static partial bool CryptSetProvParam(global::System.Runtime.InteropServices.SafeHandle safeProvHandle, global::Interop.Advapi32.CryptProvParam dwParam, nint pbData, int dwFlags) 134global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __safeProvHandle_native__marshaller = new(); 221public static partial bool CryptGetProvParam(global::System.Runtime.InteropServices.SafeHandle safeProvHandle, global::Interop.Advapi32.CryptProvParam dwParam, nint pbData, ref int dwDataLen, int dwFlags) 230global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __safeProvHandle_native__marshaller = new();
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.Decode.cs (1)
53using (SafeHandle sh = hCryptMsg.GetMsgParamAsMemory(CryptMsgParamType.CMSG_ENVELOPE_ALGORITHM_PARAM))
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.DecodeRecipients.cs (2)
28SafeHandle pCmsgCmsRecipientInfoMemory = hCryptMsg.GetMsgParamAsMemory(CryptMsgParamType.CMSG_CMS_RECIPIENT_INFO_PARAM, index); 36private static IEnumerable<RecipientInfo> ToRecipientInfosForThisIndex(SafeHandle pCmsgCmsRecipientInfoMemory, int index)
Internal\Cryptography\Pal\Windows\HelpersWindows.cs (4)
50public static SafeHandle GetMsgParamAsMemory(this SafeCryptMsgHandle hCryptMsg, CryptMsgParamType paramType, int index = 0) 58SafeHandle pvData = SafeHeapAllocHandle.Alloc(cbData); 293using (SafeHandle sh = Interop.Crypt32.CryptDecodeObjectToMemory(CryptDecodeObjectStructType.X509_OCTET_STRING, cryptAlgorithmIdentifier.Parameters.pbData, (int)cryptAlgorithmIdentifier.Parameters.cbData)) 348using (SafeHandle sh = hCryptMsg.GetMsgParamAsMemory(CryptMsgParamType.CMSG_UNPROTECTED_ATTR_PARAM))
Internal\Cryptography\Pal\Windows\KeyAgreeRecipientInfoPalWindows.cs (2)
16internal KeyAgreeRecipientInfoPalWindows(SafeHandle pCmsgCmsRecipientInfoMemory, int index, int subIndex) 181private readonly SafeHandle _pCmsgCmsRecipientInfoMemory;
Internal\Cryptography\Pal\Windows\KeyTransRecipientInfoPalWindows.cs (2)
17internal KeyTransRecipientInfoPalWindows(SafeHandle pCmsgCmsRecipientInfoMemory, int index) 106private readonly SafeHandle _pCmsgCmsRecipientInfoMemory;
Microsoft\Win32\SafeHandles\SafeProvOrNCryptKeyHandleUwp.cs (2)
18internal SafeProvOrNCryptKeyHandleUwp(IntPtr handle, SafeHandle parentHandle) 59private SafeHandle? _parentHandle;
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.CryptGetProvParam.cs (3)
29SafeHandle safeProvHandle, 47SafeHandle safeProvHandle, 54SafeHandle safeProvHandle,
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CryptEncodeDecodeWrappers.cs (3)
19internal static unsafe SafeHandle CryptDecodeObjectToMemory(CryptDecodeObjectStructType lpszStructType, byte[] pbEncoded) 27internal static unsafe SafeHandle CryptDecodeObjectToMemory(CryptDecodeObjectStructType lpszStructType, IntPtr pbEncoded, int cbEncoded) 36SafeHandle sh = SafeHeapAllocHandle.Alloc(cbRequired);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (4)
13internal static class SafeHandleCache<T> where T : SafeHandle 19/// or it should override <see cref="SafeHandle.Dispose(bool)"/> to prevent disposal when the 20/// instance represents an invalid handle: <see cref="System.Runtime.InteropServices.SafeHandle.IsInvalid"/> returns <see language="true"/>. 49internal static bool IsCachedInvalidHandle(SafeHandle handle)
System.ServiceProcess.ServiceController (1)
System\ServiceProcess\ServiceController.cs (1)
418public SafeHandle ServiceHandle
System.Threading.AccessControl (3)
System\Security\AccessControl\EventWaitHandleSecurity.cs (1)
129private static Exception? HandleErrorCode(int errorCode, string? name, SafeHandle? handle, object? context)
System\Security\AccessControl\MutexSecurity.cs (1)
123private static Exception? HandleErrorCode(int errorCode, string? name, SafeHandle? handle, object? context)
System\Security\AccessControl\SemaphoreSecurity.cs (1)
117private static Exception? HandleErrorCode(int errorCode, string? name, SafeHandle? handle, object? context)
System.Windows.Extensions (5)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCrypt32Handle.cs (1)
12internal abstract class SafeCrypt32Handle<T> : SafeHandle where T : SafeHandle, new()
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (4)
13internal static class SafeHandleCache<T> where T : SafeHandle 19/// or it should override <see cref="SafeHandle.Dispose(bool)"/> to prevent disposal when the 20/// instance represents an invalid handle: <see cref="System.Runtime.InteropServices.SafeHandle.IsInvalid"/> returns <see language="true"/>. 49internal static bool IsCachedInvalidHandle(SafeHandle handle)
UIAutomationTypes (4)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\HandleCollector.cs (4)
26internal static SafeHandle Add(SafeHandle handle, int type) { 65internal static SafeHandle Remove(SafeHandle handle, int type) {