Commit fac1c0d2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

scrrun: Fix Skip() for file collection.

parent a9a2c9b5
......@@ -1001,9 +1001,22 @@ static HRESULT WINAPI filecoll_enumvariant_Skip(IEnumVARIANT *iface, ULONG celt)
TRACE("(%p)->(%d)\n", This, celt);
while (FindNextFileW(handle, &data) && celt)
if (!celt) return S_OK;
if (!handle)
{
handle = start_enumeration(This->data.u.filecoll.coll->path, &data, TRUE);
if (!handle) return S_FALSE;
This->data.u.filecoll.find = handle;
}
else if (!FindNextFileW(handle, &data))
return S_FALSE;
do
{
if (is_file_data(&data))
--celt;
} while (celt && FindNextFileW(handle, &data));
return celt ? S_FALSE : S_OK;
}
......
......@@ -1106,7 +1106,6 @@ todo_wine
hr = IEnumVARIANT_Reset(enumvar);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IEnumVARIANT_Skip(enumvar, 2);
todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IEnumVARIANT_Skip(enumvar, 0);
ok(hr == S_OK, "got 0x%08x\n", hr);
......@@ -1119,9 +1118,7 @@ todo_wine
ok(fetched == 0, "got %d\n", fetched);
fetched = -1;
hr = IEnumVARIANT_Next(enumvar, 2, var2, &fetched);
todo_wine
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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment