Hans Leidekker : wbemprox: Implement Win32_OperatingSystem.OperatingSystemSKU.
Alexandre Julliard
julliard at winehq.org
Fri Aug 23 09:31:25 CDT 2019
Module: wine
Branch: stable
Commit: fee0e11d3641ac3dac2639838257985db5086cc2
URL: https://source.winehq.org/git/wine.git/?a=commit;h=fee0e11d3641ac3dac2639838257985db5086cc2
Author: Hans Leidekker <hans at codeweavers.com>
Date: Mon Mar 25 10:06:05 2019 +0100
wbemprox: Implement Win32_OperatingSystem.OperatingSystemSKU.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46895
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 5b2113de2d62a22828d793a3fd82741c8f181c70)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/wbemprox/builtin.c | 11 +++++++++++
dlls/wbemprox/tests/query.c | 13 +++++++++++++
2 files changed, 24 insertions(+)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 67b048c..a7dd23b 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -312,6 +312,8 @@ static const WCHAR prop_numlogicalprocessorsW[] =
{'N','u','m','b','e','r','O','f','L','o','g','i','c','a','l','P','r','o','c','e','s','s','o','r','s',0};
static const WCHAR prop_numprocessorsW[] =
{'N','u','m','b','e','r','O','f','P','r','o','c','e','s','s','o','r','s',0};
+static const WCHAR prop_operatingsystemskuW[] =
+ {'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m','S','K','U',0};
static const WCHAR prop_osarchitectureW[] =
{'O','S','A','r','c','h','i','t','e','c','t','u','r','e',0};
static const WCHAR prop_oslanguageW[] =
@@ -584,6 +586,7 @@ static const struct column col_os[] =
{ prop_localdatetimeW, CIM_DATETIME|COL_FLAG_DYNAMIC },
{ prop_localeW, CIM_STRING|COL_FLAG_DYNAMIC },
{ prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC },
+ { prop_operatingsystemskuW, CIM_UINT32, VT_I4 },
{ prop_osarchitectureW, CIM_STRING },
{ prop_oslanguageW, CIM_UINT32, VT_I4 },
{ prop_osproductsuiteW, CIM_UINT32, VT_I4 },
@@ -1009,6 +1012,7 @@ struct record_operatingsystem
const WCHAR *localdatetime;
const WCHAR *locale;
const WCHAR *name;
+ UINT32 operatingsystemsku;
const WCHAR *osarchitecture;
UINT32 oslanguage;
UINT32 osproductsuite;
@@ -3116,6 +3120,12 @@ static WCHAR *get_osversion( OSVERSIONINFOEXW *ver )
if (ret) sprintfW( ret, fmtW, ver->dwMajorVersion, ver->dwMinorVersion, ver->dwBuildNumber );
return ret;
}
+static DWORD get_operatingsystemsku(void)
+{
+ DWORD ret = PRODUCT_UNDEFINED;
+ GetProductInfo( 6, 0, 0, 0, &ret );
+ return ret;
+}
static enum fill_status fill_os( struct table *table, const struct expr *cond )
{
@@ -3141,6 +3151,7 @@ static enum fill_status fill_os( struct table *table, const struct expr *cond )
rec->localdatetime = get_localdatetime();
rec->locale = get_locale();
rec->name = get_osname( rec->caption );
+ rec->operatingsystemsku = get_operatingsystemsku();
rec->osarchitecture = get_osarchitecture();
rec->oslanguage = GetSystemDefaultLangID();
rec->osproductsuite = 2461140; /* Windows XP Professional */
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c
index d19797c..7819f85 100644
--- a/dlls/wbemprox/tests/query.c
+++ b/dlls/wbemprox/tests/query.c
@@ -1183,6 +1183,7 @@ static void test_Win32_OperatingSystem( IWbemServices *services )
static const WCHAR csdversionW[] = {'C','S','D','V','e','r','s','i','o','n',0};
static const WCHAR freephysicalmemoryW[] = {'F','r','e','e','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0};
static const WCHAR nameW[] = {'N','a','m','e',0};
+ static const WCHAR operatingsystemskuW[] = {'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m','S','K','U',0};
static const WCHAR osproductsuiteW[] = {'O','S','P','r','o','d','u','c','t','S','u','i','t','e',0};
static const WCHAR ostypeW[] = {'O','S','T','y','p','e',0};
static const WCHAR suitemaskW[] = {'S','u','i','t','e','M','a','s','k',0};
@@ -1264,6 +1265,18 @@ static void test_Win32_OperatingSystem( IWbemServices *services )
type = 0xdeadbeef;
VariantInit( &val );
+ hr = IWbemClassObject_Get( obj, operatingsystemskuW, 0, &val, &type, NULL );
+ ok( hr == S_OK || broken(hr == WBEM_E_NOT_FOUND) /* winxp */, "failed to get operatingsystemsku %08x\n", hr );
+ if (hr == S_OK)
+ {
+ ok( V_VT( &val ) == VT_I4, "unexpected variant type 0x%x\n", V_VT( &val ) );
+ ok( type == CIM_UINT32, "unexpected type 0x%x\n", type );
+ trace( "operatingsystemsku: %08x\n", V_I4( &val ) );
+ VariantClear( &val );
+ }
+
+ type = 0xdeadbeef;
+ VariantInit( &val );
hr = IWbemClassObject_Get( obj, osproductsuiteW, 0, &val, &type, NULL );
ok( hr == S_OK, "failed to get osproductsuite %08x\n", hr );
ok( V_VT( &val ) == VT_I4 || broken(V_VT( &val ) == VT_NULL) /* winxp */, "unexpected variant type 0x%x\n", V_VT( &val ) );
More information about the wine-cvs
mailing list