Commit 90e913c4 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Avoid storing rows that don't match the query condition.

parent aca407bf
......@@ -263,26 +263,30 @@ HRESULT get_method( const struct table *table, const WCHAR *name, class_method *
}
void clear_table( struct table *table )
void free_row_values( const struct table *table, UINT row )
{
UINT i, j, type;
UINT i, type;
LONGLONG val;
if (!table->data) return;
for (i = 0; i < table->num_rows; i++)
for (i = 0; i < table->num_cols; i++)
{
for (j = 0; j < table->num_cols; j++)
{
if (!(table->columns[j].type & COL_FLAG_DYNAMIC)) continue;
if (!(table->columns[i].type & COL_FLAG_DYNAMIC)) continue;
type = table->columns[j].type & COL_TYPE_MASK;
if (type == CIM_STRING || type == CIM_DATETIME || (type & CIM_FLAG_ARRAY))
{
if (get_value( table, i, j, &val ) == S_OK) heap_free( (void *)(INT_PTR)val );
}
type = table->columns[i].type & COL_TYPE_MASK;
if (type == CIM_STRING || type == CIM_DATETIME || (type & CIM_FLAG_ARRAY))
{
if (get_value( table, row, i, &val ) == S_OK) heap_free( (void *)(INT_PTR)val );
}
}
}
void clear_table( struct table *table )
{
UINT i;
if (!table->data) return;
for (i = 0; i < table->num_rows; i++) free_row_values( table, i );
if (table->fill)
{
table->num_rows = 0;
......@@ -295,10 +299,7 @@ void free_columns( struct column *columns, UINT num_cols )
{
UINT i;
for (i = 0; i < num_cols; i++)
{
heap_free( (WCHAR *)columns[i].name );
}
for (i = 0; i < num_cols; i++) { heap_free( (WCHAR *)columns[i].name ); }
heap_free( columns );
}
......
......@@ -178,6 +178,7 @@ struct table *create_table( const WCHAR *, UINT, const struct column *, UINT, BY
enum fill_status (*)(struct table *, const struct expr *) ) DECLSPEC_HIDDEN;
BOOL add_table( struct table * ) DECLSPEC_HIDDEN;
void free_columns( struct column *, UINT ) DECLSPEC_HIDDEN;
void free_row_values( const struct table *, UINT ) DECLSPEC_HIDDEN;
void clear_table( struct table * ) DECLSPEC_HIDDEN;
void free_table( struct table * ) DECLSPEC_HIDDEN;
UINT get_type_size( CIMTYPE ) 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