strmbase: Fix implementation of IEnumMediaTypes::Skip().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47291
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-06-29 13:43:50 -05:00 committed by Alexandre Julliard
parent cf09b5a800
commit af35e10c14
14 changed files with 33 additions and 36 deletions

View File

@ -611,7 +611,7 @@ static void test_enum_media_types(IBaseFilter *filter)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@ -642,7 +642,7 @@ static void test_enum_media_types(IBaseFilter *filter)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);

View File

@ -613,13 +613,13 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@ -648,7 +648,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);

View File

@ -446,7 +446,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);

View File

@ -407,7 +407,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);

View File

@ -571,7 +571,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@ -602,13 +602,13 @@ static void test_enum_media_types(void)
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
IEnumMediaTypes_Release(enum1);
IEnumMediaTypes_Release(enum2);

View File

@ -685,7 +685,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@ -748,13 +748,13 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);

View File

@ -542,7 +542,7 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 2);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);

View File

@ -1159,19 +1159,19 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Reset(enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);

View File

@ -876,7 +876,7 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 5);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@ -979,7 +979,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);

View File

@ -456,7 +456,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);

View File

@ -759,7 +759,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);

View File

@ -763,7 +763,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);

View File

@ -673,7 +673,7 @@ static void test_enum_media_types(void)
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Clone(enum1, &enum2);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
@ -736,13 +736,13 @@ static void test_enum_media_types(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Skip(enum1, 1);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);

View File

@ -203,21 +203,18 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes *iface,
return i == count ? S_OK : S_FALSE;
}
static HRESULT WINAPI IEnumMediaTypesImpl_Skip(IEnumMediaTypes * iface, ULONG cMediaTypes)
static HRESULT WINAPI IEnumMediaTypesImpl_Skip(IEnumMediaTypes *iface, ULONG count)
{
IEnumMediaTypesImpl *This = impl_from_IEnumMediaTypes(iface);
IEnumMediaTypesImpl *enummt = impl_from_IEnumMediaTypes(iface);
TRACE("(%p)->(%u)\n", iface, cMediaTypes);
TRACE("iface %p, count %u.\n", iface, count);
if (This->currentVersion != This->mediaVersionFunction(This->basePin))
if (enummt->currentVersion != enummt->mediaVersionFunction(enummt->basePin))
return VFW_E_ENUM_OUT_OF_SYNC;
if (This->uIndex + cMediaTypes < This->count)
{
This->uIndex += cMediaTypes;
return S_OK;
}
return S_FALSE;
enummt->uIndex += count;
return enummt->uIndex > enummt->count ? S_FALSE : S_OK;
}
static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface)