Module: wine Branch: master Commit: eb101df687d9002d7513dbdcb5a3822e00c18f1d URL: http://source.winehq.org/git/wine.git/?a=commit;h=eb101df687d9002d7513dbdcb5...
Author: Hans Leidekker hans@codeweavers.com Date: Tue Aug 4 12:20:10 2009 +0200
msi: Fix column width calculation.
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.
---
dlls/msi/table.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
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)