< Summary

Class:SharpHoundRPC.Handles.SAMHandle
Assembly:SharpHoundRPC
File(s):D:\a\SharpHoundCommon\SharpHoundCommon\src\SharpHoundRPC\Handles\SAMHandle.cs
Covered lines:0
Uncovered lines:18
Coverable lines:18
Total lines:34
Line coverage:0% (0 of 18)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%100%
.ctor(...)100%100%
.ctor(...)100%100%
ReleaseHandle()0%200%
Finalize()100%100%

File(s)

D:\a\SharpHoundCommon\SharpHoundCommon\src\SharpHoundRPC\Handles\SAMHandle.cs

#LineLine coverage
 1using System;
 2using Microsoft.Win32.SafeHandles;
 3using SharpHoundRPC.SAMRPCNative;
 4
 5namespace SharpHoundRPC.Handles
 6{
 7    public class SAMHandle : SafeHandleZeroOrMinusOneIsInvalid
 8    {
 09        public SAMHandle() : base(true)
 010        {
 011        }
 12
 013        public SAMHandle(IntPtr handle) : base(true)
 014        {
 015            SetHandle(handle);
 016        }
 17
 018        public SAMHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle)
 019        {
 020            SetHandle(handle);
 021        }
 22
 23        protected override bool ReleaseHandle()
 024        {
 025            if (handle == IntPtr.Zero) return true;
 026            return SAMMethods.SamCloseHandle(handle) == NtStatus.StatusSuccess;
 027        }
 28
 29        ~SAMHandle()
 030        {
 031            Dispose();
 032        }
 33    }
 34}