From: Paul Gofman <pgofman@codeweavers.com> --- dlls/wbemprox/builtin.c | 10 ++++++++++ dlls/wbemprox/tests/query.c | 1 + 2 files changed, 11 insertions(+) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index f79c0f7b2b1..1a5fb06c9b8 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -526,6 +526,7 @@ static const struct column col_systemenclosure[] = { L"LockPresent", CIM_BOOLEAN }, { L"Manufacturer", CIM_STRING|COL_FLAG_DYNAMIC }, { L"Name", CIM_STRING }, + { L"SerialNumber", CIM_STRING|COL_FLAG_DYNAMIC }, { L"Tag", CIM_STRING }, }; static const struct column col_systemsecurity[] = @@ -1123,6 +1124,7 @@ struct record_systemenclosure int lockpresent; const WCHAR *manufacturer; const WCHAR *name; + const WCHAR *serial_number; const WCHAR *tag; }; struct record_videocontroller @@ -4572,6 +4574,13 @@ done: return ret; } +static WCHAR *get_systemenclosure_serialnumber( const char *buf, UINT len ) +{ + WCHAR *ret = get_smbios_string( SMBIOS_TYPE_CHASSIS, 0, offsetof(struct smbios_chassis, serial), buf, len ); + if (!ret) return wcsdup( L"0" ); + return ret; +} + static enum fill_status fill_systemenclosure( struct table *table, const struct expr *cond ) { struct record_systemenclosure *rec; @@ -4592,6 +4601,7 @@ static enum fill_status fill_systemenclosure( struct table *table, const struct rec->lockpresent = get_systemenclosure_lockpresent( buf, len ); rec->manufacturer = get_systemenclosure_manufacturer( buf, len ); rec->name = L"System Enclosure"; + rec->serial_number = get_systemenclosure_serialnumber( buf, len ); rec->tag = L"System Enclosure 0"; if (!match_row( table, row, cond, &status )) free_row_values( table, row ); else row++; diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 5be4ade6dce..59d1ff49042 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -975,6 +975,7 @@ static void test_Win32_SystemEnclosure( IWbemServices *services ) check_property( obj, L"LockPresent", VT_BOOL, CIM_BOOLEAN ); check_property( obj, L"Manufacturer", VT_BSTR, CIM_STRING ); check_property( obj, L"Name", VT_BSTR, CIM_STRING ); + check_property( obj, L"SerialNumber", VT_BSTR, CIM_STRING ); check_property( obj, L"Tag", VT_BSTR, CIM_STRING ); IWbemClassObject_Release( obj ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9887