Commit 5b2113de authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Implement Win32_OperatingSystem.OperatingSystemSKU.

parent 66b2b3ea
...@@ -314,6 +314,8 @@ static const WCHAR prop_numlogicalprocessorsW[] = ...@@ -314,6 +314,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}; {'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[] = static const WCHAR prop_numprocessorsW[] =
{'N','u','m','b','e','r','O','f','P','r','o','c','e','s','s','o','r','s',0}; {'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[] = static const WCHAR prop_osarchitectureW[] =
{'O','S','A','r','c','h','i','t','e','c','t','u','r','e',0}; {'O','S','A','r','c','h','i','t','e','c','t','u','r','e',0};
static const WCHAR prop_oslanguageW[] = static const WCHAR prop_oslanguageW[] =
...@@ -588,6 +590,7 @@ static const struct column col_os[] = ...@@ -588,6 +590,7 @@ static const struct column col_os[] =
{ prop_localdatetimeW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_localdatetimeW, CIM_DATETIME|COL_FLAG_DYNAMIC },
{ prop_localeW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_localeW, CIM_STRING|COL_FLAG_DYNAMIC },
{ prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC },
{ prop_operatingsystemskuW, CIM_UINT32, VT_I4 },
{ prop_osarchitectureW, CIM_STRING }, { prop_osarchitectureW, CIM_STRING },
{ prop_oslanguageW, CIM_UINT32, VT_I4 }, { prop_oslanguageW, CIM_UINT32, VT_I4 },
{ prop_osproductsuiteW, CIM_UINT32, VT_I4 }, { prop_osproductsuiteW, CIM_UINT32, VT_I4 },
...@@ -1015,6 +1018,7 @@ struct record_operatingsystem ...@@ -1015,6 +1018,7 @@ struct record_operatingsystem
const WCHAR *localdatetime; const WCHAR *localdatetime;
const WCHAR *locale; const WCHAR *locale;
const WCHAR *name; const WCHAR *name;
UINT32 operatingsystemsku;
const WCHAR *osarchitecture; const WCHAR *osarchitecture;
UINT32 oslanguage; UINT32 oslanguage;
UINT32 osproductsuite; UINT32 osproductsuite;
...@@ -3197,6 +3201,12 @@ static WCHAR *get_osversion( OSVERSIONINFOEXW *ver ) ...@@ -3197,6 +3201,12 @@ static WCHAR *get_osversion( OSVERSIONINFOEXW *ver )
if (ret) sprintfW( ret, fmtW, ver->dwMajorVersion, ver->dwMinorVersion, ver->dwBuildNumber ); if (ret) sprintfW( ret, fmtW, ver->dwMajorVersion, ver->dwMinorVersion, ver->dwBuildNumber );
return ret; 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 ) static enum fill_status fill_os( struct table *table, const struct expr *cond )
{ {
...@@ -3222,6 +3232,7 @@ static enum fill_status fill_os( struct table *table, const struct expr *cond ) ...@@ -3222,6 +3232,7 @@ static enum fill_status fill_os( struct table *table, const struct expr *cond )
rec->localdatetime = get_localdatetime(); rec->localdatetime = get_localdatetime();
rec->locale = get_locale(); rec->locale = get_locale();
rec->name = get_osname( rec->caption ); rec->name = get_osname( rec->caption );
rec->operatingsystemsku = get_operatingsystemsku();
rec->osarchitecture = get_osarchitecture(); rec->osarchitecture = get_osarchitecture();
rec->oslanguage = GetSystemDefaultLangID(); rec->oslanguage = GetSystemDefaultLangID();
rec->osproductsuite = 2461140; /* Windows XP Professional */ rec->osproductsuite = 2461140; /* Windows XP Professional */
......
...@@ -1234,6 +1234,7 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) ...@@ -1234,6 +1234,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 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 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 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 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 ostypeW[] = {'O','S','T','y','p','e',0};
static const WCHAR suitemaskW[] = {'S','u','i','t','e','M','a','s','k',0}; static const WCHAR suitemaskW[] = {'S','u','i','t','e','M','a','s','k',0};
...@@ -1315,6 +1316,18 @@ static void test_Win32_OperatingSystem( IWbemServices *services ) ...@@ -1315,6 +1316,18 @@ static void test_Win32_OperatingSystem( IWbemServices *services )
type = 0xdeadbeef; type = 0xdeadbeef;
VariantInit( &val ); 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 ); hr = IWbemClassObject_Get( obj, osproductsuiteW, 0, &val, &type, NULL );
ok( hr == S_OK, "failed to get osproductsuite %08x\n", hr ); 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 ) ); ok( V_VT( &val ) == VT_I4 || broken(V_VT( &val ) == VT_NULL) /* winxp */, "unexpected variant type 0x%x\n", V_VT( &val ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment