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