James Hawkins : msi: Add support for localizable strings in MsiDatabaseImport.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 24 04:55:30 CDT 2006


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

Author: James Hawkins <truiken at gmail.com>
Date:   Mon Oct 23 18:07:04 2006 -0700

msi: Add support for localizable strings in MsiDatabaseImport.

---

 dlls/msi/database.c      |   15 ++++++++++++---
 dlls/msi/tests/install.c |    5 +----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index e496acf..8abed5c 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -351,7 +351,7 @@ static LPWSTR msi_build_createsql_column
     LPCWSTR type;
     DWORD sql_size = 1, i, len;
     WCHAR expanded[128], *ptr;
-    WCHAR size[10], comma[2], extra[10];
+    WCHAR size[10], comma[2], extra[30];
 
     static const WCHAR column_fmt[] = {'`','%','s','`',' ','%','s','%','s','%','s','%','s',' ',0};
     static const WCHAR size_fmt[] = {'(','%','s',')',0};
@@ -359,6 +359,7 @@ static LPWSTR msi_build_createsql_column
     static const WCHAR type_int[] = {'I','N','T',0};
     static const WCHAR type_long[] = {'L','O','N','G',0};
     static const WCHAR type_notnull[] = {' ','N','O','T',' ','N','U','L','L',0};
+    static const WCHAR localizable[] = {' ','L','O','C','A','L','I','Z','A','B','L','E',0};
 
     columns = msi_alloc_zero(sql_size * sizeof(WCHAR));
     if (!columns)
@@ -376,12 +377,20 @@ static LPWSTR msi_build_createsql_column
 
         ptr = &types[i][1];
         len = atolW(ptr);
+        extra[0] = '\0';
 
         switch (types[i][0])
         {
-            case 'l': case 's':
+            case 'l':
                 lstrcpyW(extra, type_notnull);
-            case 'L': case 'S':
+            case 'L':
+                lstrcatW(extra, localizable);
+                type = type_char;
+                sprintfW(size, size_fmt, ptr);
+                break;
+            case 's':
+                lstrcpyW(extra, type_notnull);
+            case 'S':
                 type = type_char;
                 sprintfW(size, size_fmt, ptr);
                 break;
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index f5a2eeb..83e68df 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -766,13 +766,10 @@ static void test_packagecoltypes(void)
     ok(count == 6, "Expected 6, got %d\n", count);
     ok(check_record(rec, 1, "i2"), "wrong column label\n");
     ok(check_record(rec, 2, "i4"), "wrong column label\n");
+    ok(check_record(rec, 3, "L64"), "wrong column label\n");
     ok(check_record(rec, 4, "S255"), "wrong column label\n");
     ok(check_record(rec, 5, "S32"), "wrong column label\n");
     ok(check_record(rec, 6, "S72"), "wrong column label\n");
-    todo_wine
-    {
-        ok(check_record(rec, 3, "L64"), "wrong column label\n");
-    }
 
     MsiCloseHandle(rec);
     MsiCloseHandle(view);




More information about the wine-cvs mailing list