Commit 492a9653 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Make name and value optional in IWbemClassObject::Next.

parent a9c6ff23
......@@ -532,8 +532,11 @@ static HRESULT WINAPI class_object_Next(
SysFreeString( prop );
return hr;
}
obj->index_property = i + 1;
*strName = prop;
if (strName) *strName = prop;
else SysFreeString( prop );
return S_OK;
}
return WBEM_S_NO_MORE_DATA;
......
......@@ -668,50 +668,71 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
if (!strcmpiW( name, classW ))
{
if (ret)
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_classname( view );
}
if (type) *type = CIM_STRING;
return S_OK;
}
if (!strcmpiW( name, genusW ))
{
if (ret)
{
V_VT( ret ) = VT_I4;
V_I4( ret ) = WBEM_GENUS_INSTANCE; /* FIXME */
}
if (type) *type = CIM_SINT32;
return S_OK;
}
else if (!strcmpiW( name, namespaceW ))
{
if (ret)
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_namespace( view );
}
if (type) *type = CIM_STRING;
return S_OK;
}
else if (!strcmpiW( name, pathW ))
{
if (ret)
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_path( view, index, name );
}
if (type) *type = CIM_STRING;
return S_OK;
}
if (!strcmpiW( name, propcountW ))
{
if (ret)
{
V_VT( ret ) = VT_I4;
V_I4( ret ) = count_selected_properties( view );
}
if (type) *type = CIM_SINT32;
return S_OK;
}
else if (!strcmpiW( name, relpathW ))
{
if (ret)
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_relpath( view, index, name );
}
if (type) *type = CIM_STRING;
return S_OK;
}
else if (!strcmpiW( name, serverW ))
{
if (ret)
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_servername( view );
}
if (type) *type = CIM_STRING;
return S_OK;
}
......@@ -835,6 +856,11 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR
hr = get_value( view->table, row, column, &val );
if (hr != S_OK) return hr;
if (type) *type = view->table->columns[column].type & COL_TYPE_MASK;
if (flavor) *flavor = 0;
if (!ret) return S_OK;
vartype = view->table->columns[column].vartype;
if (view->table->columns[column].type & CIM_FLAG_ARRAY)
{
......@@ -843,8 +869,10 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR
val_ptr = to_safearray( (const struct array *)(INT_PTR)val, basetype );
if (!val_ptr) vartype = VT_NULL;
else if (!vartype) vartype = to_vartype( basetype ) | VT_ARRAY;
goto done;
set_variant( vartype, val, val_ptr, ret );
return S_OK;
}
switch (view->table->columns[column].type & COL_TYPE_MASK)
{
case CIM_BOOLEAN:
......@@ -891,10 +919,7 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR
return WBEM_E_FAILED;
}
done:
set_variant( vartype, val, val_ptr, ret );
if (type) *type = view->table->columns[column].type & COL_TYPE_MASK;
if (flavor) *flavor = 0;
return S_OK;
}
......
......@@ -1194,6 +1194,8 @@ static void test_Win32_OperatingSystem( IWbemServices *services )
hr = IWbemClassObject_BeginEnumeration( obj, 0 );
ok( hr == S_OK, "got %08x\n", hr );
while (IWbemClassObject_Next( obj, 0, NULL, NULL, NULL, NULL ) == S_OK) {}
hr = IWbemClassObject_EndEnumeration( obj );
ok( hr == S_OK, "got %08x\n", hr );
......
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