From c2e4ef7c81871638f79598f9692037e1de198f97 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 26 Dec 2017 18:43:04 -1000 Subject: [PATCH] Correct memory reporting for Windows --- hecl-gui/SysReqTableView.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hecl-gui/SysReqTableView.cpp b/hecl-gui/SysReqTableView.cpp index cc3c607d2..c22574b6b 100644 --- a/hecl-gui/SysReqTableView.cpp +++ b/hecl-gui/SysReqTableView.cpp @@ -46,10 +46,9 @@ SysReqTableModel::SysReqTableModel(QObject* parent) } m_cpuSpeedStr.sprintf("%g GHz", m_cpuSpeed / 1000.f); #if _WIN32 - MEMORYSTATUSEX memStat = {}; - memStat.dwLength = sizeof(memStat); - GlobalMemoryStatusEx(&memStat); - m_memorySize = memStat.ullTotalPhys; + ULONGLONG memSize; + GetPhysicallyInstalledSystemMemory(&memSize); + m_memorySize = memSize * 1024; #else m_memorySize = uint64_t(sysconf(_SC_PHYS_PAGES)) * sysconf(_SC_PAGESIZE); #endif