Commit 0f8cbab1 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Add a function to resize a table.

parent f4da96bb
......@@ -781,7 +781,7 @@ static HRESULT create_signature_table( IEnumWbemClassObject *iter, WCHAR *name )
hr = create_signature_columns_and_data( iter, &num_cols, &columns, &row );
if (hr != S_OK) return hr;
if (!(table = create_table( name, num_cols, columns, 1, row, NULL )))
if (!(table = create_table( name, num_cols, columns, 1, 1, row, NULL )))
{
free_columns( columns, num_cols );
heap_free( row );
......
......@@ -290,6 +290,7 @@ void clear_table( struct table *table )
if (table->fill)
{
table->num_rows = 0;
table->num_rows_allocated = 0;
heap_free( table->data );
table->data = NULL;
}
......@@ -345,20 +346,21 @@ struct table *grab_table( const WCHAR *name )
}
struct table *create_table( const WCHAR *name, UINT num_cols, const struct column *columns,
UINT num_rows, BYTE *data,
UINT num_rows, UINT num_allocated, BYTE *data,
enum fill_status (*fill)(struct table *, const struct expr *cond) )
{
struct table *table;
if (!(table = heap_alloc( sizeof(*table) ))) return NULL;
table->name = heap_strdupW( name );
table->num_cols = num_cols;
table->columns = columns;
table->num_rows = num_rows;
table->data = data;
table->fill = fill;
table->flags = TABLE_FLAG_DYNAMIC;
table->refs = 0;
table->name = heap_strdupW( name );
table->num_cols = num_cols;
table->columns = columns;
table->num_rows = num_rows;
table->num_rows_allocated = num_allocated;
table->data = data;
table->fill = fill;
table->flags = TABLE_FLAG_DYNAMIC;
table->refs = 0;
list_init( &table->entry );
return table;
}
......
......@@ -108,6 +108,7 @@ struct table
UINT num_cols;
const struct column *columns;
UINT num_rows;
UINT num_rows_allocated;
BYTE *data;
enum fill_status (*fill)(struct table *, const struct expr *cond);
UINT flags;
......@@ -177,7 +178,7 @@ void init_table_list( void ) DECLSPEC_HIDDEN;
struct table *grab_table( const WCHAR * ) DECLSPEC_HIDDEN;
struct table *addref_table( struct table * ) DECLSPEC_HIDDEN;
void release_table( struct table * ) DECLSPEC_HIDDEN;
struct table *create_table( const WCHAR *, UINT, const struct column *, UINT, BYTE *,
struct table *create_table( const WCHAR *, UINT, const struct column *, UINT, UINT, BYTE *,
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;
......
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