msi: Fix database creation.
This commit is contained in:
parent
4fa08a638c
commit
b4005c15f0
|
@ -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" );
|
||||
|
||||
|
|
Loading…
Reference in New Issue