Commit 8343aed4 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Return selected properties only from IWbemClassObject::Next.

parent c9abb27d
...@@ -511,23 +511,30 @@ static HRESULT WINAPI class_object_Next( ...@@ -511,23 +511,30 @@ static HRESULT WINAPI class_object_Next(
CIMTYPE *pType, CIMTYPE *pType,
LONG *plFlavor ) LONG *plFlavor )
{ {
struct class_object *co = impl_from_IWbemClassObject( iface ); struct class_object *obj = impl_from_IWbemClassObject( iface );
struct enum_class_object *ec = impl_from_IEnumWbemClassObject( co->iter ); struct enum_class_object *iter = impl_from_IEnumWbemClassObject( obj->iter );
struct view *view = ec->query->view; struct view *view = iter->query->view;
BSTR property; BSTR prop;
HRESULT hr; HRESULT hr;
UINT i;
TRACE("%p, %08x, %p, %p, %p, %p\n", iface, lFlags, strName, pVal, pType, plFlavor); TRACE("%p, %08x, %p, %p, %p, %p\n", iface, lFlags, strName, pVal, pType, plFlavor);
if (!(property = get_property_name( co->name, co->index_property ))) return WBEM_S_NO_MORE_DATA; for (i = obj->index_property; i < view->table->num_cols; i++)
if ((hr = get_propval( view, co->index, property, pVal, pType, plFlavor ) != S_OK))
{ {
SysFreeString( property ); if (is_method( view->table, i )) continue;
return hr; if (!is_selected_prop( view, view->table->columns[i].name )) continue;
if (!(prop = SysAllocString( view->table->columns[i].name ))) return E_OUTOFMEMORY;
if ((hr = get_propval( view, obj->index, prop, pVal, pType, plFlavor )) != S_OK)
{
SysFreeString( prop );
return hr;
}
obj->index_property = i + 1;
*strName = prop;
return S_OK;
} }
*strName = property; return WBEM_S_NO_MORE_DATA;
co->index_property++;
return S_OK;
} }
static HRESULT WINAPI class_object_EndEnumeration( static HRESULT WINAPI class_object_EndEnumeration(
......
...@@ -424,7 +424,7 @@ done: ...@@ -424,7 +424,7 @@ done:
return hr; return hr;
} }
static BOOL is_selected_prop( const struct view *view, const WCHAR *name ) BOOL is_selected_prop( const struct view *view, const WCHAR *name )
{ {
const struct property *prop = view->proplist; const struct property *prop = view->proplist;
...@@ -563,7 +563,7 @@ done: ...@@ -563,7 +563,7 @@ done:
return ret; return ret;
} }
static inline BOOL is_method( const struct table *table, UINT column ) BOOL is_method( const struct table *table, UINT column )
{ {
return table->columns[column].type & COL_FLAG_METHOD; return table->columns[column].type & COL_FLAG_METHOD;
} }
......
...@@ -406,28 +406,3 @@ BSTR get_method_name( const WCHAR *class, UINT index ) ...@@ -406,28 +406,3 @@ BSTR get_method_name( const WCHAR *class, UINT index )
release_table( table ); release_table( table );
return NULL; return NULL;
} }
BSTR get_property_name( const WCHAR *class, UINT index )
{
struct table *table;
UINT i, count = 0;
BSTR ret;
if (!(table = grab_table( class ))) return NULL;
for (i = 0; i < table->num_cols; i++)
{
if (!(table->columns[i].type & COL_FLAG_METHOD))
{
if (index == count)
{
ret = SysAllocString( table->columns[i].name );
release_table( table );
return ret;
}
count++;
}
}
release_table( table );
return NULL;
}
...@@ -192,6 +192,7 @@ HRESULT get_column_index( const struct table *, const WCHAR *, UINT * ) DECLSPEC ...@@ -192,6 +192,7 @@ HRESULT get_column_index( const struct table *, const WCHAR *, UINT * ) DECLSPEC
HRESULT get_value( const struct table *, UINT, UINT, LONGLONG * ) DECLSPEC_HIDDEN; HRESULT get_value( const struct table *, UINT, UINT, LONGLONG * ) DECLSPEC_HIDDEN;
BSTR get_value_bstr( const struct table *, UINT, UINT ) DECLSPEC_HIDDEN; BSTR get_value_bstr( const struct table *, UINT, UINT ) DECLSPEC_HIDDEN;
HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE ) DECLSPEC_HIDDEN; HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE ) DECLSPEC_HIDDEN;
BOOL is_method( const struct table *, UINT ) DECLSPEC_HIDDEN;
HRESULT get_method( const struct table *, const WCHAR *, class_method ** ) DECLSPEC_HIDDEN; HRESULT get_method( const struct table *, const WCHAR *, class_method ** ) DECLSPEC_HIDDEN;
HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *, HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *,
CIMTYPE *, LONG * ) DECLSPEC_HIDDEN; CIMTYPE *, LONG * ) DECLSPEC_HIDDEN;
...@@ -200,10 +201,10 @@ HRESULT to_longlong( VARIANT *, LONGLONG *, CIMTYPE * ) DECLSPEC_HIDDEN; ...@@ -200,10 +201,10 @@ HRESULT to_longlong( VARIANT *, LONGLONG *, CIMTYPE * ) DECLSPEC_HIDDEN;
SAFEARRAY *to_safearray( const struct array *, CIMTYPE ) DECLSPEC_HIDDEN; SAFEARRAY *to_safearray( const struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
VARTYPE to_vartype( CIMTYPE ) DECLSPEC_HIDDEN; VARTYPE to_vartype( CIMTYPE ) DECLSPEC_HIDDEN;
void destroy_array( struct array *, CIMTYPE ) DECLSPEC_HIDDEN; void destroy_array( struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
BOOL is_selected_prop( const struct view *, const WCHAR * ) DECLSPEC_HIDDEN;
HRESULT get_properties( const struct view *, LONG, SAFEARRAY ** ) DECLSPEC_HIDDEN; HRESULT get_properties( const struct view *, LONG, SAFEARRAY ** ) DECLSPEC_HIDDEN;
HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN; HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN;
BSTR get_method_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN; BSTR get_method_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
BSTR get_property_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
void set_variant( VARTYPE, LONGLONG, void *, VARIANT * ) DECLSPEC_HIDDEN; void set_variant( VARTYPE, LONGLONG, void *, VARIANT * ) DECLSPEC_HIDDEN;
HRESULT create_signature( const WCHAR *, const WCHAR *, enum param_direction, HRESULT create_signature( const WCHAR *, const WCHAR *, enum param_direction,
IWbemClassObject ** ) DECLSPEC_HIDDEN; IWbemClassObject ** ) DECLSPEC_HIDDEN;
......
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