https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df4fa37bf91a33be390b0…
commit df4fa37bf91a33be390b0832d2ab766c12667601
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Mar 13 01:21:41 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:28:17 2022 +0100
[WINESYNC] msi: Return ERROR_INVALID_HANDLE when MsiEnableUIPreview() is called from a
custom action.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 4bb40d1a95e525c63f1f6f1f20f0c054d46f2fff by Zebediah Figura
<z.figura12(a)gmail.com>
---
dll/win32/msi/dialog.c | 14 ++------------
modules/rostests/winetests/msi/custom.c | 2 +-
2 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/dll/win32/msi/dialog.c b/dll/win32/msi/dialog.c
index 864f488d9c1..d11f09c12cf 100644
--- a/dll/win32/msi/dialog.c
+++ b/dll/win32/msi/dialog.c
@@ -4219,19 +4219,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)
{
diff --git a/modules/rostests/winetests/msi/custom.c
b/modules/rostests/winetests/msi/custom.c
index b8da55e1ce1..454966e9148 100644
--- a/modules/rostests/winetests/msi/custom.c
+++ b/modules/rostests/winetests/msi/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);