Mike McCormack : msi: Fix database creation.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Sep 13 06:07:07 CDT 2006
Module: wine
Branch: master
Commit: b4005c15f0ea05d6e26208a6690f988c90839605
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=b4005c15f0ea05d6e26208a6690f988c90839605
Author: Mike McCormack <mike at codeweavers.com>
Date: Wed Sep 13 15:55:57 2006 +0900
msi: Fix database creation.
---
dlls/msi/database.c | 2 +-
dlls/msi/tests/db.c | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index 1c0a586..d984613 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -107,7 +107,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath,
/* FIXME: MSIDBOPEN_CREATE should case STGM_TRANSACTED flag to be
* used here: */
r = StgCreateDocfile( szDBPath,
- STGM_DIRECT|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, 0, &stg);
+ STGM_CREATE|STGM_DIRECT|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, 0, &stg);
if( r == ERROR_SUCCESS )
{
IStorage_SetClass( stg, &CLSID_MsiDatabase );
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index 44a2532..26b6fa0 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -109,23 +109,28 @@ static void test_msidatabase(void)
ok( res == ERROR_SUCCESS , "Failed to close database\n" );
ok( INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile ), "database should exist\n");
- todo_wine {
/* MSIDBOPEN_CREATE deletes the database if MsiCommitDatabase isn't called */
res = MsiOpenDatabase( msifile, MSIDBOPEN_CREATE, &hdb );
ok( res == ERROR_SUCCESS , "Failed to open database\n" );
+ ok( INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile ), "database should exist\n");
+
res = MsiCloseHandle( hdb );
ok( res == ERROR_SUCCESS , "Failed to close database\n" );
+ ok( INVALID_FILE_ATTRIBUTES == GetFileAttributes( msifile ), "database should exist\n");
+
res = MsiOpenDatabase( msifile, MSIDBOPEN_CREATE, &hdb );
ok( res == ERROR_SUCCESS , "Failed to open database\n" );
res = MsiDatabaseCommit( hdb );
ok( res == ERROR_SUCCESS , "Failed to commit database\n" );
+ ok( INVALID_FILE_ATTRIBUTES != GetFileAttributes( msifile ), "database should exist\n");
+
res = MsiCloseHandle( hdb );
ok( res == ERROR_SUCCESS , "Failed to close database\n" );
- }
+
res = DeleteFile( msifile2 );
ok( res == TRUE, "Failed to delete database\n" );
More information about the wine-cvs
mailing list