forked from irusanov/SMUDebugTool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSystemInfo.cs
58 lines (51 loc) · 1.82 KB
/
SystemInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ZenStatesDebugTool
{
[Serializable]
public class SystemInfo
{
private static string SmuVersionToString(uint version)
{
string[] versionString = new string[3];
versionString[0] = ((version & 0x00FF0000) >> 16).ToString("D2");
versionString[1] = ((version & 0x0000FF00) >> 8).ToString("D2");
versionString[2] = (version & 0x000000FF).ToString("D2");
return string.Join(".", versionString);
}
public SystemInfo()
{
CpuId = 0;
MbVendor = "";
MbName = "";
CpuName = "";
BiosVersion = "";
SmuVersion = 0;
}
public SystemInfo(uint cpuId, string mbVendor, string mbName, string cpuName, string biosVersion, uint smuVersion)
{
CpuId = cpuId;
MbVendor = mbVendor ?? throw new ArgumentNullException(nameof(mbVendor));
MbName = mbName ?? throw new ArgumentNullException(nameof(mbName));
CpuName = cpuName ?? throw new ArgumentNullException(nameof(cpuName));
BiosVersion = biosVersion ?? throw new ArgumentNullException(nameof(biosVersion));
SmuVersion = smuVersion;
}
public uint CpuId { get; set; }
public string MbVendor { get; set; }
public string MbName { get; set; }
public string CpuName { get; set; }
public string BiosVersion { get; set; }
public uint SmuVersion { get; set; }
public string GetSmuVersionString()
{
return SmuVersionToString(this.SmuVersion);
}
public string GetCpuIdString()
{
return CpuId.ToString("X16").TrimStart('0');
}
}
}