diff --git a/rostests/winetests/wbemprox/query.c b/rostests/winetests/wbemprox/query.c index b46ff521cb6..3138c7a467c 100644 --- a/rostests/winetests/wbemprox/query.c +++ b/rostests/winetests/wbemprox/query.c @@ -98,7 +98,11 @@ static void test_select( IWbemServices *services ) '\"','\\','\\','\\','\\','.','\\','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0','\"',0}; static const WCHAR query9[] = {'S','E','L','E','C','T','\n','a','\r','F','R','O','M','\t','b',0}; - static const WCHAR *test[] = { query1, query2, query3, query4, query5, query6, query7, query8, query9 }; + static const WCHAR query10[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'P','r','o','c','e','s','s',' ','W','H','E','R','E',' ','C','a','p','t','i','o','n',' ', + 'L','I','K','E',' ','"','%','f','i','r','e','f','o','x','.','e','x','e','"',0}; + static const WCHAR *test[] = { query1, query2, query3, query4, query5, query6, query7, query8, query9, query10 }; HRESULT hr; IEnumWbemClassObject *result; BSTR wql = SysAllocString( wqlW ); @@ -239,6 +243,110 @@ out: SysFreeString( class ); } +static void test_Win32_Bios( IWbemServices *services ) +{ + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', 'B','i','o','s',0}; + static const WCHAR descriptionW[] = {'D','e','s','c','r','i','p','t','i','o','n',0}; + static const WCHAR identificationcodeW[] = {'I','d','e','n','t','i','f','i','c','a','t','i','o','n','C','o','d','e',0}; + static const WCHAR manufacturerW[] = {'M','a','n','u','f','a','c','t','u','r','e','r',0}; + static const WCHAR nameW[] = {'N','a','m','e',0}; + 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 versionW[] = {'V','e','r','s','i','o','n',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + CIMTYPE type; + ULONG count; + VARIANT val; + HRESULT hr; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK, "IWbemServices_ExecQuery failed %08x\n", hr ); + + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + ok( hr == S_OK, "IEnumWbemClassObject_Next failed %08x\n", hr ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, descriptionW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get description %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "description: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, identificationcodeW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get identication code %08x\n", hr ); + todo_wine + ok( V_VT( &val ) == VT_NULL, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, manufacturerW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get manufacturer %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "manufacturer: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, nameW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get name %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "name: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, releasedateW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get release date %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_DATETIME, "unexpected type 0x%x\n", type ); + trace( "release date: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, serialnumberW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get serial number %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR || V_VT( &val ) == VT_NULL /* Testbot VMs */, + "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, smbiosbiosversionW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get bios version %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "bios version: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &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 ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "version: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + IWbemClassObject_Release( obj ); + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + static void test_Win32_Process( IWbemServices *services ) { static const WCHAR returnvalueW[] = {'R','e','t','u','r','n','V','a','l','u','e',0}; @@ -941,6 +1049,7 @@ START_TEST(query) ok( hr == S_OK, "failed to set proxy blanket %08x\n", hr ); test_select( services ); + test_Win32_Bios( services ); test_Win32_Process( services ); test_Win32_Service( services ); test_Win32_ComputerSystem( services );