mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-31 06:15:08 +00:00
Search all possible registry locations for the Heatmaster serial port.
This commit is contained in:
@@ -69,20 +69,20 @@ namespace OpenHardwareMonitor.Hardware.Heatmaster {
|
|||||||
|
|
||||||
private static string[] GetRegistryPortNames() {
|
private static string[] GetRegistryPortNames() {
|
||||||
List<string> result = new List<string>();
|
List<string> result = new List<string>();
|
||||||
|
string[] paths = { "", "&MI_00" };
|
||||||
try {
|
try {
|
||||||
RegistryKey key = Registry.LocalMachine.OpenSubKey(
|
foreach (string path in paths) {
|
||||||
@"SYSTEM\CurrentControlSet\Enum\USB\VID_10C4&PID_EA60");
|
RegistryKey key = Registry.LocalMachine.OpenSubKey(
|
||||||
if (key == null)
|
@"SYSTEM\CurrentControlSet\Enum\USB\VID_10C4&PID_EA60" + path);
|
||||||
key = Registry.LocalMachine.OpenSubKey(
|
if (key != null) {
|
||||||
@"SYSTEM\CurrentControlSet\Enum\USB\VID_10C4&PID_EA60&MI_00");
|
foreach (string subKeyName in key.GetSubKeyNames()) {
|
||||||
if (key != null) {
|
RegistryKey subKey =
|
||||||
foreach (string subKeyName in key.GetSubKeyNames()) {
|
key.OpenSubKey(subKeyName + "\\" + "Device Parameters");
|
||||||
RegistryKey subKey =
|
if (subKey != null) {
|
||||||
key.OpenSubKey(subKeyName + "\\" + "Device Parameters");
|
string name = subKey.GetValue("PortName") as string;
|
||||||
if (subKey != null) {
|
if (name != null && !result.Contains(name))
|
||||||
string name = subKey.GetValue("PortName") as string;
|
result.Add((string)name);
|
||||||
if (name != null)
|
}
|
||||||
result.Add((string)name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,5 +38,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("0.1.37.8")]
|
[assembly: AssemblyVersion("0.1.37.9")]
|
||||||
[assembly: AssemblyFileVersion("0.1.37.8")]
|
[assembly: AssemblyFileVersion("0.1.37.9")]
|
||||||
|
Reference in New Issue
Block a user