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..e0bc2968f39 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -527,6 +527,7 @@ static const struct column col_systemenclosure[] = { L"Manufacturer", CIM_STRING|COL_FLAG_DYNAMIC }, { L"Name", CIM_STRING }, { L"Tag", CIM_STRING }, + { L"SerialNumber", CIM_STRING|COL_FLAG_DYNAMIC }, }; static const struct column col_systemsecurity[] = { @@ -1124,6 +1125,7 @@ struct record_systemenclosure const WCHAR *manufacturer; const WCHAR *name; const WCHAR *tag; + const WCHAR *serial_number; }; 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_SYSTEM, 0, offsetof(struct smbios_system, 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; @@ -4593,6 +4602,7 @@ static enum fill_status fill_systemenclosure( struct table *table, const struct rec->manufacturer = get_systemenclosure_manufacturer( buf, len ); rec->name = L"System Enclosure"; rec->tag = L"System Enclosure 0"; + rec->serial_number = get_systemenclosure_serialnumber( buf, len ); 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..260e191adbe 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -976,6 +976,7 @@ static void test_Win32_SystemEnclosure( IWbemServices *services ) check_property( obj, L"Manufacturer", VT_BSTR, CIM_STRING ); check_property( obj, L"Name", VT_BSTR, CIM_STRING ); check_property( obj, L"Tag", VT_BSTR, CIM_STRING ); + check_property( obj, L"SerialNumber", VT_BSTR, CIM_STRING ); IWbemClassObject_Release( obj ); done: -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9887