From 4bb40d1a95e525c63f1f6f1f20f0c054d46f2fff Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 25 Mar 2019 22:42:05 -0500 Subject: [PATCH] msi: Return ERROR_INVALID_HANDLE when MsiEnableUIPreview() is called from a custom action. Signed-off-by: Zebediah Figura Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msi/dialog.c | 14 ++------------ dlls/msi/tests/custom.c | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index a3e54815c01..153ff214d6e 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -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) { diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index b8da55e1ce1..454966e9148 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -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);