Bernhard Loos : msi: MsiDatabaseCommit also succeeds for a a readonly database.

Alexandre Julliard julliard at winehq.org
Thu Jul 28 13:55:41 CDT 2011


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

Author: Bernhard Loos <bernhardloos at googlemail.com>
Date:   Wed Jul 27 22:04:26 2011 +0200

msi: MsiDatabaseCommit also succeeds for a a readonly database.

---

 dlls/msi/msiquery.c |    6 ++++++
 dlls/msi/tests/db.c |    3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c
index 08a87a9..0f2e377 100644
--- a/dlls/msi/msiquery.c
+++ b/dlls/msi/msiquery.c
@@ -831,6 +831,12 @@ UINT WINAPI MsiDatabaseCommit( MSIHANDLE hdb )
         return ERROR_SUCCESS;
     }
 
+    if (db->mode == MSIDBOPEN_READONLY)
+    {
+        msiobj_release( &db->hdr );
+        return ERROR_SUCCESS;
+    }
+
     /* FIXME: lock the database */
 
     r = MSI_CommitTables( db );
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index d97a8cb..28a2ff2 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -96,6 +96,9 @@ static void test_msidatabase(void)
     res = MsiOpenDatabase( msifile, MSIDBOPEN_READONLY, &hdb );
     ok( res == ERROR_SUCCESS , "Failed to open database\n" );
 
+    res = MsiDatabaseCommit( hdb );
+    ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
+
     res = MsiCloseHandle( hdb );
     ok( res == ERROR_SUCCESS , "Failed to close database\n" );
 




More information about the wine-cvs mailing list