summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-07-31 17:30:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-07-31 17:30:01 +0000
commitd2b1030f624fc0b0688972388d68a85a47180476 (patch)
tree3ceb704611d27621c254840d103d10eb5d761c4c
parentcd45782fb74301b3806afa796bb6a6ac104817dd (diff)
- Windows 10 version detection;
- GetOSDisplayString() moved to mir_core.mir; - numerous warning fixes in mir_core git-svn-id: http://svn.miranda-ng.org/main/trunk@14765 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--bin10/lib/mir_core.libbin297512 -> 297744 bytes
-rw-r--r--bin10/lib/mir_core64.libbin298914 -> 299130 bytes
-rw-r--r--bin12/lib/mir_core.libbin297512 -> 297744 bytes
-rw-r--r--bin12/lib/mir_core64.libbin298914 -> 299130 bytes
-rw-r--r--bin14/lib/mir_core.libbin303140 -> 297744 bytes
-rw-r--r--bin14/lib/mir_core64.libbin304794 -> 299130 bytes
-rw-r--r--include/m_core.h2
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp292
-rw-r--r--src/mir_core/src/colourpicker.cpp4
-rw-r--r--src/mir_core/src/hyperlink.cpp16
-rw-r--r--src/mir_core/src/langpack.cpp48
-rw-r--r--src/mir_core/src/miranda.cpp10
-rw-r--r--src/mir_core/src/miranda.h2
-rw-r--r--src/mir_core/src/modules.cpp8
-rw-r--r--src/mir_core/src/threads.cpp6
-rw-r--r--src/mir_core/src/winver.cpp297
-rw-r--r--src/miranda32/res/miranda32.exe.manifest10
17 files changed, 349 insertions, 346 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib
index 4233bf12bf..09fac02fed 100644
--- a/bin10/lib/mir_core.lib
+++ b/bin10/lib/mir_core.lib
Binary files differ
diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib
index 382ec136bf..64e229b2c8 100644
--- a/bin10/lib/mir_core64.lib
+++ b/bin10/lib/mir_core64.lib
Binary files differ
diff --git a/bin12/lib/mir_core.lib b/bin12/lib/mir_core.lib
index 4233bf12bf..09fac02fed 100644
--- a/bin12/lib/mir_core.lib
+++ b/bin12/lib/mir_core.lib
Binary files differ
diff --git a/bin12/lib/mir_core64.lib b/bin12/lib/mir_core64.lib
index 382ec136bf..64e229b2c8 100644
--- a/bin12/lib/mir_core64.lib
+++ b/bin12/lib/mir_core64.lib
Binary files differ
diff --git a/bin14/lib/mir_core.lib b/bin14/lib/mir_core.lib
index d1a7b31bd2..09fac02fed 100644
--- a/bin14/lib/mir_core.lib
+++ b/bin14/lib/mir_core.lib
Binary files differ
diff --git a/bin14/lib/mir_core64.lib b/bin14/lib/mir_core64.lib
index 2e3f355ec9..64e229b2c8 100644
--- a/bin14/lib/mir_core64.lib
+++ b/bin14/lib/mir_core64.lib
Binary files differ
diff --git a/include/m_core.h b/include/m_core.h
index fea5e37baf..e812be9e2b 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -640,6 +640,8 @@ MIR_CORE_DLL(BOOL) IsFullScreen();
MIR_CORE_DLL(BOOL) IsWorkstationLocked();
MIR_CORE_DLL(BOOL) IsScreenSaverRunning();
+MIR_CORE_DLL(BOOL) GetOSDisplayString(TCHAR *buf, size_t bufSize);
+
/////////////////////////////////////////////////////////////////////////////////////////
// retrieves the hLangpack of a plugin by its HINSTANCE
// returns hLangpack if found, or 0 if error occurred
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 5afce7aaa9..dd5a94857c 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -28,298 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "jabber_rc.h"
#include "version.h"
-#ifndef VER_SUITE_WH_SERVER
- #define VER_SUITE_WH_SERVER 0x00008000
-#endif
-
-#ifndef PRODUCT_ULTIMATE
- #define PRODUCT_UNDEFINED 0x00000000
- #define PRODUCT_ULTIMATE 0x00000001
- #define PRODUCT_HOME_BASIC 0x00000002
- #define PRODUCT_HOME_PREMIUM 0x00000003
- #define PRODUCT_ENTERPRISE 0x00000004
- #define PRODUCT_HOME_BASIC_N 0x00000005
- #define PRODUCT_BUSINESS 0x00000006
- #define PRODUCT_STANDARD_SERVER 0x00000007
- #define PRODUCT_DATACENTER_SERVER 0x00000008
- #define PRODUCT_SMALLBUSINESS_SERVER 0x00000009
- #define PRODUCT_ENTERPRISE_SERVER 0x0000000A
- #define PRODUCT_STARTER 0x0000000B
- #define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C
- #define PRODUCT_STANDARD_SERVER_CORE 0x0000000D
- #define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E
- #define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F
- #define PRODUCT_BUSINESS_N 0x00000010
- #define PRODUCT_WEB_SERVER 0x00000011
- #define PRODUCT_CLUSTER_SERVER 0x00000012
- #define PRODUCT_HOME_SERVER 0x00000013
- #define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014
- #define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015
- #define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016
- #define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017
- #define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018
- #define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019
- #define PRODUCT_HOME_PREMIUM_N 0x0000001a
- #define PRODUCT_ENTERPRISE_N 0x0000001b
- #define PRODUCT_ULTIMATE_N 0x0000001c
- #define PRODUCT_WEB_SERVER_CORE 0x0000001d
- #define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001e
- #define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001f
- #define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020
- #define PRODUCT_SERVER_FOUNDATION 0x00000021
- #define PRODUCT_HOME_PREMIUM_SERVER 0x00000022
- #define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023
- #define PRODUCT_STANDARD_SERVER_V 0x00000024
- #define PRODUCT_DATACENTER_SERVER_V 0x00000025
- #define PRODUCT_ENTERPRISE_SERVER_V 0x00000026
- #define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027
- #define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028
- #define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029
- #define PRODUCT_HYPERV 0x0000002a
- #define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002b
- #define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002c
- #define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002d
- #define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002e
- #define PRODUCT_STARTER_N 0x0000002f
- #define PRODUCT_PROFESSIONAL 0x00000030
- #define PRODUCT_PROFESSIONAL_N 0x00000031
- #define PRODUCT_SB_SOLUTION_SERVER 0x00000032
- #define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033
- #define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034
- #define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035
- #define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036
- #define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037
- #define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038
- #define PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039
- #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B
- #define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C
- #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D
- #define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E
- #define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003f
- #define PRODUCT_CLUSTER_SERVER_V 0x00000040
- #define PRODUCT_EMBEDDED 0x00000041
- #define PRODUCT_STARTER_E 0x00000042
- #define PRODUCT_HOME_BASIC_E 0x00000043
- #define PRODUCT_HOME_PREMIUM_E 0x00000044
- #define PRODUCT_PROFESSIONAL_E 0x00000045
- #define PRODUCT_ENTERPRISE_E 0x00000046
- #define PRODUCT_ULTIMATE_E 0x00000047
-#endif
-#ifndef PRODUCT_CORE_N // Win8
- #define PRODUCT_CORE_N 0x00000062
- #define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063
- #define PRODUCT_CORE_SINGLELANGUAGE 0x00000064
- #define PRODUCT_CORE 0x00000065
- #define PRODUCT_PROFESSIONAL_WMC 0x00000067
- #define PRODUCT_UNLICENSED 0xABCDABCD
-#endif
-
-typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
-
-#define StringCchCopy(x,y,z) mir_tstrncpy((x),(z),(y))
-#define StringCchCat(x,y,z) mir_tstrcat((x),(z))
-
-// slightly modified sample from MSDN
-BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
-{
- OSVERSIONINFOEX osvi = { 0 };
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- BOOL bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi);
- if (!bOsVersionInfoEx) {
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (!GetVersionEx((OSVERSIONINFO*)&osvi))
- return FALSE;
- }
-
- SYSTEM_INFO si = { 0 };
- GetNativeSystemInfo(&si);
-
- // Some code from Crash Dumper Plugin :-)
- if (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId && osvi.dwMajorVersion > 4) {
- StringCchCopy(pszOS, BUFSIZE, TEXT("Microsoft "));
-
- // Test for the specific product.
- if (osvi.dwMajorVersion == 6) {
- switch (osvi.dwMinorVersion) {
- case 0:
- if (osvi.wProductType == VER_NT_WORKSTATION)
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Vista "));
- else
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2008 "));
- break;
-
- case 1:
- if (osvi.wProductType == VER_NT_WORKSTATION)
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows 7 "));
- else
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2008 R2 "));
- break;
-
- case 2:
- if (osvi.wProductType == VER_NT_WORKSTATION)
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows 8 "));
- else
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2012 "));
- break;
-
- case 3:
- if (osvi.wProductType == VER_NT_WORKSTATION)
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows 8.1 "));
- else
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2012 R2 "));
- break;
- }
-
- DWORD dwType = 0;
- HMODULE hKernel = GetModuleHandle(TEXT("kernel32.dll"));
- PGPI pGPI = (PGPI)GetProcAddress(hKernel, "GetProductInfo");
- if (pGPI != NULL)
- pGPI(osvi.dwMajorVersion, osvi.dwMinorVersion, 0, 0, &dwType);
-
- switch (dwType) {
- case PRODUCT_ULTIMATE:
- StringCchCat(pszOS, BUFSIZE, TEXT("Ultimate Edition"));
- break;
- case PRODUCT_PROFESSIONAL:
- StringCchCat(pszOS, BUFSIZE, TEXT("Professional Edition"));
- break;
- case PRODUCT_PROFESSIONAL_WMC:
- StringCchCat(pszOS, BUFSIZE, TEXT("Professional Edition with Media Center"));
- break;
- case PRODUCT_HOME_PREMIUM:
- StringCchCat(pszOS, BUFSIZE, TEXT("Home Premium Edition"));
- break;
- case PRODUCT_HOME_BASIC:
- StringCchCat(pszOS, BUFSIZE, TEXT("Home Basic Edition"));
- break;
- case PRODUCT_ENTERPRISE:
- StringCchCat(pszOS, BUFSIZE, TEXT("Enterprise Edition"));
- break;
- case PRODUCT_BUSINESS:
- StringCchCat(pszOS, BUFSIZE, TEXT("Business Edition"));
- break;
- case PRODUCT_STARTER:
- StringCchCat(pszOS, BUFSIZE, TEXT("Starter Edition"));
- break;
- case PRODUCT_CLUSTER_SERVER:
- StringCchCat(pszOS, BUFSIZE, TEXT("Cluster Server Edition"));
- break;
- case PRODUCT_DATACENTER_SERVER:
- StringCchCat(pszOS, BUFSIZE, TEXT("Datacenter Edition"));
- break;
- case PRODUCT_DATACENTER_SERVER_CORE:
- StringCchCat(pszOS, BUFSIZE, TEXT("Datacenter Edition (core installation)"));
- break;
- case PRODUCT_ENTERPRISE_SERVER:
- StringCchCat(pszOS, BUFSIZE, TEXT("Enterprise Edition"));
- break;
- case PRODUCT_ENTERPRISE_SERVER_CORE:
- StringCchCat(pszOS, BUFSIZE, TEXT("Enterprise Edition (core installation)"));
- break;
- case PRODUCT_ENTERPRISE_SERVER_IA64:
- StringCchCat(pszOS, BUFSIZE, TEXT("Enterprise Edition for Itanium-based Systems"));
- break;
- case PRODUCT_SMALLBUSINESS_SERVER:
- StringCchCat(pszOS, BUFSIZE, TEXT("Small Business Server"));
- break;
- case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
- StringCchCat(pszOS, BUFSIZE, TEXT("Small Business Server Premium Edition"));
- break;
- case PRODUCT_STANDARD_SERVER:
- StringCchCat(pszOS, BUFSIZE, TEXT("Standard Edition"));
- break;
- case PRODUCT_STANDARD_SERVER_CORE:
- StringCchCat(pszOS, BUFSIZE, TEXT("Standard Edition (core installation)"));
- break;
- case PRODUCT_WEB_SERVER:
- StringCchCat(pszOS, BUFSIZE, TEXT("Web Server Edition"));
- break;
- }
- if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- StringCchCat(pszOS, BUFSIZE, TEXT(", 64-bit"));
- else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
- StringCchCat(pszOS, BUFSIZE, TEXT(", 32-bit"));
- }
-
- if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) {
- if (GetSystemMetrics(SM_SERVERR2))
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2003 R2, "));
- else if (osvi.wSuiteMask == VER_SUITE_STORAGE_SERVER)
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Storage Server 2003"));
- else if (osvi.wSuiteMask == VER_SUITE_WH_SERVER)
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Home Server"));
- else if (osvi.wProductType == VER_NT_WORKSTATION && si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows XP Professional x64 Edition"));
- else
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows Server 2003, "));
-
- // Test for the server type.
- if (osvi.wProductType != VER_NT_WORKSTATION) {
- if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) {
- if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
- StringCchCat(pszOS, BUFSIZE, TEXT("Datacenter Edition for Itanium-based Systems"));
- else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
- StringCchCat(pszOS, BUFSIZE, TEXT("Enterprise Edition for Itanium-based Systems"));
- }
- else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
- if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
- StringCchCat(pszOS, BUFSIZE, TEXT("Datacenter x64 Edition"));
- else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
- StringCchCat(pszOS, BUFSIZE, TEXT("Enterprise x64 Edition"));
- else StringCchCat(pszOS, BUFSIZE, TEXT("Standard x64 Edition"));
- }
- else {
- if (osvi.wSuiteMask & VER_SUITE_COMPUTE_SERVER)
- StringCchCat(pszOS, BUFSIZE, TEXT("Compute Cluster Edition"));
- else if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
- StringCchCat(pszOS, BUFSIZE, TEXT("Datacenter Edition"));
- else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
- StringCchCat(pszOS, BUFSIZE, TEXT("Enterprise Edition"));
- else if (osvi.wSuiteMask & VER_SUITE_BLADE)
- StringCchCat(pszOS, BUFSIZE, TEXT("Web Edition"));
- else StringCchCat(pszOS, BUFSIZE, TEXT("Standard Edition"));
- }
- }
- }
-
- if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) {
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows XP "));
- if (osvi.wSuiteMask & VER_SUITE_PERSONAL)
- StringCchCat(pszOS, BUFSIZE, TEXT("Home Edition"));
- else StringCchCat(pszOS, BUFSIZE, TEXT("Professional"));
- }
-
- if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) {
- StringCchCat(pszOS, BUFSIZE, TEXT("Windows 2000 "));
-
- if (osvi.wProductType == VER_NT_WORKSTATION)
- StringCchCat(pszOS, BUFSIZE, TEXT("Professional"));
- else {
- if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
- StringCchCat(pszOS, BUFSIZE, TEXT("Datacenter Server"));
- else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
- StringCchCat(pszOS, BUFSIZE, TEXT("Advanced Server"));
- else StringCchCat(pszOS, BUFSIZE, TEXT("Server"));
- }
- }
-
- // Include service pack (if any) and build number.
-
- if (mir_tstrlen(osvi.szCSDVersion) > 0) {
- StringCchCat(pszOS, BUFSIZE, TEXT(" "));
- StringCchCat(pszOS, BUFSIZE, osvi.szCSDVersion);
- }
-
- TCHAR buf[80];
- mir_sntprintf(buf, TEXT(" (build %d)"), osvi.dwBuildNumber);
- StringCchCat(pszOS, BUFSIZE, buf);
- return TRUE;
- }
-
- return FALSE;
-}
-
-
BOOL CJabberProto::OnIqRequestVersion(HXML, CJabberIqInfo *pInfo)
{
if (!pInfo->GetFrom())
diff --git a/src/mir_core/src/colourpicker.cpp b/src/mir_core/src/colourpicker.cpp
index 75d0650431..d212c3ea33 100644
--- a/src/mir_core/src/colourpicker.cpp
+++ b/src/mir_core/src/colourpicker.cpp
@@ -55,7 +55,7 @@ static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd, UINT message, WPARAM wPar
CHOOSECOLOR cc = { 0 };
cc.lStructSize = sizeof(CHOOSECOLOR);
cc.hwndOwner = hwnd;
- cc.hInstance = (HWND)hInst;
+ cc.hInstance = (HWND)g_hInst;
cc.rgbResult = GetWindowLongPtr(hwnd, 0);
cc.lpCustColors = custColours;
cc.Flags = CC_ANYCOLOR | CC_FULLOPEN | CC_RGBINIT;
@@ -97,7 +97,7 @@ void InitColourPicker(void)
WNDCLASS wcl = { 0 };
wcl.lpfnWndProc = ColourPickerWndProc;
wcl.cbWndExtra = sizeof(COLORREF) * 2;
- wcl.hInstance = hInst;
+ wcl.hInstance = g_hInst;
wcl.lpszClassName = _T(WNDCLASS_COLOURPICKER);
wcl.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wcl.style = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS;
diff --git a/src/mir_core/src/hyperlink.cpp b/src/mir_core/src/hyperlink.cpp
index b4530b6e81..524152cb20 100644
--- a/src/mir_core/src/hyperlink.cpp
+++ b/src/mir_core/src/hyperlink.cpp
@@ -81,17 +81,17 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case WM_GETDLGCODE:
if (lParam) {
- MSG *msg = (MSG *)lParam;
- if (msg->message == WM_KEYDOWN) {
- if (msg->wParam == VK_TAB)
+ MSG *pMsg = (MSG *)lParam;
+ if (pMsg->message == WM_KEYDOWN) {
+ if (pMsg->wParam == VK_TAB)
return 0;
- if (msg->wParam == VK_ESCAPE)
+ if (pMsg->wParam == VK_ESCAPE)
return 0;
}
- else if (msg->message == WM_CHAR) {
- if (msg->wParam == '\t')
+ else if (pMsg->message == WM_CHAR) {
+ if (pMsg->wParam == '\t')
return 0;
- if (msg->wParam == 27)
+ if (pMsg->wParam == 27)
return 0;
}
}
@@ -267,7 +267,7 @@ void InitHyperlink(void)
WNDCLASS wcl = { 0 };
wcl.lpfnWndProc = HyperlinkWndProc;
wcl.cbWndExtra = sizeof(struct HyperlinkWndData*);
- wcl.hInstance = hInst;
+ wcl.hInstance = g_hInst;
wcl.lpszClassName = WNDCLASS_HYPERLINK;
wcl.style = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS | CS_PARENTDC;
RegisterClass(&wcl); /* automatically unregistered on exit */
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp
index c93dee0a3e..e28e07d21e 100644
--- a/src/mir_core/src/langpack.cpp
+++ b/src/mir_core/src/langpack.cpp
@@ -223,18 +223,18 @@ static void LoadLangPackFile(FILE *fp, char *line)
if (p)
*p = '\\';
- FILE *fp = _tfopen(tszFileName, _T("r"));
- if (fp) {
+ FILE *fpNew = _tfopen(tszFileName, _T("r"));
+ if (fpNew) {
line[0] = 0;
- fgets(line, LANGPACK_BUF_SIZE, fp);
+ fgets(line, LANGPACK_BUF_SIZE, fpNew);
if (strlen(line) >= 3 && line[0] == '\xef' && line[1] == '\xbb' && line[2] == '\xbf')
- fseek(fp, 3, SEEK_SET);
+ fseek(fpNew, 3, SEEK_SET);
else
- fseek(fp, 0, SEEK_SET);
+ fseek(fpNew, 0, SEEK_SET);
- LoadLangPackFile(fp, line);
- fclose(fp);
+ LoadLangPackFile(fpNew, line);
+ fclose(fpNew);
}
}
else if (!memcmp(line + 1, "muuid", 5)) {
@@ -508,19 +508,19 @@ MIR_CORE_DLL(TCHAR*) Langpack_PcharToTchar(const char *pszStr)
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(char*) TranslateA_LP(const char *str, int hLangpack)
+MIR_CORE_DLL(char*) TranslateA_LP(const char *str, int _hLangpack)
{
- return (char*)LangPackTranslateString(Langpack_LookupUuid(hLangpack), str, FALSE);
+ return (char*)LangPackTranslateString(Langpack_LookupUuid(_hLangpack), str, FALSE);
}
-MIR_CORE_DLL(WCHAR*) TranslateW_LP(const WCHAR *str, int hLangpack)
+MIR_CORE_DLL(WCHAR*) TranslateW_LP(const WCHAR *str, int _hLangpack)
{
- return (WCHAR*)LangPackTranslateString(Langpack_LookupUuid(hLangpack), (LPCSTR)str, TRUE);
+ return (WCHAR*)LangPackTranslateString(Langpack_LookupUuid(_hLangpack), (LPCSTR)str, TRUE);
}
-MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int hLangpack)
+MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int _hLangpack)
{
- MUUID *uuid = Langpack_LookupUuid(hLangpack);
+ MUUID *uuid = Langpack_LookupUuid(_hLangpack);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -542,7 +542,7 @@ MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int hLangpack)
}
if (mii.hSubMenu != NULL)
- TranslateMenu_LP(mii.hSubMenu, hLangpack);
+ TranslateMenu_LP(mii.hSubMenu, _hLangpack);
}
}
@@ -556,16 +556,10 @@ static void TranslateWindow(MUUID *pUuid, HWND hwnd)
SetWindowText(hwnd, result);
}
-struct LANGPACKTRANSLATEDIALOG
-{
- HWND hwndDlg;
- int hLangpack;
-};
-
static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam)
{
- int hLangpack = (int)lParam;
- MUUID *uuid = Langpack_LookupUuid(hLangpack);
+ int _hLangpack = (int)lParam;
+ MUUID *uuid = Langpack_LookupUuid(_hLangpack);
TCHAR szClass[32];
GetClassName(hwnd, szClass, _countof(szClass));
@@ -578,10 +572,10 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam)
return TRUE;
}
-MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLangpack)
+MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int _hLangpack)
{
- TranslateWindow(Langpack_LookupUuid(hLangpack), hDlg);
- EnumChildWindows(hDlg, TranslateDialogEnumProc, hLangpack);
+ TranslateWindow(Langpack_LookupUuid(_hLangpack), hDlg);
+ EnumChildWindows(hDlg, TranslateDialogEnumProc, _hLangpack);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -683,8 +677,8 @@ void GetDefaultLang()
}
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
- } else
- db_set_ts(NULL, "Langpack", "Current", _T("default"));
+ }
+ else db_set_ts(NULL, "Langpack", "Current", _T("default"));
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp
index c1c0518444..ac022681dd 100644
--- a/src/mir_core/src/miranda.cpp
+++ b/src/mir_core/src/miranda.cpp
@@ -41,7 +41,7 @@ void InitTimeZones();
void InitWinver();
int hLangpack = 0;
-HINSTANCE hInst = 0;
+HINSTANCE g_hInst = 0;
HANDLE hStackMutex, hThreadQueueEmpty;
DWORD mir_tls = 0;
@@ -52,8 +52,8 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM)
{
TCHAR mirandaPath[MAX_PATH], cmdLine[MAX_PATH];
PROCESS_INFORMATION pi;
- STARTUPINFO si = { 0 };
- si.cb = sizeof(si);
+ STARTUPINFO startupInfo = { 0 };
+ startupInfo.cb = sizeof(startupInfo);
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
if (wParam) {
VARST profilename(_T("%miranda_profilename%"));
@@ -62,7 +62,7 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM)
else mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
- CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
+ CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &pi);
return 0;
}
@@ -135,7 +135,7 @@ MIR_CORE_DLL(void) UnloadCoreModule(void)
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID)
{
if (fdwReason == DLL_PROCESS_ATTACH) {
- hInst = hinstDLL;
+ g_hInst = hinstDLL;
mir_tls = TlsAlloc();
LoadCoreModule();
}
diff --git a/src/mir_core/src/miranda.h b/src/mir_core/src/miranda.h
index 525a99d1d9..9d854e4f8c 100644
--- a/src/mir_core/src/miranda.h
+++ b/src/mir_core/src/miranda.h
@@ -37,7 +37,7 @@ int InitPathUtils(void);
HINSTANCE ProtoGetInstance(const char *szModuleName);
-extern HINSTANCE hInst;
+extern HINSTANCE g_hInst;
extern HWND hAPCWindow;
extern HANDLE hStackMutex, hThreadQueueEmpty;
extern MIDatabase *currDb;
diff --git a/src/mir_core/src/modules.cpp b/src/mir_core/src/modules.cpp
index 4a7df365b5..86bff8146f 100644
--- a/src/mir_core/src/modules.cpp
+++ b/src/mir_core/src/modules.cpp
@@ -76,7 +76,7 @@ TServiceToMainThreadItem;
static BOOL bServiceMode = FALSE;
static mir_cs csHooks, csServices;
static DWORD mainThreadId;
-static int hookId = 1;
+static int sttHookId = 1;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -115,7 +115,7 @@ MIR_CORE_DLL(HANDLE) CreateHookableEvent(const char *name)
THook *newItem = (THook*)mir_alloc(sizeof(THook));
strncpy(newItem->name, name, sizeof(newItem->name)); newItem->name[MAXMODULELABELLENGTH - 1] = 0;
- newItem->id = hookId++;
+ newItem->id = sttHookId++;
newItem->subscriberCount = 0;
newItem->subscriber = NULL;
newItem->pfnHook = NULL;
@@ -643,8 +643,8 @@ MIR_CORE_DLL(HINSTANCE) GetInstByAddress(void* codePtr)
idx--;
HINSTANCE result = pluginListAddr[idx];
- if (result < hInst && codePtr > hInst)
- result = hInst;
+ if (result < g_hInst && codePtr > g_hInst)
+ result = g_hInst;
else if (idx == 0 && codePtr < (void*)result)
result = NULL;
diff --git a/src/mir_core/src/threads.cpp b/src/mir_core/src/threads.cpp
index 16b5d4d993..23f34cf835 100644
--- a/src/mir_core/src/threads.cpp
+++ b/src/mir_core/src/threads.cpp
@@ -73,11 +73,11 @@ MIR_CORE_DLL(pfnExceptionFilter) GetExceptionFilter()
return pMirandaExceptFilter;
}
-MIR_CORE_DLL(pfnExceptionFilter) SetExceptionFilter(pfnExceptionFilter pMirandaExceptFilter)
+MIR_CORE_DLL(pfnExceptionFilter) SetExceptionFilter(pfnExceptionFilter _mirandaExceptFilter)
{
pfnExceptionFilter oldOne = pMirandaExceptFilter;
- if (pMirandaExceptFilter != 0)
- pMirandaExceptFilter = pMirandaExceptFilter;
+ if (_mirandaExceptFilter != 0)
+ pMirandaExceptFilter = _mirandaExceptFilter;
return oldOne;
}
diff --git a/src/mir_core/src/winver.cpp b/src/mir_core/src/winver.cpp
index bf40d2a2fa..71b7969f77 100644
--- a/src/mir_core/src/winver.cpp
+++ b/src/mir_core/src/winver.cpp
@@ -91,3 +91,300 @@ MIR_CORE_DLL(BOOL) IsScreenSaverRunning(void)
SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, &rc, FALSE);
return rc != 0;
}
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#ifndef VER_SUITE_WH_SERVER
+#define VER_SUITE_WH_SERVER 0x00008000
+#endif
+
+#ifndef PRODUCT_ULTIMATE
+#define PRODUCT_UNDEFINED 0x00000000
+#define PRODUCT_ULTIMATE 0x00000001
+#define PRODUCT_HOME_BASIC 0x00000002
+#define PRODUCT_HOME_PREMIUM 0x00000003
+#define PRODUCT_ENTERPRISE 0x00000004
+#define PRODUCT_HOME_BASIC_N 0x00000005
+#define PRODUCT_BUSINESS 0x00000006
+#define PRODUCT_STANDARD_SERVER 0x00000007
+#define PRODUCT_DATACENTER_SERVER 0x00000008
+#define PRODUCT_SMALLBUSINESS_SERVER 0x00000009
+#define PRODUCT_ENTERPRISE_SERVER 0x0000000A
+#define PRODUCT_STARTER 0x0000000B
+#define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C
+#define PRODUCT_STANDARD_SERVER_CORE 0x0000000D
+#define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E
+#define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F
+#define PRODUCT_BUSINESS_N 0x00000010
+#define PRODUCT_WEB_SERVER 0x00000011
+#define PRODUCT_CLUSTER_SERVER 0x00000012
+#define PRODUCT_HOME_SERVER 0x00000013
+#define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014
+#define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015
+#define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016
+#define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017
+#define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018
+#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019
+#define PRODUCT_HOME_PREMIUM_N 0x0000001a
+#define PRODUCT_ENTERPRISE_N 0x0000001b
+#define PRODUCT_ULTIMATE_N 0x0000001c
+#define PRODUCT_WEB_SERVER_CORE 0x0000001d
+#define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001e
+#define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001f
+#define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020
+#define PRODUCT_SERVER_FOUNDATION 0x00000021
+#define PRODUCT_HOME_PREMIUM_SERVER 0x00000022
+#define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023
+#define PRODUCT_STANDARD_SERVER_V 0x00000024
+#define PRODUCT_DATACENTER_SERVER_V 0x00000025
+#define PRODUCT_ENTERPRISE_SERVER_V 0x00000026
+#define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027
+#define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028
+#define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029
+#define PRODUCT_HYPERV 0x0000002a
+#define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002b
+#define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002c
+#define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002d
+#define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002e
+#define PRODUCT_STARTER_N 0x0000002f
+#define PRODUCT_PROFESSIONAL 0x00000030
+#define PRODUCT_PROFESSIONAL_N 0x00000031
+#define PRODUCT_SB_SOLUTION_SERVER 0x00000032
+#define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033
+#define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034
+#define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035
+#define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036
+#define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037
+#define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038
+#define PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039
+#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B
+#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C
+#define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D
+#define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E
+#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003f
+#define PRODUCT_CLUSTER_SERVER_V 0x00000040
+#define PRODUCT_EMBEDDED 0x00000041
+#define PRODUCT_STARTER_E 0x00000042
+#define PRODUCT_HOME_BASIC_E 0x00000043
+#define PRODUCT_HOME_PREMIUM_E 0x00000044
+#define PRODUCT_PROFESSIONAL_E 0x00000045
+#define PRODUCT_ENTERPRISE_E 0x00000046
+#define PRODUCT_ULTIMATE_E 0x00000047
+#endif
+#ifndef PRODUCT_CORE_N // Win8
+#define PRODUCT_CORE_N 0x00000062
+#define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063
+#define PRODUCT_CORE_SINGLELANGUAGE 0x00000064
+#define PRODUCT_CORE 0x00000065
+#define PRODUCT_PROFESSIONAL_WMC 0x00000067
+#define PRODUCT_UNLICENSED 0xABCDABCD
+#endif
+
+typedef BOOL(WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
+
+MIR_CORE_DLL(BOOL) GetOSDisplayString(TCHAR *buf, size_t bufSize)
+{
+ if (buf == NULL || bufSize == 0)
+ return 0;
+
+ buf[0] = 0;
+
+ OSVERSIONINFOEX osvi = { 0 };
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ BOOL bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi);
+ if (!bOsVersionInfoEx) {
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ if (!GetVersionEx((OSVERSIONINFO*)&osvi))
+ return FALSE;
+ }
+
+ if (VER_PLATFORM_WIN32_NT != osvi.dwPlatformId || osvi.dwMajorVersion <= 4)
+ return FALSE;
+
+ SYSTEM_INFO sysInfo = { 0 };
+ GetNativeSystemInfo(&sysInfo);
+
+ CMString ret(_T("Microsoft "));
+
+ // Test for the specific product.
+ if (osvi.dwMajorVersion >= 6) {
+ if (osvi.dwMajorVersion == 10) {
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ ret.Append(_T("Windows 10 "));
+ else
+ ret.Append(_T("Windows Server 10 "));
+ }
+ else switch (osvi.dwMinorVersion) {
+ case 0:
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ ret.Append(_T("Windows Vista "));
+ else
+ ret.Append(_T("Windows Server 2008 "));
+ break;
+
+ case 1:
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ ret.Append(_T("Windows 7 "));
+ else
+ ret.Append(_T("Windows Server 2008 R2 "));
+ break;
+
+ case 2:
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ ret.Append(_T("Windows 8 "));
+ else
+ ret.Append(_T("Windows Server 2012 "));
+ break;
+
+ case 3:
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ ret.Append(_T("Windows 8.1 "));
+ else
+ ret.Append(_T("Windows Server 2012 R2 "));
+ break;
+ }
+
+ DWORD dwType = 0;
+ HMODULE hKernel = GetModuleHandle(_T("kernel32.dll"));
+ PGPI pGPI = (PGPI)GetProcAddress(hKernel, "GetProductInfo");
+ if (pGPI != NULL)
+ pGPI(osvi.dwMajorVersion, osvi.dwMinorVersion, 0, 0, &dwType);
+
+ switch (dwType) {
+ case PRODUCT_ULTIMATE:
+ ret.Append(_T("Ultimate Edition"));
+ break;
+ case PRODUCT_PROFESSIONAL:
+ ret.Append(_T("Professional Edition"));
+ break;
+ case PRODUCT_PROFESSIONAL_WMC:
+ ret.Append(_T("Professional Edition with Media Center"));
+ break;
+ case PRODUCT_HOME_PREMIUM:
+ ret.Append(_T("Home Premium Edition"));
+ break;
+ case PRODUCT_HOME_BASIC:
+ ret.Append(_T("Home Basic Edition"));
+ break;
+ case PRODUCT_ENTERPRISE:
+ ret.Append(_T("Enterprise Edition"));
+ break;
+ case PRODUCT_BUSINESS:
+ ret.Append(_T("Business Edition"));
+ break;
+ case PRODUCT_STARTER:
+ ret.Append(_T("Starter Edition"));
+ break;
+ case PRODUCT_CLUSTER_SERVER:
+ ret.Append(_T("Cluster Server Edition"));
+ break;
+ case PRODUCT_DATACENTER_SERVER:
+ ret.Append(_T("Datacenter Edition"));
+ break;
+ case PRODUCT_DATACENTER_SERVER_CORE:
+ ret.Append(_T("Datacenter Edition (core installation)"));
+ break;
+ case PRODUCT_ENTERPRISE_SERVER:
+ ret.Append(_T("Enterprise Edition"));
+ break;
+ case PRODUCT_ENTERPRISE_SERVER_CORE:
+ ret.Append(_T("Enterprise Edition (core installation)"));
+ break;
+ case PRODUCT_ENTERPRISE_SERVER_IA64:
+ ret.Append(_T("Enterprise Edition for Itanium-based Systems"));
+ break;
+ case PRODUCT_SMALLBUSINESS_SERVER:
+ ret.Append(_T("Small Business Server"));
+ break;
+ case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
+ ret.Append(_T("Small Business Server Premium Edition"));
+ break;
+ case PRODUCT_STANDARD_SERVER:
+ ret.Append(_T("Standard Edition"));
+ break;
+ case PRODUCT_STANDARD_SERVER_CORE:
+ ret.Append(_T("Standard Edition (core installation)"));
+ break;
+ case PRODUCT_WEB_SERVER:
+ ret.Append(_T("Web Server Edition"));
+ break;
+ }
+ if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
+ ret.Append(_T(", 64-bit"));
+ else if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
+ ret.Append(_T(", 32-bit"));
+ }
+
+ if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) {
+ if (GetSystemMetrics(SM_SERVERR2))
+ ret.Append(_T("Windows Server 2003 R2, "));
+ else if (osvi.wSuiteMask == VER_SUITE_STORAGE_SERVER)
+ ret.Append(_T("Windows Storage Server 2003"));
+ else if (osvi.wSuiteMask == VER_SUITE_WH_SERVER)
+ ret.Append(_T("Windows Home Server"));
+ else if (osvi.wProductType == VER_NT_WORKSTATION && sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
+ ret.Append(_T("Windows XP Professional x64 Edition"));
+ else
+ ret.Append(_T("Windows Server 2003, "));
+
+ // Test for the server type.
+ if (osvi.wProductType != VER_NT_WORKSTATION) {
+ if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) {
+ if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
+ ret.Append(_T("Datacenter Edition for Itanium-based Systems"));
+ else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
+ ret.Append(_T("Enterprise Edition for Itanium-based Systems"));
+ }
+ else if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
+ if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
+ ret.Append(_T("Datacenter x64 Edition"));
+ else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
+ ret.Append(_T("Enterprise x64 Edition"));
+ else ret.Append(_T("Standard x64 Edition"));
+ }
+ else {
+ if (osvi.wSuiteMask & VER_SUITE_COMPUTE_SERVER)
+ ret.Append(_T("Compute Cluster Edition"));
+ else if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
+ ret.Append(_T("Datacenter Edition"));
+ else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
+ ret.Append(_T("Enterprise Edition"));
+ else if (osvi.wSuiteMask & VER_SUITE_BLADE)
+ ret.Append(_T("Web Edition"));
+ else ret.Append(_T("Standard Edition"));
+ }
+ }
+ }
+
+ if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) {
+ ret.Append(_T("Windows XP "));
+ if (osvi.wSuiteMask & VER_SUITE_PERSONAL)
+ ret.Append(_T("Home Edition"));
+ else ret.Append(_T("Professional"));
+ }
+
+ if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) {
+ ret.Append(_T("Windows 2000 "));
+
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ ret.Append(_T("Professional"));
+ else {
+ if (osvi.wSuiteMask & VER_SUITE_DATACENTER)
+ ret.Append(_T("Datacenter Server"));
+ else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
+ ret.Append(_T("Advanced Server"));
+ else ret.Append(_T("Server"));
+ }
+ }
+
+ // Include service pack (if any) and build number.
+
+ if (mir_tstrlen(osvi.szCSDVersion) > 0) {
+ ret.Append(_T(" "));
+ ret.Append(osvi.szCSDVersion);
+ }
+
+ ret.AppendFormat(_T(" (build %d)"), osvi.dwBuildNumber);
+ mir_tstrncpy(buf, ret, bufSize);
+ return TRUE;
+}
diff --git a/src/miranda32/res/miranda32.exe.manifest b/src/miranda32/res/miranda32.exe.manifest
index b0c140a148..a3b682f875 100644
--- a/src/miranda32/res/miranda32.exe.manifest
+++ b/src/miranda32/res/miranda32.exe.manifest
@@ -12,14 +12,16 @@
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
+ <!-- Windows 10 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
- <!-- Windows Vista -->
- <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
- <!-- Windows 7 -->
- <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+ <!-- Windows 7 -->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ <!-- Windows Vista -->
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
</application>
</compatibility>
</assembly>