Commit 4bb40d1a authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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

parent 19420f5f
......@@ -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;
*phPreview = 0;
WARN("MsiEnableUIPreview not allowed during a custom action!\n");
if (!(db = msihandle2msiinfo(hdb, MSIHANDLETYPE_DATABASE)))
return ERROR_INVALID_HANDLE;
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);
......
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