Skip to content

Commit 393289c

Browse files
committed
+ feature/device_manager
+ feature/gpu_monitoring
1 parent c1249b1 commit 393289c

18 files changed

Lines changed: 2196 additions & 10 deletions

.github/hooks/post-commit

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
3+
if [ -e .bump ]; then
4+
echo "Updating AssemblyInfo with git commit version..."
5+
rm .bump
6+
BuildMark=$(date +%s);
7+
GitTag=$(git describe --tags --match v3.* --candidates 1 | sed 's/v3/3/' | sed 's/-/./');
8+
GitVersion=${GitTag%%-*};
9+
GitCommit=${GitTag##*-};
10+
11+
file="src/Properties/AssemblyInfo.cs"
12+
contents=$(cat ${file});
13+
contents=$(echo "${contents}" | sed "s/\(^\[assembly: AssemblyFileVersion(\).*)]/\1\"${GitVersion}\")]/")
14+
contents=$(echo "${contents}" | sed "s/\(^\[assembly: AssemblyInformationalVersion(\).*)]/\1\"${GitVersion}\")]/")
15+
contents=$(echo "${contents}" | sed "s/\(^\[assembly: AssemblyVersion(\).*)]/\1\"${GitVersion}.*\")]/")
16+
contents=$(echo "${contents}" | sed "s/\(^\[assembly: GitCommit(\).*)]/\1\"${GitCommit}\")]/")
17+
contents=$(echo "${contents}" | sed "s/\(^\[assembly: BuildMark(\).*)]/\1\"${BuildMark}\")]/")
18+
19+
echo "${contents}" > $file;
20+
git add $file
21+
git commit --amend -C HEAD --no-verify
22+
fi

.github/hooks/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
branch=$(git branch --show-current);
3+
if [ "$branch" = "master" ] && [ ! -e .nobump ]; then
4+
touch .bump
5+
fi
6+
exit

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ Most likely you will see pieces of code that are UGLY for experienced programmer
2727

2828
+ Detailed overview of all running processes activity with highlighting.
2929
+ System performance metrics, CPU, Memory, I/O, Disk, Network.
30+
+ GPU performance metrics, Engines, Memory, Power, Temperatures.
3031
+ Network usage statistics, global and per network interface.
3132
+ List of active connections by process, and traffic.
32-
+ List of active listening ports, and which processes is holding it.
33+
+ List of listening ports, and which processes is holding it.
3334
+ List and control services pretty much as services.msc.
35+
+ Device Manager, pretty much as devmgr.msc.
3436
+ List of user and windows terminal services sessions.
3537
+ Intuitive to legacy users (not millennials) as a default Task Manager.
3638
+ Customizable graphs, column details and layouts.
@@ -74,16 +76,16 @@ Not planning to write much documentation on usage, but encourage everyone to pla
7476
These features were originally implemented on older versions, but I removed the code because it was buggy
7577

7678
+ Processes CommandLine is not implemented.
77-
+ List & Release Locked files.
79+
+ List & Release locked files.
7880
+ New Task (Run As).
7981

8082
## Future Features
8183

8284
+ DarkMode (someday, when WinForms properly supports it).
83-
+ GPU Monitoring - For nVidia users.
84-
+ WSL Instances lists and monitoring.
85+
+ Better Graphs customization and profiles.
86+
+ WSL Instances lists and control.
87+
+ Hyper-V Machine lists and control.
8588
+ More detailed Disk Performance and Usage monitor.
86-
+ Device Manager.
8789

8890
## Special Thanks
8991

src/Classes/APIs.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,20 @@ public enum WindowShowCommand : int {
13221322
public long Luid;
13231323
public uint Attr;
13241324
}
1325+
[StructLayout(LayoutKind.Sequential)] public struct SP_DEVINFO_DATA {
1326+
public int cbSize;
1327+
public Guid ClassGuid;
1328+
public int DevInst;
1329+
public IntPtr Reserved;
1330+
}
1331+
[StructLayout(LayoutKind.Sequential)] public struct DEVPROPKEY {
1332+
public DEVPROPKEY(string strGuid, int pid) {
1333+
fmtid = new Guid(strGuid);
1334+
this.pid = pid;
1335+
}
1336+
public Guid fmtid;
1337+
public int pid;
1338+
}
13251339
#endregion
13261340

13271341
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
@@ -1547,4 +1561,33 @@ public enum WindowShowCommand : int {
15471561
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
15481562
public static extern unsafe bool GetBinaryType(string lpApplicationName, ref BINARY_TYPE lpBinaryType);
15491563

1564+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("setupapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1565+
public static extern unsafe IntPtr SetupDiGetClassDevs(IntPtr ClassGuid, [MarshalAs(UnmanagedType.LPWStr)] string? Enumerator, IntPtr hwndParent, TaskManagerDeviceFilter Flags);
1566+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("setupapi.dll", SetLastError = true)]
1567+
public static extern unsafe bool SetupDiEnumDeviceInfo(IntPtr DeviceInfoSet, int MemberIndex, ref SP_DEVINFO_DATA DeviceInfoData);
1568+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("setupapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1569+
public static extern unsafe bool SetupDiGetDeviceProperty(IntPtr DeviceInfoSet, ref SP_DEVINFO_DATA DeviceInfoData, ref DEVPROPKEY PropertyKey, out int PropertyType, IntPtr PropertyBuffer, int PropertyBufferSize, out int RequiredSize, int Flags);
1570+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("setupapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1571+
public static extern unsafe bool SetupDiGetDeviceProperty(IntPtr DeviceInfoSet, ref SP_DEVINFO_DATA DeviceInfoData, ref DEVPROPKEY PropertyKey, out int PropertyType, out Guid PropertyBuffer, int PropertyBufferSize, out int RequiredSize, int Flags);
1572+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("setupapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1573+
public static extern unsafe bool SetupDiGetClassDescription(ref Guid ClassGuid, IntPtr ClassDescription, int ClassDescriptionSize, out int RequiredSize);
1574+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("setupapi.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1575+
public static extern unsafe bool SetupDiGetClassProperty(Guid ClassGuid, ref DEVPROPKEY PropertyKey, out int PropertyType, IntPtr PropertyBuffer, int PropertyBufferSize, out int RequiredSize, int Flags);
1576+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("setupapi.dll", SetLastError = true)]
1577+
public static extern unsafe bool SetupDiLoadDeviceIcon(IntPtr DeviceInfoSet, ref SP_DEVINFO_DATA DeviceInfoData, int cxIcon, int cyIcon, int Flags, out IntPtr hIcon);
1578+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("setupapi.dll", SetLastError = true)]
1579+
public static extern unsafe bool SetupDiDestroyDeviceInfoList(IntPtr DeviceInfoSet);
1580+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("cfgmgr32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1581+
public static extern unsafe int CM_Locate_DevNode(out IntPtr pdnDevInst, string pDeviceID, ulong ulFlags);
1582+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("cfgmgr32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1583+
public static extern unsafe int CM_Enable_DevNode(IntPtr dnDevInst, uint ulFlags);
1584+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("cfgmgr32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1585+
public static extern unsafe int CM_Disable_DevNode(IntPtr dnDevInst, uint ulFlags);
1586+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("cfgmgr32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1587+
public static extern unsafe int CM_Uninstall_DevNode(IntPtr dnDevInst, uint ulFlags);
1588+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("cfgmgr32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1589+
public static extern unsafe uint CM_Open_DevNode_Key(IntPtr dnDevNode, uint samDesired, uint ulHardwareProfile, int Disposition, out IntPtr phkDevice, uint ulFlags);
1590+
[System.Security.SuppressUnmanagedCodeSecurity()] [DllImport("ntdll.dll", SetLastError = true, CharSet = CharSet.Unicode)]
1591+
public static extern unsafe uint NtQueryKey(IntPtr KeyHandle, uint KeyInformationClass, IntPtr KeyInformation, uint Length, out uint ResultLength);
1592+
15501593
}

0 commit comments

Comments
 (0)