msi: MsiDatabaseCommit also succeeds for a a readonly database.

This commit is contained in:
Bernhard Loos 2011-07-27 22:04:26 +02:00 committed by Alexandre Julliard
parent 5f46f701c5
commit 20bdf059ab
2 changed files with 9 additions and 0 deletions

View File

@ -831,6 +831,12 @@ UINT WINAPI MsiDatabaseCommit( MSIHANDLE hdb )
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
if (db->mode == MSIDBOPEN_READONLY)
{
msiobj_release( &db->hdr );
return ERROR_SUCCESS;
}
/* FIXME: lock the database */ /* FIXME: lock the database */
r = MSI_CommitTables( db ); r = MSI_CommitTables( db );

View File

@ -96,6 +96,9 @@ static void test_msidatabase(void)
res = MsiOpenDatabase( msifile, MSIDBOPEN_READONLY, &hdb ); res = MsiOpenDatabase( msifile, MSIDBOPEN_READONLY, &hdb );
ok( res == ERROR_SUCCESS , "Failed to open database\n" ); ok( res == ERROR_SUCCESS , "Failed to open database\n" );
res = MsiDatabaseCommit( hdb );
ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
res = MsiCloseHandle( hdb ); res = MsiCloseHandle( hdb );
ok( res == ERROR_SUCCESS , "Failed to close database\n" ); ok( res == ERROR_SUCCESS , "Failed to close database\n" );