Dmitry Timoshkov : scrrun: IEnumVARIANT:: Next should always return number of fetched folder elements.

Alexandre Julliard julliard at winehq.org
Wed Jan 29 14:53:33 CST 2014


Module: wine
Branch: master
Commit: f5279ad37db5e6c1f5d900b08322868a972cbf70
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f5279ad37db5e6c1f5d900b08322868a972cbf70

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Jan 28 11:36:07 2014 +0900

scrrun: IEnumVARIANT::Next should always return number of fetched folder elements.

---

 dlls/scrrun/filesystem.c       |    5 +----
 dlls/scrrun/tests/filesystem.c |    1 -
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c
index 1cf1ea1..39b3241 100644
--- a/dlls/scrrun/filesystem.c
+++ b/dlls/scrrun/filesystem.c
@@ -545,13 +545,10 @@ static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG cel
         }
     } while (FindNextFileW(handle, &data));
 
-    if (count < celt)
-        return S_FALSE;
-
     if (fetched)
         *fetched = count;
 
-    return S_OK;
+    return (count < celt) ? S_FALSE : S_OK;
 }
 
 static HRESULT WINAPI foldercoll_enumvariant_Skip(IEnumVARIANT *iface, ULONG celt)
diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c
index b1de309..02a29e5 100644
--- a/dlls/scrrun/tests/filesystem.c
+++ b/dlls/scrrun/tests/filesystem.c
@@ -942,7 +942,6 @@ todo_wine
     fetched = -1;
     hr = IEnumVARIANT_Next(enumvar, 2, var2, &fetched);
     ok(hr == S_FALSE, "got 0x%08x\n", hr);
-todo_wine
     ok(fetched == 1, "got %d\n", fetched);
     ok(V_VT(&var2[0]) == VT_DISPATCH, "got type %d\n", V_VT(&var2[0]));
     VariantClear(&var2[0]);




More information about the wine-cvs mailing list