From 1f6f8eb073393e54c328c577f6b023bbb5710b2f Mon Sep 17 00:00:00 2001 From: Lesueur Benjamin Date: Thu, 20 May 2021 08:14:23 +0200 Subject: [PATCH] improved MCHBAR process reading --- DockerForm/Form1.cs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/DockerForm/Form1.cs b/DockerForm/Form1.cs index e204371..810c9d2 100644 --- a/DockerForm/Form1.cs +++ b/DockerForm/Form1.cs @@ -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 @@ -823,7 +846,7 @@ public Form1() case "806C1": // TigerLake MCHBAR = "0xFEDC59"; break; - } + } */ // update Database UpdateGameList();