< Summary

Information
Class: Microsoft.Win32.SafeHandles.SafeCrypt32Handle<T>
Assembly: System.Net.Security
File(s): D:\runner\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCrypt32Handle.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 37
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%110%
Dispose(...)0%220%

File(s)

D:\runner\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCrypt32Handle.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Runtime.InteropServices;
 6
 7namespace Microsoft.Win32.SafeHandles
 8{
 9    /// <summary>
 10    /// Base class for safe handles representing NULL-based pointers.
 11    /// </summary>
 12    internal abstract class SafeCrypt32Handle<T> : SafeHandle where T : SafeHandle, new()
 13    {
 14        protected SafeCrypt32Handle()
 015            : base(IntPtr.Zero, true)
 016        {
 017        }
 18
 19        public sealed override bool IsInvalid
 20        {
 021            get { return handle == IntPtr.Zero; }
 22        }
 23
 24        public static T InvalidHandle
 25        {
 26            get { return SafeHandleCache<T>.GetInvalidHandle(() => new T()); }
 27        }
 28
 29        protected override void Dispose(bool disposing)
 030        {
 031            if (!SafeHandleCache<T>.IsCachedInvalidHandle(this))
 032            {
 033                base.Dispose(disposing);
 034            }
 035        }
 36    }
 37}