Removed unneeded codes, for VC2010.

This commit is contained in:
spx
2011-02-20 23:03:15 +00:00
parent 480a1bd1d6
commit 9f152e0076
9 changed files with 27 additions and 183 deletions

View File

@ -111,35 +111,24 @@ double Update2(UINT id)
if(measure)
{
// Check the platform
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if(GetVersionEx((OSVERSIONINFO*)&osvi) && osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion > 4)
{
ULONGLONG longvalue = 0;
longvalue = GetPerfData(measure->ObjectName.c_str(),
measure->InstanceName.c_str(),
measure->CounterName.c_str());
ULONGLONG longvalue;
longvalue = GetPerfData(measure->ObjectName.c_str(),
measure->InstanceName.c_str(),
measure->CounterName.c_str());
if(measure->Difference)
if(measure->Difference)
{
// Compare with the old value
if(!measure->FirstTime)
{
// Compare with the old value
if(!measure->FirstTime)
{
value = (double)(longvalue - measure->OldValue);
}
measure->OldValue = longvalue;
measure->FirstTime = false;
}
else
{
value = (double)longvalue;
value = (double)(longvalue - measure->OldValue);
}
measure->OldValue = longvalue;
measure->FirstTime = false;
}
else
{
LSLog(LOG_NOTICE, L"Rainmeter", L"PerfMon plugin works only in Win2K and later.");
value = (double)longvalue;
}
}
}

View File

@ -611,17 +611,7 @@ void GetOSVersion(WCHAR* buffer)
void GetOSBits(WCHAR* buffer)
{
SYSTEM_INFO systemInfo = {0};
typedef void (WINAPI *FPGETNATIVESYSTEMINFO)(LPSYSTEM_INFO lpSystemInfo);
FPGETNATIVESYSTEMINFO GetNativeSystemInfo = (FPGETNATIVESYSTEMINFO)GetProcAddress(GetModuleHandle(L"kernel32"), "GetNativeSystemInfo");
if (GetNativeSystemInfo != NULL)
{
GetNativeSystemInfo(&systemInfo);
}
else
{
GetSystemInfo(&systemInfo);
}
GetNativeSystemInfo(&systemInfo);
if (systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ||
systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)