msdmo: Fix pointer checking in IEnumDMO_Next().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
216e1f25a4
commit
e2e3f70ed7
|
@ -519,9 +519,12 @@ static HRESULT WINAPI IEnumDMO_fnNext(
|
|||
|
||||
TRACE("(%p)->(%d %p %p %p)\n", This, cItemsToFetch, pCLSID, Names, pcItemsFetched);
|
||||
|
||||
if (!pCLSID || !Names || !pcItemsFetched)
|
||||
if (!pCLSID || !Names)
|
||||
return E_POINTER;
|
||||
|
||||
if (!pcItemsFetched && cItemsToFetch > 1)
|
||||
return E_INVALIDARG;
|
||||
|
||||
while (count < cItemsToFetch)
|
||||
{
|
||||
This->index++;
|
||||
|
@ -656,8 +659,8 @@ static HRESULT WINAPI IEnumDMO_fnNext(
|
|||
count++;
|
||||
}
|
||||
|
||||
*pcItemsFetched = count;
|
||||
if (*pcItemsFetched < cItemsToFetch)
|
||||
if (pcItemsFetched) *pcItemsFetched = count;
|
||||
if (count < cItemsToFetch)
|
||||
hres = S_FALSE;
|
||||
|
||||
TRACE("<-- %i found\n",count);
|
||||
|
|
|
@ -92,14 +92,21 @@ static void test_DMOEnum(void)
|
|||
HRESULT hr;
|
||||
CLSID clsid;
|
||||
WCHAR *name;
|
||||
DWORD count;
|
||||
|
||||
hr = DMOEnum(&GUID_unknowncategory, 0, 0, NULL, 0, NULL, &enum_dmo);
|
||||
ok(hr == S_OK, "DMOEnum() failed with %#x\n", hr);
|
||||
|
||||
hr = IEnumDMO_Next(enum_dmo, 1, &clsid, &name, NULL);
|
||||
todo_wine
|
||||
ok(hr == S_FALSE, "expected S_FALSE, got %#x\n", hr);
|
||||
|
||||
hr = IEnumDMO_Next(enum_dmo, 2, &clsid, &name, NULL);
|
||||
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
|
||||
|
||||
hr = IEnumDMO_Next(enum_dmo, 2, &clsid, &name, &count);
|
||||
ok(hr == S_FALSE, "expected S_FALSE, got %#x\n", hr);
|
||||
ok(count == 0, "expected 0, got %d\n", count);
|
||||
|
||||
IEnumDMO_Release(enum_dmo);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue