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
@ -47,12 +47,17 @@ CMeasureMemory::~CMeasureMemory()
|
|||||||
*/
|
*/
|
||||||
void CMeasureMemory::UpdateValue()
|
void CMeasureMemory::UpdateValue()
|
||||||
{
|
{
|
||||||
if (!m_Total)
|
MEMORYSTATUSEX stat;
|
||||||
{
|
stat.dwLength = sizeof(MEMORYSTATUSEX);
|
||||||
MEMORYSTATUSEX stat;
|
GlobalMemoryStatusEx(&stat);
|
||||||
stat.dwLength = sizeof(MEMORYSTATUSEX);
|
m_MaxValue = (double)(__int64)(stat.ullTotalPageFile + stat.ullTotalPhys);
|
||||||
GlobalMemoryStatusEx(&stat);
|
|
||||||
|
|
||||||
|
if (m_Total)
|
||||||
|
{
|
||||||
|
m_Value = m_MaxValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
m_Value = (double)(__int64)(stat.ullTotalPageFile + stat.ullTotalPhys - stat.ullAvailPageFile - stat.ullAvailPhys);
|
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_MaxValue = oldMaxValue;
|
||||||
|
|
||||||
m_Total = (1 == parser.ReadInt(section, L"Total", 0));
|
m_Total = (1 == parser.ReadInt(section, L"Total", 0));
|
||||||
if (m_Total)
|
|
||||||
{
|
|
||||||
m_Value = m_MaxValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -47,12 +47,17 @@ CMeasureVirtualMemory::~CMeasureVirtualMemory()
|
|||||||
*/
|
*/
|
||||||
void CMeasureVirtualMemory::UpdateValue()
|
void CMeasureVirtualMemory::UpdateValue()
|
||||||
{
|
{
|
||||||
if (!m_Total)
|
MEMORYSTATUSEX stat;
|
||||||
{
|
stat.dwLength = sizeof(MEMORYSTATUSEX);
|
||||||
MEMORYSTATUSEX stat;
|
GlobalMemoryStatusEx(&stat);
|
||||||
stat.dwLength = sizeof(MEMORYSTATUSEX);
|
m_MaxValue = (double)(__int64)stat.ullTotalPageFile;
|
||||||
GlobalMemoryStatusEx(&stat);
|
|
||||||
|
|
||||||
|
if (m_Total)
|
||||||
|
{
|
||||||
|
m_Value = m_MaxValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
m_Value = (double)(__int64)(stat.ullTotalPageFile - stat.ullAvailPageFile);
|
m_Value = (double)(__int64)(stat.ullTotalPageFile - stat.ullAvailPageFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -68,9 +73,5 @@ void CMeasureVirtualMemory::ReadOptions(CConfigParser& parser, const WCHAR* sect
|
|||||||
m_MaxValue = oldMaxValue;
|
m_MaxValue = oldMaxValue;
|
||||||
|
|
||||||
m_Total = (1 == parser.ReadInt(section, L"Total", 0));
|
m_Total = (1 == parser.ReadInt(section, L"Total", 0));
|
||||||
if (m_Total)
|
|
||||||
{
|
|
||||||
m_Value = m_MaxValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user