Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/wbemprox/builtin.c | 24 +++++++++++++++++- dlls/wbemprox/tests/query.c | 59 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 80 insertions(+), 3 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 93bea5280c..dd5b9ac9cf 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -331,6 +331,8 @@ static const WCHAR prop_servicetypeW[] = {'S','e','r','v','i','c','e','T','y','p','e',0}; static const WCHAR prop_settingidW[] = {'S','e','t','t','i','n','g','I','D',0}; +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_startmodeW[] = @@ -377,6 +379,8 @@ static const WCHAR prop_uuidW[] = {'U','U','I','D',0}; static const WCHAR prop_varianttypeW[] = {'V','a','r','i','a','n','t','T','y','p','e',0}; +static const WCHAR prop_vendorW[] = + {'V','e','n','d','o','r',0}; static const WCHAR prop_versionW[] = {'V','e','r','s','i','o','n',0}; static const WCHAR prop_videoarchitectureW[] = @@ -440,7 +444,11 @@ static const struct column col_compsys[] = static const struct column col_compsysproduct[] = { { prop_identifyingnumberW, CIM_STRING|COL_FLAG_KEY }, - { prop_uuidW, CIM_STRING|COL_FLAG_DYNAMIC } + { prop_nameW, CIM_STRING|COL_FLAG_KEY }, + { prop_skunumberW, CIM_STRING }, + { prop_uuidW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_vendorW, CIM_STRING }, + { prop_versionW, CIM_STRING|COL_FLAG_KEY } }; static const struct column col_datafile[] = { @@ -738,9 +746,15 @@ static const WCHAR compsys_modelW[] = {'W','i','n','e',0}; static const WCHAR compsysproduct_identifyingnumberW[] = {'0',0}; +static const WCHAR compsysproduct_nameW[] = + {'W','i','n','e',0}; static const WCHAR compsysproduct_uuidW[] = {'d','e','a','d','d','e','a','d','-','d','e','a','d','-','d','e','a','d','-','d','e','a','d','-', 'd','e','a','d','d','e','a','d','d','e','a','d',0}; +static const WCHAR compsysproduct_vendorW[] = + {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0}; +static const WCHAR compsysproduct_versionW[] = + {'1','.','0',0}; static const WCHAR diskdrive_interfacetypeW[] = {'I','D','E',0}; static const WCHAR diskdrive_manufacturerW[] = @@ -830,7 +844,11 @@ struct record_computersystem struct record_computersystemproduct { const WCHAR *identifyingnumber; + const WCHAR *name; + const WCHAR *skunumber; const WCHAR *uuid; + const WCHAR *vendor; + const WCHAR *version; }; struct record_datafile { @@ -1417,7 +1435,11 @@ static enum fill_status fill_compsysproduct( struct table *table, const struct e
rec = (struct record_computersystemproduct *)table->data; rec->identifyingnumber = compsysproduct_identifyingnumberW; + rec->name = compsysproduct_nameW; + rec->skunumber = NULL; rec->uuid = get_compsysproduct_uuid(); + rec->vendor = compsysproduct_vendorW; + rec->version = compsysproduct_versionW; if (!match_row( table, row, cond, &status )) free_row_values( table, row ); else row++;
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 79b09c0966..7f2e864eea 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1223,7 +1223,18 @@ static void test_OperatingSystem( IWbemServices *services )
static void test_ComputerSystemProduct( IWbemServices *services ) { - static const WCHAR uuidW[] = {'U','U','I','D',0}; + static const WCHAR identifyingnumberW[] = + {'I','d','e','n','t','i','f','y','i','n','g','N','u','m','b','e','r',0}; + static const WCHAR nameW[] = + {'N','a','m','e',0}; + static const WCHAR skunumberW[] = + {'S','K','U','N','u','m','b','e','r',0}; + static const WCHAR uuidW[] = + {'U','U','I','D',0}; + static const WCHAR vendorW[] = + {'V','e','n','d','o','r',0}; + static const WCHAR versionW[] = + {'V','e','r','s','i','o','n',0}; static const WCHAR queryW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', 'C','o','m','p','u','t','e','r','S','y','s','t','e','m','P','r','o','d','u','c','t',0}; @@ -1247,13 +1258,57 @@ static void test_ComputerSystemProduct( IWbemServices *services )
type = 0xdeadbeef; VariantInit( &value ); + hr = IWbemClassObject_Get( obj, identifyingnumberW, 0, &value, &type, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "identifyingnumber %s\n", wine_dbgstr_w(V_BSTR(&value)) ); + VariantClear( &value ); + + type = 0xdeadbeef; + VariantInit( &value ); + hr = IWbemClassObject_Get( obj, nameW, 0, &value, &type, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "name %s\n", wine_dbgstr_w(V_BSTR(&value)) ); + VariantClear( &value ); + + type = 0xdeadbeef; + VariantInit( &value ); + hr = IWbemClassObject_Get( obj, skunumberW, 0, &value, &type, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &value ) == VT_NULL, "unexpected variant type 0x%x\n", V_VT( &value ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + VariantClear( &value ); + + type = 0xdeadbeef; + VariantInit( &value ); hr = IWbemClassObject_Get( obj, uuidW, 0, &value, &type, NULL ); - ok( hr == S_OK, "failed to get computer name %08x\n", hr ); + ok( hr == S_OK, "got %08x\n", hr ); ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); trace( "uuid %s\n", wine_dbgstr_w(V_BSTR(&value)) ); VariantClear( &value );
+ type = 0xdeadbeef; + VariantInit( &value ); + hr = IWbemClassObject_Get( obj, vendorW, 0, &value, &type, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "vendor %s\n", wine_dbgstr_w(V_BSTR(&value)) ); + VariantClear( &value ); + + type = 0xdeadbeef; + VariantInit( &value ); + hr = IWbemClassObject_Get( obj, versionW, 0, &value, &type, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &value ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &value ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "version %s\n", wine_dbgstr_w(V_BSTR(&value)) ); + VariantClear( &value ); + IWbemClassObject_Release( obj ); IEnumWbemClassObject_Release( result ); SysFreeString( query );