Patch level : 10.0 644

Files correlati     : pdflib.dll
Ricompilazione Demo : [ ]
Commento            :
Corretto riconoscimento di Windows 7


git-svn-id: svn://10.65.10.50/trunk@20137 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-02-17 12:16:23 +00:00
parent 742b7b7168
commit 8a95f43ce6
3 changed files with 46 additions and 32 deletions

@ -44,22 +44,23 @@ static LONG GetNextNameValue(HKEY key, LPCTSTR subkey, LPTSTR szName, LPTSTR szD
// defines used by GetWinVer()
#define WUNKNOWNSTR _T("unknown Windows version")
#define W95STR _T("Windows 95")
#define W95SP1STR _T("Windows 95 SP1")
#define W95OSR2STR _T("Windows 95 OSR2")
#define W98STR _T("Windows 98")
#define W98SP1STR _T("Windows 98 SP1")
#define W98SESTR _T("Windows 98 SE")
#define WMESTR _T("Windows ME")
#define W95STR _T("Windows 95")
#define W95SP1STR _T("Windows 95 SP1")
#define W95OSR2STR _T("Windows 95 OSR2")
#define W98STR _T("Windows 98")
#define W98SP1STR _T("Windows 98 SP1")
#define W98SESTR _T("Windows 98 SE")
#define WMESTR _T("Windows ME")
#define WNT351STR _T("Windows NT 3.51")
#define WNT4STR _T("Windows NT 4")
#define W2KSTR _T("Windows 2000")
#define WXPSTR _T("Windows XP")
#define W2003STR _T("Windows Server 2003")
#define WVISTASTR _T("Windows Vista")
#define W2008STR _T("Windows Server 2008")
#define W7STR _T("Windows 7")
#define WNT351STR _T("Windows NT 3.51")
#define WNT4STR _T("Windows NT 4")
#define W2KSTR _T("Windows 2000")
#define WXPSTR _T("Windows XP")
#define W2003STR _T("Windows Server 2003")
#define WVISTASTR _T("Windows Vista")
#define W2008STR _T("Windows Server 2008")
#define W2008R2STR _T("Windows Server 2008 R2")
#define W7STR _T("Windows 7")
#define WCESTR _T("Windows CE")
@ -84,7 +85,8 @@ static LONG GetNextNameValue(HKEY key, LPCTSTR subkey, LPTSTR szName, LPTSTR szD
#define W2003 105
#define WVISTA 106
#define W2008 107
#define W7 108
#define W2008R2 108
#define W7 109
#define WNTLAST 199
#define WCEFIRST 201
@ -576,8 +578,9 @@ NT 4 2 4 0 1381
XP 2 5 1 2600
2003 2 5 2
Vista 2 6 0
2008 2 6 1
Win7 2 7
2008 2 6 0
2008 R2 2 6 1
Win7 2 6 1 3600
CE 3
@ -603,9 +606,9 @@ bool GetWinVer(LPTSTR lpszVersion, int nVersionSize, int *pnVersion)
int nVersion = WUNKNOWN;
LPCTSTR cp = WUNKNOWNSTR;
OSVERSIONINFO osinfo; memset(&osinfo, 0, sizeof(osinfo));
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (::GetVersionEx(&osinfo))
OSVERSIONINFOEX osinfo; memset(&osinfo, 0, sizeof(osinfo));
osinfo.dwOSVersionInfoSize = sizeof(osinfo);
if (::GetVersionEx((OSVERSIONINFO*)&osinfo))
{
DWORD dwPlatformId = osinfo.dwPlatformId;
DWORD dwMinorVersion = osinfo.dwMinorVersion;
@ -677,15 +680,24 @@ bool GetWinVer(LPTSTR lpszVersion, int nVersionSize, int *pnVersion)
}
else if (dwMajorVersion == 6)
{
cp = WVISTASTR;
nVersion = WVISTA;
const bool bServer = osinfo.wProductType != VER_NT_WORKSTATION;
switch (dwMinorVersion)
{
case 0:
if (bServer)
{ cp = W2008STR; nVersion = W2008; }
else
{ cp = WVISTASTR; nVersion = WVISTA; }
break;
default:
if (bServer)
{ cp = W2008R2STR; nVersion = W2008R2; }
else
{ cp = W7STR; nVersion = W7; }
break;
}
// TBI: Windows 2008 Server
}
else if (dwMajorVersion >= 7)
{
cp = W7STR;
nVersion = W7;
}
}
else if (dwPlatformId == VER_PLATFORM_WIN32_CE)
{

@ -3493,8 +3493,9 @@ int xvt_sys_get_os_version()
case 105: os = XVT_WS_WIN_2003; break;
case 106: os = XVT_WS_WIN_VISTA; break;
case 107: os = XVT_WS_WIN_2008; break;
case 108: os = XVT_WS_WIN_7; break;
default : os = XVT_WS_WIN_XP; break;
case 108: os = XVT_WS_WIN_2008R2; break;
case 109:
default : os = XVT_WS_WIN_7; break;
}
#else
os = XVT_WS_LINUX;
@ -3521,7 +3522,7 @@ int xvt_sys_get_version(char* os_version, char* ptk_version, int maxsize)
if (os_version && maxsize >= 8)
{
#ifdef __WXMSW__
if (version > XVT_WS_WIN_XP) // wxWidgets non sa descrivere i moderni sistemi Microsoft
if (version >= XVT_WS_WIN_VISTA) // wxWidgets non sa descrivere i moderni sistemi Microsoft
::GetWinVer(os_version, maxsize, NULL);
else
#endif

@ -19,7 +19,8 @@
#define XVT_WS_WIN_2003 307
#define XVT_WS_WIN_VISTA 308
#define XVT_WS_WIN_2008 309
#define XVT_WS_WIN_7 310
#define XVT_WS_WIN_2008R2 310
#define XVT_WS_WIN_7 311
#define XVT_WS_UNKNOWN 0
#define MACWS 100 /* Apple Macintosh */