[2/2] msi: Fix column width calculation.

Hans Leidekker hans at codeweavers.com
Tue Aug 4 05:20:10 CDT 2009


The iTunes 8 installer database has an integer column of size 1 which
takes up two bytes at storage level, so adjust the column size calculation
to account for this difference.

See http://bugs.winehq.org/show_bug.cgi?id=15533

 -Hans

diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 126769a..b963a20 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -127,11 +127,17 @@ static inline UINT bytes_per_column( MSIDATABASE *db, const MSICOLUMNINFO *col )
 {
     if( MSITYPE_IS_BINARY(col->type) )
         return 2;
+
     if( col->type & MSITYPE_STRING )
         return db->bytes_per_strref;
-    if( (col->type & 0xff) > 4 )
+
+    if( (col->type & 0xff) <= 2)
+        return 2;
+
+    if( (col->type & 0xff) != 4 )
         ERR("Invalid column size!\n");
-    return col->type & 0xff;
+
+    return 4;
 }
 
 static int utf2mime(int x)



More information about the wine-patches mailing list