James Hawkins : msi: Return MSICONDITION_NONE in MsiDatabaseIsTablePersistent if the table doesn 't exist.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Apr 23 08:39:15 CDT 2007


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

Author: James Hawkins <truiken at gmail.com>
Date:   Sat Apr 21 02:33:10 2007 -0500

msi: Return MSICONDITION_NONE in MsiDatabaseIsTablePersistent if the table doesn't exist.

---

 dlls/msi/msipriv.h  |    2 +-
 dlls/msi/table.c    |    5 ++++-
 dlls/msi/tests/db.c |    2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 55dd2fa..0aedbf2 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -563,7 +563,7 @@ extern const WCHAR *msi_string_lookup_id( string_table *st, UINT id );
 extern UINT msi_string_get_codepage( string_table *st );
 
 
-extern BOOL TABLE_Exists( MSIDATABASE *db, LPWSTR name );
+extern BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name );
 extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table );
 
 extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname,
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 420519b..ce5df79 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -1027,7 +1027,7 @@ static UINT get_tablecolumns( MSIDATABASE *db,
 }
 
 /* try to find the table name in the _Tables table */
-BOOL TABLE_Exists( MSIDATABASE *db, LPWSTR name )
+BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name )
 {
     UINT r, table_id = 0, i, count;
     MSITABLE *table = NULL;
@@ -1716,6 +1716,9 @@ MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table )
     if (!table)
         return MSICONDITION_ERROR;
 
+    if (!TABLE_Exists( db, table ))
+        return MSICONDITION_NONE;
+
     return MSICONDITION_FALSE;
 }
 
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index dc5e42d..53599ed 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -2648,10 +2648,10 @@ static void test_temporary_table(void)
 
     cond = MsiDatabaseIsTablePersistent(hdb, "_Columns");
     ok( cond == MSICONDITION_NONE, "wrong return condition\n");
+    }
 
     cond = MsiDatabaseIsTablePersistent(hdb, "_Streams");
     ok( cond == MSICONDITION_NONE, "wrong return condition\n");
-    }
 
     query = "CREATE TABLE `P` ( `B` SHORT NOT NULL, `C` CHAR(255) PRIMARY KEY `C`)";
     r = run_query(hdb, 0, query);




More information about the wine-cvs mailing list