sysinfo: add win32 memory reporting

This commit is contained in:
Danny Robson 2019-06-20 12:50:33 +10:00
parent e73d42e817
commit 3b5ec78513

View File

@ -57,5 +57,15 @@ cruft::util::operator<< (std::ostream &os, sysinfo const &)
os << ", username: " << name; os << ", username: " << name;
} }
{
MEMORYSTATUSEX status {};
status.dwLength = sizeof (status);
if (!GlobalMemoryStatusEx (&status))
win32::error::throw_code ();
os << ", ram: { total: " << status.ullTotalPhys << ", available: " << status.ullAvailPhys << " },";
};
return os << " }"; return os << " }";
} }