mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-28 16:57:51 +00:00
[Windows] More tidyup and robustness for metro app support - debug cleanup and serialization of input (not quite finished) [windows] Refactor serialized input code when used with key event thread model [windows] Add consistent precompiled headers for other projects [windows] Merge console window test into metro support [Windows] Tidy up work and identify additional TODOs for metro-style app support [Windows] Ensure error case falls through to default hook processing for console windows [Windows] Refactor shared memory into memory mapped file so we can cross 32-64 bit boundary [Windows] Tweaks to C++ security calls and parameters [Windows] Start refactor of SerialKeyEvent* classes [Windows] Rename to SerialKeyEventServer (refactoring) [Windows] Complete refactoring of SerialKeyEventClient class [Windows] Further encapsulation and cleanup with 'interfaces' to reduce header pollution [Windows] Complete serialization fix with move of modifier state management from client thread to server thread to guarantee consistency [Windows] Replace atom-based keyboard switching with memory mapped file indexed to avoid security constraints [Windows] Fixup Left Alt+Shift interaction with serializer [Windows] Use Windows 8.1 SDK for test
126 lines
3.3 KiB
C++
126 lines
3.3 KiB
C++
/*
|
|
Name: versioninfo
|
|
Copyright: Copyright (C) SIL International.
|
|
Documentation:
|
|
Description:
|
|
Create Date: 11 Dec 2009
|
|
|
|
Modified Date: 4 May 2010
|
|
Authors: mcdurdin
|
|
Related Files:
|
|
Dependencies:
|
|
|
|
Bugs:
|
|
Todo:
|
|
Notes:
|
|
History: 11 Dec 2009 - mcdurdin - I934 - x64 - Initial version
|
|
12 Mar 2010 - mcdurdin - I934 - x64 - Complete
|
|
12 Mar 2010 - mcdurdin - I2229 - Remove hints and warnings
|
|
04 May 2010 - mcdurdin - I2357 - Version info update for Windows 7
|
|
*/
|
|
|
|
#include "pch.h"
|
|
|
|
#pragma warning(disable: 4996)
|
|
void GetWindowsVersion(char *buf)
|
|
{
|
|
OSVERSIONINFOEX osvi;
|
|
|
|
char *pplatform = "unknown", *pos = "unknown", *pextra = "";
|
|
char verinfo[256];
|
|
verinfo[0] = 0;
|
|
|
|
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
|
GetVersionEx((OSVERSIONINFO *)&osvi);
|
|
|
|
switch(osvi.dwPlatformId)
|
|
{
|
|
case VER_PLATFORM_WIN32_NT:
|
|
pplatform = "NT";
|
|
if ( osvi.dwMajorVersion <= 4 )
|
|
pos = "Microsoft Windows NT";
|
|
|
|
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )
|
|
pos = "Microsoft Windows 2000";
|
|
|
|
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )
|
|
pos = "Microsoft Windows XP";
|
|
|
|
if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 )
|
|
pos = "Microsoft Windows Vista";
|
|
|
|
if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1 )
|
|
pos = "Microsoft Windows 7";
|
|
|
|
// Test for product type.
|
|
|
|
if ( osvi.wProductType == VER_NT_WORKSTATION )
|
|
{
|
|
if( osvi.wSuiteMask & VER_SUITE_PERSONAL )
|
|
pextra = "Personal";
|
|
else
|
|
pextra = "Professional";
|
|
}
|
|
|
|
else if ( osvi.wProductType == VER_NT_SERVER )
|
|
{
|
|
if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
|
|
pextra = "DataCenter Server";
|
|
else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
|
|
pextra = "Advanced Server";
|
|
else
|
|
pextra = "Server";
|
|
}
|
|
|
|
// Display version, service pack (if any), and build number.
|
|
|
|
if ( osvi.dwMajorVersion <= 4 )
|
|
{
|
|
wsprintf (verinfo, "version %d.%d %s (Build %d)",
|
|
osvi.dwMajorVersion,
|
|
osvi.dwMinorVersion,
|
|
osvi.szCSDVersion,
|
|
osvi.dwBuildNumber & 0xFFFF);
|
|
}
|
|
else
|
|
{
|
|
wsprintf (verinfo, "version %s (Build %d)",
|
|
osvi.szCSDVersion,
|
|
osvi.dwBuildNumber & 0xFFFF);
|
|
}
|
|
break;
|
|
|
|
case VER_PLATFORM_WIN32_WINDOWS:
|
|
|
|
pplatform = "9x";
|
|
|
|
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
|
|
{
|
|
pos = "Microsoft Windows 95";
|
|
if ( osvi.szCSDVersion[1] == 'C' || osvi.szCSDVersion[1] == 'B' )
|
|
pextra = "OSR2";
|
|
}
|
|
|
|
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)
|
|
{
|
|
pos = "Microsoft Windows 98";
|
|
if ( osvi.szCSDVersion[1] == 'A' )
|
|
pextra = "SE";
|
|
}
|
|
|
|
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
|
|
{
|
|
pos = "Microsoft Windows Me";
|
|
}
|
|
break;
|
|
|
|
case VER_PLATFORM_WIN32s:
|
|
|
|
pplatform = "Win32s";
|
|
pos = "Microsoft Win32s";
|
|
break;
|
|
}
|
|
|
|
wsprintf(buf, "Platform %s OS %s%s%s %s", pplatform, pos, pextra ? " " : "", pextra, verinfo);
|
|
}
|
|
#pragma warning(default: 4996)
|