Add Windows OS version

This commit is contained in:
fvanroie 2021-03-09 20:26:37 +01:00
parent f4ad8ed3d8
commit 3259bdcbe8
2 changed files with 13 additions and 1 deletions

View File

@ -52,7 +52,7 @@ void Win32Device::set_hostname(const char* hostname)
}
const char* Win32Device::get_core_version()
{
return "win32";
return _core_version.c_str();
}
const char* Win32Device::get_display_driver()
{

View File

@ -35,6 +35,17 @@ class Win32Device : public BaseDevice {
_hostname = "localhost";
}
// Get the Windows version.
DWORD dwBuild = 0;
DWORD dwVersion = GetVersion();
DWORD dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
DWORD dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
if(dwVersion < 0x80000000) dwBuild = (DWORD)(HIWORD(dwVersion));
char version[128];
snprintf(version, sizeof(version), "Windows %d.%d-%d", dwMajorVersion, dwMinorVersion, dwBuild);
_core_version = version;
// _backlight_pin = -1;
_backlight_power = 1;
_backlight_level = 100;
@ -63,6 +74,7 @@ class Win32Device : public BaseDevice {
private:
std::string _hostname;
std::string _core_version;
uint8_t _backlight_pin;
uint8_t _backlight_level;