From a9826b48e4c385ddce1d7913c41cdc652b8fbf06 Mon Sep 17 00:00:00 2001 From: Louis Lenders Date: Wed, 19 Jan 2022 12:43:07 +0100 Subject: [PATCH] wbemprox: Add some properties of SoftwareLicensingProduct class. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51163 Signed-off-by: Louis Lenders Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/wbemprox/builtin.c | 16 ++++++++++++++++ dlls/wbemprox/tests/query.c | 26 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 6b63c744b69..5a09d64b8fb 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -387,6 +387,11 @@ static const struct column col_sid[] = { L"SID", CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, { L"SidLength", CIM_UINT32 }, }; +static const struct column col_softwarelicensingproduct[] = +{ + { L"LicenseIsAddon", CIM_BOOLEAN }, + { L"LicenseStatus", CIM_UINT32 }, +}; static const struct column col_sounddevice[] = { { L"DeviceID", CIM_STRING|COL_FLAG_DYNAMIC }, @@ -809,6 +814,11 @@ struct record_sid const WCHAR *sid; UINT32 sidlength; }; +struct record_softwarelicensingproduct +{ + int license_is_addon; + UINT32 license_status; +}; struct record_sounddevice { const WCHAR *deviceid; @@ -978,6 +988,11 @@ static const struct record_quickfixengineering data_quickfixengineering[] = { L"http://winehq.org", L"KB1234567" }, }; +static const struct record_softwarelicensingproduct data_softwarelicensingproduct[] = +{ + { 0, 1 }, +}; + static const struct record_stdregprov data_stdregprov[] = { { @@ -4110,6 +4125,7 @@ static struct table cimv2_builtin_classes[] = { L"CIM_DataFile", C(col_datafile), 0, 0, NULL, fill_datafile }, { L"CIM_LogicalDisk", C(col_logicaldisk), 0, 0, NULL, fill_logicaldisk }, { L"CIM_Processor", C(col_processor), 0, 0, NULL, fill_processor }, + { L"SoftwareLicensingProduct", C(col_softwarelicensingproduct), D(data_softwarelicensingproduct) }, { L"StdRegProv", C(col_stdregprov), D(data_stdregprov) }, { L"SystemRestore", C(col_sysrestore), D(data_sysrestore) }, { L"Win32_BIOS", C(col_bios), 0, 0, NULL, fill_bios }, diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 912671f4ad2..583ae578efa 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1835,6 +1835,31 @@ static void test_Win32_WinSAT( IWbemServices *services ) SysFreeString( wql ); } +static void test_SoftwareLicensingProduct( IWbemServices *services ) +{ + BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM SoftwareLicensingProduct" ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + HRESULT hr; + DWORD count; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK , "got %08x\n", hr ); + + for (;;) + { + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (hr != S_OK) break; + check_property( obj, L"LicenseIsAddon", VT_BOOL, CIM_BOOLEAN ); + check_property( obj, L"LicenseStatus", VT_I4, CIM_UINT32 ); + IWbemClassObject_Release( obj ); + } + + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + static void test_Win32_DesktopMonitor( IWbemServices *services ) { BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM Win32_DesktopMonitor" ); @@ -2187,6 +2212,7 @@ START_TEST(query) test_select( services ); /* classes */ + test_SoftwareLicensingProduct( services ); test_StdRegProv( services ); test_SystemSecurity( services ); test_Win32_Baseboard( services );