mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 19:45:41 -04:00
[rp-download] IDownloader: Include the Windows OS version.
I meant to do this a while ago, but never got around to doing it... TODO: Version numbers for other OSes.
This commit is contained in:
parent
73cab42f07
commit
2f742c6900
@ -188,9 +188,32 @@ void IDownloader::createUserAgent(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// TODO: OS version number.
|
// Get the OS version number.
|
||||||
// For now, assuming "Windows NT".
|
OSVERSIONINFO osvi;
|
||||||
m_userAgent += _T(" (Windows NT");
|
osvi.dwOSVersionInfoSize = sizeof(osvi);
|
||||||
|
GetVersionEx(&osvi);
|
||||||
|
|
||||||
|
m_userAgent += _T(" (");
|
||||||
|
switch (osvi.dwPlatformId) {
|
||||||
|
case VER_PLATFORM_WIN32s:
|
||||||
|
// Good luck with that.
|
||||||
|
m_userAgent += _T("Win32s");
|
||||||
|
break;
|
||||||
|
case VER_PLATFORM_WIN32_WINDOWS:
|
||||||
|
default:
|
||||||
|
m_userAgent += _T("Windows");
|
||||||
|
break;
|
||||||
|
case VER_PLATFORM_WIN32_NT:
|
||||||
|
m_userAgent += _T("Windows NT");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
m_userAgent += _T(' ');
|
||||||
|
|
||||||
|
// Version number.
|
||||||
|
TCHAR buf[32];
|
||||||
|
_sntprintf(buf, _countof(buf), _T("%u.%u"), osvi.dwMajorVersion, osvi.dwMinorVersion);
|
||||||
|
m_userAgent += buf;
|
||||||
|
|
||||||
# ifndef NO_CPU
|
# ifndef NO_CPU
|
||||||
m_userAgent += _T("; ");
|
m_userAgent += _T("; ");
|
||||||
# ifdef _WIN64
|
# ifdef _WIN64
|
||||||
|
Loading…
Reference in New Issue
Block a user