Mike McCormack : msi: Fix a couple of test cases for MsiDatabaseIsTablePersistent.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Sep 13 06:07:09 CDT 2006


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

Author: Mike McCormack <mike at codeweavers.com>
Date:   Wed Sep 13 18:46:13 2006 +0900

msi: Fix a couple of test cases for MsiDatabaseIsTablePersistent.

---

 dlls/msi/msipriv.h  |    1 +
 dlls/msi/msiquery.c |   16 ++++++++++++++--
 dlls/msi/table.c    |    8 ++++++++
 dlls/msi/tests/db.c |    4 ++--
 4 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 9177b1d..a10be59 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -338,6 +338,7 @@ extern UINT msi_string_get_codepage( str
 
 
 extern BOOL TABLE_Exists( MSIDATABASE *db, LPWSTR name );
+extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table );
 
 extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname,
                               USHORT **pdata, UINT *psz );
diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c
index 157ae18..e146cc8 100644
--- a/dlls/msi/msiquery.c
+++ b/dlls/msi/msiquery.c
@@ -898,6 +898,18 @@ MSICONDITION WINAPI MsiDatabaseIsTablePe
 MSICONDITION WINAPI MsiDatabaseIsTablePersistentW(
               MSIHANDLE hDatabase, LPCWSTR szTableName)
 {
-    FIXME("%lx %s\n", hDatabase, debugstr_w(szTableName));
-    return MSICONDITION_FALSE;
+    MSIDATABASE *db;
+    MSICONDITION r;
+
+    TRACE("%lx %s\n", hDatabase, debugstr_w(szTableName));
+
+    db = msihandle2msiinfo( hDatabase, MSIHANDLETYPE_DATABASE );
+    if( !db )
+        return MSICONDITION_ERROR;
+
+    r = MSI_DatabaseIsTablePersistent( db, szTableName );
+
+    msiobj_release( &db->hdr );
+
+    return r;
 }
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 1c05e79..4eb3f52 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -1643,6 +1643,14 @@ UINT MSI_CommitTables( MSIDATABASE *db )
     return ERROR_SUCCESS;
 }
 
+MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table )
+{
+    if (!table)
+        return MSICONDITION_ERROR;
+
+    return MSICONDITION_FALSE;
+}
+
 static MSIRECORD *msi_get_transform_record( MSITABLEVIEW *tv, string_table *st, USHORT *rawdata )
 {
     UINT i, val, ofs = 0;
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index 7ec5a70..acfa093 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -2170,15 +2170,15 @@ static void test_temporary_table(void)
     DWORD sz;
 
     cond = MsiDatabaseIsTablePersistent(0, NULL);
-    todo_wine ok( cond == MSICONDITION_ERROR, "wrong return condition\n");
+    ok( cond == MSICONDITION_ERROR, "wrong return condition\n");
 
     hdb = create_db();
     ok( hdb, "failed to create db\n");
 
-    todo_wine {
     cond = MsiDatabaseIsTablePersistent(hdb, NULL);
     ok( cond == MSICONDITION_ERROR, "wrong return condition\n");
 
+    todo_wine {
     cond = MsiDatabaseIsTablePersistent(hdb, "_Tables");
     ok( cond == MSICONDITION_NONE, "wrong return condition\n");
 




More information about the wine-cvs mailing list