[PATCH] wbemprox: Add some properties of SoftwareLicensingProduct class.

Louis Lenders xerox.xerox2000x at gmail.com
Wed Jan 19 03:43:21 CST 2022


Part of https://bugs.winehq.org/show_bug.cgi?id=51163

Signed-off-by: Louis Lenders <xerox.xerox2000x at gmail.com>
---
 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..f47fc008b4b 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[] =
 {
     {
@@ -4136,6 +4151,7 @@ static struct table cimv2_builtin_classes[] =
     { L"Win32_Process", C(col_process), 0, 0, NULL, fill_process },
     { L"Win32_Processor", C(col_processor), 0, 0, NULL, fill_processor },
     { L"Win32_QuickFixEngineering", C(col_quickfixengineering), D(data_quickfixengineering) },
+    { L"SoftwareLicensingProduct", C(col_softwarelicensingproduct), D(data_softwarelicensingproduct) },
     { L"Win32_SID", C(col_sid), 0, 0, NULL, fill_sid },
     { L"Win32_Service", C(col_service), 0, 0, NULL, fill_service },
     { L"Win32_SoundDevice", C(col_sounddevice), 0, 0, NULL, fill_sounddevice },
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c
index 912671f4ad2..61b245f2e85 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" );
@@ -2209,6 +2234,7 @@ START_TEST(query)
     test_Win32_Processor( services );
     test_Win32_QuickFixEngineering( services );
     test_Win32_Service( services );
+    test_SoftwareLicensingProduct( services );
     test_Win32_SoundDevice( services );
     test_Win32_SystemEnclosure( services );
     test_Win32_VideoController( services );
-- 
2.34.1




More information about the wine-devel mailing list