quartz: Only return S_FALSE in IEnumFilters::Skip() if count goes past the end of the sequence.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=28332
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2020-11-23 17:29:28 +01:00 committed by Alexandre Julliard
parent 68d03ba8bb
commit 4807a8f588
2 changed files with 25 additions and 1 deletions

View File

@ -331,7 +331,7 @@ static HRESULT WINAPI EnumFilters_Skip(IEnumFilters *iface, ULONG count)
while (count--)
{
if (!(enum_filters->cursor = list_next(&enum_filters->graph->filters, enum_filters->cursor)))
return S_FALSE;
return count ? S_FALSE : S_OK;
}
return S_OK;

View File

@ -695,6 +695,30 @@ static void test_enum_filters(void)
hr = IEnumFilters_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumFilters_Skip(enum1, 0);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumFilters_Skip(enum1, 1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumFilters_Skip(enum1, 2);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumFilters_Skip(enum1, 1);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
hr = IEnumFilters_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumFilters_Skip(enum1, 2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumFilters_Skip(enum1, 1);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
hr = IEnumFilters_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumFilters_Next(enum1, 1, filters, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(filters[0] == filter2, "Got filter %p.\n", filters[0]);