mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Partially reverted cbee39e
This commit is contained in:
parent
7e627cf5f3
commit
1c59a717fe
@ -46,13 +46,18 @@ CMeasureMemory::~CMeasureMemory()
|
||||
**
|
||||
*/
|
||||
void CMeasureMemory::UpdateValue()
|
||||
{
|
||||
if (!m_Total)
|
||||
{
|
||||
MEMORYSTATUSEX stat;
|
||||
stat.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
GlobalMemoryStatusEx(&stat);
|
||||
m_MaxValue = (double)(__int64)(stat.ullTotalPageFile + stat.ullTotalPhys);
|
||||
|
||||
if (m_Total)
|
||||
{
|
||||
m_Value = m_MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Value = (double)(__int64)(stat.ullTotalPageFile + stat.ullTotalPhys - stat.ullAvailPageFile - stat.ullAvailPhys);
|
||||
}
|
||||
}
|
||||
@ -68,8 +73,4 @@ void CMeasureMemory::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
||||
m_MaxValue = oldMaxValue;
|
||||
|
||||
m_Total = (1 == parser.ReadInt(section, L"Total", 0));
|
||||
if (m_Total)
|
||||
{
|
||||
m_Value = m_MaxValue;
|
||||
}
|
||||
}
|
||||
|
@ -46,13 +46,18 @@ CMeasureVirtualMemory::~CMeasureVirtualMemory()
|
||||
**
|
||||
*/
|
||||
void CMeasureVirtualMemory::UpdateValue()
|
||||
{
|
||||
if (!m_Total)
|
||||
{
|
||||
MEMORYSTATUSEX stat;
|
||||
stat.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
GlobalMemoryStatusEx(&stat);
|
||||
m_MaxValue = (double)(__int64)stat.ullTotalPageFile;
|
||||
|
||||
if (m_Total)
|
||||
{
|
||||
m_Value = m_MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Value = (double)(__int64)(stat.ullTotalPageFile - stat.ullAvailPageFile);
|
||||
}
|
||||
}
|
||||
@ -68,9 +73,5 @@ void CMeasureVirtualMemory::ReadOptions(CConfigParser& parser, const WCHAR* sect
|
||||
m_MaxValue = oldMaxValue;
|
||||
|
||||
m_Total = (1 == parser.ReadInt(section, L"Total", 0));
|
||||
if (m_Total)
|
||||
{
|
||||
m_Value = m_MaxValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user