Skip to content

Commit

Permalink
fixed a critical issue with MCHBAR reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed May 20, 2021
1 parent 2f76ee9 commit 78001e9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions DockerForm/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private static void ApplyPowerProfiles()
private static void SetPowerProfile(PowerProfile profile)
{
// skip if unsupported platform
if (MCHBAR == null)
if (MCHBAR == null || !MCHBAR.Contains("0x"))
return;

// skip check on empty profile
Expand Down Expand Up @@ -826,10 +826,13 @@ public Form1()
while (!proc.StandardOutput.EndOfStream)
{
string line = proc.StandardOutput.ReadLine();

if (!line.Contains("0x"))
continue;

MCHBAR = line.GetLast(10);
MCHBAR = MCHBAR.Substring(0, 6) + "59";
break;
// do something with line
}

/* string ProcessorID = GetProcessorID();
Expand Down

0 comments on commit 78001e9

Please sign in to comment.