msi: Return ERROR_INVALID_HANDLE when MsiDatabaseImport() is called from a custom action.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-03-25 22:42:04 -05:00 committed by Alexandre Julliard
parent 3ff7d30520
commit 19420f5f7c
2 changed files with 3 additions and 12 deletions

View File

@ -870,17 +870,8 @@ UINT WINAPI MsiDatabaseImportW(MSIHANDLE handle, LPCWSTR szFolder, LPCWSTR szFil
TRACE("%x %s %s\n",handle,debugstr_w(szFolder), debugstr_w(szFilename));
db = msihandle2msiinfo( handle, MSIHANDLETYPE_DATABASE );
if( !db )
{
MSIHANDLE remote_database = msi_get_remote( handle );
if ( !remote_database )
return ERROR_INVALID_HANDLE;
WARN("MsiDatabaseImport not allowed during a custom action!\n");
return ERROR_SUCCESS;
}
if (!(db = msihandle2msiinfo(handle, MSIHANDLETYPE_DATABASE)))
return ERROR_INVALID_HANDLE;
r = MSI_DatabaseImport( db, szFolder, szFilename );
msiobj_release( &db->hdr );

View File

@ -1138,7 +1138,7 @@ static void test_invalid_functions(MSIHANDLE hinst)
ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
r = MsiDatabaseImportA(db, path, "bogus.idt");
todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
r = MsiDatabaseCommit(db);
ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);