https://git.reactos.org/?p=reactos.git;a=commitdiff;h=43025b17d11ae59128826…
commit 43025b17d11ae59128826acdcb3811b4770a1a93
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Mar 13 00:16:26 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:28:08 2022 +0100
[WINESYNC] msi: Get rid of the find_matching_rows() view operation.
It was introduced in 9f487ba1d as part of an optimization, but ceased to be used in
a52c2bf94.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id ced768f2ec163e25b7e1cf54a87f4b01369a846e by Zebediah Figura
<z.figura12(a)gmail.com>
---
dll/win32/msi/alter.c | 9 ------
dll/win32/msi/create.c | 1 -
dll/win32/msi/delete.c | 10 ------
dll/win32/msi/distinct.c | 22 -------------
dll/win32/msi/drop.c | 1 -
dll/win32/msi/insert.c | 10 ------
dll/win32/msi/msipriv.h | 13 --------
dll/win32/msi/select.c | 20 ------------
dll/win32/msi/storages.c | 30 ------------------
dll/win32/msi/streams.c | 30 ------------------
dll/win32/msi/table.c | 80 ------------------------------------------------
dll/win32/msi/update.c | 9 ------
dll/win32/msi/where.c | 31 -------------------
13 files changed, 266 deletions(-)
diff --git a/dll/win32/msi/alter.c b/dll/win32/msi/alter.c
index 8b11351f8be..8899c4499da 100644
--- a/dll/win32/msi/alter.c
+++ b/dll/win32/msi/alter.c
@@ -221,14 +221,6 @@ static UINT ALTER_delete( struct tagMSIVIEW *view )
return ERROR_SUCCESS;
}
-static UINT ALTER_find_matching_rows( struct tagMSIVIEW *view, UINT col,
- UINT val, UINT *row, MSIITERHANDLE *handle )
-{
- TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
-
- return ERROR_FUNCTION_FAILED;
-}
-
static const MSIVIEWOPS alter_ops =
{
ALTER_fetch_int,
@@ -243,7 +235,6 @@ static const MSIVIEWOPS alter_ops =
ALTER_get_column_info,
ALTER_modify,
ALTER_delete,
- ALTER_find_matching_rows,
NULL,
NULL,
NULL,
diff --git a/dll/win32/msi/create.c b/dll/win32/msi/create.c
index c679d6b131f..0a60066d8e2 100644
--- a/dll/win32/msi/create.c
+++ b/dll/win32/msi/create.c
@@ -142,7 +142,6 @@ static const MSIVIEWOPS create_ops =
NULL,
NULL,
NULL,
- NULL,
};
static UINT check_columns( const column_info *col_info )
diff --git a/dll/win32/msi/delete.c b/dll/win32/msi/delete.c
index 4472409a0a0..4ed5384b8d1 100644
--- a/dll/win32/msi/delete.c
+++ b/dll/win32/msi/delete.c
@@ -164,15 +164,6 @@ static UINT DELETE_delete( struct tagMSIVIEW *view )
return ERROR_SUCCESS;
}
-static UINT DELETE_find_matching_rows( struct tagMSIVIEW *view, UINT col,
- UINT val, UINT *row, MSIITERHANDLE *handle )
-{
- TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
-
- return ERROR_FUNCTION_FAILED;
-}
-
-
static const MSIVIEWOPS delete_ops =
{
DELETE_fetch_int,
@@ -187,7 +178,6 @@ static const MSIVIEWOPS delete_ops =
DELETE_get_column_info,
DELETE_modify,
DELETE_delete,
- DELETE_find_matching_rows,
NULL,
NULL,
NULL,
diff --git a/dll/win32/msi/distinct.c b/dll/win32/msi/distinct.c
index 04f09fa4913..ff292f16bc4 100644
--- a/dll/win32/msi/distinct.c
+++ b/dll/win32/msi/distinct.c
@@ -247,27 +247,6 @@ static UINT DISTINCT_delete( struct tagMSIVIEW *view )
return ERROR_SUCCESS;
}
-static UINT DISTINCT_find_matching_rows( struct tagMSIVIEW *view, UINT col,
- UINT val, UINT *row, MSIITERHANDLE *handle )
-{
- MSIDISTINCTVIEW *dv = (MSIDISTINCTVIEW*)view;
- UINT r;
-
- TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
-
- if( !dv->table )
- return ERROR_FUNCTION_FAILED;
-
- r = dv->table->ops->find_matching_rows( dv->table, col, val, row, handle
);
-
- if( *row > dv->row_count )
- return ERROR_NO_MORE_ITEMS;
-
- *row = dv->translation[ *row ];
-
- return r;
-}
-
static const MSIVIEWOPS distinct_ops =
{
DISTINCT_fetch_int,
@@ -282,7 +261,6 @@ static const MSIVIEWOPS distinct_ops =
DISTINCT_get_column_info,
DISTINCT_modify,
DISTINCT_delete,
- DISTINCT_find_matching_rows,
NULL,
NULL,
NULL,
diff --git a/dll/win32/msi/drop.c b/dll/win32/msi/drop.c
index f0b58039fd3..41dbc8d4e28 100644
--- a/dll/win32/msi/drop.c
+++ b/dll/win32/msi/drop.c
@@ -112,7 +112,6 @@ static const MSIVIEWOPS drop_ops =
NULL,
NULL,
NULL,
- NULL,
};
UINT DROP_CreateView(MSIDATABASE *db, MSIVIEW **view, LPCWSTR name)
diff --git a/dll/win32/msi/insert.c b/dll/win32/msi/insert.c
index c404929f285..0ae0cdc77fb 100644
--- a/dll/win32/msi/insert.c
+++ b/dll/win32/msi/insert.c
@@ -318,15 +318,6 @@ static UINT INSERT_delete( struct tagMSIVIEW *view )
return ERROR_SUCCESS;
}
-static UINT INSERT_find_matching_rows( struct tagMSIVIEW *view, UINT col,
- UINT val, UINT *row, MSIITERHANDLE *handle )
-{
- TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
-
- return ERROR_FUNCTION_FAILED;
-}
-
-
static const MSIVIEWOPS insert_ops =
{
INSERT_fetch_int,
@@ -341,7 +332,6 @@ static const MSIVIEWOPS insert_ops =
INSERT_get_column_info,
INSERT_modify,
INSERT_delete,
- INSERT_find_matching_rows,
NULL,
NULL,
NULL,
diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h
index a637cfcc80d..79c50062ef8 100644
--- a/dll/win32/msi/msipriv.h
+++ b/dll/win32/msi/msipriv.h
@@ -301,19 +301,6 @@ typedef struct tagMSIVIEWOPS
*/
UINT (*delete)( struct tagMSIVIEW * );
- /*
- * find_matching_rows - iterates through rows that match a value
- *
- * If the column type is a string then a string ID should be passed in.
- * If the value to be looked up is an integer then no transformation of
- * the input value is required, except if the column is a string, in which
- * case a string ID should be passed in.
- * The handle is an input/output parameter that keeps track of the current
- * position in the iteration. It must be initialised to zero before the
- * first call and continued to be passed in to subsequent calls.
- */
- UINT (*find_matching_rows)( struct tagMSIVIEW *view, UINT col, UINT val, UINT *row,
MSIITERHANDLE *handle );
-
/*
* add_ref - increases the reference count of the table
*/
diff --git a/dll/win32/msi/select.c b/dll/win32/msi/select.c
index e8f38855a86..70d2c329505 100644
--- a/dll/win32/msi/select.c
+++ b/dll/win32/msi/select.c
@@ -331,25 +331,6 @@ static UINT SELECT_delete( struct tagMSIVIEW *view )
return ERROR_SUCCESS;
}
-static UINT SELECT_find_matching_rows( struct tagMSIVIEW *view, UINT col,
- UINT val, UINT *row, MSIITERHANDLE *handle )
-{
- MSISELECTVIEW *sv = (MSISELECTVIEW*)view;
-
- TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
-
- if( !sv->table )
- return ERROR_FUNCTION_FAILED;
-
- if( (col==0) || (col>sv->num_cols) )
- return ERROR_FUNCTION_FAILED;
-
- col = sv->cols[ col - 1 ];
-
- return sv->table->ops->find_matching_rows( sv->table, col, val, row,
handle );
-}
-
-
static const MSIVIEWOPS select_ops =
{
SELECT_fetch_int,
@@ -364,7 +345,6 @@ static const MSIVIEWOPS select_ops =
SELECT_get_column_info,
SELECT_modify,
SELECT_delete,
- SELECT_find_matching_rows,
NULL,
NULL,
NULL,
diff --git a/dll/win32/msi/storages.c b/dll/win32/msi/storages.c
index 3ca708cb5bc..f0b960d7c8b 100644
--- a/dll/win32/msi/storages.c
+++ b/dll/win32/msi/storages.c
@@ -415,35 +415,6 @@ static UINT STORAGES_delete(struct tagMSIVIEW *view)
return ERROR_SUCCESS;
}
-static UINT STORAGES_find_matching_rows(struct tagMSIVIEW *view, UINT col,
- UINT val, UINT *row, MSIITERHANDLE *handle)
-{
- MSISTORAGESVIEW *sv = (MSISTORAGESVIEW *)view;
- UINT index = PtrToUlong(*handle);
-
- TRACE("(%d, %d): %d\n", *row, col, val);
-
- if (col == 0 || col > NUM_STORAGES_COLS)
- return ERROR_INVALID_PARAMETER;
-
- while (index < sv->num_rows)
- {
- if (sv->storages[index]->str_index == val)
- {
- *row = index;
- break;
- }
-
- index++;
- }
-
- *handle = UlongToPtr(++index);
- if (index >= sv->num_rows)
- return ERROR_NO_MORE_ITEMS;
-
- return ERROR_SUCCESS;
-}
-
static const MSIVIEWOPS storages_ops =
{
STORAGES_fetch_int,
@@ -458,7 +429,6 @@ static const MSIVIEWOPS storages_ops =
STORAGES_get_column_info,
STORAGES_modify,
STORAGES_delete,
- STORAGES_find_matching_rows,
NULL,
NULL,
NULL,
diff --git a/dll/win32/msi/streams.c b/dll/win32/msi/streams.c
index e3a8c7bc30b..05367a42741 100644
--- a/dll/win32/msi/streams.c
+++ b/dll/win32/msi/streams.c
@@ -361,35 +361,6 @@ static UINT STREAMS_delete(struct tagMSIVIEW *view)
return ERROR_SUCCESS;
}
-static UINT STREAMS_find_matching_rows(struct tagMSIVIEW *view, UINT col,
- UINT val, UINT *row, MSIITERHANDLE *handle)
-{
- MSISTREAMSVIEW *sv = (MSISTREAMSVIEW *)view;
- UINT index = PtrToUlong(*handle);
-
- TRACE("(%p, %d, %d, %p, %p)\n", view, col, val, row, handle);
-
- if (!col || col > sv->num_cols)
- return ERROR_INVALID_PARAMETER;
-
- while (index < sv->db->num_streams)
- {
- if (sv->db->streams[index].str_index == val)
- {
- *row = index;
- break;
- }
- index++;
- }
-
- *handle = UlongToPtr(++index);
-
- if (index > sv->db->num_streams)
- return ERROR_NO_MORE_ITEMS;
-
- return ERROR_SUCCESS;
-}
-
static const MSIVIEWOPS streams_ops =
{
STREAMS_fetch_int,
@@ -404,7 +375,6 @@ static const MSIVIEWOPS streams_ops =
STREAMS_get_column_info,
STREAMS_modify,
STREAMS_delete,
- STREAMS_find_matching_rows,
NULL,
NULL,
NULL,
diff --git a/dll/win32/msi/table.c b/dll/win32/msi/table.c
index e046c5c9e27..e24b0bd0e53 100644
--- a/dll/win32/msi/table.c
+++ b/dll/win32/msi/table.c
@@ -1875,85 +1875,6 @@ static UINT TABLE_delete( struct tagMSIVIEW *view )
return ERROR_SUCCESS;
}
-static UINT TABLE_find_matching_rows( struct tagMSIVIEW *view, UINT col,
- UINT val, UINT *row, MSIITERHANDLE *handle )
-{
- MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
- const MSICOLUMNHASHENTRY *entry;
-
- TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
-
- if( !tv->table )
- return ERROR_INVALID_PARAMETER;
-
- if( (col==0) || (col > tv->num_cols) )
- return ERROR_INVALID_PARAMETER;
-
- if( !tv->columns[col-1].hash_table )
- {
- UINT i;
- UINT num_rows = tv->table->row_count;
- MSICOLUMNHASHENTRY **hash_table;
- MSICOLUMNHASHENTRY *new_entry;
-
- if( tv->columns[col-1].offset >= tv->row_size )
- {
- ERR("Stuffed up %d >= %d\n", tv->columns[col-1].offset,
tv->row_size );
- ERR("%p %p\n", tv, tv->columns );
- return ERROR_FUNCTION_FAILED;
- }
-
- /* allocate contiguous memory for the table and its entries so we
- * don't have to do an expensive cleanup */
- hash_table = msi_alloc(MSITABLE_HASH_TABLE_SIZE * sizeof(MSICOLUMNHASHENTRY*) +
- num_rows * sizeof(MSICOLUMNHASHENTRY));
- if (!hash_table)
- return ERROR_OUTOFMEMORY;
-
- memset(hash_table, 0, MSITABLE_HASH_TABLE_SIZE * sizeof(MSICOLUMNHASHENTRY*));
- tv->columns[col-1].hash_table = hash_table;
-
- new_entry = (MSICOLUMNHASHENTRY *)(hash_table + MSITABLE_HASH_TABLE_SIZE);
-
- for (i = 0; i < num_rows; i++, new_entry++)
- {
- UINT row_value;
-
- if (view->ops->fetch_int( view, i, col, &row_value ) !=
ERROR_SUCCESS)
- continue;
-
- new_entry->next = NULL;
- new_entry->value = row_value;
- new_entry->row = i;
- if (hash_table[row_value % MSITABLE_HASH_TABLE_SIZE])
- {
- MSICOLUMNHASHENTRY *prev_entry = hash_table[row_value %
MSITABLE_HASH_TABLE_SIZE];
- while (prev_entry->next)
- prev_entry = prev_entry->next;
- prev_entry->next = new_entry;
- }
- else
- hash_table[row_value % MSITABLE_HASH_TABLE_SIZE] = new_entry;
- }
- }
-
- if( !*handle )
- entry = tv->columns[col-1].hash_table[val % MSITABLE_HASH_TABLE_SIZE];
- else
- entry = (*handle)->next;
-
- while (entry && entry->value != val)
- entry = entry->next;
-
- *handle = entry;
- if (!entry)
- return ERROR_NO_MORE_ITEMS;
-
- *row = entry->row;
-
- return ERROR_SUCCESS;
-}
-
static UINT TABLE_add_ref(struct tagMSIVIEW *view)
{
MSITABLEVIEW *tv = (MSITABLEVIEW*)view;
@@ -2148,7 +2069,6 @@ static const MSIVIEWOPS table_ops =
TABLE_get_column_info,
TABLE_modify,
TABLE_delete,
- TABLE_find_matching_rows,
TABLE_add_ref,
TABLE_release,
TABLE_add_column,
diff --git a/dll/win32/msi/update.c b/dll/win32/msi/update.c
index d0e3c28f792..ed81447aa5e 100644
--- a/dll/win32/msi/update.c
+++ b/dll/win32/msi/update.c
@@ -195,14 +195,6 @@ static UINT UPDATE_delete( struct tagMSIVIEW *view )
return ERROR_SUCCESS;
}
-static UINT UPDATE_find_matching_rows( struct tagMSIVIEW *view, UINT col, UINT val, UINT
*row, MSIITERHANDLE *handle )
-{
- TRACE("%p %d %d %p\n", view, col, val, *handle );
-
- return ERROR_FUNCTION_FAILED;
-}
-
-
static const MSIVIEWOPS update_ops =
{
UPDATE_fetch_int,
@@ -217,7 +209,6 @@ static const MSIVIEWOPS update_ops =
UPDATE_get_column_info,
UPDATE_modify,
UPDATE_delete,
- UPDATE_find_matching_rows,
NULL,
NULL,
NULL,
diff --git a/dll/win32/msi/where.c b/dll/win32/msi/where.c
index ddd8c07fab5..b493bda7dd8 100644
--- a/dll/win32/msi/where.c
+++ b/dll/win32/msi/where.c
@@ -1015,36 +1015,6 @@ static UINT WHERE_delete( struct tagMSIVIEW *view )
return ERROR_SUCCESS;
}
-static UINT WHERE_find_matching_rows( struct tagMSIVIEW *view, UINT col,
- UINT val, UINT *row, MSIITERHANDLE *handle )
-{
- MSIWHEREVIEW *wv = (MSIWHEREVIEW*)view;
- UINT i, row_value;
-
- TRACE("%p, %d, %u, %p\n", view, col, val, *handle);
-
- if (!wv->tables)
- return ERROR_FUNCTION_FAILED;
-
- if (col == 0 || col > wv->col_count)
- return ERROR_INVALID_PARAMETER;
-
- for (i = PtrToUlong(*handle); i < wv->row_count; i++)
- {
- if (view->ops->fetch_int( view, i, col, &row_value ) != ERROR_SUCCESS)
- continue;
-
- if (row_value == val)
- {
- *row = i;
- *handle = UlongToPtr(i + 1);
- return ERROR_SUCCESS;
- }
- }
-
- return ERROR_NO_MORE_ITEMS;
-}
-
static UINT WHERE_sort(struct tagMSIVIEW *view, column_info *columns)
{
MSIWHEREVIEW *wv = (MSIWHEREVIEW *)view;
@@ -1108,7 +1078,6 @@ static const MSIVIEWOPS where_ops =
WHERE_get_column_info,
WHERE_modify,
WHERE_delete,
- WHERE_find_matching_rows,
NULL,
NULL,
NULL,