Hans Leidekker : wbemprox: Add more Win32_BIOS properties.

Alexandre Julliard julliard at winehq.org
Mon Feb 5 16:48:26 CST 2018


Module: wine
Branch: master
Commit: bc07327c15d27360417811064fd218b8e0cd0001
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=bc07327c15d27360417811064fd218b8e0cd0001

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Feb  5 16:08:16 2018 +0100

wbemprox: Add more Win32_BIOS properties.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wbemprox/builtin.c     | 10 +++++++++-
 dlls/wbemprox/tests/query.c | 18 ++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index dd5b9ac..b699724 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -335,6 +335,10 @@ static const WCHAR prop_skunumberW[] =
     {'S','K','U','N','u','m','b','e','r',0};
 static const WCHAR prop_smbiosbiosversionW[] =
     {'S','M','B','I','O','S','B','I','O','S','V','e','r','s','i','o','n',0};
+static const WCHAR prop_smbiosmajorversionW[] =
+    {'S','M','B','I','O','S','M','a','j','o','r','V','e','r','s','i','o','n',0};
+static const WCHAR prop_smbiosminorversionW[] =
+    {'S','M','B','I','O','S','M','i','n','o','r','V','e','r','s','i','o','n',0};
 static const WCHAR prop_startmodeW[] =
     {'S','t','a','r','t','M','o','d','e',0};
 static const WCHAR prop_sidW[] =
@@ -418,6 +422,8 @@ static const struct column col_bios[] =
     { prop_releasedateW,        CIM_DATETIME },
     { prop_serialnumberW,       CIM_STRING },
     { prop_smbiosbiosversionW,  CIM_STRING },
+    { prop_smbiosmajorversionW, CIM_UINT16, VT_I4 },
+    { prop_smbiosminorversionW, CIM_UINT16, VT_I4 },
     { prop_versionW,            CIM_STRING|COL_FLAG_KEY }
 };
 static const struct column col_cdromdrive[] =
@@ -818,6 +824,8 @@ struct record_bios
     const WCHAR *releasedate;
     const WCHAR *serialnumber;
     const WCHAR *smbiosbiosversion;
+    UINT16       smbiosmajorversion;
+    UINT16       smbiosminorversion;
     const WCHAR *version;
 };
 struct record_cdromdrive
@@ -1113,7 +1121,7 @@ static const struct record_baseboard data_baseboard[] =
 static const struct record_bios data_bios[] =
 {
     { bios_descriptionW, NULL, bios_manufacturerW, bios_nameW, bios_releasedateW, bios_serialnumberW,
-      bios_smbiosbiosversionW, bios_versionW }
+      bios_smbiosbiosversionW, 1, 0, bios_versionW }
 };
 static const struct record_param data_param[] =
 {
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c
index 7f2e864..c2d0eba 100644
--- a/dlls/wbemprox/tests/query.c
+++ b/dlls/wbemprox/tests/query.c
@@ -288,6 +288,8 @@ static void test_Win32_Bios( IWbemServices *services )
     static const WCHAR releasedateW[] = {'R','e','l','e','a','s','e','D','a','t','e',0};
     static const WCHAR serialnumberW[] = {'S','e','r','i','a','l','N','u','m','b','e','r',0};
     static const WCHAR smbiosbiosversionW[] = {'S','M','B','I','O','S','B','I','O','S','V','e','r','s','i','o','n',0};
+    static const WCHAR smbiosmajorversionW[] = {'S','M','B','I','O','S','M','a','j','o','r','V','e','r','s','i','o','n',0};
+    static const WCHAR smbiosminorversionW[] = {'S','M','B','I','O','S','M','i','n','o','r','V','e','r','s','i','o','n',0};
     static const WCHAR versionW[] = {'V','e','r','s','i','o','n',0};
     BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW );
     IEnumWbemClassObject *result;
@@ -367,6 +369,22 @@ static void test_Win32_Bios( IWbemServices *services )
 
     type = 0xdeadbeef;
     VariantInit( &val );
+    hr = IWbemClassObject_Get( obj, smbiosmajorversionW, 0, &val, &type, NULL );
+    ok( hr == S_OK, "failed to get bios major version %08x\n", hr );
+    ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) );
+    ok( type == CIM_UINT16, "unexpected type 0x%x\n", type );
+    trace( "bios major version: %u\n", V_I4( &val ) );
+
+    type = 0xdeadbeef;
+    VariantInit( &val );
+    hr = IWbemClassObject_Get( obj, smbiosminorversionW, 0, &val, &type, NULL );
+    ok( hr == S_OK, "failed to get bios minor version %08x\n", hr );
+    ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) );
+    ok( type == CIM_UINT16, "unexpected type 0x%x\n", type );
+    trace( "bios minor version: %u\n", V_I4( &val ) );
+
+    type = 0xdeadbeef;
+    VariantInit( &val );
     hr = IWbemClassObject_Get( obj, versionW, 0, &val, &type, NULL );
     ok( hr == S_OK, "failed to get version %08x\n", hr );
     ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) );




More information about the wine-cvs mailing list