< Summary - Results for net481, Release

Information
Class: LockCheck.Windows.ProcessInfoWindows
Assembly: LockCheck
File(s): D:\a\LockCheck\LockCheck\src\LockCheck\Windows\ProcessInfo.Windows.cs
Tag: 117_11660770947
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 31
Line coverage: 100%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Create(...)50%22100%
Create(...)100%22100%
.ctor(...)100%11100%

File(s)

D:\a\LockCheck\LockCheck\src\LockCheck\Windows\ProcessInfo.Windows.cs

#LineLine coverage
 1using System.IO;
 2
 3namespace LockCheck.Windows;
 4
 5internal class ProcessInfoWindows : ProcessInfo
 6{
 7    public static ProcessInfoWindows? Create(NativeMethods.RM_PROCESS_INFO pi)
 8    {
 29        var peb = new Peb((int)pi.Process.dwProcessId, pi.GetStartTime());
 210        return peb.HasError ? null : new ProcessInfoWindows(peb);
 11    }
 12
 13    public static ProcessInfoWindows? Create(int processId)
 14    {
 215        var peb = new Peb(processId, NativeMethods.GetProcessStartTime(processId));
 216        return peb.HasError ? null : new ProcessInfoWindows(peb);
 17    }
 18
 19    public ProcessInfoWindows(Peb peb)
 220        : base(peb.ProcessId, peb.StartTime)
 21    {
 222        ParentProcessId = peb.ParentProcessId;
 223        ExecutableFullPath = peb.ExecutableFullPath;
 224        ExecutableName = Path.GetFileName(peb.ExecutableFullPath);
 225        ApplicationName = peb.ProcessName;
 226        SessionId = peb.SessionId;
 227        Owner = peb.Owner;
 228        IsCritical = peb.IsCritical;
 229        ProcessStartKey = peb.ProcessStartKey;
 230    }
 31}