Mike McCormack : msi: Stream fields shouldn't be treated as strings.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 17 06:12:28 CDT 2006


Module: wine
Branch: master
Commit: 1f737c035efc2bd8736d7e1b20c3137e271ab170
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1f737c035efc2bd8736d7e1b20c3137e271ab170

Author: Mike McCormack <mike at codeweavers.com>
Date:   Tue Oct 17 17:48:53 2006 +0900

msi: Stream fields shouldn't be treated as strings.

---

 dlls/msi/table.c    |    4 +++-
 dlls/msi/tests/db.c |   14 ++++++++++++++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 22b5a71..68d246a 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -1293,7 +1293,9 @@ static UINT table_validate_new( MSITABLE
         if ( tv->columns[i].type & MSITYPE_NULLABLE )
             continue;
 
-        if ( tv->columns[i].type & MSITYPE_STRING )
+        if ( MSITYPE_IS_BINARY(tv->columns[i].type) )
+            TRACE("skipping binary column\n");
+        else if ( tv->columns[i].type & MSITYPE_STRING )
         {
             LPCWSTR str;
 
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index 68c7682..f7dce1e 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -1906,6 +1906,20 @@ static void test_try_transform(void)
     r = run_query(hdb, 0, query);
     ok(r == ERROR_SUCCESS, "failed to add table\n");
 
+    hrec = MsiCreateRecord(2);
+    r = MsiRecordSetInteger(hrec, 1, 2);
+    ok(r == ERROR_SUCCESS, "failed to set integer\n");
+
+    write_file("testdata.bin", "lamyon", 6);
+    r = MsiRecordSetStream(hrec, 2, "testdata.bin");
+    ok(r == ERROR_SUCCESS, "failed to set stream\n");
+
+    query = "INSERT INTO `BINARY` ( `ID`, `BLOB` ) VALUES ( ?, ? )";
+    r = run_query(hdb, hrec, query);
+    ok(r == ERROR_SUCCESS, "failed to add row with blob\n");
+
+    MsiCloseHandle(hrec);
+
     r = MsiDatabaseCommit( hdb );
     ok( r == ERROR_SUCCESS , "Failed to commit database\n" );
 




More information about the wine-cvs mailing list