msi: Return ERROR_INVALID_HANDLE when MsiEnableUIPreview() 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:
parent
19420f5f7c
commit
4bb40d1a95
|
@ -4216,19 +4216,9 @@ UINT WINAPI MsiEnableUIPreview( MSIHANDLE hdb, MSIHANDLE *phPreview )
|
|||
|
||||
TRACE("%d %p\n", hdb, phPreview);
|
||||
|
||||
db = msihandle2msiinfo( hdb, MSIHANDLETYPE_DATABASE );
|
||||
if (!db)
|
||||
{
|
||||
MSIHANDLE remote_database = msi_get_remote( hdb );
|
||||
if (!remote_database)
|
||||
return ERROR_INVALID_HANDLE;
|
||||
if (!(db = msihandle2msiinfo(hdb, MSIHANDLETYPE_DATABASE)))
|
||||
return ERROR_INVALID_HANDLE;
|
||||
|
||||
*phPreview = 0;
|
||||
|
||||
WARN("MsiEnableUIPreview not allowed during a custom action!\n");
|
||||
|
||||
return ERROR_FUNCTION_FAILED;
|
||||
}
|
||||
preview = MSI_EnableUIPreview( db );
|
||||
if (preview)
|
||||
{
|
||||
|
|
|
@ -1150,7 +1150,7 @@ static void test_invalid_functions(MSIHANDLE hinst)
|
|||
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);
|
||||
ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
|
||||
|
||||
sprintf(package_name, "#%u", db);
|
||||
r = MsiOpenPackageA(package_name, &package);
|
||||
|
|
Loading…
Reference in New Issue