Refactor SystemInfo and implement macOS system info backend (#1177)
This commit is contained in:
parent
4c54f36c38
commit
651a07c6c2
6 changed files with 187 additions and 45 deletions
23
Ryujinx.Common/SystemInfo/WindowsSystemInfo.cs
Normal file
23
Ryujinx.Common/SystemInfo/WindowsSystemInfo.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using System.Management;
|
||||
|
||||
namespace Ryujinx.Common.SystemInfo
|
||||
{
|
||||
internal class WindowsSysteminfo : SystemInfo
|
||||
{
|
||||
public override string CpuName { get; }
|
||||
public override ulong RamSize { get; }
|
||||
|
||||
public WindowsSysteminfo()
|
||||
{
|
||||
foreach (ManagementBaseObject mObject in new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Processor").Get())
|
||||
{
|
||||
CpuName = mObject["Name"].ToString();
|
||||
}
|
||||
|
||||
foreach (ManagementBaseObject mObject in new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem").Get())
|
||||
{
|
||||
RamSize = ulong.Parse(mObject["TotalVisibleMemorySize"].ToString()) * 1024;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue