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:
		@@ -47,12 +47,17 @@ CMeasureMemory::~CMeasureMemory()
 | 
				
			|||||||
*/
 | 
					*/
 | 
				
			||||||
void CMeasureMemory::UpdateValue()
 | 
					void CMeasureMemory::UpdateValue()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (!m_Total)
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
	MEMORYSTATUSEX stat;
 | 
						MEMORYSTATUSEX stat;
 | 
				
			||||||
	stat.dwLength = sizeof(MEMORYSTATUSEX);
 | 
						stat.dwLength = sizeof(MEMORYSTATUSEX);
 | 
				
			||||||
	GlobalMemoryStatusEx(&stat);
 | 
						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);
 | 
							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;
 | 
						MEMORYSTATUSEX stat;
 | 
				
			||||||
	stat.dwLength = sizeof(MEMORYSTATUSEX);
 | 
						stat.dwLength = sizeof(MEMORYSTATUSEX);
 | 
				
			||||||
	GlobalMemoryStatusEx(&stat);
 | 
						GlobalMemoryStatusEx(&stat);
 | 
				
			||||||
 | 
						m_MaxValue = (double)(__int64)stat.ullTotalPageFile;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						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;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user