Commit b4005c15 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Fix database creation.

parent 4fa08a63
......@@ -107,7 +107,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
/* 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 );
......
......@@ -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" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment