Hans Leidekker : msi: Don't free cached tables in MsiDatabaseCommit.

Alexandre Julliard julliard at winehq.org
Thu Apr 26 13:58:35 CDT 2012


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Apr 26 11:18:31 2012 +0200

msi: Don't free cached tables in MsiDatabaseCommit.

---

 dlls/msi/table.c         |    3 --
 dlls/msi/tests/package.c |   47 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 54743bd..dd25fbb 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -2195,9 +2195,6 @@ UINT MSI_CommitTables( MSIDATABASE *db )
         }
     }
 
-    /* force everything to reload next time */
-    free_cached_tables( db );
-
     hr = IStorage_Commit( db->storage, 0 );
     if (FAILED( hr ))
     {
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index fc77c03..8cf8f27 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -8746,6 +8746,52 @@ error:
     DeleteFileA( msifile );
 }
 
+static void test_MsiDatabaseCommit(void)
+{
+    UINT r;
+    MSIHANDLE hdb, hpkg = 0;
+    char buf[32], package[12];
+    DWORD sz;
+
+    hdb = create_package_db();
+    ok( hdb, "failed to create database\n" );
+
+    r = create_property_table( hdb );
+    ok( r == ERROR_SUCCESS, "can't create Property table %u\n", r );
+
+    sprintf( package, "#%u", hdb );
+    r = MsiOpenPackage( package, &hpkg );
+    if (r == ERROR_INSTALL_PACKAGE_REJECTED)
+    {
+        skip("Not enough rights to perform tests\n");
+        goto error;
+    }
+    ok( r == ERROR_SUCCESS, "got %u\n", r );
+
+    r = MsiSetPropertyA( hpkg, "PROP", "value" );
+    ok( r == ERROR_SUCCESS, "got %u\n", r );
+
+    buf[0] = 0;
+    sz = sizeof(buf);
+    r = MsiGetPropertyA( hpkg, "PROP", buf, &sz );
+    ok( r == ERROR_SUCCESS, "MsiGetPropertyA returned %u\n", r );
+    ok( !lstrcmpA( buf, "value" ), "got \"%s\"\n", buf );
+
+    r = MsiDatabaseCommit( hdb );
+    ok( r == ERROR_SUCCESS, "MsiDatabaseCommit returned %u\n", r );
+
+    buf[0] = 0;
+    sz = sizeof(buf);
+    r = MsiGetPropertyA( hpkg, "PROP", buf, &sz );
+    ok( r == ERROR_SUCCESS, "MsiGetPropertyA returned %u\n", r );
+    ok( !lstrcmpA( buf, "value" ), "got \"%s\"\n", buf );
+
+    MsiCloseHandle( hpkg );
+error:
+    MsiCloseHandle( hdb );
+    DeleteFileA( msifile );
+}
+
 START_TEST(package)
 {
     STATEMGRSTATUS status;
@@ -8802,6 +8848,7 @@ START_TEST(package)
     test_MsiApplyMultiplePatches();
     test_MsiApplyPatch();
     test_MsiEnumComponentCosts();
+    test_MsiDatabaseCommit();
 
     if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
     {




More information about the wine-cvs mailing list