mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
ASysInfo plugin can show Vista and Win7 in OS_VERSION.
Added OS_BITS to the SysInfo plugin.
This commit is contained in:
parent
dd9ab1dc04
commit
b3fc191b58
@ -50,6 +50,7 @@ MULTIMONITOR_INFO m_Monitors = { 0 };
|
||||
|
||||
BOOL CheckConnection();
|
||||
void GetOSVersion(WCHAR* buffer);
|
||||
void GetOSBits(WCHAR* buffer);
|
||||
BOOL CALLBACK MyInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData);
|
||||
|
||||
enum TYPE
|
||||
@ -60,6 +61,7 @@ enum TYPE
|
||||
SCREEN_SIZE,
|
||||
RAS_STATUS,
|
||||
OS_VERSION,
|
||||
OS_BITS,
|
||||
ADAPTER_DESCRIPTION,
|
||||
NET_MASK,
|
||||
IP_ADDRESS,
|
||||
@ -126,6 +128,10 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
|
||||
{
|
||||
g_Types[id] = OS_VERSION;
|
||||
}
|
||||
else if (wcsicmp(L"OS_BITS", type) == 0)
|
||||
{
|
||||
g_Types[id] = OS_BITS;
|
||||
}
|
||||
else if (wcsicmp(L"ADAPTER_DESCRIPTION", type) == 0)
|
||||
{
|
||||
g_Types[id] = ADAPTER_DESCRIPTION;
|
||||
@ -279,6 +285,10 @@ LPCTSTR GetString(UINT id, UINT flags)
|
||||
GetOSVersion(buffer);
|
||||
return buffer;
|
||||
|
||||
case OS_BITS:
|
||||
GetOSBits(buffer);
|
||||
return buffer;
|
||||
|
||||
case ADAPTER_DESCRIPTION:
|
||||
if (ERROR_SUCCESS == GetAdaptersInfo((IP_ADAPTER_INFO*)buffer, &len))
|
||||
{
|
||||
@ -521,9 +531,9 @@ void Finalize(HMODULE instance, UINT id)
|
||||
*/
|
||||
void GetOSVersion(WCHAR* buffer)
|
||||
{
|
||||
OSVERSIONINFO version;
|
||||
version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx(&version);
|
||||
OSVERSIONINFOEX version;
|
||||
version.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
GetVersionEx((OSVERSIONINFO*)&version);
|
||||
|
||||
if (version.dwPlatformId == VER_PLATFORM_WIN32_NT)
|
||||
{
|
||||
@ -531,7 +541,7 @@ void GetOSVersion(WCHAR* buffer)
|
||||
{
|
||||
wcscpy(buffer, L"Windows NT");
|
||||
}
|
||||
else
|
||||
else if (version.dwMajorVersion == 5)
|
||||
{
|
||||
if (version.dwMinorVersion == 2)
|
||||
{
|
||||
@ -550,6 +560,29 @@ void GetOSVersion(WCHAR* buffer)
|
||||
wcscpy(buffer, L"Unknown");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (version.dwMinorVersion == 1 && version.wProductType == VER_NT_WORKSTATION)
|
||||
{
|
||||
wcscpy(buffer, L"Windows 7");
|
||||
}
|
||||
else if (version.dwMinorVersion == 1 && version.wProductType != VER_NT_WORKSTATION)
|
||||
{
|
||||
wcscpy(buffer, L"Windows Server 2008 R2");
|
||||
}
|
||||
else if (version.dwMinorVersion == 0 && version.wProductType == VER_NT_WORKSTATION)
|
||||
{
|
||||
wcscpy(buffer, L"Windows Vista");
|
||||
}
|
||||
else if (version.dwMinorVersion == 0 && version.wProductType != VER_NT_WORKSTATION)
|
||||
{
|
||||
wcscpy(buffer, L"Windows Server 2008");
|
||||
}
|
||||
else
|
||||
{
|
||||
wcscpy(buffer, L"Unknown");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -568,6 +601,21 @@ void GetOSVersion(WCHAR* buffer)
|
||||
}
|
||||
}
|
||||
|
||||
void GetOSBits(WCHAR* buffer)
|
||||
{
|
||||
SYSTEM_INFO systemInfo = {0};
|
||||
GetNativeSystemInfo(&systemInfo);
|
||||
|
||||
if (systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ||
|
||||
systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)
|
||||
{
|
||||
wcscpy(buffer, L"64");
|
||||
}
|
||||
else
|
||||
{
|
||||
wcscpy(buffer, L"32");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Tests if there is a RAS connection or not. Don't know
|
||||
|
Loading…
Reference in New Issue
Block a user