Zebediah Figura : msi: Return MSIDBSTATE_ERROR when MsiGetDatabaseState() is called from a custom action.

Alexandre Julliard julliard at winehq.org
Fri Aug 23 09:31:24 CDT 2019


Module: wine
Branch: stable
Commit: b77e677474f29d6d47693a84b7090efcc2bbd79a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b77e677474f29d6d47693a84b7090efcc2bbd79a

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon Mar 25 22:42:01 2019 -0500

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 at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 60b1fd7e8764ab63d79382c1805d4c007a6be332)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/msi/database.c     | 13 ++-----------
 dlls/msi/tests/custom.c |  4 ++--
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index b8ec393..502a411 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -1887,17 +1887,8 @@ 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 )
-            return MSIDBSTATE_ERROR;
-
-        WARN("MsiGetDatabaseState not allowed during a custom action!\n");
-
-        return MSIDBSTATE_READ;
-    }
+    if (!(db = msihandle2msiinfo( handle, MSIHANDLETYPE_DATABASE )))
+        return MSIDBSTATE_ERROR;
 
     if (db->mode != MSIDBOPEN_READONLY )
         ret = MSIDBSTATE_WRITE;
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index 6ae5bfc..9e9e2bf 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -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);




More information about the wine-cvs mailing list