Module: wine Branch: refs/heads/master Commit: 65d12c342d95d15320c127f8192fe08f1ef8a670 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=65d12c342d95d15320c127f8...
Author: Mike McCormack mike@codeweavers.com Date: Thu Jul 27 12:34:20 2006 +0900
msi: Fix the value of LONG integers in records (suggested by James Hawkins).
---
dlls/msi/table.c | 2 ++ dlls/msi/tests/db.c | 8 ++++++++ dlls/msi/where.c | 2 +- 3 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/dlls/msi/table.c b/dlls/msi/table.c index 39dfc4e..1a3ccb2 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -1308,6 +1308,8 @@ static UINT msi_table_modify_row( MSITAB val = MSI_RecordGetInteger( rec, i+1 ); if ( 2 == bytes_per_column( &tv->columns[i] ) ) val ^= 0x8000; + else + val ^= 0x80000000; } r = TABLE_set_int( &tv->view, row, i+1, val ); if( r ) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 8f0b75f..baf5635 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -1026,12 +1026,20 @@ static void test_where(void) r = do_query(hdb, query, &rec); ok(r == ERROR_SUCCESS, "MsiViewFetch failed: %d\n", r); ok( check_record( rec, 4, "zero.cab"), "wrong cabinet\n"); + MsiCloseHandle( rec );
query = "SELECT * FROM `Media` WHERE `LastSequence` >= 1"; r = do_query(hdb, query, &rec); ok(r == ERROR_SUCCESS, "MsiViewFetch failed: %d\n", r); ok( check_record( rec, 4, "one.cab"), "wrong cabinet\n");
+ r = MsiRecordGetInteger(rec, 1); + ok( 2 == r, "field wrong\n"); + r = MsiRecordGetInteger(rec, 2); + ok( 1 == r, "field wrong\n"); + + MsiCloseHandle( rec ); + MsiCloseHandle( hdb ); DeleteFile(msifile); } diff --git a/dlls/msi/where.c b/dlls/msi/where.c index 7670bfd..d01510b 100644 --- a/dlls/msi/where.c +++ b/dlls/msi/where.c @@ -197,7 +197,7 @@ static UINT WHERE_evaluate( MSIDATABASE
case EXPR_COL_NUMBER32: r = table->ops->fetch_int( table, row, cond->u.col_number, &tval ); - *val = tval; + *val = tval - 0x80000000; return r;
case EXPR_UVAL: