diff options
Diffstat (limited to 'libmsi/where.c')
-rw-r--r-- | libmsi/where.c | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/libmsi/where.c b/libmsi/where.c index b7b5ff0..18473ec 100644 --- a/libmsi/where.c +++ b/libmsi/where.c @@ -22,16 +22,9 @@ #include <stdarg.h> #include <assert.h> -#include "windef.h" -#include "winbase.h" -#include "winerror.h" #include "debug.h" -#include "unicode.h" #include "libmsi.h" -#include "objbase.h" -#include "objidl.h" #include "msipriv.h" -#include "winnls.h" #include "query.h" @@ -139,7 +132,7 @@ static unsigned add_row(LibmsiWhereView *wv, unsigned vals[]) wv->reorder_size = newsize; } - new = msi_alloc(FIELD_OFFSET( LibmsiRowEntry, values[wv->table_count] )); + new = msi_alloc(offsetof( LibmsiRowEntry, values[wv->table_count] )); if (!new) return LIBMSI_RESULT_OUTOFMEMORY; @@ -178,7 +171,7 @@ static unsigned parse_column(LibmsiWhereView *wv, union ext_column *column, do { - const WCHAR *table_name; + const char *table_name; if (column->unparsed.table) { @@ -186,20 +179,20 @@ static unsigned parse_column(LibmsiWhereView *wv, union ext_column *column, NULL, &table_name); if (r != LIBMSI_RESULT_SUCCESS) return r; - if (strcmpW(table_name, column->unparsed.table) != 0) + if (strcmp(table_name, column->unparsed.table) != 0) continue; } for(i = 1; i <= table->col_count; i++) { - const WCHAR *col_name; + const char *col_name; r = table->view->ops->get_column_info(table->view, i, &col_name, column_type, NULL, NULL); if(r != LIBMSI_RESULT_SUCCESS ) return r; - if(strcmpW(col_name, column->unparsed.column)) + if(strcmp(col_name, column->unparsed.column)) continue; column->parsed.column = i; column->parsed.table = table; @@ -208,7 +201,7 @@ static unsigned parse_column(LibmsiWhereView *wv, union ext_column *column, } while ((table = table->next)); - WARN("Couldn't find column %s.%s\n", debugstr_w( column->unparsed.table ), debugstr_w( column->unparsed.column ) ); + WARN("Couldn't find column %s.%s\n", debugstr_a( column->unparsed.table ), debugstr_a( column->unparsed.column ) ); return LIBMSI_RESULT_BAD_QUERY_SYNTAX; } @@ -235,7 +228,7 @@ static unsigned where_view_fetch_int( LibmsiView *view, unsigned row, unsigned c return table->view->ops->fetch_int(table->view, rows[table->table_index], col, val); } -static unsigned where_view_fetch_stream( LibmsiView *view, unsigned row, unsigned col, IStream **stm ) +static unsigned where_view_fetch_stream( LibmsiView *view, unsigned row, unsigned col, GsfInput **stm ) { LibmsiWhereView *wv = (LibmsiWhereView*)view; JOINTABLE *table; @@ -484,7 +477,7 @@ static unsigned expr_eval_unary( LibmsiWhereView *wv, const unsigned rows[], static unsigned expr_eval_string( LibmsiWhereView *wv, const unsigned rows[], const struct expr *expr, const LibmsiRecord *record, - const WCHAR **str ) + const char **str ) { unsigned val = 0, r = LIBMSI_RESULT_SUCCESS; @@ -519,7 +512,7 @@ static unsigned expr_eval_strcmp( LibmsiWhereView *wv, const unsigned rows[], co int *val, const LibmsiRecord *record ) { int sr; - const WCHAR *l_str, *r_str; + const char *l_str, *r_str; unsigned r; *val = true; @@ -538,7 +531,7 @@ static unsigned expr_eval_strcmp( LibmsiWhereView *wv, const unsigned rows[], co else if( r_str && ! l_str ) sr = -1; else - sr = strcmpW( l_str, r_str ); + sr = strcmp( l_str, r_str ); *val = ( expr->op == OP_EQ && ( sr == 0 ) ) || ( expr->op == OP_NE && ( sr != 0 ) ); @@ -857,8 +850,8 @@ static unsigned where_view_get_dimensions( LibmsiView *view, unsigned *rows, uns return LIBMSI_RESULT_SUCCESS; } -static unsigned where_view_get_column_info( LibmsiView *view, unsigned n, const WCHAR **name, - unsigned *type, bool *temporary, const WCHAR **table_name ) +static unsigned where_view_get_column_info( LibmsiView *view, unsigned n, const char **name, + unsigned *type, bool *temporary, const char **table_name ) { LibmsiWhereView *wv = (LibmsiWhereView*)view; JOINTABLE *table; @@ -921,7 +914,7 @@ static unsigned where_view_find_matching_rows( LibmsiView *view, unsigned col, if (col == 0 || col > wv->col_count) return LIBMSI_RESULT_INVALID_PARAMETER; - for (i = PtrToUlong(*handle); i < wv->row_count; i++) + for (i = (uintptr_t)*handle; i < wv->row_count; i++) { if (view->ops->fetch_int( view, i, col, &row_value ) != LIBMSI_RESULT_SUCCESS) continue; @@ -929,7 +922,7 @@ static unsigned where_view_find_matching_rows( LibmsiView *view, unsigned col, if (row_value == val) { *row = i; - *handle = UlongToPtr(i + 1); + *handle = (MSIITERHANDLE)(uintptr_t)(i + 1); return LIBMSI_RESULT_SUCCESS; } } @@ -1097,14 +1090,14 @@ static unsigned where_view_verify_condition( LibmsiWhereView *wv, struct expr *c return LIBMSI_RESULT_SUCCESS; } -unsigned where_view_create( LibmsiDatabase *db, LibmsiView **view, WCHAR *tables, +unsigned where_view_create( LibmsiDatabase *db, LibmsiView **view, char *tables, struct expr *cond ) { LibmsiWhereView *wv = NULL; unsigned r, valid = 0; - WCHAR *ptr; + char *ptr; - TRACE("(%s)\n", debugstr_w(tables) ); + TRACE("(%s)\n", debugstr_a(tables) ); wv = msi_alloc_zero( sizeof *wv ); if( !wv ) @@ -1119,7 +1112,7 @@ unsigned where_view_create( LibmsiDatabase *db, LibmsiView **view, WCHAR *tables { JOINTABLE *table; - if ((ptr = strchrW(tables, ' '))) + if ((ptr = strchr(tables, ' '))) *ptr = '\0'; table = msi_alloc(sizeof(JOINTABLE)); @@ -1132,7 +1125,7 @@ unsigned where_view_create( LibmsiDatabase *db, LibmsiView **view, WCHAR *tables r = table_view_create(db, tables, &table->view); if (r != LIBMSI_RESULT_SUCCESS) { - WARN("can't create table: %s\n", debugstr_w(tables)); + WARN("can't create table: %s\n", debugstr_a(tables)); msi_free(table); r = LIBMSI_RESULT_BAD_QUERY_SYNTAX; goto end; |