From 65d12c342d95d15320c127f8192fe08f1ef8a670 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 27 Jul 2006 12:34:20 +0900 Subject: [PATCH] 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 deletion(-) diff --git a/dlls/msi/table.c b/dlls/msi/table.c index 39dfc4e2067..1a3ccb2c112 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -1308,6 +1308,8 @@ static UINT msi_table_modify_row( MSITABLEVIEW *tv, MSIRECORD *rec, 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 8f0b75f23da..baf56351601 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 7670bfd9301..d01510bce9f 100644 --- a/dlls/msi/where.c +++ b/dlls/msi/where.c @@ -197,7 +197,7 @@ static UINT WHERE_evaluate( MSIDATABASE *db, MSIVIEW *table, UINT row, 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: