[PATCH] wbemprox: Add a stub MSSMBios_RawSMBiosTables implementation.

Hans Leidekker hans at codeweavers.com
Fri Dec 3 07:20:25 CST 2021


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51946
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/wbemprox/builtin.c     | 22 +++++++++++++++++++++-
 dlls/wbemprox/tests/query.c | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 3fccd3fb600..6b63c744b69 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -358,6 +358,10 @@ static const struct column col_quickfixengineering[] =
     { L"Caption",  CIM_STRING },
     { L"HotFixID", CIM_STRING|COL_FLAG_KEY },
 };
+static const struct column col_rawsmbiostables[] =
+{
+    { L"SMBiosData", CIM_UINT8|CIM_FLAG_ARRAY },
+};
 static const struct column col_service[] =
 {
     { L"AcceptPause",   CIM_BOOLEAN },
@@ -776,6 +780,10 @@ struct record_quickfixengineering
     const WCHAR *caption;
     const WCHAR *hotfixid;
 };
+struct record_rawsmbiostables
+{
+    const struct array *smbiosdata;
+};
 struct record_service
 {
     int          accept_pause;
@@ -953,11 +961,18 @@ static const struct record_physicalmedia data_physicalmedia[] =
 {
     { L"WINEHDISK", L"\\\\.\\PHYSICALDRIVE0" }
 };
+
+static const struct record_rawsmbiostables data_rawsmbiostables[] =
+{
+    { 0 },
+};
+
 static const struct record_qualifier data_qualifier[] =
 {
     { L"__WIN32_PROCESS_GETOWNER_OUT", L"User", CIM_SINT32, FLAVOR_ID, L"ID", 0 },
     { L"__WIN32_PROCESS_GETOWNER_OUT", L"Domain", CIM_SINT32, FLAVOR_ID, L"ID", 1 }
 };
+
 static const struct record_quickfixengineering data_quickfixengineering[] =
 {
     { L"http://winehq.org", L"KB1234567" },
@@ -4128,6 +4143,11 @@ static struct table cimv2_builtin_classes[] =
     { L"Win32_VideoController", C(col_videocontroller), 0, 0, NULL, fill_videocontroller },
     { L"Win32_WinSAT", C(col_winsat), D(data_winsat) },
 };
+
+static struct table wmi_builtin_classes[] =
+{
+    { L"MSSMBios_RawSMBiosTables", C(col_rawsmbiostables), D(data_rawsmbiostables) },
+};
 #undef C
 #undef D
 
@@ -4141,7 +4161,7 @@ builtin_namespaces[WBEMPROX_NAMESPACE_LAST] =
 {
     {L"cimv2", cimv2_builtin_classes, ARRAY_SIZE(cimv2_builtin_classes)},
     {L"Microsoft\\Windows\\Storage", NULL, 0},
-    {L"wmi", NULL, 0},
+    {L"wmi", wmi_builtin_classes, ARRAY_SIZE(wmi_builtin_classes)},
 };
 
 void init_table_list( void )
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c
index 577a352c26f..912671f4ad2 100644
--- a/dlls/wbemprox/tests/query.c
+++ b/dlls/wbemprox/tests/query.c
@@ -2102,6 +2102,41 @@ static void test_empty_namespace( IWbemLocator *locator )
     IWbemServices_Release( services );
 }
 
+static void test_MSSMBios_RawSMBiosTables( IWbemLocator *locator )
+{
+    BSTR path = SysAllocString( L"ROOT\\WMI" );
+    BSTR bios = SysAllocString( L"MSSMBios_RawSMBiosTables" );
+    IWbemServices *services;
+    IEnumWbemClassObject *iter;
+    IWbemClassObject *obj;
+    VARIANT val;
+    CIMTYPE type;
+    ULONG count;
+    HRESULT hr;
+
+    hr = IWbemLocator_ConnectServer( locator, path, NULL, NULL, NULL, 0, NULL, NULL, &services );
+    ok( hr == S_OK, "failed to get IWbemServices interface %08x\n", hr );
+
+    hr = IWbemServices_CreateInstanceEnum( services, bios, 0, NULL, &iter );
+    ok( hr == S_OK, "got %08x\n", hr );
+
+    hr = IEnumWbemClassObject_Next( iter, WBEM_INFINITE, 1, &obj, &count );
+    ok( hr == S_OK, "got %08x\n", hr );
+
+    type = 0;
+    VariantInit( &val );
+    hr = IWbemClassObject_Get( obj, L"SMBiosData", 0, &val, &type, NULL );
+    ok( hr == S_OK, "got %08x\n", hr );
+    todo_wine ok( V_VT( &val ) == (VT_UI1 | VT_ARRAY), "got %08x\n", V_VT(&val) );
+    ok( type == (CIM_UINT8 | CIM_FLAG_ARRAY), "got %08x\n", type );
+
+    IWbemClassObject_Release( obj );
+    IEnumWbemClassObject_Release( iter );
+    IWbemServices_Release( services );
+    SysFreeString( path );
+    SysFreeString( bios );
+}
+
 START_TEST(query)
 {
     BSTR path = SysAllocString( L"ROOT\\CIMV2" );
@@ -2180,6 +2215,7 @@ START_TEST(query)
     test_Win32_WinSAT( services );
     test_SystemRestore( services );
     test_empty_namespace( locator );
+    test_MSSMBios_RawSMBiosTables( locator );
 
     SysFreeString( path );
     IWbemServices_Release( services );
-- 
2.30.2




More information about the wine-devel mailing list