Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/quartz/filtergraph.c | 3 +++ dlls/quartz/tests/filtergraph.c | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index b3aebabbdad..fb2cbc76b31 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -322,6 +322,9 @@ static HRESULT WINAPI EnumFilters_Skip(IEnumFilters *iface, ULONG count)
TRACE("enum_filters %p, count %u.\n", enum_filters, count);
+ if (enum_filters->version != enum_filters->graph->version) + return VFW_E_ENUM_OUT_OF_SYNC; + if (!enum_filters->cursor) return S_FALSE;
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index e7ee4e5c446..446fa4ae1af 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -683,6 +683,9 @@ static void test_enum_filters(void) hr = IEnumFilters_Next(enum1, 1, filters, NULL); ok(hr == VFW_E_ENUM_OUT_OF_SYNC, "Got hr %#x.\n", hr);
+ hr = IEnumFilters_Skip(enum1, 1); + ok(hr == VFW_E_ENUM_OUT_OF_SYNC, "Got hr %#x.\n", hr); + hr = IEnumFilters_Reset(enum1); ok(hr == S_OK, "Got hr %#x.\n", hr);
Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/quartz/filtergraph.c | 2 +- dlls/quartz/tests/filtergraph.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index fb2cbc76b31..b2a1e25600c 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -326,7 +326,7 @@ static HRESULT WINAPI EnumFilters_Skip(IEnumFilters *iface, ULONG count) return VFW_E_ENUM_OUT_OF_SYNC;
if (!enum_filters->cursor) - return S_FALSE; + return E_INVALIDARG;
while (count--) { diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 446fa4ae1af..9de4919df28 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -677,6 +677,12 @@ static void test_enum_filters(void) hr = IEnumFilters_Next(enum1, 1, filters, NULL); ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ hr = IEnumFilters_Skip(enum1, 0); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + + hr = IEnumFilters_Skip(enum1, 1); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + IFilterGraph2_AddFilter(graph, filter1, NULL); IFilterGraph2_AddFilter(graph, filter2, NULL);
Signed-off-by: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/quartz/filtergraph.c | 2 +- dlls/quartz/tests/filtergraph.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index b2a1e25600c..c9e26231032 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -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; diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 9de4919df28..3da089d4915 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -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]);
Signed-off-by: Zebediah Figura z.figura12@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=28332
(Sorry about forgetting, again)