Mike McCormack : msi: Fix insertion of null integers into a table.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Oct 23 06:16:34 CDT 2006
Module: wine
Branch: master
Commit: f6c7ae6a0c8b84794c4a46588f207e89cc17c75c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f6c7ae6a0c8b84794c4a46588f207e89cc17c75c
Author: Mike McCormack <mike at codeweavers.com>
Date: Tue Oct 24 02:18:21 2006 +0900
msi: Fix insertion of null integers into a table.
---
dlls/msi/table.c | 4 +++-
dlls/msi/tests/db.c | 7 +------
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 8d416f2..444c2a8 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -1378,7 +1378,9 @@ static UINT msi_table_modify_row( MSITAB
if( (~tv->columns[i].type & MSITYPE_KEY) && (~mask & (1<<i)) )
continue;
- if( (tv->columns[i].type & MSITYPE_STRING) &&
+ if (MSI_RecordIsNull( rec, i+1))
+ val = 0;
+ else if( (tv->columns[i].type & MSITYPE_STRING) &&
! MSITYPE_IS_BINARY(tv->columns[i].type) )
{
const WCHAR *str = MSI_RecordGetString( rec, i+1 );
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index 832e9eb..0a3125e 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -1458,10 +1458,7 @@ static void test_msiimport(void)
ok(i == 2, "Expected 2, got %d\n", i);
i = MsiRecordGetInteger(rec, 4);
- todo_wine
- {
- ok(i == 0x80000000, "Expected 0x80000000, got %d\n", i);
- }
+ ok(i == MSI_NULL_INTEGER, "Expected MSI_NULL_INTEGER, got %d\n", i);
i = MsiRecordGetInteger(rec, 5);
ok(i == 2147483640, "Expected 2147483640, got %d\n", i);
@@ -2887,12 +2884,10 @@ static void test_integers(void)
r = MsiRecordGetFieldCount(rec);
ok(r == 8, "record count wrong: %d\n", r);
- todo_wine {
i = MsiRecordGetInteger(rec, 1);
ok(i == MSI_NULL_INTEGER, "Expected MSI_NULL_INTEGER, got %d\n", i);
i = MsiRecordGetInteger(rec, 3);
ok(i == MSI_NULL_INTEGER, "Expected MSI_NULL_INTEGER, got %d\n", i);
- }
i = MsiRecordGetInteger(rec, 2);
ok(i == 2, "Expected 2, got %d\n", i);
i = MsiRecordGetInteger(rec, 4);
More information about the wine-cvs
mailing list