Skip to content

Commit

Permalink
improved MCHBAR process reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed May 20, 2021
1 parent 19d292a commit 1f6f8eb
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions DockerForm/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,30 @@ public Form1()
}

// update MCHBAR
string ProcessorID = GetProcessorID();
string command = "/Min /Nologo /Stdout /command=\"Delay 1000;rpci32 0 0 0 0x48;rwexit\"";
var proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = path_rw,
Arguments = command,
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};

proc.Start();
while (!proc.StandardOutput.EndOfStream)
{
string line = proc.StandardOutput.ReadLine();
MCHBAR = line.GetLast(10);
MCHBAR = MCHBAR.Substring(0, 6) + "59";
break;
// do something with line
}

/* string ProcessorID = GetProcessorID();
switch (ProcessorID.Substring(ProcessorID.Length - 5))
{
case "206A7": // SandyBridge
Expand All @@ -823,7 +846,7 @@ public Form1()
case "806C1": // TigerLake
MCHBAR = "0xFEDC59";
break;
}
} */

// update Database
UpdateGameList();
Expand Down

0 comments on commit 1f6f8eb

Please sign in to comment.