Skip to content

Commit

Permalink
SysInfo: Added "SysInfoType=OS_PRODUCT_NAME"
Browse files Browse the repository at this point in the history
This retrieves the "ProductName" from the registry from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
  • Loading branch information
brianferguson committed Sep 9, 2022
1 parent 111caf9 commit 42d5518
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Library/MeasureSysInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ void MeasureSysInfo::ReadOptions(ConfigParser& parser, const WCHAR* section)
{
m_Type = SysInfoType::OS_VERSION;
}
else if (_wcsicmp(L"OS_PRODUCT_NAME", type) == 0)
{
m_Type = SysInfoType::OS_PRODUCT_NAME;
}
else if (_wcsicmp(L"PAGESIZE", type) == 0)
{
m_Type = SysInfoType::PAGESIZE;
Expand Down Expand Up @@ -625,6 +629,10 @@ void MeasureSysInfo::UpdateValue()
m_StringValue = GetPlatform().GetName();
return;

case SysInfoType::OS_PRODUCT_NAME:
m_StringValue = GetPlatform().GetProductName();
return;

case SysInfoType::SCREEN_SIZE:
_snwprintf_s(buffer, bufferLen, L"%i x %i",
GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
Expand Down
1 change: 1 addition & 0 deletions Library/MeasureSysInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum class SysInfoType : UINT
USER_NAME,
USER_SID,
OS_VERSION,
OS_PRODUCT_NAME,
PAGESIZE,
OS_BITS,

Expand Down

0 comments on commit 42d5518

Please sign in to comment.