From: Fabian Maurer dark.shadow4@web.de
--- dlls/wbemprox/tests/query.c | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index ea108e31e49..d7f0d093531 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -544,11 +544,15 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path ) static const LONG expected_flavor = WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE | WBEM_FLAVOR_NOT_OVERRIDABLE | WBEM_FLAVOR_ORIGIN_PROPAGATED; + BSTR wql = SysAllocString( L"wql" ), query; WCHAR full_path[MAX_COMPUTERNAME_LENGTH + ARRAY_SIZE( L"\\%s\ROOT\CIMV2:" )]; BSTR class, method; IWbemClassObject *process, *sig_in, *sig_out, *out, *params; WCHAR cmdlineW[MAX_PATH + 64 + 1]; IWbemQualifierSet *qualifiers; + IEnumWbemClassObject *enum_result; + WCHAR query_buffer[100]; + WCHAR executable_path[255]; VARIANT retval, val; SAFEARRAY *names; LONG bound, i; @@ -765,8 +769,42 @@ static void test_Win32_Process( IWbemServices *services, BOOL use_full_path ) hr = IWbemQualifierSet_Get( qualifiers, L"ID", 0, &val, &flavor ); ok( hr == WBEM_E_NOT_FOUND, "got %#lx\n", hr );
+ /* Test query and result properties */ + + wsprintfW( query_buffer, L"SELECT * FROM Win32_Process WHERE ProcessId = %lu\n", GetCurrentProcessId() ); + query = SysAllocString( query_buffer); + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &enum_result ); + ok( hr == S_OK, "got %#lx\n", hr ); + if (hr == S_OK) + { + GetModuleFileNameW( NULL, executable_path, ARRAY_SIZE(executable_path) ); + + hr = IEnumWbemClassObject_Next( enum_result, 10000, 1, &process, &ret ); + ok( hr == S_OK, "got %#lx\n", hr ); + + type = 0xdeadbeef; + VariantInit( &val ); + todo_wine + hr = IWbemClassObject_Get( process, L"ExecutablePath", 0, &val, &type, NULL ); + todo_wine + ok( hr == S_OK, "IWbemClassObject_Get failed with %#lx\n", hr ); + todo_wine + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + todo_wine + ok( type == CIM_STRING, "unexpected type %#lx\n", type ); + todo_wine + ok( !lstrcmpiW( V_BSTR( &val ), executable_path), "got %s, expected %s\n", wine_dbgstr_w(V_BSTR(&val)), wine_dbgstr_w(executable_path) ); + VariantClear( &val ); + + IWbemClassObject_Release( process ); + IEnumWbemClassObject_Release( enum_result ); + } + IWbemQualifierSet_Release( qualifiers ); IWbemClassObject_Release( out ); + SysFreeString( wql ); + SysFreeString( query ); }
static void test_Win32_ComputerSystem( IWbemServices *services )