forked from Mirrors/wine-wine
msi: Return MSIDBSTATE_ERROR when MsiGetDatabaseState() is called from a custom action.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46812
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>
(cherry picked from commit 60b1fd7e87
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
parent
f462faf675
commit
b77e677474
|
@ -1887,18 +1887,9 @@ MSIDBSTATE WINAPI MsiGetDatabaseState( MSIHANDLE handle )
|
|||
|
||||
TRACE("%d\n", handle);
|
||||
|
||||
db = msihandle2msiinfo( handle, MSIHANDLETYPE_DATABASE );
|
||||
if( !db )
|
||||
{
|
||||
MSIHANDLE remote_database = msi_get_remote(handle);
|
||||
if ( !remote_database )
|
||||
if (!(db = msihandle2msiinfo( handle, MSIHANDLETYPE_DATABASE )))
|
||||
return MSIDBSTATE_ERROR;
|
||||
|
||||
WARN("MsiGetDatabaseState not allowed during a custom action!\n");
|
||||
|
||||
return MSIDBSTATE_READ;
|
||||
}
|
||||
|
||||
if (db->mode != MSIDBOPEN_READONLY )
|
||||
ret = MSIDBSTATE_WRITE;
|
||||
msiobj_release( &db->hdr );
|
||||
|
|
|
@ -1119,7 +1119,7 @@ static void test_invalid_functions(MSIHANDLE hinst)
|
|||
UINT r;
|
||||
|
||||
r = MsiGetDatabaseState(hinst);
|
||||
todo_wine ok(hinst, r == MSIDBSTATE_ERROR, "got %u\n", r);
|
||||
ok(hinst, r == MSIDBSTATE_ERROR, "got %u\n", r);
|
||||
|
||||
db = MsiGetActiveDatabase(hinst);
|
||||
ok(hinst, db, "MsiGetActiveDatabase failed\n");
|
||||
|
@ -1147,7 +1147,7 @@ static void test_invalid_functions(MSIHANDLE hinst)
|
|||
ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
|
||||
|
||||
r = MsiGetDatabaseState(db);
|
||||
todo_wine ok(hinst, r == MSIDBSTATE_ERROR, "got %u\n", r);
|
||||
ok(hinst, r == MSIDBSTATE_ERROR, "got %u\n", r);
|
||||
|
||||
r = MsiEnableUIPreview(db, &preview);
|
||||
todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
|
||||
|
|
Loading…
Reference in New Issue