Jinoh Kang : msi: Wrap around to first record at end of view in MSI_ViewFetch.

Alexandre Julliard julliard at winehq.org
Mon Nov 29 16:26:53 CST 2021


Module: wine
Branch: master
Commit: 547492007e17ed7fe3c2e5ffd5f58f0d46a40048
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=547492007e17ed7fe3c2e5ffd5f58f0d46a40048

Author: Jinoh Kang <jinoh.kang.kr at gmail.com>
Date:   Sun Nov 28 19:54:42 2021 +0900

msi: Wrap around to first record at end of view in MSI_ViewFetch.

Signed-off-by: Jinoh Kang <jinoh.kang.kr at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msi/msiquery.c | 5 +++++
 dlls/msi/tests/db.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c
index c217ee7c8f5..b3a499a0788 100644
--- a/dlls/msi/msiquery.c
+++ b/dlls/msi/msiquery.c
@@ -394,6 +394,11 @@ UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec)
         (*prec)->cookie = (UINT64)(ULONG_PTR)query;
         MSI_RecordSetInteger(*prec, 0, 1);
     }
+    else if (r == ERROR_NO_MORE_ITEMS)
+    {
+        /* end of view; reset cursor to first row */
+        query->row = 0;
+    }
 
     return r;
 }
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index eb087eb9711..447f2cdd0ee 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -9343,7 +9343,7 @@ static void test_viewfetch_wraparound(void)
             winetest_push_context( "Record #%d", i );
 
             r = MsiViewFetch( view, &rec );
-            todo_wine_if(tries > 0) ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
+            ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r );
             if (r != ERROR_SUCCESS)
             {
                 winetest_pop_context();




More information about the wine-cvs mailing list